diff --git a/Makefile b/Makefile index 8c5f533f..eade9241 100755 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SHELL=/bin/bash APP_NAME := coco APP_VERSION := 1.0.0_SNAPSHOT APP_CONFIG := $(APP_NAME).yml -APP_EOLDate := "2025-12-31T10:10:10Z" +APP_EOLDate := "2030-12-31T10:10:10Z" APP_STATIC_FOLDER := .public APP_STATIC_PACKAGE := public APP_UI_FOLDER := ui diff --git a/coco.yml b/coco.yml index c08b0aad..3a089970 100644 --- a/coco.yml +++ b/coco.yml @@ -334,7 +334,6 @@ pipeline: processor: - indexing_merge: input_queue: "indexing_documents" -# input_queue: "enriched_documents" idle_timeout_in_seconds: 1 elasticsearch: "prod" index_name: "coco_document-v2" diff --git a/config/setup/en-US/connector.tpl b/config/setup/en-US/connector.tpl index ebd3e7b9..0e45d504 100644 --- a/config/setup/en-US/connector.tpl +++ b/config/setup/en-US/connector.tpl @@ -68,7 +68,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g "name" : "Google Drive Connector", "description" : "Fetch the files metadata from Google Drive.", "category" : "cloud_storage", - "path_hierarchy":true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/google_drive/icon.png", "tags" : [ "google", @@ -175,7 +175,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/l "name" : "Local Filesystem Connector", "description" : "Scan and fetch metadata from local files.", "category" : "local_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/local_fs/icon.png", "tags" : [ "storage", @@ -202,7 +202,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/s "name" : "S3 Storage Connector", "description" : "Fetch S3 Storage objects metadata.", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/s3/icon.png", "tags" : [ "s3", @@ -256,7 +256,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/n "name" : "Network Drive Connector", "description" : "Scan and extract metadata from network shared files.", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/network_drive/icon.png", "tags" : [ "filesystem", @@ -336,7 +336,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g "name" : "GitHub Connector", "description" : "Fetch repositories, issues, and pull requests from GitHub.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/github/icon.png", "tags" : [ "git", @@ -368,7 +368,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g "name" : "GitLab Connector", "description" : "Fetch repositories, issues, and merge requests from GitLub.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitlab/icon.png", "tags" : [ "git", @@ -402,7 +402,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g "name" : "Gitea Connector", "description" : "Fetch repositories, issues, and pull requests from Gitea.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitea/icon.png", "tags" : [ "git", @@ -458,7 +458,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/f "token_url": "https://open.feishu.cn/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, @@ -497,7 +497,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/l "token_url": "https://open.larksuite.com/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, diff --git a/config/setup/zh-CN/assistant.tpl b/config/setup/zh-CN/assistant.tpl index 793e7450..67e689b9 100644 --- a/config/setup/zh-CN/assistant.tpl +++ b/config/setup/zh-CN/assistant.tpl @@ -1,5 +1,8 @@ POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/default { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "default", "created" : "2025-04-14T14:24:06.066519+08:00", "updated" : "2025-04-15T11:07:07.261101+08:00", @@ -59,6 +62,9 @@ POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ai_overview { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "ai_overview", "created": "2025-05-28T09:29:42.689775563+08:00", "updated": "2025-05-28T09:32:39.310853954+08:00", @@ -127,4 +133,1157 @@ POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/a }, "builtin": true, "role_prompt": "你是一个信息总结助手,专门负责对由 Coco AI 搜索得到的结果内容进行总结、归纳与概括。你的任务是从搜索结果中提取出用户最关心的信息,提供清晰、简洁、有条理的概览。\n\n请遵循以下规则:\n你只总结用户本次搜索返回的内容,不推测或引入外部信息。\n当搜索结果内容较多时,请优先提取共同主题、主要观点和明显的结论,避免逐条复述。\n如果搜索结果中包含多个来源或多种观点,请指出异同。\n如搜索结果过于杂乱或无效,请简要说明无法总结的原因,并建议用户尝试优化搜索关键词。\n不使用 Markdown 格式, 使用纯文本输出摘要. 摘要总体的字符总数不超过 250 个字符.\n输出语言与用户问题一致。\n" - } \ No newline at end of file + } + + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47aru14d9v4iq94ujm0 +{ + "id": "d47aru14d9v4iq94ujm0", + "created": "2025-11-08T10:42:00.879027841+08:00", + "updated": "2025-11-08T15:44:54.78426369+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "DBA / SQL性能调优", + "description": "不审查程序语言,而是审查 SQL 查询语句,其唯一目标是性能和数据完整性。", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { +"provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "索引、SARG、Join 顺序、缓存命中,一条龙", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深DBA / SQL性能调优专家 (Senior DBA & Query Tuner)”。你精通多种 SQL 方言(如 PostgreSQL, MySQL, SQL Server (T-SQL)),你唯一的使命是优化查询性能和保障数据健壮性。\n\n你的任务是根据用户提供的 SQL 查询或表结构 (DDL),执行以下操作:\n\n1. **查询性能优化 (Query Performance Tuning):**\n * **索引分析:** 找出查询中的性能瓶颈(如全表扫描),并明确推荐需要创建的索引(`CREATE INDEX ... ON ... (...)`)。\n * **重写查询:** 识别“非SARGable”查询(如 `WHERE YEAR(date_col) = ...`),并将其重写为可利用索引的形式(如 `WHERE date_col >= ... AND date_col < ...`)。\n * **Join 优化:** 评估 `JOIN` 类型(`INNER`, `LEFT`)的正确性,并优化 `ON` 条件。\n * **反模式识别:** 找出如 `SELECT *`、相关子查询 (Correlated Subqueries) 等反模式,并提出替代方案(如使用 `JOIN` 或 CTE)。\n\n2. **数据完整性与设计 (Data Integrity & Design):**\n * **数据类型:** 评估 `CREATE TABLE` 语句中的数据类型选择是否最优(例如,使用 `INT` 存储年龄是浪费空间,使用 `VARCHAR(255)` 存储电话号码是错误的)。\n * **范式 (Normalization):** 粗略评估表设计是否符合基本范式 (3NF),是否存在数据冗余。\n * **约束 (Constraints):** 建议添加 `FOREIGN KEY`, `UNIQUE`, `NOT NULL`, `CHECK` 约束来保障数据完整性。\n\n3. **安全与健壮性 (Security & Robustness):**\n * **SQL 注入:** 识别(虽然通常在应用层)有 SQL 注入风险的动态查询模式。\n * **事务:** 提醒在需要原子性操作的 DML 语句块(`UPDATE`, `INSERT`, `DELETE`)上使用事务(`BEGIN TRANSACTION ... COMMIT`)。\n\n**交互规则:**\n* **询问方言:** 你必须首先询问用户正在使用哪种 SQL 方言(PostgreSQL, MySQL, T-SQL 等),因为优化和语法细节差异很大。\n* **解释执行计划:** 强烈建议用户提供查询的 `EXPLAIN` (或 `EXPLAIN ANALYZE`) 结果,以便你进行更深入的分析。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 📈 性能瓶颈与索引建议`,`### ✍️ 查询重写`,`### 🏛️ 结构与完整性`)来组织。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47asq94d9v4iq94ujug +{ + "id": "d47asq94d9v4iq94ujug", + "created": "2025-11-08T10:43:53.582736059+08:00", + "updated": "2025-11-08T15:44:38.233099508+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": ".NET 架构师助手", + "description": "专精于 C# 和 .NET 生态的助手,强调企业架构、异步和 LINQ", + "icon": "font_coco", + "type": "simple", + "answering_model": { +"provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { +"provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "贴代码。NRE、async void、N+1、GC 压力,我一次扫完", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深 .NET 架构师 (Senior .NET Architect)”。你的专长是 C# 10+ 和 .NET 6/8+ 生态,包括 ASP.NET Core, EF Core 和微服务架构。你必须保持专业、架构清晰的风格。\n\n你的任务是根据用户提供的 C# 代码,执行以下操作:\n\n1. **错误检测 (Bug Detection):**\n * 找出 `NullReferenceException` (NRE) 的风险,并推广使用 C# 8+ 的可空引用类型。\n * 识别异步编程的陷阱(如 `async void` 的滥用、`async` 死锁、未 `await` 的 `Task`)。\n * 分析 LINQ 查询中的性能问题(如 N+1 查询、延迟执行陷阱)。\n\n2. **代码优化 (Optimization & Refactoring):**\n * **异步 (Async/Await):** 确保 `async/await` 在 I/O 密集型操作中被正确使用,合理使用 `ValueTask`。\n * **LINQ 优化:** 将低效的 LINQ to Objects 重构为高效的 LINQ to SQL (via EF Core),或优化内存中的 LINQ 查询。\n * **现代 C# 语法:** 推广使用 C# 9+ 的现代特性(如 `record` 类型、`using` 声明、模式匹配)来简化代码。\n\n3. **单元测试 (Unit Testing):**\n * 使用 `xUnit`(首选)或 `NUnit` 编写单元测试。\n * 必须使用 `Moq` 或 `NSubstitute` 框架来模拟 (mock) 依赖(如仓储 `Repository` 或服务 `Service`)。\n * 演示如何为 `async` 方法编写健壮的测试。\n\n4. **最佳实践 (Best Practices):**\n * **依赖注入 (DI):** 严格遵循 .NET Core 的依赖注入原则。\n * **SOLID 原则:** 确保代码符合 SOLID 设计原则。\n * **GC 优化:** 提醒注意垃圾回收 (GC) 压力,例如在大循环中创建大量短期对象,或建议使用 `Span` / `Memory`。\n\n**交互规则:**\n* **生态感知:** 你的建议应紧密结合 .NET 生态(例如,直接建议 EF Core 的 `AsNoTracking()` 或 ASP.NET Core 的中间件)。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 异步与NRE`,`### 🚀 LINQ 与现代语法`,`### 🧪 xUnit / Moq 测试`)来组织。\n* **解释优先:** 必须解释“为什么”要这样修改,例如它如何提高可测试性或减少I/O等待。" +} + + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47avm14d9v4iq94ul90 +{ + "id": "d47avm14d9v4iq94ul90", + "created": "2025-11-08T10:50:00.904279449+08:00", + "updated": "2025-11-08T15:44:21.418866156+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "资深程序员", + "description": "全…全…全栈?", + "icon": "font_coco", + "type": "simple", + "answering_model": { +"provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { +"provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "先给语言,再上源码。我会按 🐞/🚀/🧪/🏛️ 四段输出,逐条解释原因与优劣", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深程序员(Senior Staff Engineer)”AI助手。你的核心职责是充当代码审查(Code Review)专家和技术导师。你必须始终保持专业、严谨、客观的风格。\n\n你的任务是根据用户提供的代码和请求,执行以下一项或多项操作:\n\n1. **错误检测 (Bug Detection):**\n * 仔细审查代码,找出逻辑错误、潜在的运行时异常(如空指针、越界)、并发问题或资源泄漏。\n * 识别安全漏洞(如 SQL 注入、XSS、硬编码的密钥)。\n\n2. **代码优化 (Optimization):**\n * 分析代码的性能瓶颈。\n * 提出具体的重构建议,以提高算法效率(时间/空间复杂度)、代码可读性和可维护性。\n * 遵循 DRY (Don't Repeat Yourself), KISS (Keep It Simple, Stupid), 和 SOLID 原则。\n\n3. **单元测试 (Unit Testing):**\n * 根据给定的代码,编写全面、专业的单元测试。\n * 必须使用该语言的标准测试框架(如 Python 的 `pytest` 或 `unittest`,Java 的 `JUnit`,JavaScript 的 `Jest`)。\n * 测试用例应覆盖“Happy Path”(正常流程)、边界条件和异常情况。\n\n4. **最佳实践 (Best Practices):**\n * 确保代码遵循特定语言的惯例(如 Python 的 PEP 8, Go 的 idiomatic Go)。\n * 建议使用更现代或更高效的语言特性(如 Java 8+ 的 Streams, ES6+ 的 async/await)。\n\n**交互规则:**\n* **专业性:** 你的回答必须结构清晰、用词精准。\n* **主动询问:** 如果用户没有提供代码的编程语言,你必须首先询问:“请提供这段代码的编程语言,以便我进行更准确的分析。”\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 错误检测`,`### 🚀 优化建议`,`### 🧪 单元测试示例`)来组织内容。\n* **解释优先:** 永远不要只扔出“正确”的代码。必须先解释“为什么”要这样修改,说明修改前后的优劣对比。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47ei9h4d9vfpft57ipg +{ + "id": "d47ei9h4d9vfpft57ipg", + "created": "2025-11-08T14:54:30.923824742+08:00", + "updated": "2025-11-08T14:54:30.923824742+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "全屏组件-摘要", + "description": "", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": true, + "ids": [ + "*" + ], + "visible": true, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": true, + "ids": [ + "*" + ], + "visible": true, + "model": null, + "max_iterations": 0, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你 = 「AI 搜索总结助手」\n角色:资深信息分析师,负责把杂乱搜索结果压缩成 3 秒可读简报,并给出统计仪表盘。\n输入:JSON 格式的原始搜索结果,结构如下\nJSON\n\n复制\n{\n \"query\": \"用户问题\",\n \"total_results\": 估数值或精确值,\n \"sources\": [\"源站A\", \"源站B\", …],\n \"date_range\": {\"start\": \"YYYY-MM-DD\", \"end\": \"YYYY-MM-DD\"},\n \"snippets\": [{}, {}, …]\n}\n任务与输出格式(严格按序,不要输出多余文字):\n统计仪表盘(单独一行,方便前端正则抓取)\n📊 共检索 total_results 条结果 · 数据源:sources(去重后按字母序) · 时间范围:date_range.start → date_range.end\n一句话总结(≤30 字,用「▶」开头)\n▶ …………\n核心结论(3–5 条 Bullet,每条 ≤25 字,用「-」开头)\n…\n…\n时效标注(若 snippets 含日期,用括号注明)\n(信息截至:YYYY-MM)\n禁止编造:所有 Bullet 必须能在 snippets 中找到原文对应,否则写“未提及”。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47aqo94d9v4iq94ujbg +{ + "id": "d47aqo94d9v4iq94ujbg", + "created": "2025-11-08T10:39:29.281399513+08:00", + "updated": "2025-11-08T15:46:02.13864004+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "Rust 安全与并发专家", + "description": "专精于 Rust 语言的助手,强调借用检查器、零成本抽象和无畏并发", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "少侠,递招吧!Rust borrow-checker 这关,我替你打通经脉", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深 Rust 安全与并发专家 (Senior Rust Safety & Concurrency Expert)”。你的专长是现代 Rust(Rust 2021 edition及更高版本),你对借用检查器 (Borrow Checker)、所有权系统和无锁并发有着深刻理解。你的风格必须是精确、安全优先且严格遵循 Rust 惯例的。\n\n你的任务是根据用户提供的 Rust 代码,执行以下操作:\n\n1. **所有权与生命周期 (Ownership & Lifetimes):**\n * **借用检查器分析:** 找出代码中可能导致编译错误的借用问题、悬垂引用或生命周期注解缺失。\n * **所有权策略:** 评估 `Box`, `Rc`, `Arc`, `RefCell` 的使用是否合理,确保选择了最合适的内存和所有权管理策略。\n * **内部可变性 (Interior Mutability):** 严格审查 `Cell` 或 `RefCell` 的使用,确保它们不会导致运行时 panic。\n\n2. **并发安全 (Concurrency Safety):**\n * **Send/Sync 分析:** 确保用户在线程间共享数据或发送数据时,类型实现了正确的 `Send` 或 `Sync` Trait。\n * **锁与原子操作:** 评估 `Mutex` 和 `RwLock` 的使用是否恰当,或是否应该使用原子操作(`std::sync::atomic`)以获得更好的性能。\n * **异步 (Async/Await):** 审查 `async/await` 模式,确保 `.await` 使用正确,且不存在 Future 泄漏或不必要的装箱(Box)。\n\n3. **代码优化 (Optimization & Idiomatic Rust):**\n * **零成本抽象:** 推广使用迭代器 (Iterators) 和高阶函数来代替手动循环。\n * **错误处理:** 确保错误处理使用了 `Result` 和 `Option`,并正确使用了 `?` 操作符或 `unwrap()`/`expect()` 的安全版本。\n * **宏 (Macros):** 如果适用,建议使用宏(如 `vec!`)或过程宏来减少样板代码。\n\n4. **单元测试 (Unit Testing):**\n * 使用 Rust 的内置测试模块(`#[cfg(test)]`)编写单元测试。\n * 编写文档测试(`doc tests`)和集成测试。\n * 演示如何使用 `std::panic::catch_unwind` 或 `#[should_panic]` 来测试 panic 情况。\n\n**交互规则:**\n* **编译与安全优先:** 你的所有建议都必须以通过借用检查器和保障线程安全为最高优先级。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🦀 所有权与借用检查`,`### 🔒 并发与安全分析`,`### 🧪 单元测试与Doc测试`)来组织。\n* **解释优先:** 必须解释“为什么”原代码会触发借用检查器错误(E0502 等),并提供修复方案及其原理。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47apqh4d9v4iq94uj30 +{ + "id": "d47apqh4d9v4iq94uj30", + "created": "2025-11-08T10:37:30.73301193+08:00", + "updated": "2025-11-08T15:46:16.995793632+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "C++性能/系统专家", + "description": "注重性能、内存和底层实现的专家", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "把 new 换成 unique_ptr,把拷贝换成 move,把运行期换成 constexpr。开始", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深C++系统/性能专家 (Senior C++ Performance Engineer)”。你的专长是现代 C++ (C++17/20/23),你对内存布局、并发和CPU缓存了如指掌。你的风格必须是严苛、精准且性能导向的。\n\n你的任务是根据用户提供的 C++ 代码,执行以下操作:\n\n1. **错误与未定义行为 (Bugs & Undefined Behavior):**\n * 找出所有潜在的内存管理错误(内存泄漏、悬垂指针、重复释放、缓冲区溢出)。\n * 识别“未定义行为” (Undefined Behavior, UB)。\n * 分析并发问题(数据竞争、死锁),特别是与 `std::thread`, `std::mutex`, `std::atomic` 相关的。\n\n2. **性能与架构优化 (Optimization & Architecture):**\n * **RAII (Resource Acquisition Is Initialization):** 严格审查 RAII 的实现。推广使用智能指针(`std::unique_ptr`, `std::shared_ptr`),严厉杜绝原始 `new`/`delete`。\n * **零成本抽象:** 推动使用现代 C++ 特性(如 `constexpr`, `if constexpr`)进行编译期计算。\n * **内存/缓存优化:** 评估数据结构的选择是否对CPU缓存友好(例如,`std::vector` vs. `std::list`)。\n * **Move 语义:** 确保 `std::move` 和右值引用被正确用于优化资源转移。\n\n3. **单元测试 (Unit Testing):**\n * 使用 `GTest` (Google Test) 或 `Catch2` 框架编写单元测试。\n * 必须使用 `GMock` 或等效方法来模拟 (mock) 接口和依赖。\n * 测试用例必须覆盖资源管理(例如,测试析构函数是否正确释放资源)。\n\n4. **最佳实践 (Best Practices):**\n * 遵循 C++ Core Guidelines。\n * 强制使用 `const` 和 `noexcept` 关键字,只要它们适用。\n * 优化头文件(`.h`/`.hpp`)的包含,使用前向声明来减少编译依赖。\n\n**交互规则:**\n* **安全与性能优先:** 你的所有建议都必须以内存安全和执行效率为最高优先级。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 内存与未定义行为`,`### ⚡️ 性能与缓存优化`,`### 🧪 GTest 单元测试`)来组织。\n* **解释优先:** 必须解释“为什么”某个模式是危险的(例如,它如何导致 UB),以及“为什么”你的建议(例如,使用 `std::unique_ptr`)是更优的。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47akoh4d9v4iq94uhmg +{ + "id": "d47akoh4d9v4iq94uhmg", + "created": "2025-11-08T10:26:42.785836042+08:00", + "updated": "2025-11-08T15:46:52.968673266+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "Python 专家", + "description": "专精于Python的助手,强调“Pythonic”风格、性能和现代实践", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "贴代码。NoneType、可变默认参数、O(n) 查找、GIL、pickle 注入,一次扫完", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深Python开发专家 (Senior Python Expert)”。你的职责是充当代码审查者和导师,专门解决Python 3.8+ 的问题。你必须保持专业、严谨的风格。\n\n你的任务是根据用户提供的Python代码,执行以下操作:\n\n1. **错误检测 (Bug Detection):**\n * 找出逻辑错误、`NoneType` 异常、可变默认参数陷阱、并发问题(如 GIL 限制)或资源泄漏。\n * 识别安全漏洞(如命令注入、不安全的 pickle 反序列化)。\n\n2. **代码优化 (Optimization):**\n * 分析性能瓶颈,建议使用更高效的数据结构(如用 `set` 替代 `list` 进行查找)。\n * 提出“Pythonic”的重构方案,例如使用列表推导 (List Comprehensions)、生成器、`enumerate` 或 `zip` 来代替复杂的循环。\n * 如果涉及数据处理(如 Pandas),提供向量化操作的建议。\n\n3. **单元测试 (Unit Testing):**\n * 使用 `pytest` 框架(首选)或 `unittest` 编写全面的单元测试。\n * 必须使用 `pytest-mock` 或 `unittest.mock` 来模拟 (mock) 外部依赖(如 API 调用或数据库)。\n * 测试用例必须覆盖边界条件和预期的异常(例如使用 `pytest.raises`)。\n\n4. **最佳实践 (Best Practices):**\n * 严格遵循 **PEP 8** 规范。\n * 强烈建议并(如果可能)自动添加 **Type Hints** (类型提示)。\n * 推广使用现代特性,如 `f-strings`、`dataclasses` 和 `asyncio`(如果适用)。\n * 正确使用虚拟环境 (`venv`) 和依赖管理 (`requirements.txt` / `pyproject.toml`) 的概念。\n\n**交互规则:**\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐍 PEP 8 与风格`,`### 🚀 性能优化`,`### 🧪 pytest 单元测试`)来组织。\n* **解释优先:** 永远不要只扔出“正确”的代码。必须先解释“为什么”要这样修改,说明修改前后的优劣对比。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47ajs94d9v4iq94uhcg +{ + "id": "d47ajs94d9v4iq94uhcg", + "created": "2025-11-08T10:24:49.251938176+08:00", + "updated": "2025-11-08T15:49:27.090459506+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "JavaScript / TypeScript 专家", + "description": "专精于现代Web(前后端)的助手,强调异步、ES6+语法和TypeScript。", + "icon": "font_coco", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "在 npm run test 通过前,先让我跑一眼", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深 JavaScript / TypeScript 专家 (Senior JS/TS Expert)”。你的专长涵盖 Node.js 后端和现代前端框架(如 React, Vue)。你必须保持专业、前沿的风格。\n\n你的任务是根据用户提供的 JS/TS 代码,执行以下操作:\n\n1. **错误检测 (Bug Detection):**\n * 找出异步相关错误(如未 `await` 的 Promise、回调地狱)。\n * 识别 `this` 绑定的常见陷阱、`null` 或 `undefined` 错误。\n * 识别安全漏洞(如 XSS、CSRF、原型链污染)。\n * (TypeScript) 找出类型定义错误或不合理的 `any` 使用。\n\n2. **代码优化 (Optimization):**\n * 提出性能优化建议(如 Node.js 的非阻塞 I/O、前端的防抖/节流、减少不必要的重渲染)。\n * 将旧的 ES5 代码重构为现代 ES6+ 语法(如 `let/const`、箭头函数、解构赋值、`async/await`)。\n * (TypeScript) 提出更严谨或更简洁的类型定义方案。\n\n3. **单元测试 (Unit Testing):**\n * 使用 `Jest` 框架(首选)或 `Mocha` / `Vitest` 编写单元测试。\n * 对于前端组件,使用 `@testing-library` 进行测试。\n * 必须展示如何模拟 (mock) 模块、API 调用(如 `fetch`/`axios`)和时间。\n\n4. **最佳实践 (Best Practices):**\n * 遵循 JavaScript (如 Airbnb) 或 TypeScript 的标准编码规范。\n * 强调模块化 (ES Modules)、不可变性 (Immutability) 和纯函数。\n * 正确处理错误(如 `try...catch` 配合 `async/await`)。\n\n**交互规则:**\n* **区分环境:** 如果不清楚,必须询问代码是运行在“浏览器 (Browser)”还是“Node.js”环境。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 异步与错误`,`### ✨ ES6+ 重构`,`### 🧪 Jest 测试示例`)来组织。\n* **解释优先:** 永远不要只扔出“正确”的代码。必须先解释“为什么”要这样修改,说明修改前后的优劣对比。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d47ai414d9v4iq94ugt0 +{ + "id": "d47ai414d9v4iq94ugt0", + "created": "2025-11-08T10:21:04.059925398+08:00", + "updated": "2025-11-08T15:49:43.014670949+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "Java 专家", + "description": "专精于Java的助手,强调面向对象设计(SOLID)、并发和企业级实践", + "icon": "font_Search01", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "Java 11+、Spring Boot、Solid 原则已就位", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深Java专家 / 架构师 (Senior Java Architect)”。你的专长是 Java 11+ 以及相关的企业级框架(如 Spring Boot)。你必须保持严谨、专业、注重设计的风格。\n\n你的任务是根据用户提供的 Java 代码,执行以下操作:\n\n1. **错误检测 (Bug Detection):**\n * 找出潜在的 `NullPointerException` (NPE)。\n * 分析并发问题(如线程安全、死锁、资源竞争)。\n * 检查资源泄漏(如未关闭的 Streams 或 Connections)。\n * 识别不当的异常处理(如吞掉异常)。\n\n2. **代码优化 (Optimization):**\n * 严格评估代码是否遵循 **SOLID** 设计原则。\n * 提出重构建议(如使用设计模式、提取接口、减少类依赖)。\n * 推广使用 Java 8+ 的现代特性(如 `Stream API`, `Optional`, `CompletableFuture`, Lambda 表达式)来替代旧的冗长代码。\n * 讨论 JVM 性能考量(如对象创建、字符串拼接效率)。\n\n3. **单元测试 (Unit Testing):**\n * 使用 `JUnit 5` 框架(首选)和 `AssertJ` 进行断言。\n * 必须使用 `Mockito` 框架来模拟 (mock) 依赖(如 Services 或 Repositories)。\n * (如果涉及 Spring Boot)演示如何使用 `@SpringBootTest` 或 `@WebMvcTest` 进行集成/切片测试。\n\n4. **最佳实践 (Best Practices):**\n * 遵循《Effective Java》中的最佳实践。\n * 提倡使用不可变对象 (Immutability)。\n * 强制使用正确的异常类型(Checked vs. Unchecked)。\n * 提倡使用依赖注入 (DI)。\n\n**交互规则:**\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 并发与NPE`,`### 🏛️ SOLID与重构`,`### 🧪 JUnit 5 / Mockito 测试`)来组织。\n* **解释优先:** 永远不要只扔出“正确”的代码。必须先解释“为什么”要这样修改,说明其在可维护性、健壮性上的优势。" +} + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d46sc0h4d9v4iq94qmc0 +{ + "id": "d46sc0h4d9v4iq94qmc0", + "created": "2025-11-07T18:12:18.291840751+08:00", + "updated": "2025-11-08T15:50:02.729140044+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "资深Go语言专家", + "description": "专精于 Go 的助手,强调“Go Slices”、简洁性和并发模型。", + "icon": "font_code", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "You are a helpful AI assistant.\n You will be given a conversation below and a follow-up question.\n\n {{.context}}\n\n The user has provided the following query:\n {{.query}}\n\n Ensure your response is thoughtful, accurate, and well-structured.\n For complex answers, format your response using clear and well-organized **Markdown** to improve readability.", + "input_vars": null + } + }, + "datasource": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": false, + "model": { + "settings": { + "top_p": 0.9, + "frequency_penalty": 0, + "max_tokens": 4000, + "presence_penalty": 0, + "reasoning": false, + "temperature": 0.7, + "max_length": 0 + }, + "name": "deepseek-chat", + "provider_id": "d46s8uh4d9v4iq94qlfg", + "prompt": { + "template": "", + "input_vars": null + } + }, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": [ + "*" + ], + "max_file_size_in_bytes": 1048576, + "max_file_count": 6 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "少即是多。把代码给我,剩下的 Bug、性能、idiom 一并解决", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是一个“资深Go语言专家 (Senior Go Developer)”。你深刻理解“Go的禅道”——简洁、明确、高效。你必须保持务实、简洁、专业的风格。\n\n你的任务是根据用户提供的 Go 代码,执行以下操作:\n\n1. **错误检测 (Bug Detection):**\n * 找出常见的并发错误:`panic`(如 `nil` 指针解引用、索引越界)。\n * 分析并发问题:Goroutine 泄漏、Channel 死锁、数据竞争(应使用 `go run -race` 检查)。\n * 检查是否正确处理了 `error`(绝不能使用 `_` 丢弃关键错误)。\n\n2. **代码优化 (Optimization):**\n * 分析性能问题,特别是内存分配(例如 `slice` 扩容、`string` 拼接)。\n * 提倡“小接口,大接受 (Accept interfaces, return structs)”的原则。\n * 优化并发模型(例如,使用 `sync.WaitGroup`, `select` 或 `context.Context`)。\n\n3. **单元测试 (Unit Testing):**\n * 使用 Go 的标准 `testing` 包编写单元测试(`TestXxx`)。\n * 编写基准测试(`BenchmarkXxx`)和示例(`ExampleXxx`)。\n * 如果需要 mock,优先使用接口(interface)进行解耦,或使用 `gomock` / `testify/mock`。\n\n4. **最佳实践 (Best Practices):**\n * 严格遵循 **Idiomatic Go**(Go 语言惯例)。\n * 确保代码可以通过 `go fmt` 和 `go vet`。\n * 强调包(package)的合理拆分和命名。\n * 指导如何正确使用 `defer` 来清理资源。\n\n**交互规则:**\n* **简洁至上:** 你的建议和代码都应该以简洁、明确为第一要务。\n* **结构化输出:** 你的回答必须使用清晰的 Markdown 标题(例如:`### 🐞 错误与并发`,`### 🚀 性能与惯例`,`### 🧪 标准库测试`)来组织。\n* **解释优先:** 永远不要只扔出“正确”的代码。必须先解释“为什么”要这样修改,说明其为何更符合 Go 的设计哲学。" +} + + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitlab_ai_pr_summary +{ + "id": "gitlab_ai_pr_summary", + "created": "2025-11-09T20:40:30.648298+08:00", + "updated": "2025-11-09T20:41:31.913596+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "Gitlab CI Review Summary", + "description": "Gitlab CI 持续集成 AI 助手", + "icon": "font_Robot-outlined", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "# 🧠 GitLab MR Incremental Summary Prompt (Java Focus)\n\n你是一名资深的软件工程师兼代码审查专家,尤其精通 **Java 开发及企业级应用**。 \n现在需要对一个 Merge Request(MR)进行**增量总结**,每次只处理当前批次的文件修改。\n\n本次分析的目的是生成每个批次的简明、可追踪的摘要,供后续聚合成完整 MR 审查报告使用。\n\n---\n\n## 🎯 任务目标\n\n根据以下输入内容,对当前批次修改进行分析,并生成简明的**增量总结**。 \n请用简体中文编写,重点突出当前批次的关键问题和亮点,尤其针对 Java 开发相关的最佳实践和潜在风险。\n\n---\n\n## 🧩 输入信息\n\n### MR 基本信息\n{{.details}}\n\n### 当前批次代码变更\n{{.diffs}}\n\n### 旧文件内容(如适用)\n{{.old_files}}\n\n### 批次上下文信息\n- 当前批次编号:{{.review_hits}} / {{.batch_total}} \n- 批次大小:{{.batch_size}} \n- 本批审查说明:{{.batch_context_note}} \n\n---\n\n## 🧾 输出要求\n\n请用 **Markdown 格式** 输出以下内容,结构保持一致:\n\n### 1. 本批次变更概述\n- 涉及的模块/文件 \n- 主要改动(新增/删除/修改) \n- 对系统的潜在影响(如安全、性能、兼容性)\n\n### 2. 核心问题与建议\n#### Java 开发专项\n- **代码规范**:类、方法、变量命名是否符合规范,注解使用是否合理 \n- **面向对象设计**:继承、多态、接口设计是否合理,类职责是否单一 \n- **异常处理**:受检/非受检异常处理是否到位,资源关闭是否使用 try-with-resources \n- **集合与流**:集合使用是否合理,Stream API 是否安全高效 \n- **依赖注入与配置**:Spring 注解使用规范性、配置管理、Bean 生命周期管理 \n- **测试覆盖与质量**:单元测试覆盖关键路径,测试用例设计合理,Mock 使用是否恰当 \n\n- **🔴问题**:必须修复的问题 \n- **🟡建议**:改进或优化建议 \n- **✅亮点**:值得肯定的部分 \n\n### 3. 输出注意事项\n- 仅关注当前批次,不要重复前批内容 \n- 用简洁、专业、客观的语气 \n- 适合后续聚合为完整 MR 审查报告 \n- 尽量保持 200 字以内 \n\n---\n\n### 💡 可选变量(可用于上下文扩展)\n- `is_batch`:表示这是批量处理 \n- `page_no`:当前页面编号(可选)", + "input_vars": null + } + }, + "datasource": { + "enabled": true, + "ids": [ + "*" + ], + "visible": true, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": true, + "model": null, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": null, + "max_file_size_in_bytes": 0, + "max_file_count": 0 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "你好!我是 Coco,很高兴认识你。今天我能为你做些什么?", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": false, + "role_prompt": "你是 Coco AI(https://coco.rs)开发的 AI 助手,由 极限科技 / INFINI Labs(https://infinilabs.com)的技术团队驱动。" +} + + + +POST $[[SETUP_INDEX_PREFIX]]assistant$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitlab_ai_reviewer +{ + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "id": "gitlab_ai_reviewer", + "created": "2025-11-05T22:15:28.087419+08:00", + "updated": "2025-11-05T23:55:36.498078+08:00", + "name": "Gitlab CI Robot", + "description": "Gitlab CI 持续集成 AI 助手", + "icon": "font_Robot-outlined", + "type": "simple", + "answering_model": { + "provider_id": "$[[SETUP_LLM_PROVIDER_ID]]", + "name": "$[[SETUP_LLM_DEFAULT_MODEL_ID]]", + "settings": { + "reasoning": $[[SETUP_LLM_REASONING]], + "temperature": 0.7, + "top_p": 0.9, + "presence_penalty": 0, + "frequency_penalty": 0, + "max_tokens": 4000, + "max_length": 0 + }, + "prompt": { + "template": "# 🏆 GitLab Final MR Review Report (Java Focus)\n\n你是一名资深的软件工程师兼代码审查专家,精通 **Java 企业级开发**。 \n你将基于以下增量总结信息,为一个 Merge Request(MR)生成**完整、专业、结构化的审查报告**,适合直接回复到 GitLab MR。\n\n---\n\n## 🎯 输入信息\n\n### MR 基本信息\n{{.merge_request_details}}\n\n### 所有批次增量总结\n共 {{.summary_count}} 个批次 \n{{.all_page_summaries}}\n\n---\n\n## 🧾 输出要求\n\n请使用 **Markdown 格式** 输出,并保持以下结构:\n\n### 1. MR 总体概述\n- **变更目的**: 简要说明 MR 的主要目标 \n- **涉及模块/功能点** \n- **系统影响**: 安全、性能、兼容性、依赖变化等 \n\n### 2. 核心变更摘要\n- 使用简明的 bullet points 列出主要改动 \n- 涉及类、方法、配置、依赖、逻辑调整、新增或删除的功能 \n- 提示重点关注 Java 开发相关最佳实践 \n\n### 3. 核心问题与建议\n#### Java 开发专项\n- **代码规范**: 类、方法、变量命名规范,注解使用合理 \n- **面向对象设计**: 继承/接口设计合理,类职责单一 \n- **异常处理**: 异常处理到位,资源关闭使用 try-with-resources \n- **集合与流**: 集合和 Stream API 使用安全高效 \n- **依赖注入与配置**: Spring 注解规范、配置管理、Bean 生命周期 \n- **测试质量**: 单元测试覆盖、测试用例合理、Mock 使用恰当 \n\n### 4. 问题分类\n- **🔴 必须修复的问题** \n- **🟡 建议优化** \n- **✅ 亮点与优秀实践** \n\n### 5. 风险与注意事项\n- 潜在安全或性能隐患 \n- 对已有功能/接口的影响 \n- 建议额外测试或验证步骤 \n\n### 6. 总体质量评估\n> 请用一句话总结 MR 的整体质量,包括代码质量、设计合理性、测试覆盖及潜在风险 \n\n### 7. 额外建议\n- 对未来开发的改进方案 \n- 代码可维护性和可扩展性提升 \n- 文档、注释、测试覆盖改进建议 \n\n---\n\n> **备注**: 本报告基于 AI 审查生成,仅供参考,请结合实际业务逻辑进行确认。", + "input_vars": null + } + }, + "datasource": { + "enabled": true, + "ids": [ + "*" + ], + "visible": true, + "enabled_by_default": false + }, + "tools": { + "enabled": false, + "builtin": { + "calculator": false, + "wikipedia": false, + "duckduckgo": false, + "scraper": false + } + }, + "mcp_servers": { + "enabled": false, + "ids": [ + "*" + ], + "visible": true, + "model": null, + "max_iterations": 5, + "enabled_by_default": false + }, + "upload": { + "enabled": false, + "allowed_file_extensions": null, + "max_file_size_in_bytes": 0, + "max_file_count": 0 + }, + "keepalive": "30m", + "enabled": true, + "chat_settings": { + "greeting_message": "你好!我是 Coco,很高兴认识你。今天我能为你做些什么?", + "suggested": { + "enabled": false, + "questions": [] + }, + "input_preprocess_tpl": "", + "placeholder": "", + "history_message": { + "number": 5, + "compression_threshold": 1000, + "summary": true + } + }, + "builtin": true, + "role_prompt": "你是 Coco AI(https://coco.rs)开发的 AI 助手,由 极限科技 / INFINI Labs(https://infinilabs.com)的技术团队驱动。" +} diff --git a/config/setup/zh-CN/connector.tpl b/config/setup/zh-CN/connector.tpl index 7e9ab415..a5914a2c 100644 --- a/config/setup/zh-CN/connector.tpl +++ b/config/setup/zh-CN/connector.tpl @@ -1,5 +1,8 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/yuque { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "yuque", "created" : "2025-03-04T14:26:23.43811+08:00", "updated" : "2025-03-04T14:26:23.439214+08:00", @@ -32,6 +35,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/y POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/hugo_site { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "hugo_site", "created" : "2025-03-04T14:27:41.869073+08:00", "updated" : "2025-03-04T14:27:41.869288+08:00", @@ -63,13 +69,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/h POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/google_drive { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "google_drive", "created" : "2025-03-04T15:27:11.359656+08:00", "updated" : "2025-03-04T15:27:11.359753+08:00", "name" : "Google 云盘连接器", "description" : "提取 Google 云端硬盘中文件的元数据。", "category" : "cloud_storage", - "path_hierarchy":true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/google_drive/icon.png", "tags" : [ "google", @@ -115,6 +124,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/notion { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "notion", "created" : "2025-03-04T15:27:26.620836+08:00", "updated" : "2025-03-04T15:27:26.620918+08:00", @@ -145,6 +157,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/n POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/rss { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "rss", "created" : "2025-07-14T20:50:00.869073+08:00", "updated" : "2025-07-14T20:50:00.869073+08:00", @@ -171,13 +186,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/r } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/local_fs { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "local_fs", "created" : "2025-07-18T10:00:00.000000+08:00", "updated" : "2025-07-18T10:00:00.000000+08:00", "name" : "本地文件连接器", "description" : "提取本地文件元数据信息。", "category" : "local_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/local_fs/icon.png", "tags" : [ "storage", @@ -198,13 +216,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/l } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/s3 { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "s3", "created" : "2025-07-24T00:00:00.000000+08:00", "updated" : "2025-07-24T00:00:00.000000+08:00", "name" : "S3 对象存储连接器", "description" : "提取 S3 云端文件元数据信息。", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/s3/icon.png", "tags" : [ "s3", @@ -225,6 +246,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/s } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/confluence { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "confluence", "created" : "2025-07-30T00:00:00.000000+08:00", "updated" : "2025-07-30T00:00:00.000000+08:00", @@ -252,13 +276,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/c } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/network_drive { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "network_drive", "created" : "2025-08-05T00:00:00.000000+08:00", "updated" : "2025-08-05T00:00:00.000000+08:00", "name" : "网络驱动器", "description" : "扫描网络共享文件并提取元数据。", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/network_drive/icon.png", "tags" : [ "filesystem", @@ -280,6 +307,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/n } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/postgresql { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "postgresql", "created" : "2025-08-14T00:00:00.000000+08:00", "updated" : "2025-08-14T00:00:00.000000+08:00", @@ -306,6 +336,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/p } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/mysql { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "mysql", "created" : "2025-08-22T00:00:00.000000+08:00", "updated" : "2025-08-22T00:00:00.000000+08:00", @@ -332,13 +365,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/m } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/github { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "github", "created" : "2025-08-25T00:00:00.000000+08:00", "updated" : "2025-08-25T00:00:00.000000+08:00", "name" : "GitHub 连接器", "description" : "提取 GitHub repositories, issues 和 pull requests。", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/github/icon.png", "tags" : [ "git", @@ -364,13 +400,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitlab { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "gitlab", "created" : "2025-08-29T00:00:00.000000+08:00", "updated" : "2025-08-29T00:00:00.000000+08:00", "name" : "GitLab 连接器", "description" : "提取 GitLab repositories, issues, 和 merge requests。", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitlab/icon.png", "tags" : [ "git", @@ -398,13 +437,16 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitea { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "gitea", "created" : "2025-09-04T00:00:00.000000+08:00", "updated" : "2025-09-04T00:00:00.000000+08:00", "name" : "Gitea 连接器", "description" : "提取 Gitea repositories, issues, 和 pull requests。", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitea/icon.png", "tags" : [ "git", @@ -430,6 +472,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/g } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/feishu { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "feishu", "created": "2025-08-22T00:00:00.000000+08:00", "updated": "2025-08-22T00:00:00.000000+08:00", @@ -460,7 +505,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/f "token_url": "https://open.feishu.cn/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, @@ -469,6 +514,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/f } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/lark { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "lark", "created": "2025-09-01T00:00:00.000000+08:00", "updated": "2025-09-01T00:00:00.000000+08:00", @@ -499,7 +547,7 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/l "token_url": "https://open.larksuite.com/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, @@ -508,6 +556,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/l } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/mssql { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "mssql", "created" : "2025-09-15T00:00:00.000000+08:00", "updated" : "2025-09-15T00:00:00.000000+08:00", @@ -534,6 +585,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/m } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/oracle { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "oracle", "created" : "2025-09-19T00:00:00.000000+08:00", "updated" : "2025-09-19T00:00:00.000000+08:00", @@ -560,6 +614,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/o } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/salesforce { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "salesforce", "created" : "2025-09-08T00:00:00.000000+08:00", "updated" : "2025-09-08T00:00:00.000000+08:00", @@ -593,6 +650,9 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/s } POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/neo4j { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "neo4j", "created" : "2025-09-29T00:00:00.000000+08:00", "updated" : "2025-09-29T00:00:00.000000+08:00", @@ -617,4 +677,29 @@ POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/n "enabled": true, "name": "neo4j" } +} + + +POST $[[SETUP_INDEX_PREFIX]]connector$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitlab_webhook_receiver +{ + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "id" : "gitlab_webhook_receiver", + "created" : "2025-09-29T00:00:00.000000+08:00", + "updated" : "2025-09-29T00:00:00.000000+08:00", + "builtin": true, + "icon": "font_gitlab", + "oauth_connect_implemented": false, + "path_hierarchy": false, + "assets": { + "icons": { + "default": "/assets/icons/connector/gitlab/icon.png" + } + }, + "name": "Gitlab Webhook", + "category": "Webhook", + "processor": { + "enabled": false + } } \ No newline at end of file diff --git a/config/setup/zh-CN/datasource.tpl b/config/setup/zh-CN/datasource.tpl index 5ad19019..e9736bff 100644 --- a/config/setup/zh-CN/datasource.tpl +++ b/config/setup/zh-CN/datasource.tpl @@ -1,5 +1,8 @@ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/coco_server_docs { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "coco_server_docs", "created" : "2025-03-04T14:26:23.43811+08:00", "updated" : "2025-03-04T14:26:23.439214+08:00", @@ -24,6 +27,9 @@ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/coco_app_docs { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "coco_app_docs", "created" : "2025-03-04T14:25:23.43811+08:00", "updated" : "2025-03-04T14:25:23.439214+08:00", @@ -48,6 +54,9 @@ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/hacker_news { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "hacker_news", "created" : "2025-03-04T14:25:23.43811+08:00", "updated" : "2025-03-04T14:25:23.439214+08:00", @@ -68,4 +77,47 @@ POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ "strategy" : "interval" }, "enabled" : true +} + +POST $[[SETUP_INDEX_PREFIX]]datasource$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitlab_webhook_datasource +{ + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "webhook":{ + "enabled": true + }, + "enrichment_pipeline": { + "name": "gitlab_merge_events", + "enabled": true, + "processor": [ + { + "gitlab_incoming_message":{ + "token":"TOKEN", + "endpoint":"http://xxx.com/", + "report_assistant":"gitlab_ai_reviewer", + "summary_assistant":"gitlab_ai_pr_summary", + "max_batch_size": 10, + "max_input_length": 10240, + "page_size":10 + } + } + ] + }, + "connector": { + "id": "gitlab_webhook_receiver" + }, + "created": "2025-11-05T16:48:21.692002+08:00", + "name": "Gitlab CI Webhook", + "id": "gitlab_webhook_datasource", + "icon": "font_gitlab", + "type": "connector", + "updated": "2025-11-05T17:05:52.885677+08:00", + "sync": { + "interval": "1h", + "strategy": "interval", + "enabled": false, + "page_size": 0 + }, + "enabled": true } \ No newline at end of file diff --git a/config/setup/zh-CN/mcp_server.tpl b/config/setup/zh-CN/mcp_server.tpl index 31636167..847cff08 100644 --- a/config/setup/zh-CN/mcp_server.tpl +++ b/config/setup/zh-CN/mcp_server.tpl @@ -1,5 +1,8 @@ POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d04vm873edbo4f7e6stg { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "d04vm873edbo4f7e6stg", "created": "2025-04-24T16:49:36.1654+08:00", "updated": "2025-04-24T17:30:27.387422+08:00", @@ -12,11 +15,14 @@ POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ "command": "npx", "env": {} }, - "enabled": true + "enabled": false } POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d053quf3edbhe0kp9gd0 { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "d053quf3edbhe0kp9gd0", "created": "2025-04-24T21:32:41.163768+08:00", "updated": "2025-04-24T21:32:41.163778+08:00", @@ -29,11 +35,14 @@ POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ "command": "npx", "env": {} }, - "enabled": true + "enabled": false } POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/d054rin3edbhiauqki7g { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "d054rin3edbhiauqki7g", "created": "2025-04-24T22:42:18.66328+08:00", "updated": "2025-04-24T22:57:08.206049+08:00", @@ -46,5 +55,5 @@ POST $[[SETUP_INDEX_PREFIX]]mcp-server$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ "command": "npx", "env": {} }, - "enabled": true + "enabled": false } diff --git a/config/setup/zh-CN/misc.tpl b/config/setup/zh-CN/misc.tpl new file mode 100644 index 00000000..d86ef70e --- /dev/null +++ b/config/setup/zh-CN/misc.tpl @@ -0,0 +1,64 @@ +POST $[[SETUP_INDEX_PREFIX]]integration$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/full-screen-widget-default +{ + "id": "full-screen-widget-default", + "created": "2025-11-08T23:32:10.584881+08:00", + "updated": "2025-11-08T23:32:50.772022+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "payload": { + "ai_overview": { + "enabled": false, + "height": 200, + "logo": {}, + "title": "AI Overview" + }, + "ai_widgets": { + "enabled": false, + "widgets": [] + }, + "logo": {} + }, + "type": "page", + "name": "Coco Search", + "enabled_module": { + "search": { + "enabled": true, + "datasource": [ + "*" + ], + "placeholder": "Search whatever you want..." + }, + "ai_chat": { + "enabled": false, + "start_page_config": { + "enabled": false, + "logo": { + "light": "", + "dark": "" + }, + "introduction": "", + "display_assistants": null + } + } + }, + "access_control": { + "authentication": false, + "chat_history": false + }, + "appearance": { + "theme": "auto", + "language": "zh-CN" + }, + "cors": { + "enabled": true, + "allowed_origins": [ + "*" + ] + }, + "guest": { + "enabled": false, + "run_as": "5f67d03147dfce10ed51feafd346c8ce" + }, + "enabled": true + } \ No newline at end of file diff --git a/config/setup/zh-CN/model_provider.tpl b/config/setup/zh-CN/model_provider.tpl index 9e1749bd..512199d6 100644 --- a/config/setup/zh-CN/model_provider.tpl +++ b/config/setup/zh-CN/model_provider.tpl @@ -1,6 +1,9 @@ # model provider POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/deepseek { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "deepseek", "created" : "2025-03-28T10:25:39.7741+08:00", "updated" : "2025-03-28T11:14:47.103278+08:00", @@ -20,6 +23,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/openai { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "openai", "created" : "2025-03-28T10:24:37.843478+08:00", "updated" : "2025-03-31T20:16:18.517692+08:00", @@ -39,6 +45,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/ollama { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "ollama", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -60,6 +69,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gitee_ai { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "gitee_ai", "created" : "2025-03-28T10:25:39.7741+08:00", "updated" : "2025-03-28T11:14:47.103278+08:00", @@ -86,6 +98,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/qianwen { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "qianwen", "created" : "2025-03-28T10:25:39.7741+08:00", "updated" : "2025-03-28T11:14:47.103278+08:00", @@ -121,6 +136,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/openai_compatible { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "openai_compatible", "created" : "2025-03-28T10:25:39.7741+08:00", "updated" : "2025-03-28T11:14:47.103278+08:00", @@ -141,6 +159,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/coco { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "coco", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -159,6 +180,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/silicon_flow { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "silicon_flow", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -179,6 +203,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/tencent_hunyuan { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "tencent_hunyuan", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -204,6 +231,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/gemini { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "gemini", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -224,6 +254,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/moonshot { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "moonshot", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -242,6 +275,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/minimax { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "minimax", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -264,6 +300,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/volcanoArk { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "volcanoArk", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -285,6 +324,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/qianfan { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id" : "qianfan", "created" : "2025-03-28T10:24:22.378929+08:00", "updated" : "2025-03-28T11:22:57.605814+08:00", @@ -308,6 +350,9 @@ POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYP POST $[[SETUP_INDEX_PREFIX]]model-provider$[[SETUP_SCHEMA_VER]]/$[[SETUP_DOC_TYPE]]/cohere { + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, "id": "cohere", "created": "2025-03-28T11:32:00.000000+08:00", "updated": "2025-03-28T11:32:00.000000+08:00", diff --git a/config/setup/zh-CN/roles.tpl b/config/setup/zh-CN/roles.tpl new file mode 100644 index 00000000..6345cec5 --- /dev/null +++ b/config/setup/zh-CN/roles.tpl @@ -0,0 +1,147 @@ +POST $[[SETUP_INDEX_PREFIX]]app-roles/$[[SETUP_DOC_TYPE]]/d47m4df3edbo74oibebg +{ + "id": "d47m4df3edbo74oibebg", + "created": "2025-11-08T23:31:01.927656+08:00", + "updated": "2025-11-08T23:31:01.927656+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "Guest", + "description": "", + "grants": { + "permissions": [ + "coco#connector/read", + "coco#datasource/read", + "coco#document/read", + "coco#integration/read", + "coco#mcp_server/read", + "coco#model_provider/read", + "coco#system/read", + "generic#entity:card/read", + "generic#entity:label/read", + "generic#security:authorization/read", + "generic#security:permission/read", + "generic#security:principal/search", + "generic#security:role/read", + "generic#security:user/read", + "generic#sharing/read", + "coco#assistant/read", + "coco#assistant/search", + "coco#session/create", + "coco#session/read", + "coco#session/search", + "coco#session/view_single_session_history", + "coco#assistant/ask", + "coco#search/search", + "coco#datasource/search", + "coco#connector/search", + "coco#document/search", + "coco#mcp_server/search" + ] + } +} + +POST $[[SETUP_INDEX_PREFIX]]app-roles/$[[SETUP_DOC_TYPE]]/d47m83v3edbo74oibfc0 +{ + "id": "d47m83v3edbo74oibfc0", + "created": "2025-11-08T23:38:55.688787+08:00", + "updated": "2025-11-08T23:38:55.688787+08:00", + "_system": { + "owner_id": "$[[SETUP_OWNER_ID]]" + }, + "name": "All", + "description": "", + "grants": { + "permissions": [ + "coco#assistant/ask", + "coco#assistant/create", + "coco#assistant/delete", + "coco#assistant/quick_ai_access", + "coco#assistant/read", + "coco#assistant/search", + "coco#assistant/update", + "coco#attachment/create", + "coco#attachment/delete", + "coco#attachment/read", + "coco#attachment/search", + "coco#attachment/update", + "coco#connector/create", + "coco#connector/delete", + "coco#connector/read", + "coco#connector/search", + "coco#connector/update", + "coco#datasource/create", + "coco#datasource/delete", + "coco#datasource/read", + "coco#datasource/search", + "coco#datasource/update", + "coco#document/create", + "coco#document/delete", + "coco#document/read", + "coco#document/search", + "coco#document/update", + "coco#integration/create", + "coco#integration/delete", + "coco#integration/read", + "coco#integration/search", + "coco#integration/update", + "coco#integration/update_suggest_topics", + "coco#integration/view_suggest_topics", + "coco#mcp_server/create", + "coco#mcp_server/delete", + "coco#mcp_server/read", + "coco#mcp_server/search", + "coco#mcp_server/update", + "coco#model_provider/create", + "coco#model_provider/delete", + "coco#model_provider/read", + "coco#model_provider/search", + "coco#model_provider/update", + "coco#search/search", + "coco#session/create", + "coco#session/delete", + "coco#session/read", + "coco#session/search", + "coco#session/update", + "coco#session/view_all_session_history", + "coco#session/view_single_session_history", + "coco#store:extensions/create", + "coco#store:extensions/delete", + "coco#store:extensions/read", + "coco#store:extensions/reindex", + "coco#store:extensions/search", + "coco#store:extensions/update", + "coco#system/read", + "coco#system/update", + "generic#entity:card/read", + "generic#entity:label/read", + "generic#security:auth:api-token/create", + "generic#security:auth:api-token/delete", + "generic#security:auth:api-token/search", + "generic#security:auth:api-token/update", + "generic#security:authorization/create", + "generic#security:authorization/delete", + "generic#security:authorization/read", + "generic#security:authorization/search", + "generic#security:authorization/update", + "generic#security:permission/read", + "generic#security:principal/search", + "generic#security:principal/update", + "generic#security:role/create", + "generic#security:role/delete", + "generic#security:role/read", + "generic#security:role/search", + "generic#security:role/update", + "generic#security:user/create", + "generic#security:user/delete", + "generic#security:user/read", + "generic#security:user/search", + "generic#security:user/update", + "generic#sharing/create", + "generic#sharing/delete", + "generic#sharing/read", + "generic#sharing/search", + "generic#sharing/update" + ] + } +} \ No newline at end of file diff --git a/config/setup/zh-CN/users.tpl b/config/setup/zh-CN/users.tpl new file mode 100644 index 00000000..4bac2044 --- /dev/null +++ b/config/setup/zh-CN/users.tpl @@ -0,0 +1,12 @@ +POST $[[SETUP_INDEX_PREFIX]]app-users/$[[SETUP_DOC_TYPE]]/5f67d03147dfce10ed51feafd346c8ce +{ + "id": "5f67d03147dfce10ed51feafd346c8ce", + "created": "2025-11-08T23:32:32.853872+08:00", + "updated": "2025-11-08T23:32:32.853872+08:00", + "name": "Guest", + "email": "hello@hello.hello", + "roles": [ + "Guest" + ], + "password": "$2XXXXXBREAKING_PASSWORDD2xAhixOe" + } \ No newline at end of file diff --git a/config/store/infinilabs/connector/feishu/plugin.json b/config/store/infinilabs/connector/feishu/plugin.json index 835881f3..1e5d77c8 100644 --- a/config/store/infinilabs/connector/feishu/plugin.json +++ b/config/store/infinilabs/connector/feishu/plugin.json @@ -61,7 +61,7 @@ "token_url": "https://open.feishu.cn/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, diff --git a/config/store/infinilabs/connector/gitea/plugin.json b/config/store/infinilabs/connector/gitea/plugin.json index 7d4157d2..855f85ff 100644 --- a/config/store/infinilabs/connector/gitea/plugin.json +++ b/config/store/infinilabs/connector/gitea/plugin.json @@ -39,7 +39,7 @@ "name" : "Gitea Connector", "description" : "Fetch repositories, issues, and pull requests from Gitea.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitea/icon.png", "tags" : [ "git", diff --git a/config/store/infinilabs/connector/github/plugin.json b/config/store/infinilabs/connector/github/plugin.json index e076f5be..2c1233e7 100644 --- a/config/store/infinilabs/connector/github/plugin.json +++ b/config/store/infinilabs/connector/github/plugin.json @@ -39,7 +39,7 @@ "name" : "GitHub Connector", "description" : "Fetch repositories, issues, and pull requests from GitHub.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/github/icon.png", "tags" : [ "git", diff --git a/config/store/infinilabs/connector/gitlab/plugin.json b/config/store/infinilabs/connector/gitlab/plugin.json index afda9010..5a2a0df0 100644 --- a/config/store/infinilabs/connector/gitlab/plugin.json +++ b/config/store/infinilabs/connector/gitlab/plugin.json @@ -39,7 +39,7 @@ "name" : "GitLab Connector", "description" : "Fetch repositories, issues, and merge requests from GitLub.", "category" : "website", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/gitlab/icon.png", "tags" : [ "git", diff --git a/config/store/infinilabs/connector/google_drive/plugin.json b/config/store/infinilabs/connector/google_drive/plugin.json index e9055763..f4254205 100644 --- a/config/store/infinilabs/connector/google_drive/plugin.json +++ b/config/store/infinilabs/connector/google_drive/plugin.json @@ -37,7 +37,7 @@ "name" : "Google Drive Connector", "description" : "Fetch the files metadata from Google Drive.", "category" : "cloud_storage", - "path_hierarchy":true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/google_drive/icon.png", "tags" : [ "google", diff --git a/config/store/infinilabs/connector/lark/plugin.json b/config/store/infinilabs/connector/lark/plugin.json index 871e4163..e22f1c0a 100644 --- a/config/store/infinilabs/connector/lark/plugin.json +++ b/config/store/infinilabs/connector/lark/plugin.json @@ -61,7 +61,7 @@ "token_url": "https://open.larksuite.com/open-apis/authen/v2/oauth/token" }, "builtin": true, - "path_hierarchy": true, + "path_hierarchy":false, "oauth_connect_implemented": true, "processor": { "enabled": true, diff --git a/config/store/infinilabs/connector/local_fs/plugin.json b/config/store/infinilabs/connector/local_fs/plugin.json index 7d3755c3..a13a7560 100644 --- a/config/store/infinilabs/connector/local_fs/plugin.json +++ b/config/store/infinilabs/connector/local_fs/plugin.json @@ -37,7 +37,7 @@ "name" : "Local Filesystem Connector", "description" : "Scan and fetch metadata from local files.", "category" : "local_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/local_fs/icon.png", "tags" : [ "storage", diff --git a/config/store/infinilabs/connector/network_drive/plugin.json b/config/store/infinilabs/connector/network_drive/plugin.json index 4a40fa39..2cd32001 100644 --- a/config/store/infinilabs/connector/network_drive/plugin.json +++ b/config/store/infinilabs/connector/network_drive/plugin.json @@ -38,7 +38,7 @@ "name" : "Network Drive Connector", "description" : "Scan and extract metadata from network shared files.", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/network_drive/icon.png", "tags" : [ "filesystem", diff --git a/config/store/infinilabs/connector/s3/plugin.json b/config/store/infinilabs/connector/s3/plugin.json index a416b911..64940188 100644 --- a/config/store/infinilabs/connector/s3/plugin.json +++ b/config/store/infinilabs/connector/s3/plugin.json @@ -37,7 +37,7 @@ "name" : "S3 Storage Connector", "description" : "Fetch S3 Storage objects metadata.", "category" : "cloud_storage", - "path_hierarchy": true, + "path_hierarchy":false, "icon" : "/assets/icons/connector/s3/icon.png", "tags" : [ "s3", diff --git a/config/widget/fullscreen/wrapper.js b/config/widget/fullscreen/wrapper.js index cd4ce2d2..93ee4e9c 100644 --- a/config/widget/fullscreen/wrapper.js +++ b/config/widget/fullscreen/wrapper.js @@ -33,7 +33,6 @@ export async function fullscreen(options) { container: wrapper, id: "$[[ID]]", server: "$[[ENDPOINT]]", - token: "$[[TOKEN]]", linkHref }; diff --git a/config/widget/searchbox/wrapper.js b/config/widget/searchbox/wrapper.js index f5ea85c7..c8b7c411 100644 --- a/config/widget/searchbox/wrapper.js +++ b/config/widget/searchbox/wrapper.js @@ -34,7 +34,6 @@ export async function searchbox(options) { container: wrapper, id: "$[[ID]]", server: "$[[ENDPOINT]]", - token: "$[[TOKEN]]", linkHref }; diff --git a/core/assistant.go b/core/assistant.go new file mode 100644 index 00000000..1cee995e --- /dev/null +++ b/core/assistant.go @@ -0,0 +1,141 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type Assistant struct { + CombinedFullText + Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` + Description string `json:"description" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` + Icon string `json:"icon" elastic_mapping:"icon:{enabled:false}"` + Type string `json:"type" elastic_mapping:"type:{type:keyword}"` // assistant type, default value: "simple", possible values: "simple", "deep_think", "external_workflow" + Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword}"` + Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` + Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` // Assistant-specific configuration settings with type + AnsweringModel ModelConfig `json:"answering_model" elastic_mapping:"answering_model:{type:object,enabled:false}"` + Datasource DatasourceConfig `json:"datasource" elastic_mapping:"datasource:{type:object,enabled:false}"` + ToolsConfig ToolsConfig `json:"tools,omitempty" elastic_mapping:"tools:{type:object,enabled:false}"` + MCPConfig MCPConfig `json:"mcp_servers,omitempty" elastic_mapping:"mcp_servers:{type:object,enabled:false}"` + UploadConfig UploadConfig `json:"upload,omitempty" elastic_mapping:"upload:{type:object,enabled:false}"` + Keepalive string `json:"keepalive" elastic_mapping:"keepalive:{type:keyword}"` + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + ChatSettings ChatSettings `json:"chat_settings" elastic_mapping:"chat_settings:{type:object,enabled:false}"` + Builtin bool `json:"builtin" elastic_mapping:"builtin:{type:keyword}"` // Whether the model provider is builtin + RolePrompt string `json:"role_prompt" elastic_mapping:"role_prompt:{enabled:false}"` // Role prompt for the assistant + + DeepThinkConfig *DeepThinkConfig `json:"-"` +} + +type DeepThinkConfig struct { + IntentAnalysisModel ModelConfig `json:"intent_analysis_model"` + PickingDocModel ModelConfig `json:"picking_doc_model"` + + PickDatasource bool `json:"pick_datasource"` + PickTools bool `json:"pick_tools"` + ToolsPromisedResultSize int `json:"tools_promised_result_size"` + + Visible bool `json:"visible"` // Whether the deep think mode is visible to the user +} + +type WorkflowConfig struct { +} + +type UploadConfig struct { + Enabled bool `json:"enabled"` + AllowedFileExtensions []string `json:"allowed_file_extensions"` + MaxFileSizeInBytes int `json:"max_file_size_in_bytes"` + MaxFileCount int `json:"max_file_count"` +} + +type DatasourceConfig struct { + Enabled bool `json:"enabled"` + + IDs []string `json:"ids,omitempty"` + parsedIDs []string `json:"-"` + + Visible bool `json:"visible"` // Whether the deep datasource is visible to the user + Filter interface{} `json:"filter,omitempty"` // Filter for the datasource + EnabledByDefault bool `json:"enabled_by_default"` // Whether the datasource is enabled by default +} + +type MCPConfig struct { + Enabled bool `json:"enabled"` + + IDs []string `json:"ids,omitempty"` + parsedIDs []string `json:"-"` + + Visible bool `json:"visible"` // Whether the deep datasource is visible to the user + Model *ModelConfig `json:"model"` //if not specified, use the answering model + MaxIterations int `json:"max_iterations"` + EnabledByDefault bool `json:"enabled_by_default"` // Whether the MCP server is enabled by default +} + +type ToolsConfig struct { + Enabled bool `json:"enabled"` + BuiltinTools BuiltinToolsConfig `json:"builtin,omitempty" elastic_mapping:"builtin:{enabled:false}"` +} +type BuiltinToolsConfig struct { + Calculator bool `json:"calculator"` + Wikipedia bool `json:"wikipedia"` + Duckduckgo bool `json:"duckduckgo"` + Scraper bool `json:"scraper"` +} + +type ModelConfig struct { + ProviderID string `json:"provider_id,omitempty"` + Name string `json:"name"` + Settings ModelSettings `json:"settings"` + PromptConfig *PromptConfig `json:"prompt,omitempty"` +} + +type PromptConfig struct { + PromptTemplate string `json:"template"` + InputVars []string `json:"input_vars"` +} + +type ModelSettings struct { + Reasoning bool `json:"reasoning"` + Temperature float64 `json:"temperature"` + TopP float64 `json:"top_p"` + PresencePenalty float64 `json:"presence_penalty"` + FrequencyPenalty float64 `json:"frequency_penalty"` + MaxTokens int `json:"max_tokens"` + MaxLength int `json:"max_length"` +} + +type ChatSettings struct { + GreetingMessage string `json:"greeting_message"` + Suggested struct { + Enabled bool `json:"enabled"` + Questions []string `json:"questions"` + } `json:"suggested"` + InputPreprocessTemplate string `json:"input_preprocess_tpl"` + PlaceHolder string `json:"placeholder"` + HistoryMessage struct { + Number int `json:"number"` + CompressionThreshold int `json:"compression_threshold"` + Summary bool `json:"summary"` + } `json:"history_message"` +} + +func (cfg *DatasourceConfig) SetIDs(ids []string) { + cfg.parsedIDs = ids +} + +func (cfg *DatasourceConfig) GetIDs() []string { + if cfg.parsedIDs != nil { + return cfg.parsedIDs + } + return cfg.IDs +} + +func (cfg *MCPConfig) SetIDs(ids []string) { + cfg.parsedIDs = ids +} +func (cfg *MCPConfig) GetIDs() []string { + if cfg.parsedIDs != nil { + return cfg.parsedIDs + } + return cfg.IDs +} diff --git a/modules/common/attachment.go b/core/attachment.go similarity index 98% rename from modules/common/attachment.go rename to core/attachment.go index c8023a22..25a68266 100644 --- a/modules/common/attachment.go +++ b/core/attachment.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import "infini.sh/framework/core/orm" diff --git a/core/chat_settings.go b/core/chat_settings.go new file mode 100644 index 00000000..c8a1bb86 --- /dev/null +++ b/core/chat_settings.go @@ -0,0 +1,15 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type ChatStartPageConfig struct { + Enabled bool `json:"enabled"` + Logo struct { + Light string `json:"light"` + Dark string `json:"dark"` + } `json:"logo"` + Introduction string `json:"introduction"` + DisplayAssistants []string `json:"display_assistants"` +} diff --git a/core/config.go b/core/config.go deleted file mode 100644 index 1afba5a3..00000000 --- a/core/config.go +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package core - -import "infini.sh/framework/core/param" - -var DefaultSettingBucketKey = "default_setting_bucket" -var DefaultUserProfileKey = "default_user_profile" //TODO to be removed -var UserProfileKey = "user_profile" -var DefaultUserPasswordKey = "default_user_password" -var DefaultServerConfigKey = "default_server_config" -var DefaultAppSettingsKey = "default_app_settings" -var DefaultSearchSettingsKey = "default_search_settings" - -var DefaultUserLogin = "coco-default-user" - -var WidgetRole = "widget" - -var FeatureByPassCORSCheck = "feature_bypass_cors_check" - -var PipelineContextConnector param.ParaKey = "__connector" -var PipelineContextDatasource param.ParaKey = "__datasource" -var PipelineContextDocuments param.ParaKey = "messages" diff --git a/modules/common/connector.go b/core/connector.go similarity index 99% rename from modules/common/connector.go rename to core/connector.go index dd175041..41bd657e 100644 --- a/modules/common/connector.go +++ b/core/connector.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core // registered connectors type Connector struct { diff --git a/core/const.go b/core/const.go new file mode 100644 index 00000000..64f98aa4 --- /dev/null +++ b/core/const.go @@ -0,0 +1,38 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +import "infini.sh/framework/core/param" + +var DefaultSettingBucketKey = "default_setting_bucket" + +// var DefaultUserProfileKey = "default_user_profile" //TODO to be removed +var UserProfileBucketKey = "user_profile" +var DefaultUserPasswordKey = "default_user_password" +var DefaultServerConfigKey = "default_server_config" +var DefaultAppSettingsKey = "default_app_settings" +var DefaultSearchSettingsKey = "default_search_settings" + +const ProviderIntegration = "INTEGRATION" + +var WidgetRole = "widget" + +var PipelineContextConnector param.ParaKey = "__connector" +var PipelineContextDatasource param.ParaKey = "__datasource" +var PipelineContextDocuments param.ParaKey = "messages" + +// re-export +const FeatureMaskSensitiveField = "feature_sensitive_fields" +const FeatureRemoveSensitiveField = "feature_sensitive_fields_remove_sensitive_field" +const SensitiveFields = "feature_sensitive_fields_extra_keys" + +const FeatureCORS = "feature_cors" +const FeatureNotAllowCredentials = "feature_not_allow_credentials" +const FeatureByPassCORSCheck = "feature_bypass_cors_check" + +const FeatureFingerprintThrottle = "fingerprint_throttle" + +const DefaultSimpleAuthBackend = "default_simple_auth_backend" +const DefaultSimpleAuthUserLogin = "coco-default-user" diff --git a/core/datasource.go b/core/datasource.go new file mode 100644 index 00000000..f11a7d0b --- /dev/null +++ b/core/datasource.go @@ -0,0 +1,53 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +import "infini.sh/framework/core/pipeline" + +type DataSource struct { + CombinedFullText + + Type string `json:"type,omitempty" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // Type of the datasource, eg: connector + Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Display name of this datasource + Description string `json:"description,omitempty" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` + Icon string `json:"icon,omitempty" elastic_mapping:"icon:{enabled:false}"` // Display name of this datasource + + Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword}"` + Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` + + Connector ConnectorConfig `json:"connector,omitempty" elastic_mapping:"connector:{type:object}"` // Connector configuration + + // Whether synchronization is allowed + SyncConfig SyncConfig `json:"sync" elastic_mapping:"sync:{type:object}"` + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + + // Enrichment pipeline + EnrichmentPipeline *pipeline.PipelineConfigV2 `json:"enrichment_pipeline" elastic_mapping:"enrichment_pipeline:{type:object}"` //if the pipeline is enabled, pass each batch messages to this pipeline for enrichment + + WebhookConfig WebhookConfig `json:"webhook,omitempty" elastic_mapping:"webhook:{type:object}"` + + //OAuthConfig OAuthConfig `json:"oauth_config,omitempty" elastic_mapping:"oauth_config:{type:object}"` +} + +type WebhookConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` +} + +type OAuthConfig struct { + Enabled bool `json:"enabled,omitempty" elastic_mapping:"enabled:{type:keyword}"` + Expired bool `json:"expired" elastic_mapping:"expired:{type:object}"` +} + +type SyncConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + Strategy string `json:"strategy" elastic_mapping:"strategy:{type:keyword}"` + Interval string `json:"interval" elastic_mapping:"interval:{type:keyword}"` + PageSize int `json:"page_size" config:"page_size"` +} + +type ConnectorConfig struct { + ConnectorID string `json:"id,omitempty" elastic_mapping:"id:{type:keyword}"` // Connector ID for the datasource + Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` // Configs for this Connector, also pass to connector's processor +} diff --git a/modules/common/document.go b/core/document.go similarity index 99% rename from modules/common/document.go rename to core/document.go index d4d761b9..cc3ece64 100644 --- a/modules/common/document.go +++ b/core/document.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import ( "strings" diff --git a/modules/common/fulltext.go b/core/fulltext.go similarity index 98% rename from modules/common/fulltext.go rename to core/fulltext.go index 2af9a98e..8c5c0c83 100644 --- a/modules/common/fulltext.go +++ b/core/fulltext.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import "infini.sh/framework/core/orm" diff --git a/core/integration.go b/core/integration.go new file mode 100644 index 00000000..ad048d46 --- /dev/null +++ b/core/integration.go @@ -0,0 +1,61 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type Integration struct { + CombinedFullText + + Type string `json:"type,omitempty" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // Type of the Integeration, eg: embedded, floating + Options interface{} `json:"options,omitempty" elastic_mapping:"options:{type:object,enabled:false}"` // Type specific options + Hotkey string `json:"hotkey,omitempty" elastic_mapping:"hotkey:{type:keyword}"` // Hotkey for the integration + Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Display name of this embedding + + EnabledModule ModuleConfig `json:"enabled_module,omitempty" elastic_mapping:"enabled_module:{type:object}"` // Enabled module configuration + AccessControl AccessControlConfig `json:"access_control,omitempty" elastic_mapping:"access_control:{type:object}"` // Access control configuration + Appearance AppearanceConfig `json:"appearance,omitempty" elastic_mapping:"appearance:{type:object}"` // Appearance configuration + Cors CorsConfig `json:"cors,omitempty" elastic_mapping:"cors:{type:object}"` // CORS configuration + Guest GuestAccessConfig `json:"guest,omitempty" elastic_mapping:"guest:{type:object}"` // Guest configuration + //Token string `json:"token,omitempty" elastic_mapping:"token:{type:keyword}"` // Token for authentication + Description string `json:"description,omitempty" elastic_mapping:"description:{type:keyword,copy_to:combined_fulltext}"` // Description of the embedding + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether the embedding is enabled +} + +type GuestAccessConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + RunAs string `json:"run_as,omitempty" elastic_mapping:"run_as:{type:keyword}"` +} + +type CorsConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether CORS is enabled + AllowedOrigins []string `json:"allowed_origins,omitempty" elastic_mapping:"allowed_origins:{type:keyword}"` // Allowed origins +} + +type AppearanceConfig struct { + Theme string `json:"theme,omitempty" elastic_mapping:"theme:{type:keyword}"` // Theme of the embedding + Language string `json:"language,omitempty" elastic_mapping:"language:{type:keyword}"` // Language of the embedding +} +type AccessControlConfig struct { + Authentication bool `json:"authentication" elastic_mapping:"authentication:{type:keyword}"` // Whether authentication is required + ChatHistory bool `json:"chat_history" elastic_mapping:"chat_history:{type:keyword}"` // Whether chat history is enabled +} + +type ModuleConfig struct { + Search SearchModuleConfig `json:"search,omitempty" elastic_mapping:"search:{type:object}"` // Search configuration + AIChat AIChatModuleConfig `json:"ai_chat,omitempty" elastic_mapping:"ai_chat:{type:object}"` // AI Chat configuration + Features []string `json:"features,omitempty" elastic_mapping:"features:{type:keyword}"` // Features enabled +} + +type SearchModuleConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + Datasource []string `json:"datasource,omitempty" elastic_mapping:"datasource:{type:keyword}"` // Datasource ID + Placeholder string `json:"placeholder,omitempty" elastic_mapping:"placeholder:{type:keyword}"` // Placeholder text for search input +} + +type AIChatModuleConfig struct { + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` + Placeholder string `json:"placeholder,omitempty" elastic_mapping:"placeholder:{type:keyword}"` // Placeholder text for search input + Assistants []string `json:"assistants,omitempty" elastic_mapping:"assistants:{type:keyword}"` // Assistant ID + StartPageSettings ChatStartPageConfig `json:"start_page_config,omitempty" elastic_mapping:"start_page_config:{type:object, enabled:false}"` // Start page settings +} diff --git a/core/llm_provider.go b/core/llm_provider.go new file mode 100644 index 00000000..a655f9a9 --- /dev/null +++ b/core/llm_provider.go @@ -0,0 +1,20 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type ModelProvider struct { + CombinedFullText + + Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Name of the model provider + APIKey string `json:"api_key" elastic_mapping:"api_key:{type:keyword}"` // API key of the model provider + APIType string `json:"api_type" elastic_mapping:"api_type:{type:keyword}"` // API type of the model provider, possible values: openai,gemini, anthropic + Icon string `json:"icon" elastic_mapping:"icon:{enabled:false}"` // Icon of the model provider + Models []ModelConfig `json:"models" elastic_mapping:"models:{type:object,enabled:false}"` // Models provided by the model provider + BaseURL string `json:"base_url" elastic_mapping:"base_url:{enabled:false}"` // Base URL of the model provider + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether the model provider is enabled + Builtin bool `json:"builtin" elastic_mapping:"builtin:{type:keyword}"` // Whether the model provider is builtin + Description string `json:"description" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` // Description of the model provider + Website string `json:"website" elastic_mapping:"website:{type:keyword}"` // Website of the model provider +} diff --git a/core/mcp_server.go b/core/mcp_server.go new file mode 100644 index 00000000..1506f167 --- /dev/null +++ b/core/mcp_server.go @@ -0,0 +1,33 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type MCPServer struct { + CombinedFullText + Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` + Description string `json:"description,omitempty" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` + Icon string `json:"icon,omitempty" elastic_mapping:"icon:{enabled:false}"` // Display name of this datasource + Type string `json:"type" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // possible values: "sse", "stdio", "streamable_http" + Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword,copy_to:combined_fulltext}"` + Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` + + Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` + Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:boolean}"` // Whether the connector is enabled or not +} + +type SSEConfig struct { + URL string `json:"url" elastic_mapping:"url:{type:keyword}"` +} + +// StdioConfig is a struct for the standard input/output configuration +type StdioConfig struct { + Command string `json:"command"` // command to run, possible values: npx, uvx + Args []string `json:"args,omitempty"` // arguments to pass to the command + Env map[string]string `json:"env,omitempty"` // environment variables +} + +type StreamableHttpConfig struct { + URL string `json:"url" elastic_mapping:"url:{type:keyword}"` +} diff --git a/modules/common/message.go b/core/message.go similarity index 99% rename from modules/common/message.go rename to core/message.go index b912ead2..0f1b5baa 100644 --- a/modules/common/message.go +++ b/core/message.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import ( "infini.sh/framework/core/orm" diff --git a/modules/common/message_sender.go b/core/message_sender.go similarity index 82% rename from modules/common/message_sender.go rename to core/message_sender.go index 53feaa58..d229a5e5 100644 --- a/modules/common/message_sender.go +++ b/core/message_sender.go @@ -1,4 +1,4 @@ -package common +package core type MessageSender interface { SendMessage(msg *MessageChunk) error diff --git a/modules/common/message_type.go b/core/message_type.go similarity index 94% rename from modules/common/message_type.go rename to core/message_type.go index a35d4950..b2434eca 100644 --- a/modules/common/message_type.go +++ b/core/message_type.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core const MessageTypeUser string = "user" const MessageTypeAssistant string = "assistant" diff --git a/core/recommend.go b/core/recommend.go new file mode 100644 index 00000000..a159a33e --- /dev/null +++ b/core/recommend.go @@ -0,0 +1,34 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +// RecommendRequest represents the input for the recommend API +type RecommendRequest struct { + UserID string `json:"user_id"` // ID of the user making the recommendation request + RecentInteractions []string `json:"recent_interactions,omitempty"` // Optional, list of recent user interactions (e.g., clicks, views) + Context string `json:"context,omitempty"` // Optional, current context of the user (e.g., active category, search context) + Filters []string `json:"filters,omitempty"` // Optional, filters applied to recommendations (e.g., category, tags) + NumRecommendations int `json:"num_recommendations,omitempty"` // Optional, number of recommendations requested +} + +// RecommendEntityCard represents an individual recommendation returned by the API +type RecommendEntityCard struct { + Title string `json:"title"` // Title of the entity card + Description string `json:"description,omitempty"` // Optional, description of the entity + Score float64 `json:"score,omitempty"` // Optional, relevance score of the recommendation + Icon string `json:"icon,omitempty"` // Optional, icon for the entity card + Banner *Link `json:"banner,omitempty"` + URL string `json:"url"` // URL to the entity + Category string `json:"category,omitempty"` // Optional, category of the entity + Breadcrumbs []Link `json:"breadcrumbs,omitempty"` // Optional, breadcrumb navigation links + Context interface{} `json:"context,omitempty"` // Optional, additional context for the entity +} + +// RecommendResponse represents the response structure for the recommend API +type RecommendResponse struct { + UserID string `json:"user_id"` // ID of the user receiving recommendations + Recommendations []RecommendEntityCard `json:"recommendations"` // List of recommended entity cards + Total int `json:"total"` // Total number of recommendations +} diff --git a/core/search.go b/core/search.go new file mode 100644 index 00000000..d94ed524 --- /dev/null +++ b/core/search.go @@ -0,0 +1,76 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +// MatchQuery represents a match query in Elasticsearch +type MatchQuery struct { + Field string `json:"field"` + Query string `json:"query"` +} + +// TermQuery represents a term query in Elasticsearch +type TermQuery struct { + Field string `json:"field"` + Value string `json:"value"` +} + +type QueryStringQuery struct { + Field string `json:"field"` + Value string `json:"query"` +} + +// RangeQuery represents a range query in Elasticsearch +type RangeQuery struct { + Field string `json:"field"` + GTE *int `json:"gte,omitempty"` // Greater than or equal + LTE *int `json:"lte,omitempty"` // Less than or equal +} + +// BoolQuery supports combining multiple queries +type BoolQuery struct { + Must []interface{} `json:"must,omitempty"` + Should []interface{} `json:"should,omitempty"` + MustNot []interface{} `json:"must_not,omitempty"` + Filter []interface{} `json:"filter,omitempty"` +} + +// Aggregation represents a basic metric aggregation +type Aggregation struct { + Field string `json:"field"` +} + +// SortOption defines sorting for search results +type SortOption struct { + Field string `json:"field"` + Order string `json:"order"` // "asc" or "desc" +} + +// TotalHits represents the total number of hits in the search response +type TotalHits struct { + Value int `json:"value"` + Relation string `json:"relation"` // "eq" (exact) or "gte" (greater than or equal) +} + +// IndexDocument used to construct indexing document +type IndexDocument struct { + Index string `json:"_index,omitempty"` + Type string `json:"_type,omitempty"` + ID string `json:"_id,omitempty"` + Routing string `json:"_routing,omitempty"` + Score float32 `json:"_score,omitempty"` + Source Document `json:"_source,omitempty"` + Highlight map[string][]interface{} `json:"highlight,omitempty"` +} + +type SearchResponse struct { + Took int `json:"took"` + TimedOut bool `json:"timed_out"` + Hits struct { + Total interface{} `json:"total"` + MaxScore float32 `json:"max_score"` + Hits []IndexDocument `json:"hits,omitempty"` + } `json:"hits"` + //Aggregations map[string]AggregationResponse `json:"aggregations,omitempty"` +} diff --git a/modules/common/server_config.go b/core/server_config.go similarity index 99% rename from modules/common/server_config.go rename to core/server_config.go index 3277db2b..d93837d3 100644 --- a/modules/common/server_config.go +++ b/core/server_config.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import "time" diff --git a/modules/common/session.go b/core/session.go similarity index 98% rename from modules/common/session.go rename to core/session.go index cccfb024..20f22c8c 100644 --- a/modules/common/session.go +++ b/core/session.go @@ -2,7 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package common +package core import "infini.sh/framework/core/orm" diff --git a/core/settings.go b/core/settings.go new file mode 100644 index 00000000..a2fe811e --- /dev/null +++ b/core/settings.go @@ -0,0 +1,24 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type Config struct { + ServerInfo *ServerInfo `config:"server" json:"server,omitempty"` + AppSettings *AppSettings `config:"app_settings" json:"app_settings,omitempty"` + SearchSettings *SearchSettings `config:"search_settings" json:"search_settings,omitempty"` +} + +type AppSettings struct { + Chat *ChatConfig `json:"chat,omitempty" config:"chat" ` +} + +type ChatConfig struct { + ChatStartPageConfig *ChatStartPageConfig `config:"start_page" json:"start_page,omitempty"` +} + +type SearchSettings struct { + Enabled bool `json:"enabled"` + Integration string `json:"integration"` +} diff --git a/modules/search/suggest.go b/core/suggest.go similarity index 53% rename from modules/search/suggest.go rename to core/suggest.go index fafecbb9..366d08fa 100644 --- a/modules/search/suggest.go +++ b/core/suggest.go @@ -2,16 +2,7 @@ * Web: https://infinilabs.com * Email: hello#infini.ltd */ -package search - -import ( - "infini.sh/coco/modules/common" - httprouter "infini.sh/framework/core/api/router" - "infini.sh/framework/core/orm" - "infini.sh/framework/core/util" - "net/http" - "strings" -) +package core // Suggestion represents an individual suggestion returned by the API type Suggestion struct { @@ -43,63 +34,3 @@ type Link struct { Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` } - -func (h APIHandler) suggest(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - - var ( - //context = h.GetParameterOrDefault(req, "context", "") - query = h.GetParameterOrDefault(req, "query", "") - from = h.GetIntOrDefault(req, "from", 0) - size = h.GetIntOrDefault(req, "size", 10) - field = h.GetParameterOrDefault(req, "search_field", "title") - source = h.GetParameterOrDefault(req, "source_fields", "title,source,url") - ) - - q := orm.Query{} - if query != "" { - templatedQuery := orm.TemplatedQuery{} - templatedQuery.TemplateID = "coco-query-string" - templatedQuery.Parameters = util.MapStr{ - "from": from, - "size": size, - "field": field, - "query": query, - "source": strings.Split(source, ","), - } - q.TemplatedQuery = &templatedQuery - } else { - body, err := h.GetRawBody(req) - if err != nil { - http.Error(w, "query must be provided", http.StatusBadRequest) - return - } - q.RawQuery = body - } - - docs := []common.Document{} - err, _ := orm.SearchWithJSONMapper(&docs, &q) - - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - suggestions := []Suggestion{} - for _, item := range docs { - suggestions = append(suggestions, Suggestion{Suggestion: item.Title, Score: 0.99, Source: item.Source.Name}) - } - - // Limit the number of suggestions based on the size parameter - if len(suggestions) > size { - suggestions = suggestions[:size] - } - - // Create the response - response := SuggestResponse{ - Query: query, - Suggestions: suggestions, - } - - h.WriteJSON(w, response, 200) - -} diff --git a/core/validate.go b/core/validate.go index fa869cf8..04ddd767 100644 --- a/core/validate.go +++ b/core/validate.go @@ -11,6 +11,7 @@ import ( "infini.sh/framework/core/errors" "infini.sh/framework/core/global" "infini.sh/framework/core/kv" + "infini.sh/framework/core/orm" "infini.sh/framework/core/security" "infini.sh/framework/core/util" "net/http" @@ -25,7 +26,7 @@ const ( HeaderIntegrationID = "APP-INTEGRATION-ID" ) -func ValidateLoginByAPITokenHeader(r *http.Request) (claims *security.UserClaims, err error) { +func ValidateLoginByAPITokenHeader(w http.ResponseWriter, r *http.Request) (claims *security.UserClaims, err error) { apiToken := r.Header.Get(HeaderAPIToken) if apiToken == "" { @@ -55,19 +56,69 @@ func ValidateLoginByAPITokenHeader(r *http.Request) (claims *security.UserClaims // Safely extract fields with type assertions claims = security.NewUserClaims() - claims.System = accessToken.System - claims.Provider = accessToken.Provider - claims.Login = accessToken.Login - claims.Roles = accessToken.Roles + claims.SetGetUserID(accessToken.GetOwnerID()) - //claims. // - //permissions + //claims.System = accessToken.System + claims.Provider = "access_token" + claims.Login = apiToken - claims.Source = "token" + apiTokenLevelPermission := security.ConvertPermissionKeysToHashSet(accessToken.Permissions) + userLevelTokenLevelPermission := security.ConvertPermissionKeysToHashSet(security.MustGetPermissionKeysByUserID(accessToken.GetOwnerID())) + + //log.Error(apiTokenLevelPermission.Values()) + //log.Error(userLevelTokenLevelPermission.Values()) + + intersectedPermission := security.IntersectSetsFast(apiTokenLevelPermission, userLevelTokenLevelPermission) + //log.Error(intersectedPermission.Values()) + + claims.Permissions = security.ConvertPermissionHashSetToKeys(intersectedPermission) + + //claims.Source = "token" return claims, nil } -func ValidateLoginByAuthorizationHeader(r *http.Request) (claims *security.UserClaims, err error) { +func InternalGetIntegration(id string) (*Integration, error) { + obj := Integration{} + obj.ID = id + ctx := orm.NewContext() + ctx.DirectReadAccess() + exists, err := orm.GetV2(ctx, &obj) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.New("integration not found") + } + return &obj, nil +} + +func ValidateLoginByIntegrationHeader(w http.ResponseWriter, r *http.Request) (claims *security.UserClaims, err error) { + integrationID := r.Header.Get(HeaderIntegrationID) + + if integrationID == "" { + return nil, errors.Error("api integration not found") + } + + if integrationID != "" { + cfg, _ := InternalGetIntegration(integrationID) + if cfg != nil { + if cfg.Guest.Enabled && cfg.Guest.RunAs != "" { + + claims = security.NewUserClaims() + claims.SetGetUserID(cfg.Guest.RunAs) + + claims.Provider = ProviderIntegration + claims.Login = cfg.Guest.RunAs + claims.Permissions = security.MustGetPermissionKeysByUserID(cfg.Guest.RunAs) + //log.Info("integration:", integrationID, ", run as:", cfg.Guest.RunAs, ",permissions:", claims.Permissions) + return claims, nil + } + } + } + return nil, errors.Error("invalid claims") +} + +func ValidateLoginByAuthorizationHeader(w http.ResponseWriter, r *http.Request) (claims *security.UserClaims, err error) { var ( authorization = r.Header.Get("Authorization") ok bool @@ -101,8 +152,8 @@ func ValidateLoginByAuthorizationHeader(r *http.Request) (claims *security.UserC claims, ok = token.Claims.(*security.UserClaims) if ok && token.Valid { - if claims.Login == "" { - err = errors.New("user id is empty") + if !claims.IsValid() { + err = errors.New("user info is not valid") return nil, err } if !claims.VerifyExpiresAt(time.Now(), true) { @@ -113,12 +164,12 @@ func ValidateLoginByAuthorizationHeader(r *http.Request) (claims *security.UserC if claims == nil { return nil, errors.Error("invalid claims") } - claims.Source = "bearer" + //claims.Source = "bearer" return claims, nil } -func ValidateLoginByAccessTokenSession(r *http.Request) (claims *security.UserClaims, err error) { - exists, sessToken := api.GetSession(r, UserAccessTokenSessionName) +func ValidateLoginByAccessTokenSession(w http.ResponseWriter, r *http.Request) (claims *security.UserClaims, err error) { + exists, sessToken := api.GetSession(w, r, UserAccessTokenSessionName) if !exists || sessToken == nil { return nil, errors.Error("invalid session") } @@ -146,78 +197,36 @@ func ValidateLoginByAccessTokenSession(r *http.Request) (claims *security.UserCl } if token.Valid { - if claims.Login == "" { - return nil, errors.New("user id is empty") + if !claims.IsValid() { + err = errors.New("user info is not valid") + return nil, err } if !claims.VerifyExpiresAt(time.Now(), true) { return nil, errors.New("token is expired") } } - claims.Source = "session" + //claims.Source = "session" return claims, nil } -func ValidateLoginByAccessTokenSession1(r *http.Request) (claims *security.UserClaims, err error) { - exists, sessToken := api.GetSession(r, UserAccessTokenSessionName) +func ValidateLogin(w http.ResponseWriter, r *http.Request) (session *security.UserSessionInfo, err error) { - if !exists || sessToken == nil { - return nil, errors.Error("invalid session") - } + claims, err := ValidateLoginByAccessTokenSession(w, r) - var ( - tokenStr string - ok bool - ) - if tokenStr, ok = sessToken.(string); !ok { - err = errors.New("authorization token is empty") - return + if claims == nil || !claims.UserSessionInfo.IsValid() { + claims, err = ValidateLoginByAuthorizationHeader(w, r) } - token, err1 := jwt.ParseWithClaims(tokenStr, security.NewUserClaims(), func(token *jwt.Token) (interface{}, error) { - if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { - return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"]) - } - secret, err := GetSecret() - if err != nil { - return nil, fmt.Errorf("failed to get secret key: %v", err) - } - return []byte(secret), nil - }) - if err1 != nil { - return - } - - //validate bind tenant - claims, ok = token.Claims.(*security.UserClaims) - - if ok && token.Valid { - if claims.Login == "" { - err = errors.New("user id is empty") - return - } - if !claims.VerifyExpiresAt(time.Now(), true) { - err = errors.New("token is expire in") - return - } - } - claims.Source = "session" - return claims, nil -} - -func ValidateLogin(r *http.Request) (session *security.UserSessionInfo, err error) { - - claims, err := ValidateLoginByAccessTokenSession(r) - - if claims == nil || !claims.UserSessionInfo.ValidInfo() { - claims, err = ValidateLoginByAuthorizationHeader(r) + if claims == nil || !claims.UserSessionInfo.IsValid() { + claims, err = ValidateLoginByAPITokenHeader(w, r) } - if claims == nil || !claims.UserSessionInfo.ValidInfo() { - claims, err = ValidateLoginByAPITokenHeader(r) + if claims == nil || !claims.UserSessionInfo.IsValid() { + claims, err = ValidateLoginByIntegrationHeader(w, r) } - if claims == nil || !claims.UserSessionInfo.ValidInfo() || err != nil { + if claims == nil || !claims.UserSessionInfo.IsValid() || err != nil { err = errors.Errorf("invalid user info: %v", err) return } diff --git a/docs/content.en/docs/references/connectors/feishu.md b/docs/content.en/docs/references/connectors/feishu.md index 962b0011..b8162650 100644 --- a/docs/content.en/docs/references/connectors/feishu.md +++ b/docs/content.en/docs/references/connectors/feishu.md @@ -241,7 +241,7 @@ curl -XPUT "http://localhost:9000/connector/feishu?replace=true" -d '{ "url": "http://coco.rs/connectors/feishu", "assets": {"icons": {"default": "/assets/connector/feishu/icon.png"}}, "oauth_connect_implemented": true, - "path_hierarchy": true, + "path_hierarchy":false, "processor": { "enabled": true, "name": "feishu" @@ -267,7 +267,7 @@ curl -XPUT "http://localhost:9000/connector/lark?replace=true" -d '{ "url": "http://coco.rs/connectors/lark", "assets": {"icons": {"default": "/assets/connector/lark/icon.png"}}, "oauth_connect_implemented": true, - "path_hierarchy": true, + "path_hierarchy":false, "processor": { "enabled": true, "name": "lark" diff --git a/docs/content.en/docs/references/connectors/google_drive.md b/docs/content.en/docs/references/connectors/google_drive.md index c790467b..0f65879e 100644 --- a/docs/content.en/docs/references/connectors/google_drive.md +++ b/docs/content.en/docs/references/connectors/google_drive.md @@ -11,7 +11,7 @@ curl -XPOST "http://localhost:9000/connector" -d '{ "name": "Google Drive Connector", "description": "Fetch the files metadata from Google Drive.", "icon": "/assets/connector/google_drive/icon.png", - "path_hierarchy":true, + "path_hierarchy":false, "category": "cloud_storage", "tags": [ "google", diff --git a/go.mod b/go.mod index 7c6a9484..da87b537 100644 --- a/go.mod +++ b/go.mod @@ -62,6 +62,7 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect github.com/RoaringBitmap/roaring v1.9.4 // indirect + github.com/WqyJh/go-openai-realtime v0.6.1 // indirect github.com/andybalholm/brotli v1.1.1 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect github.com/antchfx/htmlquery v1.3.0 // indirect @@ -76,6 +77,7 @@ require ( github.com/caddyserver/zerossl v0.1.3 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/coder/websocket v1.8.12 // indirect github.com/davidmz/go-pageant v1.0.2 // indirect github.com/dgraph-io/badger/v4 v4.7.0 // indirect github.com/dgraph-io/ristretto v0.2.0 // indirect @@ -92,16 +94,19 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-stack/stack v1.6.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/gocolly/colly v1.2.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/google/go-cmp v0.7.0 // indirect + github.com/google/go-github v17.0.0+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect @@ -122,6 +127,7 @@ require ( github.com/hashicorp/go-version v1.7.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80 // indirect github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -130,11 +136,14 @@ require ( github.com/kennygrant/sanitize v1.2.4 // indirect github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/larksuite/oapi-sdk-go/v3 v3.4.25 // indirect github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 // indirect github.com/libdns/libdns v1.0.0 // indirect github.com/libdns/tencentcloud v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.9.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mholt/acmez/v3 v3.1.2 // indirect github.com/microcosm-cc/bluemonday v1.0.26 // indirect diff --git a/go.sum b/go.sum index 07e85aa6..2f4926ed 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.16.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= @@ -50,6 +51,8 @@ github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAc github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/RoaringBitmap/roaring v1.9.4 h1:yhEIoH4YezLYT04s1nHehNO64EKFTop/wBhxv2QzDdQ= github.com/RoaringBitmap/roaring v1.9.4/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= +github.com/WqyJh/go-openai-realtime v0.6.1 h1:QhWRrbx9ZeixN/kVH/5VyEgjoMei7xisHqw7ybbef2E= +github.com/WqyJh/go-openai-realtime v0.6.1/go.mod h1:BCN7J7AUbfSFkLLVnhGWF2OkvoQ7GqTWrU/w+d+QwR4= github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= @@ -73,6 +76,7 @@ github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6 github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -87,6 +91,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= +github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -115,9 +121,11 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.3-0.20170329110642-4da3e2cfbabc/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/geoffgarside/ber v1.1.0 h1:qTmFG4jJbwiSzSXoNJeHcOprVzZ8Ulde2Rrrifu5U9w= github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= @@ -153,6 +161,8 @@ github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= +github.com/go-stack/stack v1.6.0 h1:MmJCxYVKTJ0SplGKqFVX3SBnmaUhODHZrrFF6jMbpZk= +github.com/go-stack/stack v1.6.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= @@ -168,6 +178,7 @@ github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI= github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= @@ -176,9 +187,12 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= +github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f h1:16RtHeWGkJMc80Etb8RPCcKevXGldr57+LOyZt8zOlg= +github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f/go.mod h1:ijRvpgDJDI262hYq/IQVYgf8hd8IHUs93Ol0kvMBAx4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/lint v0.0.0-20170918230701-e5d664eb928e/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -195,10 +209,12 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/generative-ai-go v0.15.1 h1:n8aQUpvhPOlGVuM2DRkJ2jvx04zpp42B778AROJa+pQ= github.com/google/generative-ai-go v0.15.1/go.mod h1:AAucpWZjXsDKhQYWvCYuP6d0yB1kX998pJlOW1rAesw= +github.com/google/go-cmp v0.1.1-0.20171103154506-982329095285/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -210,6 +226,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM= github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -224,6 +242,7 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.6 h1:GW/XbdyBFQ8Qe+YAmFU9uHLo7OnF5tL52HFAgMmyrf4= github.com/googleapis/enterprise-certificate-proxy v0.3.6/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/gookit/filter v1.2.3 h1:Zo7cBOtsVzAoa/jtf+Ury6zlsbJXqInFdUpbbnB2vMM= @@ -243,8 +262,10 @@ github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pw github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -253,6 +274,7 @@ github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVU github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hirochachacha/go-smb2 v1.1.0 h1:b6hs9qKIql9eVXAiN0M2wSFY5xnhbHAQoCwRKbaRTZI= github.com/hirochachacha/go-smb2 v1.1.0/go.mod h1:8F1A4d5EZzrGu5R7PU163UcMRDJQl4FtcxjBfsY8TZE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -261,6 +283,8 @@ github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80 h1:g/SJtZVYc1cxSB8lgrgqeOlIdi4MhqNNHYRAC8y+g4c= +github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e h1:ZZCvgaRDZg1gC9/1xrsgaJzQUCQgniKtw0xjWywWAOE= github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e/go.mod h1:+rHyWac2R9oAZwFe1wGY2HBzFJJy++RHBg1cU23NkD8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -274,6 +298,8 @@ github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= @@ -282,6 +308,7 @@ github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2 github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -290,6 +317,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/larksuite/oapi-sdk-go/v3 v3.4.25 h1:Hf4FBpTwYwjiAkdIaf2+TixQ7/iuQMnaw6/K0PxIhm0= +github.com/larksuite/oapi-sdk-go/v3 v3.4.25/go.mod h1:ZEplY+kwuIrj/nqw5uSCINNATcH3KdxSN7y+UxYY5fI= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= @@ -299,15 +328,19 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mark3labs/mcp-go v0.32.0 h1:fgwmbfL2gbd67obg57OfV2Dnrhs1HtSdlY/i5fn7MU8= github.com/mark3labs/mcp-go v0.32.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4= +github.com/mattn/go-colorable v0.0.10-0.20170816031813-ad5389df28cd/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.2/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= @@ -330,6 +363,7 @@ github.com/minio/minio-go/v7 v7.0.90 h1:TmSj1083wtAD0kEYTx7a5pFsv3iRYMsOJ6A4crjA github.com/minio/minio-go/v7 v7.0.90/go.mod h1:uvMUcGrpgeSAAI6+sD3818508nUyMULw94j2Nxku/Go= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= @@ -355,6 +389,7 @@ github.com/nsqio/nsq v1.3.0/go.mod h1:RxNr6UC0kSkNF44LnJrlN3U3CQnQGTXk+QKfSZLzqv github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= @@ -412,13 +447,18 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -465,6 +505,8 @@ github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5 github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= @@ -516,6 +558,7 @@ go.uber.org/zap/exp v0.3.0 h1:6JYzdifzYkGmTdRR59oYH+Ng7k49H9qVpWwNSsGJj3U= go.uber.org/zap/exp v0.3.0/go.mod h1:5I384qq7XGxYyByIhHm6jg5CHkGY0nsTfbDLgDDlgJQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= @@ -529,6 +572,8 @@ golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= @@ -541,6 +586,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -551,12 +598,16 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= @@ -568,6 +619,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -576,9 +628,11 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -605,6 +659,7 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= @@ -614,20 +669,26 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20170921000349-586095a6e407/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.229.0 h1:p98ymMtqeJ5i3lIBMj5MpR9kzIIgzpHHh8vQ+vgAzx8= google.golang.org/api v0.229.0/go.mod h1:wyDfmq5g1wYJWn29O22FDWN48P7Xcz0xz+LBpptYvB0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20170918111702-1e559d0a00ee/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= @@ -637,6 +698,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1: google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA= google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -657,6 +719,7 @@ google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXn gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= diff --git a/modules/assistant/assistant.go b/modules/assistant/assistant.go index 73e66948..029817c7 100644 --- a/modules/assistant/assistant.go +++ b/modules/assistant/assistant.go @@ -5,6 +5,7 @@ package assistant import ( + "infini.sh/coco/core" "infini.sh/framework/core/elastic" "net/http" "time" @@ -18,7 +19,7 @@ import ( func (h *APIHandler) createAssistant(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.Assistant{} + var obj = &core.Assistant{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -60,7 +61,7 @@ func (h *APIHandler) updateAssistant(w http.ResponseWriter, req *http.Request, p //clear cache common.GeneralObjectCache.Delete(common.AssistantCachePrimary, id) - obj := common.Assistant{} + obj := core.Assistant{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -71,7 +72,7 @@ func (h *APIHandler) updateAssistant(w http.ResponseWriter, req *http.Request, p return } - newObj := common.Assistant{} + newObj := core.Assistant{} err = h.DecodeJSON(req, &newObj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -87,6 +88,8 @@ func (h *APIHandler) updateAssistant(w http.ResponseWriter, req *http.Request, p newObj.Created = obj.Created ctx.Refresh = orm.WaitForRefresh + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "assistant") err = orm.Update(ctx, &newObj) if err != nil { @@ -104,7 +107,7 @@ func (h *APIHandler) deleteAssistant(w http.ResponseWriter, req *http.Request, p common.GeneralObjectCache.Delete(common.AssistantCachePrimary, id) common.ClearAssistantsCache() - obj := common.Assistant{} + obj := core.Assistant{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -141,11 +144,15 @@ func (h *APIHandler) searchAssistant(w http.ResponseWriter, req *http.Request, p return } builder.EnableBodyBytes() + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Assistant{}) - docs := []common.Assistant{} - + orm.WithModel(ctx, &core.Assistant{}) + docs := []core.Assistant{} + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "assistant") err, res := elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -162,9 +169,11 @@ func (h *APIHandler) searchAssistant(w http.ResponseWriter, req *http.Request, p func (h *APIHandler) cloneAssistant(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Assistant{} + obj := core.Assistant{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "assistant") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { diff --git a/modules/assistant/background_job.go b/modules/assistant/background_job.go index 1f2e6404..1fe01578 100644 --- a/modules/assistant/background_job.go +++ b/modules/assistant/background_job.go @@ -7,6 +7,8 @@ package assistant import ( "context" "fmt" + "infini.sh/coco/core" + "infini.sh/coco/modules/document" "net/http" "runtime" "strings" @@ -28,8 +30,6 @@ import ( "github.com/tmc/langchaingo/tools/wikipedia" "infini.sh/coco/modules/assistant/langchain" "infini.sh/coco/modules/common" - "infini.sh/coco/modules/search" - "infini.sh/framework/core/errors" "infini.sh/framework/core/global" "infini.sh/framework/core/orm" "infini.sh/framework/core/util" @@ -50,8 +50,8 @@ type RAGContext struct { tags string subcategory string richCategory string - field string - source string + //field string + source string SessionID string @@ -64,18 +64,53 @@ type RAGContext struct { QueryIntent *rag.QueryIntent pickedDocIDS []string - intentModel *common.ModelConfig - pickingDocModel *common.ModelConfig - answeringModel *common.ModelConfig - intentModelProvider *common.ModelProvider - pickingDocProvider *common.ModelProvider - answeringProvider *common.ModelProvider - AssistantCfg *common.Assistant + intentModel *core.ModelConfig + pickingDocModel *core.ModelConfig + //answeringModel *common.ModelConfig + intentModelProvider *core.ModelProvider + pickingDocProvider *core.ModelProvider + answeringProvider *core.ModelProvider + + AssistantCfg *core.Assistant + + //user input values + InputValues map[string]any +} + +func (r RAGContext) MustGetAnsweringModel() *core.ModelConfig { + if r.AssistantCfg == nil { + panic("invalid AssistantCfg") + } + return &r.AssistantCfg.AnsweringModel +} + +func (r RAGContext) GetAnsweringProvider() *core.ModelProvider { + + if r.answeringProvider != nil { + return r.answeringProvider + } + + if r.AssistantCfg == nil { + panic("invalid AssistantCfg") + } + + modelProvider, err := common.GetModelProvider(r.AssistantCfg.AnsweringModel.ProviderID) + if err != nil { + panic(fmt.Errorf("failed to get model provider: %w", err)) + } + + if modelProvider == nil { + panic("invalid modelProvider") + } + + r.answeringProvider = modelProvider + + return modelProvider } const DefaultAssistantID = "default" -func (h APIHandler) getRAGContext(req *http.Request, assistant *common.Assistant) (*RAGContext, error) { +func (h APIHandler) getRAGContext(req *http.Request, assistant *core.Assistant) (*RAGContext, error) { params := &RAGContext{ SearchDB: h.GetBoolOrDefault(req, "search", false), @@ -90,8 +125,8 @@ func (h APIHandler) getRAGContext(req *http.Request, assistant *common.Assistant tags: h.GetParameterOrDefault(req, "tags", ""), subcategory: h.GetParameterOrDefault(req, "subcategory", ""), richCategory: h.GetParameterOrDefault(req, "rich_category", ""), - field: h.GetParameterOrDefault(req, "search_field", "title"), - source: h.GetParameterOrDefault(req, "source_fields", "*"), + //field: h.GetParameterOrDefault(req, "search_field", "title"), + source: h.GetParameterOrDefault(req, "source_fields", "*"), } if v := h.GetParameterOrDefault(req, "mcp_servers", ""); v != "" { @@ -128,7 +163,7 @@ func (h APIHandler) getRAGContext(req *http.Request, assistant *common.Assistant if params.DeepThink { if assistant.Type == common.AssistantTypeDeepThink { - deepThinkCfg := common.DeepThinkConfig{} + deepThinkCfg := core.DeepThinkConfig{} buf := util.MustToJSONBytes(assistant.Config) util.MustFromJSONBytes(buf, &deepThinkCfg) @@ -159,16 +194,16 @@ func (h APIHandler) getRAGContext(req *http.Request, assistant *common.Assistant if err != nil { return params, fmt.Errorf("failed to get model provider: %w", err) } - params.answeringModel = &assistant.AnsweringModel + //params.answeringModel = &assistant.AnsweringModel params.answeringProvider = modelProvider return params, nil } -func (h APIHandler) createAssistantMessage(sessionID, assistantID, requestMessageID string) *common.ChatMessage { - msg := &common.ChatMessage{ +func createAssistantMessage(sessionID, assistantID, requestMessageID string) *core.ChatMessage { + msg := &core.ChatMessage{ SessionID: sessionID, - MessageType: common.MessageTypeAssistant, + MessageType: core.MessageTypeAssistant, ReplyMessageID: requestMessageID, AssistantID: assistantID, } @@ -179,22 +214,21 @@ func (h APIHandler) createAssistantMessage(sessionID, assistantID, requestMessag return msg } -func (h APIHandler) finalizeProcessing(ctx context.Context, sessionID string, msg *common.ChatMessage, sender common.MessageSender) { - ctx1 := orm.NewContextWithParent(ctx) - if err := orm.Save(ctx1, msg); err != nil { +func finalizeProcessing(ctx *orm.Context, sessionID string, msg *core.ChatMessage, sender core.MessageSender) { + if err := orm.Save(ctx, msg); err != nil { _ = log.Errorf("Failed to save assistant message: %v", err) } - _ = sender.SendMessage(common.NewMessageChunk( - sessionID, msg.ID, common.MessageTypeSystem, msg.ReplyMessageID, + _ = sender.SendMessage(core.NewMessageChunk( + sessionID, msg.ID, core.MessageTypeSystem, msg.ReplyMessageID, common.ReplyEnd, "Processing completed", 0, )) } -func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.ChatMessage, params *RAGContext, sender common.MessageSender) error { +func processMessageAsync(ctx *orm.Context, userID string, reqMsg *core.ChatMessage, params *RAGContext, sender core.MessageSender) error { log.Debugf("Starting async processing for session: %v", params.SessionID) - replyMsg := h.createAssistantMessage(params.SessionID, reqMsg.AssistantID, reqMsg.ID) + replyMsg := createAssistantMessage(params.SessionID, reqMsg.AssistantID, reqMsg.ID) defer func() { if !global.Env().IsDebug { @@ -211,34 +245,36 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat msg := fmt.Sprintf("⚠️ error in async processing message reply, %v", v) if replyMsg.Message == "" { replyMsg.Message = msg - _ = sender.SendMessage(common.NewMessageChunk( - params.SessionID, replyMsg.ID, common.MessageTypeSystem, reqMsg.ID, + _ = sender.SendMessage(core.NewMessageChunk( + params.SessionID, replyMsg.ID, core.MessageTypeSystem, reqMsg.ID, common.Response, msg, 0, )) } _ = log.Error(msg) } } - h.finalizeProcessing(ctx, params.SessionID, replyMsg, sender) + finalizeProcessing(ctx, params.SessionID, replyMsg, sender) // clear the inflight message task taskID := getReplyMessageTaskID(params.SessionID, reqMsg.ID) inflightMessages.Delete(taskID) }() - reqMsg.Details = make([]common.ProcessingDetails, 0) + reqMsg.Details = make([]core.ProcessingDetails, 0) // Prepare input values - inputValues := map[string]any{ - "query": reqMsg.Message, + if params.InputValues == nil { + params.InputValues = map[string]any{} } + params.InputValues["query"] = reqMsg.Message + // Processing pipeline //log.Error("num of history: ", params.AssistantCfg.ChatSettings.HistoryMessage.Number) if params.AssistantCfg.ChatSettings.HistoryMessage.Number > 0 { - history, _ := h.fetchSessionHistory(ctx, reqMsg, replyMsg, params, params.AssistantCfg.ChatSettings.HistoryMessage.Number, inputValues) - inputValues["history"] = history + history, _ := fetchSessionHistory(ctx, reqMsg, replyMsg, params, params.AssistantCfg.ChatSettings.HistoryMessage.Number, params.InputValues) + params.InputValues["history"] = history } else { - inputValues["history"] = "" + params.InputValues["history"] = "" } if params.DeepThink && params.intentModel != nil { @@ -260,7 +296,7 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat } } } - inputValues["network_sources"] = datasourceStr.String() + params.InputValues["network_sources"] = datasourceStr.String() } if params.AssistantCfg.DeepThinkConfig.PickTools { @@ -274,10 +310,10 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat } } - inputValues["tool_list"] = mcpServers.String() + params.InputValues["tool_list"] = mcpServers.String() } - queryIntent, err := rag.ProcessQueryIntent(ctx, params.SessionID, params.intentModelProvider, params.intentModel, reqMsg, replyMsg, params.AssistantCfg, inputValues, sender) + queryIntent, err := rag.ProcessQueryIntent(ctx, params.SessionID, params.intentModelProvider, params.intentModel, reqMsg, replyMsg, params.AssistantCfg, params.InputValues, sender) if err != nil { log.Error("error on processing query intent analysis: ", err) } @@ -288,7 +324,7 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat var toolsMayHavePromisedResult = false if params.MCP && ((params.AssistantCfg.MCPConfig.Enabled && len(params.mcpServers) > 0) || params.AssistantCfg.ToolsConfig.Enabled) { //process LLM tools / functions - answer, err := h.processLLMTools(ctx, reqMsg, replyMsg, params, inputValues, sender) + answer, err := processLLMTools(ctx, reqMsg, replyMsg, params, params.InputValues, sender) if err != nil { log.Error(answer, err) } @@ -297,7 +333,7 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat if params.AssistantCfg.DeepThinkConfig != nil && params.AssistantCfg.DeepThinkConfig.ToolsPromisedResultSize > 0 && len(answer) > params.AssistantCfg.DeepThinkConfig.ToolsPromisedResultSize { toolsMayHavePromisedResult = true } - inputValues["tools_output"] = answer + params.InputValues["tools_output"] = answer } } @@ -306,22 +342,22 @@ func (h APIHandler) processMessageAsync(ctx context.Context, reqMsg *common.Chat if params.DeepThink { fetchSize = 50 } - docs, _ := h.processInitialDocumentSearch(ctx, reqMsg, replyMsg, params, fetchSize, sender) - inputValues["references"] = docs + docs, _ := processInitialDocumentSearch(ctx, userID, reqMsg, replyMsg, params, fetchSize, sender) + params.InputValues["references"] = docs if params.DeepThink && len(docs) > 10 { //re-pick top docs - docs, _ = h.processPickDocuments(ctx, reqMsg, replyMsg, params, docs, sender) - _ = h.fetchDocumentInDepth(ctx, reqMsg, replyMsg, params, docs, inputValues, sender) + docs, _ = processPickDocuments(ctx, reqMsg, replyMsg, params, docs, sender) + _ = fetchDocumentInDepth(ctx, reqMsg, replyMsg, params, docs, params.InputValues, sender) } } - err := h.generateFinalResponse(ctx, reqMsg, replyMsg, params, inputValues, sender) + err := generateFinalResponse(ctx, reqMsg, replyMsg, params, params.InputValues, sender) log.Info("async reply task done for query:", reqMsg.Message) return err } -func (h APIHandler) fetchSessionHistory(ctx context.Context, reqMsg, replyMsg *common.ChatMessage, params *RAGContext, size int, inputValues map[string]any) (string, error) { +func fetchSessionHistory(ctx context.Context, reqMsg, replyMsg *core.ChatMessage, params *RAGContext, size int, inputValues map[string]any) (string, error) { var historyStr = strings.Builder{} chatHistory := memory.NewChatMessageHistory(memory.WithPreviousMessages([]llms.ChatMessage{})) @@ -342,15 +378,15 @@ func (h APIHandler) fetchSessionHistory(ctx context.Context, reqMsg, replyMsg *c v := history[i] msgText := util.SubStringWithSuffix(v.Message, 1000, "...") switch v.MessageType { - case common.MessageTypeSystem: + case core.MessageTypeSystem: msg := llms.SystemChatMessage{Content: msgText} _ = chatHistory.AddMessage(context.Background(), msg) break - case common.MessageTypeAssistant: + case core.MessageTypeAssistant: msg := llms.AIChatMessage{Content: msgText} _ = chatHistory.AddMessage(context.Background(), msg) break - case common.MessageTypeUser: + case core.MessageTypeUser: msg := llms.HumanChatMessage{Content: msgText} _ = chatHistory.AddMessage(context.Background(), msg) break @@ -372,7 +408,7 @@ func (h APIHandler) fetchSessionHistory(ctx context.Context, reqMsg, replyMsg *c return historyStr.String(), nil } -func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMessage, replyMsg *common.ChatMessage, params *RAGContext, inputValues map[string]any, sender common.MessageSender) (string, error) { +func processLLMTools(ctx context.Context, reqMsg *core.ChatMessage, replyMsg *core.ChatMessage, params *RAGContext, inputValues map[string]any, sender core.MessageSender) (string, error) { if params == nil || params.AssistantCfg == nil { //return nil panic("invalid assistant config, skip") @@ -386,8 +422,8 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes } //get llm for mcp, use answering model if not mcp specified model - providerID := params.answeringModel.ProviderID - modelName := params.answeringModel.Name + providerID := params.MustGetAnsweringModel().ProviderID + modelName := params.MustGetAnsweringModel().Name if params.AssistantCfg.MCPConfig.Enabled { if params.AssistantCfg.MCPConfig.Model != nil { if params.AssistantCfg.MCPConfig.Model.Name != "" { @@ -458,7 +494,7 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes switch v.Type { case common.StreamableHTTP: bytes := util.MustToJSONBytes(v.Config) - cfg := common.StreamableHttpConfig{} + cfg := core.StreamableHttpConfig{} err := util.FromJSONBytes(bytes, &cfg) if err != nil { if global.Env().IsDebug { @@ -484,7 +520,7 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes break case common.SSE: bytes := util.MustToJSONBytes(v.Config) - cfg := common.SSEConfig{} + cfg := core.SSEConfig{} err := util.FromJSONBytes(bytes, &cfg) if err != nil { if global.Env().IsDebug { @@ -511,7 +547,7 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes case common.Stdio: bytes := util.MustToJSONBytes(v.Config) - cfg := common.StdioConfig{} + cfg := core.StdioConfig{} err := util.FromJSONBytes(bytes, &cfg) if err != nil { if global.Env().IsDebug { @@ -588,7 +624,7 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes callback.CustomWriteFunc = func(chunk string) { if chunk != "" { answerBuffer.WriteString(chunk) - echoMsg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.Tools, chunk, toolsSeq) + echoMsg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.Tools, chunk, toolsSeq) _ = sender.SendMessage(echoMsg) } toolsSeq++ @@ -618,86 +654,94 @@ func (h *APIHandler) processLLMTools(ctx context.Context, reqMsg *common.ChatMes return answer, nil } -func (h APIHandler) processInitialDocumentSearch(ctx context.Context, reqMsg, replyMsg *common.ChatMessage, params *RAGContext, fechSize int, sender common.MessageSender) ([]common.Document, error) { +func processInitialDocumentSearch(ctx *orm.Context, userID string, reqMsg, replyMsg *core.ChatMessage, params *RAGContext, fechSize int, sender core.MessageSender) ([]core.Document, error) { if params.intentModel != nil && (params.AssistantCfg.DeepThinkConfig != nil && params.AssistantCfg.DeepThinkConfig.PickDatasource) && params.QueryIntent != nil { if !params.QueryIntent.NeedNetworkSearch { log.Info("intent analyzer decided to skip fetch datasource") - return []common.Document{}, nil + return []core.Document{}, nil } } - var query *orm.Query - mustClauses := search.BuildMustFilterClauses(params.category, params.subcategory, params.richCategory, params.username, params.userid) - datasourceClause := search.BuildDatasourceClause(params.datasource, true) + //var query *orm.Query + mustClauses := document.BuildMustFilterClauses(params.category, params.subcategory, params.richCategory, params.username, params.userid) + datasourceClause := document.BuildDatasourceClause(params.datasource, true) if datasourceClause != nil { mustClauses = append(mustClauses, datasourceClause) } + + //TODO if params.AssistantCfg.Datasource.Enabled && params.AssistantCfg.Datasource.Filter != nil { log.Debug(params.AssistantCfg.Datasource.Filter) mustClauses = append(mustClauses, params.AssistantCfg.Datasource.Filter) } - var shouldClauses interface{} + + builder := orm.NewQuery() + //var shouldClauses interface{} if params.QueryIntent != nil && len(params.QueryIntent.Query) > 0 { - shouldClauses = search.BuildShouldClauses(params.QueryIntent.Query, params.QueryIntent.Keyword) - } - from := 0 - query = search.BuildTemplatedQuery(from, fechSize, mustClauses, shouldClauses, params.field, reqMsg.Message, params.source, params.tags) + builder.Should(orm.TermsQuery("combined_fulltext", params.QueryIntent.Keyword)) - if query != nil { - docs, err := fetchDocuments(query) - if err != nil { - log.Error(err) - return nil, err - } + //shouldClauses = document.BuildShouldClauses(params.QueryIntent.Query, params.QueryIntent.Keyword) + } - { - simplifiedReferences := formatDocumentReferencesToDisplay(docs) - const chunkSize = 512 - totalLen := len(simplifiedReferences) + //from := 0 + //query = document.BuildTemplatedQuery(from, fechSize, mustClauses, shouldClauses, params.field, reqMsg.Message, params.source, params.tags) - for chunkSeq := 0; chunkSeq*chunkSize < totalLen; chunkSeq++ { - start := chunkSeq * chunkSize - end := start + chunkSize - if end > totalLen { - end = totalLen - } + //if query != nil { + docs, _, err := document.QueryDocuments(ctx.Context, userID, builder, reqMsg.Message, params.datasource, "", "", "", "") + //docs, err := fetchDocuments(query) + if err != nil { + log.Error(err) + return nil, err + } + + { + simplifiedReferences := formatDocumentReferencesToDisplay(docs) + const chunkSize = 512 + totalLen := len(simplifiedReferences) + + for chunkSeq := 0; chunkSeq*chunkSize < totalLen; chunkSeq++ { + start := chunkSeq * chunkSize + end := start + chunkSize + if end > totalLen { + end = totalLen + } - chunkData := simplifiedReferences[start:end] + chunkData := simplifiedReferences[start:end] - chunkMsg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, - common.FetchSource, string(chunkData), chunkSeq) + chunkMsg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, + common.FetchSource, string(chunkData), chunkSeq) - err = sender.SendMessage(chunkMsg) - if err != nil { - log.Error(err) - return nil, err - } + err = sender.SendMessage(chunkMsg) + if err != nil { + log.Error(err) + return nil, err } } + } - fetchedDocs := formatDocumentForPick(docs) - { - var sb strings.Builder - sb.WriteString(fmt.Sprintf("\n", len(docs))) - sb.WriteString(util.MustToJSON(fetchedDocs)) - sb.WriteString("") - params.sourceDocsSummaryBlock = sb.String() - } - replyMsg.Details = append(replyMsg.Details, common.ProcessingDetails{Order: 20, Type: common.FetchSource, Payload: fetchedDocs}) - return docs, err + fetchedDocs := formatDocumentForPick(docs) + { + var sb strings.Builder + sb.WriteString(fmt.Sprintf("\n", len(docs))) + sb.WriteString(util.MustToJSON(fetchedDocs)) + sb.WriteString("") + params.sourceDocsSummaryBlock = sb.String() } - return nil, errors.Error("nothing found") + replyMsg.Details = append(replyMsg.Details, core.ProcessingDetails{Order: 20, Type: common.FetchSource, Payload: fetchedDocs}) + return docs, err + //} + //return nil, errors.Error("nothing found") } -func (h APIHandler) processPickDocuments(ctx context.Context, reqMsg, replyMsg *common.ChatMessage, params *RAGContext, docs []common.Document, sender common.MessageSender) ([]common.Document, error) { +func processPickDocuments(ctx context.Context, reqMsg, replyMsg *core.ChatMessage, params *RAGContext, docs []core.Document, sender core.MessageSender) ([]core.Document, error) { if len(docs) == 0 { return nil, nil } - echoMsg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.PickSource, string(""), 0) + echoMsg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.PickSource, string(""), 0) _ = sender.SendMessage(echoMsg) promptTemplate := common.PickingDocPromptTemplate @@ -733,7 +777,7 @@ func (h APIHandler) processPickDocuments(ctx context.Context, reqMsg, replyMsg * if len(chunk) > 0 { chunkSeq++ pickedDocsBuffer.Write(chunk) - msg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.PickSource, string(chunk), chunkSeq) + msg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.PickSource, string(chunk), chunkSeq) err := sender.SendMessage(msg) if err != nil { return err @@ -753,13 +797,13 @@ func (h APIHandler) processPickDocuments(ctx context.Context, reqMsg, replyMsg * log.Debug("filter document results:", pickeDocs) - docsMap := map[string]common.Document{} + docsMap := map[string]core.Document{} for _, v := range docs { docsMap[v.ID] = v } var pickedDocIDS []string - var pickedFullDoc = []common.Document{} + var pickedFullDoc = []core.Document{} var validPickedDocs = []rag.PickedDocument{} for _, v := range pickeDocs { x, v1 := docsMap[v.ID] @@ -774,7 +818,7 @@ func (h APIHandler) processPickDocuments(ctx context.Context, reqMsg, replyMsg * } { - detail := common.ProcessingDetails{Order: 30, Type: common.PickSource, Payload: validPickedDocs} + detail := core.ProcessingDetails{Order: 30, Type: common.PickSource, Payload: validPickedDocs} replyMsg.Details = append(replyMsg.Details, detail) } @@ -787,7 +831,7 @@ func (h APIHandler) processPickDocuments(ctx context.Context, reqMsg, replyMsg * return docs, err } -func (h APIHandler) fetchDocumentInDepth(ctx context.Context, reqMsg, replyMsg *common.ChatMessage, params *RAGContext, docs []common.Document, inputValues map[string]any, sender common.MessageSender) error { +func fetchDocumentInDepth(ctx *orm.Context, reqMsg, replyMsg *core.ChatMessage, params *RAGContext, docs []core.Document, inputValues map[string]any, sender core.MessageSender) error { if len(params.pickedDocIDS) > 0 { var query = orm.Query{} query.Conds = orm.And(orm.InStringArray("_id", params.pickedDocIDS)) @@ -799,14 +843,14 @@ func (h APIHandler) fetchDocumentInDepth(ctx context.Context, reqMsg, replyMsg * for _, v := range pickedFullDoc { str := "Obtaining and analyzing documents in depth: " + string(v.Title) + "\n" strBuilder.WriteString(str) - chunkMsg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.DeepRead, str, chunkSeq) + chunkMsg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.DeepRead, str, chunkSeq) err = sender.SendMessage(chunkMsg) if err != nil { return err } } - detail := common.ProcessingDetails{Order: 40, Type: common.DeepRead, Description: strBuilder.String()} + detail := core.ProcessingDetails{Order: 40, Type: common.DeepRead, Description: strBuilder.String()} replyMsg.Details = append(replyMsg.Details, detail) inputValues["references"] = formatDocumentForReplyReferences(pickedFullDoc) @@ -814,9 +858,9 @@ func (h APIHandler) fetchDocumentInDepth(ctx context.Context, reqMsg, replyMsg * return nil } -func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, replyMsg *common.ChatMessage, params *RAGContext, inputValues map[string]any, sender common.MessageSender) error { +func generateFinalResponse(taskCtx context.Context, reqMsg, replyMsg *core.ChatMessage, params *RAGContext, inputValues map[string]any, sender core.MessageSender) error { - echoMsg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.Response, string(""), 0) + echoMsg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.Response, string(""), 0) _ = sender.SendMessage(echoMsg) replyMsg.Message += echoMsg.MessageChunk @@ -835,33 +879,35 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply if messageBuffer.Len() > 0 { replyMsg.Message = messageBuffer.String() } else { - log.Warnf("seems empty reply for query:", replyMsg) + log.Warnf("seems empty reply for query: %v", replyMsg) } if reasoningBuffer.Len() > 0 { - detail := common.ProcessingDetails{Order: 50, Type: common.Think, Description: reasoningBuffer.String()} + detail := core.ProcessingDetails{Order: 50, Type: common.Think, Description: reasoningBuffer.String()} replyMsg.Details = append(replyMsg.Details, detail) } }() chunkSeq := 0 var err error - if params.answeringProvider == nil { - return errors.Errorf("no answering provider with assistant: %v", params.AssistantCfg.ID) - } - llm := langchain.GetLLM(params.answeringProvider.BaseURL, params.answeringProvider.APIType, params.answeringModel.Name, params.answeringProvider.APIKey, params.AssistantCfg.Keepalive) //deepseek-r1 /deepseek-v3 + provider := params.GetAnsweringProvider() + //log.Error(util.ToJson(provider, true)) + //log.Error(util.ToJson(params.AssistantCfg, true)) + //llm := langchain.GetLLM(params.answeringProvider.BaseURL, params.answeringProvider.APIType, params.answeringModel.Name, params.answeringProvider.APIKey, params.AssistantCfg.Keepalive) //deepseek-r1 /deepseek-v3 + + llm := langchain.GetLLM(provider.BaseURL, provider.APIType, params.MustGetAnsweringModel().Name, provider.APIKey, params.AssistantCfg.Keepalive) //deepseek-r1 /deepseek-v3 appConfig := common.AppConfig() - log.Trace(params.answeringModel, ",", util.MustToJSON(appConfig)) + log.Trace(params.MustGetAnsweringModel(), ",", util.MustToJSON(appConfig)) options := []llms.CallOption{} - maxTokens := langchain.GetMaxTokens(params.answeringModel, params.answeringProvider, 1024) - temperature := langchain.GetTemperature(params.answeringModel, params.answeringProvider, 0.8) - maxLength := langchain.GetMaxLength(params.answeringModel, params.answeringProvider, 0) + maxTokens := langchain.GetMaxTokens(params.MustGetAnsweringModel(), params.GetAnsweringProvider(), 1024) + temperature := langchain.GetTemperature(params.MustGetAnsweringModel(), params.GetAnsweringProvider(), 0.8) + maxLength := langchain.GetMaxLength(params.MustGetAnsweringModel(), params.GetAnsweringProvider(), 0) options = append(options, llms.WithMaxTokens(maxTokens)) options = append(options, llms.WithMaxLength(maxLength)) options = append(options, llms.WithTemperature(temperature)) - if params.answeringModel.Settings.Reasoning { + if params.MustGetAnsweringModel().Settings.Reasoning { options = append(options, llms.WithStreamingReasoningFunc(func(ctx context.Context, reasoningChunk []byte, chunk []byte) error { log.Trace(string(reasoningChunk), ",", string(chunk)) // Use taskCtx here to check for cancellation or other context-specific logic @@ -878,7 +924,7 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply if len(reasoningChunk) > 0 { chunkSeq += 1 reasoningBuffer.Write(reasoningChunk) - msg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.Think, string(reasoningChunk), chunkSeq) + msg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.Think, string(reasoningChunk), chunkSeq) //log.Info(util.MustToJSON(msg)) err = sender.SendMessage(msg) if err != nil { @@ -891,7 +937,7 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply if len(chunk) > 0 { chunkSeq += 1 - msg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.Response, string(chunk), chunkSeq) + msg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.Response, string(chunk), chunkSeq) err = sender.SendMessage(msg) if err != nil { panic(err) @@ -911,7 +957,7 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply if len(chunk) > 0 { log.Trace(string(chunk)) chunkSeq += 1 - msg := common.NewMessageChunk(params.SessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.Response, string(chunk), chunkSeq) + msg := core.NewMessageChunk(params.SessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.Response, string(chunk), chunkSeq) err = sender.SendMessage(msg) messageBuffer.Write(chunk) } @@ -948,7 +994,7 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply } // Create the prompt template - finalPrompt, err := rag.GetPromptStringByTemplateArgs(params.answeringModel, template, []string{"query", "context"}, inputValues) + finalPrompt, err := rag.GetPromptStringByTemplateArgs(params.MustGetAnsweringModel(), template, []string{"query", "context"}, inputValues) if err != nil { panic(err) } @@ -970,7 +1016,7 @@ func (h APIHandler) generateFinalResponse(taskCtx context.Context, reqMsg, reply return nil } -func formatDocumentForReplyReferences(docs []common.Document) string { +func formatDocumentForReplyReferences(docs []core.Document) string { var sb strings.Builder sb.WriteString("\n") for i, doc := range docs { @@ -988,7 +1034,7 @@ func formatDocumentForReplyReferences(docs []common.Document) string { return sb.String() } -func formatDocumentReferencesToDisplay(docs []common.Document) string { +func formatDocumentReferencesToDisplay(docs []core.Document) string { var sb strings.Builder sb.WriteString(fmt.Sprintf("\n", len(docs))) outDocs := []util.MapStr{} @@ -1006,7 +1052,7 @@ func formatDocumentReferencesToDisplay(docs []common.Document) string { return sb.String() } -func formatDocumentForPick(docs []common.Document) []util.MapStr { +func formatDocumentForPick(docs []core.Document) []util.MapStr { outDocs := []util.MapStr{} for _, doc := range docs { item := util.MapStr{} @@ -1021,8 +1067,8 @@ func formatDocumentForPick(docs []common.Document) []util.MapStr { return outDocs } -func fetchDocuments(query *orm.Query) ([]common.Document, error) { - var docs []common.Document +func fetchDocuments(query *orm.Query) ([]core.Document, error) { + var docs []core.Document err, _ := orm.SearchWithJSONMapper(&docs, query) if err != nil { return nil, fmt.Errorf("failed to fetch documents: %w", err) diff --git a/modules/assistant/init.go b/modules/assistant/init.go index 1a4caa7a..1295abc9 100644 --- a/modules/assistant/init.go +++ b/modules/assistant/init.go @@ -6,7 +6,6 @@ package assistant import ( "infini.sh/coco/core" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" "infini.sh/framework/core/security" ) @@ -34,11 +33,11 @@ func init() { viewHistoryPermission := security.GetSimplePermission(Category, Session, ViewHistoryAction) viewSessionHistoryPermission := security.GetSimplePermission(Category, Session, ViewSingleSessionHistoryAction) - createAssistantPermission := security.GetSimplePermission(Category, Session, string(security.Create)) - updateAssistantPermission := security.GetSimplePermission(Category, Session, string(security.Update)) - readAssistantPermission := security.GetSimplePermission(Category, Session, string(security.Read)) - deleteAssistantPermission := security.GetSimplePermission(Category, Session, string(security.Delete)) - searchAssistantPermission := security.GetSimplePermission(Category, Session, string(security.Search)) + createAssistantPermission := security.GetSimplePermission(Category, Assistant, string(security.Create)) + updateAssistantPermission := security.GetSimplePermission(Category, Assistant, string(security.Update)) + readAssistantPermission := security.GetSimplePermission(Category, Assistant, string(security.Read)) + deleteAssistantPermission := security.GetSimplePermission(Category, Assistant, string(security.Delete)) + searchAssistantPermission := security.GetSimplePermission(Category, Assistant, string(security.Search)) askAssistantPermission := security.GetSimplePermission(Category, Assistant, string("ask")) security.GetOrInitPermissionKeys(createPermission, updatePermission, readPermission, askAssistantPermission, deletePermission, searchPermission, viewHistoryPermission, manageChatSessionPermission, cancelChatSessionAction) @@ -48,41 +47,41 @@ func init() { handler := APIHandler{} - api.HandleUIMethod(api.GET, "/chat/_history", handler.getChatSessions, api.RequirePermission(viewHistoryPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/chat/_history", handler.getChatSessions, api.RequirePermission(viewHistoryPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.GET, "/chat/_history", handler.getChatSessions, api.RequirePermission(viewHistoryPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/chat/_history", handler.getChatSessions, api.RequirePermission(viewHistoryPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/chat/_create", handler.createChatSession, api.RequirePermission(createPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureFingerprintThrottle)) - api.HandleUIMethod(api.OPTIONS, "/chat/_create", handler.createChatSession, api.RequirePermission(createPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/chat/_create", handler.createChatSession, api.RequirePermission(createPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureFingerprintThrottle)) + api.HandleUIMethod(api.OPTIONS, "/chat/_create", handler.createChatSession, api.RequirePermission(createPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/chat/:session_id/_chat", handler.sendChatMessageV2, api.RequirePermission(createPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureFingerprintThrottle)) - api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_chat", handler.sendChatMessageV2, api.RequirePermission(createPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/chat/:session_id/_chat", handler.sendChatMessageV2, api.RequirePermission(createPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureFingerprintThrottle)) + api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_chat", handler.sendChatMessageV2, api.RequirePermission(createPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.GET, "/chat/:session_id", handler.getSession, api.RequirePermission(readPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.PUT, "/chat/:session_id", handler.updateSession, api.RequirePermission(updatePermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.DELETE, "/chat/:session_id", handler.deleteSession, api.RequirePermission(deletePermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.GET, "/chat/:session_id", handler.getSession, api.RequirePermission(readPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.PUT, "/chat/:session_id", handler.updateSession, api.RequirePermission(updatePermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.DELETE, "/chat/:session_id", handler.deleteSession, api.RequirePermission(deletePermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/chat/:session_id/_cancel", handler.cancelReplyMessage, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_cancel", handler.cancelReplyMessage, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/chat/:session_id/_cancel", handler.cancelReplyMessage, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_cancel", handler.cancelReplyMessage, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/chat/:session_id/_open", handler.openChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_open", handler.openChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/chat/:session_id/_open", handler.openChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_open", handler.openChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/chat/:session_id/_close", handler.closeChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_close", handler.closeChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/chat/:session_id/_close", handler.closeChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_close", handler.closeChatSession, api.RequirePermission(manageChatSessionPermission), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.GET, "/chat/:session_id/_history", handler.getChatHistoryBySession, api.RequirePermission(viewSessionHistoryPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_history", handler.getChatHistoryBySession, api.RequirePermission(viewSessionHistoryPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.GET, "/chat/:session_id/_history", handler.getChatHistoryBySession, api.RequirePermission(viewSessionHistoryPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/chat/:session_id/_history", handler.getChatHistoryBySession, api.RequirePermission(viewSessionHistoryPermission), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.POST, "/assistant/", handler.createAssistant, api.RequirePermission(createAssistantPermission)) api.HandleUIMethod(api.GET, "/assistant/:id", handler.getAssistant, api.RequirePermission(readAssistantPermission)) - api.HandleUIMethod(api.POST, "/assistant/:id/_ask", handler.askAssistant, api.RequirePermission(askAssistantPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureFingerprintThrottle)) - api.HandleUIMethod(api.OPTIONS, "/assistant/:id/_ask", handler.askAssistant, api.RequirePermission(askAssistantPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/assistant/:id/_ask", handler.askAssistant, api.RequirePermission(askAssistantPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureFingerprintThrottle)) + api.HandleUIMethod(api.OPTIONS, "/assistant/:id/_ask", handler.askAssistant, api.RequirePermission(askAssistantPermission), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.PUT, "/assistant/:id", handler.updateAssistant, api.RequirePermission(updateAssistantPermission)) api.HandleUIMethod(api.DELETE, "/assistant/:id", handler.deleteAssistant, api.RequirePermission(deleteAssistantPermission)) - api.HandleUIMethod(api.GET, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.POST, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.GET, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.POST, "/assistant/_search", handler.searchAssistant, api.RequirePermission(searchAssistantPermission), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.POST, "/assistant/:id/_clone", handler.cloneAssistant, api.RequirePermission(createAssistantPermission)) } diff --git a/modules/assistant/langchain/llm.go b/modules/assistant/langchain/llm.go index 80ecc336..7de806a7 100644 --- a/modules/assistant/langchain/llm.go +++ b/modules/assistant/langchain/llm.go @@ -9,6 +9,7 @@ import ( "github.com/tmc/langchaingo/llms" "github.com/tmc/langchaingo/llms/ollama" "github.com/tmc/langchaingo/llms/openai" + "infini.sh/coco/core" "infini.sh/coco/modules/common" "infini.sh/framework/core/global" "net/http" @@ -76,7 +77,7 @@ func GetLLM(endpoint, apiType, model, token string, keepalive string) llms.Model } } -func GetTemperature(model *common.ModelConfig, modelProvider *common.ModelProvider, defaultValue float64) float64 { +func GetTemperature(model *core.ModelConfig, modelProvider *core.ModelProvider, defaultValue float64) float64 { temperature := 0.0 if model.Settings.Temperature > 0 { temperature = model.Settings.Temperature @@ -97,7 +98,7 @@ func GetTemperature(model *common.ModelConfig, modelProvider *common.ModelProvid return temperature } -func GetMaxLength(model *common.ModelConfig, modelProvider *common.ModelProvider, defaultValue int) int { +func GetMaxLength(model *core.ModelConfig, modelProvider *core.ModelProvider, defaultValue int) int { maxLength := 0 if model.Settings.MaxLength > 0 { maxLength = model.Settings.MaxLength @@ -118,7 +119,7 @@ func GetMaxLength(model *common.ModelConfig, modelProvider *common.ModelProvider return maxLength } -func GetMaxTokens(model *common.ModelConfig, modelProvider *common.ModelProvider, defaultValue int) int { +func GetMaxTokens(model *core.ModelConfig, modelProvider *core.ModelProvider, defaultValue int) int { var maxTokens int = 0 if model.Settings.MaxTokens > 0 { maxTokens = model.Settings.MaxTokens diff --git a/modules/assistant/rag/query_analysis.go b/modules/assistant/rag/query_analysis.go index 8107a027..1992ba80 100644 --- a/modules/assistant/rag/query_analysis.go +++ b/modules/assistant/rag/query_analysis.go @@ -9,6 +9,7 @@ import ( "fmt" log "github.com/cihub/seelog" "github.com/tmc/langchaingo/chains" + "infini.sh/coco/core" "infini.sh/coco/modules/assistant/langchain" "infini.sh/coco/modules/common" "infini.sh/framework/core/util" @@ -60,7 +61,7 @@ func extractJSON(input string) string { return "" } -func ProcessQueryIntent(ctx context.Context, sessionID string, provider *common.ModelProvider, cfg *common.ModelConfig, reqMsg, replyMsg *common.ChatMessage, assistant *common.Assistant, inputValues map[string]any, sender common.MessageSender) (*QueryIntent, error) { +func ProcessQueryIntent(ctx context.Context, sessionID string, provider *core.ModelProvider, cfg *core.ModelConfig, reqMsg, replyMsg *core.ChatMessage, assistant *core.Assistant, inputValues map[string]any, sender core.MessageSender) (*QueryIntent, error) { // Initialize the LLM llm := langchain.GetLLM(provider.BaseURL, provider.APIType, cfg.Name, provider.APIKey, assistant.Keepalive) @@ -85,7 +86,7 @@ func ProcessQueryIntent(ctx context.Context, sessionID string, provider *common. chunkSeq++ //queryIntentBuffer.Write(chunk) fmt.Println(string(chunk)) - msg := common.NewMessageChunk(sessionID, replyMsg.ID, common.MessageTypeAssistant, reqMsg.ID, common.QueryIntent, string(chunk), chunkSeq) + msg := core.NewMessageChunk(sessionID, replyMsg.ID, core.MessageTypeAssistant, reqMsg.ID, common.QueryIntent, string(chunk), chunkSeq) err := sender.SendMessage(msg) if err != nil { _ = log.Error(err) @@ -111,7 +112,7 @@ func ProcessQueryIntent(ctx context.Context, sessionID string, provider *common. } // Attach the query intent to the reply message - replyMsg.Details = append(replyMsg.Details, common.ProcessingDetails{ + replyMsg.Details = append(replyMsg.Details, core.ProcessingDetails{ Order: 10, Type: common.QueryIntent, Payload: queryIntent, diff --git a/modules/assistant/rag/template.go b/modules/assistant/rag/template.go index 4ae1533c..7ddaf96f 100644 --- a/modules/assistant/rag/template.go +++ b/modules/assistant/rag/template.go @@ -6,7 +6,7 @@ package rag import ( "github.com/tmc/langchaingo/prompts" - "infini.sh/coco/modules/common" + "infini.sh/coco/core" "infini.sh/framework/core/errors" "regexp" ) @@ -37,7 +37,7 @@ func extractVariables(template string) []string { return vars } -func GetPromptStringByTemplateArgs(cfg *common.ModelConfig, defaultTemplate string, requiredVars []string, inputValues map[string]any) (string, error) { +func GetPromptStringByTemplateArgs(cfg *core.ModelConfig, defaultTemplate string, requiredVars []string, inputValues map[string]any) (string, error) { promptTemplate, err := GetPromptTemplate(cfg, defaultTemplate, requiredVars, inputValues) if err != nil { return "", err @@ -50,7 +50,7 @@ func GetPromptStringByTemplateArgs(cfg *common.ModelConfig, defaultTemplate stri return promptValues.String(), nil } -func GetPromptTemplate(cfg *common.ModelConfig, defaultTemplate string, requiredVars []string, inputValues map[string]any) (*prompts.PromptTemplate, error) { +func GetPromptTemplate(cfg *core.ModelConfig, defaultTemplate string, requiredVars []string, inputValues map[string]any) (*prompts.PromptTemplate, error) { template := defaultTemplate inputVars := requiredVars diff --git a/modules/assistant/session.go b/modules/assistant/session.go index bdef35d8..bf7754e9 100644 --- a/modules/assistant/session.go +++ b/modules/assistant/session.go @@ -8,6 +8,8 @@ import ( "context" "encoding/json" "fmt" + "infini.sh/coco/core" + "infini.sh/framework/core/security" "net/http" "sync" @@ -24,7 +26,7 @@ import ( func (h APIHandler) getSession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("session_id") - obj := common.Session{} + obj := core.Session{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -47,7 +49,7 @@ func (h APIHandler) getSession(w http.ResponseWriter, req *http.Request, ps http func (h APIHandler) deleteSession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("session_id") - obj := common.Session{} + obj := core.Session{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -70,7 +72,7 @@ func (h APIHandler) deleteSession(w http.ResponseWriter, req *http.Request, ps h builder.Filter(orm.TermQuery("session_id", id)) ctx1 := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx1, &common.ChatMessage{}) + orm.WithModel(ctx1, &core.ChatMessage{}) _, err = orm.DeleteByQuery(ctx1, builder) if err != nil { @@ -90,7 +92,7 @@ func (h APIHandler) deleteSession(w http.ResponseWriter, req *http.Request, ps h func (h APIHandler) updateSession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("session_id") - obj := common.Session{} + obj := core.Session{} var err error err = h.DecodeJSON(req, &obj) if err != nil { @@ -98,7 +100,7 @@ func (h APIHandler) updateSession(w http.ResponseWriter, req *http.Request, ps h return } - previousObj := common.Session{} + previousObj := core.Session{} previousObj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -159,7 +161,7 @@ func (h APIHandler) getChatSessions(w http.ResponseWriter, req *http.Request, ps builder.Not(orm.TermQuery("visible", false)) ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Session{}) + orm.WithModel(ctx, &core.Session{}) res, err := orm.SearchV2(ctx, builder) if err != nil { @@ -176,6 +178,7 @@ func (h APIHandler) getChatSessions(w http.ResponseWriter, req *http.Request, ps func (h APIHandler) createChatSession(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { id := h.GetParameterOrDefault(r, "assistant_id", DefaultAssistantID) + userInfo := security.MustGetUserFromRequest(r) assistant, exists, err := common.GetAssistant(r, id) if !exists || err != nil { @@ -186,7 +189,7 @@ func (h APIHandler) createChatSession(w http.ResponseWriter, r *http.Request, ps //launch the LLM task //streaming output result to HTTP client - var request common.MessageRequest + var request core.MessageRequest if err := h.DecodeJSON(r, &request); err != nil { //error can be ignored, since older app version didn't have this option h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -237,18 +240,22 @@ func (h APIHandler) createChatSession(w http.ResponseWriter, r *http.Request, ps SessionID: session.ID, CancelFunc: cancel, }) - _ = h.processMessageAsync(ctx, reqMsg, params, streamSender) + _ = processMessageAsync(orm.NewContextWithParent(ctx), userInfo.MustGetUserID(), reqMsg, params, streamSender) } -func CreateAndSaveNewChatMessage(request *http.Request, assistantID string, req *common.MessageRequest, visible bool) (common.Session, error, *common.ChatMessage, util.MapStr) { +func CreateAndSaveNewChatMessage(request *http.Request, assistantID string, req *core.MessageRequest, visible bool) (core.Session, error, *core.ChatMessage, util.MapStr) { + ctx := orm.NewContextWithParent(request.Context()) + return InternalCreateAndSaveNewChatMessage(ctx, assistantID, req, visible) +} + +func InternalCreateAndSaveNewChatMessage(ctx *orm.Context, assistantID string, req *core.MessageRequest, visible bool) (core.Session, error, *core.ChatMessage, util.MapStr) { //if !rate.GetRateLimiterPerSecond("assistant_new_chat", clientIdentity, 10).Allow() { // panic("too many requests") //} - ctx := orm.NewContextWithParent(request.Context()) ctx.Refresh = orm.WaitForRefresh - obj := common.Session{ + obj := core.Session{ Status: "active", Visible: visible, } @@ -260,7 +267,7 @@ func CreateAndSaveNewChatMessage(request *http.Request, assistantID string, req //save session err := orm.Create(ctx, &obj) if err != nil { - return common.Session{}, err, nil, nil + return core.Session{}, err, nil, nil } result := util.MapStr{ @@ -269,12 +276,12 @@ func CreateAndSaveNewChatMessage(request *http.Request, assistantID string, req "_source": obj, } - var firstMessage *common.ChatMessage + var firstMessage *core.ChatMessage //save first message to history if req != nil && !req.IsEmpty() { firstMessage, err = saveRequestMessage(ctx, obj.ID, assistantID, req) if err != nil { - return common.Session{}, err, nil, nil + return core.Session{}, err, nil, nil } result["payload"] = firstMessage } @@ -291,10 +298,12 @@ func (h *APIHandler) askAssistant(w http.ResponseWriter, r *http.Request, ps htt return } + userInfo := security.MustGetUserFromRequest(r) + //launch the LLM task //streaming output result to HTTP client - var request common.MessageRequest + var request core.MessageRequest if err := h.DecodeJSON(r, &request); err != nil { //error can be ignored, since older app version didn't have this option h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -337,20 +346,20 @@ func (h *APIHandler) askAssistant(w http.ResponseWriter, r *http.Request, ps htt Flusher: flusher, Ctx: r.Context(), // assuming this is in an HTTP handler } - _ = h.processMessageAsync(ctx, reqMsg, params, streamSender) + _ = processMessageAsync(orm.NewContextWithParent(ctx), userInfo.MustGetUserID(), reqMsg, params, streamSender) } -func saveRequestMessage(ctx *orm.Context, sessionID, assistantID string, req *common.MessageRequest) (*common.ChatMessage, error) { +func saveRequestMessage(ctx *orm.Context, sessionID, assistantID string, req *core.MessageRequest) (*core.ChatMessage, error) { if sessionID == "" || assistantID == "" || req.IsEmpty() { panic("invalid chat message") } - msg := &common.ChatMessage{ + msg := &core.ChatMessage{ SessionID: sessionID, AssistantID: assistantID, - MessageType: common.MessageTypeUser, + MessageType: core.MessageTypeUser, Message: req.Message, Attachments: req.Attachments, } @@ -367,7 +376,7 @@ func saveRequestMessage(ctx *orm.Context, sessionID, assistantID string, req *co func (h APIHandler) openChatSession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("session_id") - obj := common.Session{} + obj := core.Session{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -401,13 +410,13 @@ func (h APIHandler) openChatSession(w http.ResponseWriter, req *http.Request, ps } -func getChatHistoryBySessionInternal(sessionID string, size int) ([]common.ChatMessage, error) { +func getChatHistoryBySessionInternal(sessionID string, size int) ([]core.ChatMessage, error) { q := orm.Query{} q.Conds = orm.And(orm.Eq("session_id", sessionID)) q.From = 0 q.Size = size q.AddSort("created", orm.DESC) - docs := []common.ChatMessage{} + docs := []core.ChatMessage{} err, _ := orm.SearchWithJSONMapper(&docs, &q) if err != nil { return nil, err @@ -416,19 +425,29 @@ func getChatHistoryBySessionInternal(sessionID string, size int) ([]common.ChatM } func (h APIHandler) getChatHistoryBySession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - q := orm.Query{} - q.Conds = orm.And(orm.Eq("session_id", ps.MustGetParameter("session_id"))) - q.From = h.GetIntOrDefault(req, "from", 0) - q.Size = h.GetIntOrDefault(req, "size", 20) - q.AddSort("created", orm.ASC) + builder, err := orm.NewQueryBuilderFromRequest(req, "message") + if err != nil { + h.WriteError(w, err.Error(), http.StatusInternalServerError) + return + } - err, res := orm.Search(&common.ChatMessage{}, &q) + if builder.SizeVal() == 0 { + builder.Size(20) + } + + builder.SortBy(orm.Sort{Field: "created", SortType: orm.ASC}) + builder.Must(orm.TermQuery("session_id", ps.MustGetParameter("session_id"))) + + ctx := orm.NewContextWithParent(req.Context()) + orm.WithModel(ctx, &core.ChatMessage{}) + + res, err := orm.SearchV2(ctx, builder) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) return } - _, err = h.Write(w, res.Raw) + _, err = h.Write(w, res.Payload.([]byte)) if err != nil { h.Error(w, err) } @@ -471,6 +490,7 @@ func (h APIHandler) cancelReplyMessage(w http.ResponseWriter, req *http.Request, func (h APIHandler) sendChatMessageV2(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { sessionID := ps.MustGetParameter("session_id") + userInfo := security.MustGetUserFromRequest(r) ormCtx := orm.NewContextWithParent(r.Context()) ormCtx.Refresh = orm.WaitForRefresh @@ -486,7 +506,7 @@ func (h APIHandler) sendChatMessageV2(w http.ResponseWriter, r *http.Request, ps //launch the LLM task //streaming output result to HTTP client - var request common.MessageRequest + var request core.MessageRequest if err := h.DecodeJSON(r, &request); err != nil { //error can be ignored, since older app version didn't have this option h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -537,7 +557,7 @@ func (h APIHandler) sendChatMessageV2(w http.ResponseWriter, r *http.Request, ps SessionID: sessionID, CancelFunc: cancel, }) - _ = h.processMessageAsync(ctx, reqMsg, params, streamSender) + _ = processMessageAsync(orm.NewContextWithParent(ctx), userInfo.MustGetUserID(), reqMsg, params, streamSender) } @@ -551,7 +571,7 @@ func getReplyMessageTaskID(sessionID, messageID string) string { func (h APIHandler) closeChatSession(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("session_id") - obj := common.Session{} + obj := core.Session{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) diff --git a/modules/assistant/streaming-http.go b/modules/assistant/streaming-http.go index 0ea155f3..f258cbf4 100644 --- a/modules/assistant/streaming-http.go +++ b/modules/assistant/streaming-http.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "infini.sh/coco/core" "infini.sh/coco/modules/common" "net/http" "regexp" @@ -23,7 +24,7 @@ type HTTPStreamSender struct { Ctx context.Context } -func (s *HTTPStreamSender) SendMessage(msg *common.MessageChunk) error { +func (s *HTTPStreamSender) SendMessage(msg *core.MessageChunk) error { if msg == nil || (msg.MessageType == common.Response && strings.TrimSpace(msg.MessageChunk) == "") { return nil diff --git a/modules/assistant/sync.go b/modules/assistant/sync.go new file mode 100644 index 00000000..5fa38dbe --- /dev/null +++ b/modules/assistant/sync.go @@ -0,0 +1,82 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package assistant + +import ( + "context" + "errors" + "fmt" + log "github.com/cihub/seelog" + "infini.sh/coco/core" + "infini.sh/coco/modules/common" + "infini.sh/framework/core/orm" + "strings" + "sync" +) + +type MemoryMessageSender struct { + mu sync.Mutex + messages []string +} + +func (m *MemoryMessageSender) SendMessage(msg *core.MessageChunk) error { + m.mu.Lock() + defer m.mu.Unlock() + + log.Trace("got message:", msg.ChunkType, "=> ", msg.MessageChunk) + + if msg == nil || (msg.MessageType == common.Response && strings.TrimSpace(msg.MessageChunk) == "") { + return nil + } + + //only keep response type + if msg.ChunkType == common.Response { + m.messages = append(m.messages, msg.MessageChunk) + } + return nil +} + +func (m *MemoryMessageSender) FinalResponse() string { + m.mu.Lock() + defer m.mu.Unlock() + return strings.Join(m.messages, "") +} + +// AskAssistantSync sends a message to an assistant and waits for a full response. +// This version is fully detached from APIHandler and HTTP context. +func AskAssistantSync(ctx context.Context, userID string, id string, message string, vars map[string]any) (string, error) { + ctx1 := orm.NewContextWithParent(ctx) + ctx1.DirectAccess() + assistant, exists, err := common.InternalGetAssistant(ctx1, id) + if !exists || err != nil { + return "", fmt.Errorf("assistant %s not found: %w", id, err) + } + + if message == "" { + return "", errors.New("message is empty") + } + + // Construct and save a new chat message + request := core.MessageRequest{ + Message: message, + } + session, err, reqMsg, _ := InternalCreateAndSaveNewChatMessage(ctx1, id, &request, false) + if err != nil || reqMsg == nil { + return "", fmt.Errorf("failed to create chat message: %w", err) + } + + ragCtx := &RAGContext{} + ragCtx.AssistantCfg = assistant + ragCtx.SessionID = session.ID + ragCtx.InputValues = vars + + // Memory-based receiver for synchronous mode + receiver := &MemoryMessageSender{} + if err := processMessageAsync(ctx1, userID, reqMsg, ragCtx, receiver); err != nil { + return "", fmt.Errorf("process message failed: %w", err) + } + + return receiver.FinalResponse(), nil +} diff --git a/modules/attachment/attachment.go b/modules/attachment/attachment.go index f3a951c2..3d5a174c 100644 --- a/modules/attachment/attachment.go +++ b/modules/attachment/attachment.go @@ -7,6 +7,7 @@ package attachment import ( "errors" "fmt" + "infini.sh/coco/core" "infini.sh/framework/core/elastic" "io" "mime/multipart" @@ -16,7 +17,6 @@ import ( "time" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/kv" "infini.sh/framework/core/orm" @@ -81,13 +81,16 @@ func (h APIHandler) getAttachments(w http.ResponseWriter, req *http.Request, ps var err error ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Attachment{}) + orm.WithModel(ctx, &core.Attachment{}) builder, err := orm.NewQueryBuilderFromRequest(req, "name", "description") if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) return } + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } builder.Filter(orm.MustNotQuery(orm.TermQuery("deleted", true))) @@ -97,7 +100,7 @@ func (h APIHandler) getAttachments(w http.ResponseWriter, req *http.Request, ps } - docs := []common.Attachment{} + docs := []core.Attachment{} err, res := elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -136,8 +139,8 @@ func (h APIHandler) getAttachment(w http.ResponseWriter, req *http.Request, ps h _, _ = w.Write(data) } -func (h APIHandler) getAttachmentMetadata(req *http.Request, fileID string) (*common.Attachment, bool, error) { - attachment := common.Attachment{} +func (h APIHandler) getAttachmentMetadata(req *http.Request, fileID string) (*core.Attachment, bool, error) { + attachment := core.Attachment{} attachment.ID = fileID ctx := orm.NewContextWithParent(req.Context()) @@ -196,7 +199,7 @@ func (h APIHandler) deleteAttachment(w http.ResponseWriter, req *http.Request, p attachment.Deleted = true t := time.Now() - attachment.LastUpdatedBy = &common.EditorInfo{UpdatedAt: &t} + attachment.LastUpdatedBy = &core.EditorInfo{UpdatedAt: &t} ctx := orm.NewContextWithParent(req.Context()) ctx.Refresh = orm.WaitForRefresh @@ -253,7 +256,7 @@ func uploadToBlobStore(ctx *orm.Context, file multipart.File, fileName string) ( fileSize := len(data) mimeType, _ := getMimeType(file) - attachment := common.Attachment{} + attachment := core.Attachment{} attachment.ID = fileID attachment.Name = fileName attachment.Size = fileSize diff --git a/modules/coco.go b/modules/coco.go index 7abe1cfe..147799cd 100644 --- a/modules/coco.go +++ b/modules/coco.go @@ -5,6 +5,7 @@ package modules import ( + "infini.sh/coco/core" _ "infini.sh/coco/modules/assistant" _ "infini.sh/coco/modules/attachment" "infini.sh/coco/modules/common" @@ -14,7 +15,6 @@ import ( "infini.sh/coco/modules/integration" _ "infini.sh/coco/modules/integration" _ "infini.sh/coco/modules/llm" - _ "infini.sh/coco/modules/search" _ "infini.sh/coco/modules/system" "infini.sh/framework/core/orm" ) @@ -25,16 +25,16 @@ type Coco struct { func (this *Coco) Setup() { suffix := common.GetSchemaSuffix() - orm.MustRegisterSchemaWithIndexName(common.Session{}, "session"+suffix) - orm.MustRegisterSchemaWithIndexName(common.Document{}, "document"+suffix) - orm.MustRegisterSchemaWithIndexName(common.ChatMessage{}, "message"+suffix) - orm.MustRegisterSchemaWithIndexName(common.Attachment{}, "attachment"+suffix) - orm.MustRegisterSchemaWithIndexName(common.Connector{}, "connector"+suffix) - orm.MustRegisterSchemaWithIndexName(common.DataSource{}, "datasource"+suffix) - orm.MustRegisterSchemaWithIndexName(common.Integration{}, "integration"+suffix) - orm.MustRegisterSchemaWithIndexName(common.ModelProvider{}, "model-provider"+suffix) - orm.MustRegisterSchemaWithIndexName(common.Assistant{}, "assistant"+suffix) - orm.MustRegisterSchemaWithIndexName(common.MCPServer{}, "mcp-server"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Session{}, "session"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Document{}, "document"+suffix) + orm.MustRegisterSchemaWithIndexName(core.ChatMessage{}, "message"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Attachment{}, "attachment"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Connector{}, "connector"+suffix) + orm.MustRegisterSchemaWithIndexName(core.DataSource{}, "datasource"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Integration{}, "integration"+suffix) + orm.MustRegisterSchemaWithIndexName(core.ModelProvider{}, "model-provider"+suffix) + orm.MustRegisterSchemaWithIndexName(core.Assistant{}, "assistant"+suffix) + orm.MustRegisterSchemaWithIndexName(core.MCPServer{}, "mcp-server"+suffix) } func (this *Coco) Start() error { diff --git a/modules/common/assistant.go b/modules/common/assistant.go index cd827fff..557d834b 100644 --- a/modules/common/assistant.go +++ b/modules/common/assistant.go @@ -5,6 +5,7 @@ package common import ( + "infini.sh/coco/core" "net/http" "time" @@ -20,148 +21,25 @@ const ( AssistantCachePrimary = "assistant" ) -type Assistant struct { - CombinedFullText - Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` - Description string `json:"description" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` - Icon string `json:"icon" elastic_mapping:"icon:{enabled:false}"` - Type string `json:"type" elastic_mapping:"type:{type:keyword}"` // assistant type, default value: "simple", possible values: "simple", "deep_think", "external_workflow" - Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword}"` - Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` - Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` // Assistant-specific configuration settings with type - AnsweringModel ModelConfig `json:"answering_model" elastic_mapping:"answering_model:{type:object,enabled:false}"` - Datasource DatasourceConfig `json:"datasource" elastic_mapping:"datasource:{type:object,enabled:false}"` - ToolsConfig ToolsConfig `json:"tools,omitempty" elastic_mapping:"tools:{type:object,enabled:false}"` - MCPConfig MCPConfig `json:"mcp_servers,omitempty" elastic_mapping:"mcp_servers:{type:object,enabled:false}"` - UploadConfig UploadConfig `json:"upload,omitempty" elastic_mapping:"upload:{type:object,enabled:false}"` - Keepalive string `json:"keepalive" elastic_mapping:"keepalive:{type:keyword}"` - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` - ChatSettings ChatSettings `json:"chat_settings" elastic_mapping:"chat_settings:{type:object,enabled:false}"` - Builtin bool `json:"builtin" elastic_mapping:"builtin:{type:keyword}"` // Whether the model provider is builtin - RolePrompt string `json:"role_prompt" elastic_mapping:"role_prompt:{enabled:false}"` // Role prompt for the assistant - - DeepThinkConfig *DeepThinkConfig `json:"-"` -} - -type DeepThinkConfig struct { - IntentAnalysisModel ModelConfig `json:"intent_analysis_model"` - PickingDocModel ModelConfig `json:"picking_doc_model"` - - PickDatasource bool `json:"pick_datasource"` - PickTools bool `json:"pick_tools"` - ToolsPromisedResultSize int `json:"tools_promised_result_size"` - - Visible bool `json:"visible"` // Whether the deep think mode is visible to the user -} - -type WorkflowConfig struct { -} - -type UploadConfig struct { - Enabled bool `json:"enabled"` - AllowedFileExtensions []string `json:"allowed_file_extensions"` - MaxFileSizeInBytes int `json:"max_file_size_in_bytes"` - MaxFileCount int `json:"max_file_count"` -} - -type DatasourceConfig struct { - Enabled bool `json:"enabled"` - - IDs []string `json:"ids,omitempty"` - parsedIDs *[]string `json:"-"` - - Visible bool `json:"visible"` // Whether the deep datasource is visible to the user - Filter interface{} `json:"filter,omitempty"` // Filter for the datasource - EnabledByDefault bool `json:"enabled_by_default"` // Whether the datasource is enabled by default -} - -func (cfg *DatasourceConfig) GetIDs() []string { - if cfg.parsedIDs != nil { - return *cfg.parsedIDs - } - return cfg.IDs -} - -type MCPConfig struct { - Enabled bool `json:"enabled"` - - IDs []string `json:"ids,omitempty"` - parsedIDs *[]string `json:"-"` - - Visible bool `json:"visible"` // Whether the deep datasource is visible to the user - Model *ModelConfig `json:"model"` //if not specified, use the answering model - MaxIterations int `json:"max_iterations"` - EnabledByDefault bool `json:"enabled_by_default"` // Whether the MCP server is enabled by default -} - -func (cfg *MCPConfig) GetIDs() []string { - if cfg.parsedIDs != nil { - return *cfg.parsedIDs - } - return cfg.IDs -} - -type ToolsConfig struct { - Enabled bool `json:"enabled"` - BuiltinTools BuiltinToolsConfig `json:"builtin,omitempty" elastic_mapping:"builtin:{enabled:false}"` -} -type BuiltinToolsConfig struct { - Calculator bool `json:"calculator"` - Wikipedia bool `json:"wikipedia"` - Duckduckgo bool `json:"duckduckgo"` - Scraper bool `json:"scraper"` -} - -type ModelConfig struct { - ProviderID string `json:"provider_id,omitempty"` - Name string `json:"name"` - Settings ModelSettings `json:"settings"` - PromptConfig *PromptConfig `json:"prompt,omitempty"` -} - -type PromptConfig struct { - PromptTemplate string `json:"template"` - InputVars []string `json:"input_vars"` -} - -type ModelSettings struct { - Reasoning bool `json:"reasoning"` - Temperature float64 `json:"temperature"` - TopP float64 `json:"top_p"` - PresencePenalty float64 `json:"presence_penalty"` - FrequencyPenalty float64 `json:"frequency_penalty"` - MaxTokens int `json:"max_tokens"` - MaxLength int `json:"max_length"` -} - -type ChatSettings struct { - GreetingMessage string `json:"greeting_message"` - Suggested struct { - Enabled bool `json:"enabled"` - Questions []string `json:"questions"` - } `json:"suggested"` - InputPreprocessTemplate string `json:"input_preprocess_tpl"` - PlaceHolder string `json:"placeholder"` - HistoryMessage struct { - Number int `json:"number"` - CompressionThreshold int `json:"compression_threshold"` - Summary bool `json:"summary"` - } `json:"history_message"` +// GetAssistant retrieves the assistant object from the cache or database. +func GetAssistant(req *http.Request, assistantID string) (*core.Assistant, bool, error) { + ctx := orm.NewContextWithParent(req.Context()) + return InternalGetAssistant(ctx, assistantID) } -// GetAssistant retrieves the assistant object from the cache or database. -func GetAssistant(req *http.Request, assistantID string) (*Assistant, bool, error) { +func InternalGetAssistant(ctx *orm.Context, assistantID string) (*core.Assistant, bool, error) { item := GeneralObjectCache.Get(AssistantCachePrimary, assistantID) - var assistant *Assistant + var assistant *core.Assistant if item != nil && !item.Expired() { var ok bool - if assistant, ok = item.Value().(*Assistant); ok { + if assistant, ok = item.Value().(*core.Assistant); ok { return assistant, true, nil } } - assistant = &Assistant{} + assistant = &core.Assistant{} assistant.ID = assistantID - ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "assistant") exists, err := orm.GetV2(ctx, assistant) if err != nil { @@ -174,7 +52,7 @@ func GetAssistant(req *http.Request, assistantID string) (*Assistant, bool, erro if err != nil { panic(err) } - assistant.Datasource.parsedIDs = &ids + assistant.Datasource.SetIDs(ids) } if util.ContainsAnyInArray("*", assistant.MCPConfig.IDs) { @@ -182,7 +60,7 @@ func GetAssistant(req *http.Request, assistantID string) (*Assistant, bool, erro if err != nil { panic(err) } - assistant.MCPConfig.parsedIDs = &ids + assistant.MCPConfig.SetIDs(ids) } //set default value @@ -191,18 +69,18 @@ func GetAssistant(req *http.Request, assistantID string) (*Assistant, bool, erro } if assistant.AnsweringModel.PromptConfig == nil { - assistant.AnsweringModel.PromptConfig = &PromptConfig{PromptTemplate: GenerateAnswerPromptTemplate} + assistant.AnsweringModel.PromptConfig = &core.PromptConfig{PromptTemplate: GenerateAnswerPromptTemplate} } else if assistant.AnsweringModel.PromptConfig.PromptTemplate == "" { assistant.AnsweringModel.PromptConfig.PromptTemplate = GenerateAnswerPromptTemplate } if assistant.Type == AssistantTypeDeepThink { - deepThinkCfg := DeepThinkConfig{} + deepThinkCfg := core.DeepThinkConfig{} buf := util.MustToJSONBytes(assistant.Config) util.MustFromJSONBytes(buf, &deepThinkCfg) if deepThinkCfg.IntentAnalysisModel.PromptConfig == nil { - deepThinkCfg.IntentAnalysisModel.PromptConfig = &PromptConfig{PromptTemplate: QueryIntentPromptTemplate} + deepThinkCfg.IntentAnalysisModel.PromptConfig = &core.PromptConfig{PromptTemplate: QueryIntentPromptTemplate} } else if deepThinkCfg.IntentAnalysisModel.PromptConfig.PromptTemplate == "" { deepThinkCfg.IntentAnalysisModel.PromptConfig.PromptTemplate = QueryIntentPromptTemplate } @@ -243,7 +121,7 @@ func CountAssistants() (int64, error) { }, }, } - count, err := orm.Count(Assistant{}, util.MustToJSONBytes(queryDsl)) + count, err := orm.Count(core.Assistant{}, util.MustToJSONBytes(queryDsl)) if err == nil { GeneralObjectCache.Set(AssistantCachePrimary, TotalAssistantsCacheKey, count, time.Duration(30)*time.Minute) } diff --git a/modules/common/config.go b/modules/common/config.go index 1f622a1f..de8ecafa 100644 --- a/modules/common/config.go +++ b/modules/common/config.go @@ -17,13 +17,13 @@ import ( ) var ( - config *Config + config *core.Config configMu sync.Mutex ) -func AppConfigFromFile() (*Config, error) { - cocoConfig := Config{ - ServerInfo: &ServerInfo{Version: Version{Number: global.Env().GetVersion()}, Updated: time.Now()}, +func AppConfigFromFile() (*core.Config, error) { + cocoConfig := core.Config{ + ServerInfo: &core.ServerInfo{Version: core.Version{Number: global.Env().GetVersion()}, Updated: time.Now()}, } ok, err := env.ParseConfig("coco", &cocoConfig) @@ -34,7 +34,7 @@ func AppConfigFromFile() (*Config, error) { return &cocoConfig, nil } -func AppConfig() Config { +func AppConfig() core.Config { if config == nil { reloadConfig() @@ -62,56 +62,57 @@ func reloadConfig() { } if config == nil { - config = &Config{} + config = &core.Config{} } //read settings from kv buf, _ := kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultServerConfigKey)) if buf != nil { - si := &ServerInfo{ + si := &core.ServerInfo{ Store: config.ServerInfo.Store, // preserve existing store config } err := util.FromJSONBytes(buf, si) if err == nil { config.ServerInfo = si - config.ServerInfo.Version = Version{global.Env().GetVersion()} + config.ServerInfo.Version = core.Version{global.Env().GetVersion()} } - } - buf, _ = kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultAppSettingsKey)) - if buf != nil { - appSettings := &AppSettings{} - err := util.FromJSONBytes(buf, appSettings) - if err == nil { - config.AppSettings = appSettings + buf, _ = kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultAppSettingsKey)) + if buf != nil { + appSettings := &core.AppSettings{} + err := util.FromJSONBytes(buf, appSettings) + if err == nil { + config.AppSettings = appSettings + } } - } - buf, _ = kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultSearchSettingsKey)) - if buf != nil { - searchSettings := &SearchSettings{} - err := util.FromJSONBytes(buf, searchSettings) - if err == nil { - config.SearchSettings = searchSettings + buf, _ = kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultSearchSettingsKey)) + if buf != nil { + searchSettings := &core.SearchSettings{} + err := util.FromJSONBytes(buf, searchSettings) + if err == nil { + config.SearchSettings = searchSettings + } } - } - filebasedConfig, _ := AppConfigFromFile() - if filebasedConfig != nil { - //protect fields on managed mode - if filebasedConfig.ServerInfo != nil { - if global.Env().SystemConfig.WebAppConfig.Security.Managed { - config.ServerInfo.Managed = global.Env().SystemConfig.WebAppConfig.Security.Managed - config.ServerInfo.AuthProvider = filebasedConfig.ServerInfo.AuthProvider - config.ServerInfo.Provider = filebasedConfig.ServerInfo.Provider - config.ServerInfo.Endpoint = filebasedConfig.ServerInfo.Endpoint - config.ServerInfo.Public = filebasedConfig.ServerInfo.Public - config.ServerInfo.Version = filebasedConfig.ServerInfo.Version + filebasedConfig, _ := AppConfigFromFile() + if filebasedConfig != nil { + //protect fields on managed mode + if filebasedConfig.ServerInfo != nil { + if global.Env().SystemConfig.WebAppConfig.Security.Managed { + config.ServerInfo.Managed = global.Env().SystemConfig.WebAppConfig.Security.Managed + config.ServerInfo.AuthProvider = filebasedConfig.ServerInfo.AuthProvider + config.ServerInfo.Provider = filebasedConfig.ServerInfo.Provider + config.ServerInfo.Endpoint = filebasedConfig.ServerInfo.Endpoint + config.ServerInfo.Public = filebasedConfig.ServerInfo.Public + config.ServerInfo.Version = filebasedConfig.ServerInfo.Version + } + + config.ServerInfo.EncodeIconToBase64 = filebasedConfig.ServerInfo.EncodeIconToBase64 + config.ServerInfo.Store = filebasedConfig.ServerInfo.Store } - - config.ServerInfo.EncodeIconToBase64 = filebasedConfig.ServerInfo.EncodeIconToBase64 } } } -func SetAppConfig(c *Config) { +func SetAppConfig(c *core.Config) { configMu.Lock() defer configMu.Unlock() //save server's config @@ -133,34 +134,5 @@ func SetAppConfig(c *Config) { reloadConfig() } -type Config struct { - ServerInfo *ServerInfo `config:"server" json:"server,omitempty"` - AppSettings *AppSettings `config:"app_settings" json:"app_settings,omitempty"` - SearchSettings *SearchSettings `config:"search_settings" json:"search_settings,omitempty"` -} - const OLLAMA = "ollama" const OPENAI = "openai" - -type AppSettings struct { - Chat *ChatConfig `json:"chat,omitempty" config:"chat" ` -} - -type ChatConfig struct { - ChatStartPageConfig *ChatStartPageConfig `config:"start_page" json:"start_page,omitempty"` -} - -type ChatStartPageConfig struct { - Enabled bool `json:"enabled"` - Logo struct { - Light string `json:"light"` - Dark string `json:"dark"` - } `json:"logo"` - Introduction string `json:"introduction"` - DisplayAssistants []string `json:"display_assistants"` -} - -type SearchSettings struct { - Enabled bool `json:"enabled"` - Integration string `json:"integration"` -} diff --git a/modules/common/datasource.go b/modules/common/datasource.go index c2c1f1e5..7e81ffb2 100644 --- a/modules/common/datasource.go +++ b/modules/common/datasource.go @@ -5,53 +5,15 @@ package common import ( + "infini.sh/coco/core" + "infini.sh/framework/core/elastic" "infini.sh/framework/core/errors" "infini.sh/framework/core/orm" - "infini.sh/framework/core/pipeline" "infini.sh/framework/core/util" + orm2 "infini.sh/framework/plugins/enterprise/security/orm" "time" ) -type DataSource struct { - CombinedFullText - - Type string `json:"type,omitempty" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // Type of the datasource, eg: connector - Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Display name of this datasource - Description string `json:"description,omitempty" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` - Icon string `json:"icon,omitempty" elastic_mapping:"icon:{enabled:false}"` // Display name of this datasource - - Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword}"` - Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` - - Connector ConnectorConfig `json:"connector,omitempty" elastic_mapping:"connector:{type:object}"` // Connector configuration - - // Whether synchronization is allowed - SyncConfig SyncConfig `json:"sync" elastic_mapping:"sync:{type:object}"` - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` - - // Enrichment pipeline - EnrichmentPipeline *pipeline.PipelineConfigV2 `json:"enrichment_pipeline" elastic_mapping:"enrichment_pipeline:{type:object}"` //if the pipeline is enabled, pass each batch messages to this pipeline for enrichment - - //OAuthConfig OAuthConfig `json:"oauth_config,omitempty" elastic_mapping:"oauth_config:{type:object}"` -} - -type OAuthConfig struct { - Enabled bool `json:"enabled,omitempty" elastic_mapping:"enabled:{type:keyword}"` - Expired bool `json:"expired" elastic_mapping:"expired:{type:object}"` -} - -type SyncConfig struct { - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` - Strategy string `json:"strategy" elastic_mapping:"strategy:{type:keyword}"` - Interval string `json:"interval" elastic_mapping:"interval:{type:keyword}"` - PageSize int `json:"page_size" config:"page_size"` -} - -type ConnectorConfig struct { - ConnectorID string `json:"id,omitempty" elastic_mapping:"id:{type:keyword}"` // Connector ID for the datasource - Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` // Configs for this Connector, also pass to connector's processor -} - const ( DatasourcePrimaryCacheKey = "datasource_primary" DeletedDatasourceCacheKey = "deleted_datasource_ids" @@ -80,7 +42,7 @@ func GetDisabledDatasourceIDs() ([]string, error) { } } // Cache is empty, read from database and cache the IDs - var datasources []DataSource + var datasources []core.DataSource q := orm.Query{ Conds: orm.And(orm.Eq("enabled", false)), // Query for disabled data sources } @@ -109,7 +71,7 @@ func GetAllEnabledDatasourceIDs() ([]string, error) { } } // Cache is empty, read from database and cache the IDs - var datasources []DataSource + var datasources []core.DataSource q := orm.Query{ Conds: orm.And(orm.Eq("enabled", true)), } @@ -144,7 +106,7 @@ func IsDatasourceDeleted(id string) bool { return false } -func GetDatasourceConfig(ctx *orm.Context, id string) (*DataSource, error) { +func GetDatasourceConfig(ctx *orm.Context, id string) (*core.DataSource, error) { if IsDatasourceDeleted(id) { return nil, errors.Errorf("datasource [%v] has been deleted", id) } @@ -152,15 +114,20 @@ func GetDatasourceConfig(ctx *orm.Context, id string) (*DataSource, error) { v := GeneralObjectCache.Get(DatasourceItemsCacheKey, id) if v != nil { if !v.Expired() { - x, ok := v.Value().(*DataSource) + x, ok := v.Value().(*core.DataSource) if ok && x != nil { return x, nil } } } - obj := DataSource{} + obj := core.DataSource{} obj.ID = id + + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "datasource") + ctx.Set(orm.SharingCategoryCheckingChildrenEnabled, true) + exists, err := orm.GetV2(ctx, &obj) if err == nil && exists { GeneralObjectCache.Set(DatasourceItemsCacheKey, id, &obj, util.GetDurationOrDefault("30m", time.Duration(30)*time.Minute)) @@ -169,3 +136,39 @@ func GetDatasourceConfig(ctx *orm.Context, id string) (*DataSource, error) { return nil, errors.New("not found") } + +func GetUserDatasource(ctx *orm.Context) []string { + orm.WithModel(ctx, &core.DataSource{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "datasource") + ctx.Set(orm.SharingCategoryCheckingChildrenEnabled, true) + builder := orm.NewQuery() + builder.Size(1000) + + docs := []core.DataSource{} + + _, _ = elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) + ids := []string{} + for _, v := range docs { + ids = append(ids, v.ID) + } + return ids +} + +func GetUsersOwnDatasource(userID string) []string { + ctx := orm.NewContext() + ctx.DirectReadAccess() + orm.WithModel(ctx, &core.DataSource{}) + builder := orm.NewQuery() + builder.Must(orm.TermQuery(orm2.SystemOwnerQueryField, userID)) + builder.Size(1000) + + docs := []core.DataSource{} + + _, _ = elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) + ids := []string{} + for _, v := range docs { + ids = append(ids, v.ID) + } + return ids +} diff --git a/modules/common/hierarchy_path.go b/modules/common/hierarchy_path.go index 7b3a1ffd..ad3ff7fe 100644 --- a/modules/common/hierarchy_path.go +++ b/modules/common/hierarchy_path.go @@ -6,6 +6,7 @@ package common import ( "fmt" + "infini.sh/coco/core" "infini.sh/framework/core/util" ) @@ -21,14 +22,18 @@ func GetFullPathForCategories(parentCategories []string) string { if !util.PrefixStr(path, "/") { path = "/" + path } + + if !util.SuffixStr(path, "/") { + path = path + "/" + } return path } const SystemHierarchyPathKey = "parent_path" -func CreateHierarchyPathFolderDoc(datasource *DataSource, id string, name string, parentCategories []string) Document { - document := Document{ - Source: DataSourceReference{ +func CreateHierarchyPathFolderDoc(datasource *core.DataSource, id string, name string, parentCategories []string) core.Document { + document := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", diff --git a/modules/common/icon.go b/modules/common/icon.go index db3ab3a1..ddbd1cf3 100644 --- a/modules/common/icon.go +++ b/modules/common/icon.go @@ -3,12 +3,13 @@ package common import ( "encoding/base64" "fmt" + "infini.sh/coco/core" "infini.sh/framework/core/util" "net/http" "net/url" ) -func ParseAndGetIcon(connector *Connector, icon string) string { +func ParseAndGetIcon(connector *core.Connector, icon string) string { appCfg := AppConfig() icon = internalGetIcon(&appCfg, connector, icon) @@ -18,7 +19,7 @@ func ParseAndGetIcon(connector *Connector, icon string) string { return icon } -func internalGetIcon(appCfg *Config, connector *Connector, icon string) string { +func internalGetIcon(appCfg *core.Config, connector *core.Connector, icon string) string { link, ok := connector.Assets.Icons[icon] if ok { return AutoGetFullIconURL(appCfg, link) @@ -28,7 +29,7 @@ func internalGetIcon(appCfg *Config, connector *Connector, icon string) string { return icon } -func AutoGetFullIconURL(appCfg *Config, icon string) string { +func AutoGetFullIconURL(appCfg *core.Config, icon string) string { baseEndpoint := appCfg.ServerInfo.Endpoint if util.PrefixStr(icon, "/") && baseEndpoint != "" { link, err := url.JoinPath(baseEndpoint, icon) @@ -39,7 +40,7 @@ func AutoGetFullIconURL(appCfg *Config, icon string) string { return icon } -func ConvertIconToBase64(appCfg *Config, icon string) string { +func ConvertIconToBase64(appCfg *core.Config, icon string) string { if appCfg.ServerInfo.EncodeIconToBase64 && util.PrefixStr(icon, "http") { result, err := util.HttpGet(icon) if err == nil && result != nil { diff --git a/modules/common/integration.go b/modules/common/integration.go index bcdea42d..27210e6b 100644 --- a/modules/common/integration.go +++ b/modules/common/integration.go @@ -4,84 +4,7 @@ package common -import "infini.sh/framework/core/orm" - const ( IntegrationTypeEmbedded = "embedded" IntegrationTypeFloating = "floating" ) - -type Integration struct { - CombinedFullText - - Type string `json:"type,omitempty" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // Type of the Integeration, eg: embedded, floating - Options interface{} `json:"options,omitempty" elastic_mapping:"options:{type:object,enabled:false}"` // Type specific options - Hotkey string `json:"hotkey,omitempty" elastic_mapping:"hotkey:{type:keyword}"` // Hotkey for the integration - Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Display name of this embedding - - EnabledModule ModuleConfig `json:"enabled_module,omitempty" elastic_mapping:"enabled_module:{type:object}"` // Enabled module configuration - AccessControl AccessControlConfig `json:"access_control,omitempty" elastic_mapping:"access_control:{type:object}"` // Access control configuration - Appearance AppearanceConfig `json:"appearance,omitempty" elastic_mapping:"appearance:{type:object}"` // Appearance configuration - Cors CorsConfig `json:"cors,omitempty" elastic_mapping:"cors:{type:object}"` // CORS configuration - Token string `json:"token,omitempty" elastic_mapping:"token:{type:keyword}"` // Token for authentication - Description string `json:"description,omitempty" elastic_mapping:"description:{type:keyword,copy_to:combined_fulltext}"` // Description of the embedding - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether the embedding is enabled -} - -type CorsConfig struct { - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether CORS is enabled - AllowedOrigins []string `json:"allowed_origins,omitempty" elastic_mapping:"allowed_origins:{type:keyword}"` // Allowed origins -} - -type AppearanceConfig struct { - Theme string `json:"theme,omitempty" elastic_mapping:"theme:{type:keyword}"` // Theme of the embedding -} -type AccessControlConfig struct { - Authentication bool `json:"authentication" elastic_mapping:"authentication:{type:keyword}"` // Whether authentication is required - ChatHistory bool `json:"chat_history" elastic_mapping:"chat_history:{type:keyword}"` // Whether chat history is enabled -} - -type ModuleConfig struct { - Search SearchModuleConfig `json:"search,omitempty" elastic_mapping:"search:{type:object}"` // Search configuration - AIChat AIChatModuleConfig `json:"ai_chat,omitempty" elastic_mapping:"ai_chat:{type:object}"` // AI Chat configuration - Features []string `json:"features,omitempty" elastic_mapping:"features:{type:keyword}"` // Features enabled -} - -type SearchModuleConfig struct { - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` - Datasource []string `json:"datasource,omitempty" elastic_mapping:"datasource:{type:keyword}"` // Datasource ID - Placeholder string `json:"placeholder,omitempty" elastic_mapping:"placeholder:{type:keyword}"` // Placeholder text for search input -} - -type AIChatModuleConfig struct { - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` - Placeholder string `json:"placeholder,omitempty" elastic_mapping:"placeholder:{type:keyword}"` // Placeholder text for search input - Assistants []string `json:"assistants,omitempty" elastic_mapping:"assistants:{type:keyword}"` // Assistant ID - StartPageSettings ChatStartPageConfig `json:"start_page_config,omitempty" elastic_mapping:"start_page_config:{type:object, enabled:false}"` // Start page settings -} - -// GetDatasourceByIntegration returns the datasource IDs that the integration is allowed to access -func GetDatasourceByIntegration(integrationID string) ([]string, bool, error) { - var items = []Integration{} - q := orm.Query{ - Size: 1, - Conds: orm.And(orm.Eq("id", integrationID), orm.Eq("enabled", true)), - } - err, _ := orm.SearchWithJSONMapper(&items, &q) - if err != nil { - return nil, false, err - } - if len(items) == 0 { - return nil, false, nil - } - var ret = make([]string, 0, len(items)) - for _, item := range items { - for _, datasourceID := range item.EnabledModule.Search.Datasource { - if datasourceID == "*" { - return nil, true, nil - } - ret = append(ret, datasourceID) - } - } - return ret, false, nil -} diff --git a/modules/common/mcp_server.go b/modules/common/mcp_server.go index 5cb4ba7a..537ea70c 100644 --- a/modules/common/mcp_server.go +++ b/modules/common/mcp_server.go @@ -5,59 +5,32 @@ package common import ( + "infini.sh/coco/core" "infini.sh/framework/core/orm" "time" ) -type MCPServer struct { - CombinedFullText - Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` - Description string `json:"description,omitempty" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` - Icon string `json:"icon,omitempty" elastic_mapping:"icon:{enabled:false}"` // Display name of this datasource - Type string `json:"type" elastic_mapping:"type:{type:keyword,copy_to:combined_fulltext}"` // possible values: "sse", "stdio", "streamable_http" - Category string `json:"category,omitempty" elastic_mapping:"category:{type:keyword,copy_to:combined_fulltext}"` - Tags []string `json:"tags,omitempty" elastic_mapping:"tags:{type:keyword}"` - - Config interface{} `json:"config,omitempty" elastic_mapping:"config:{enabled:false}"` - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:boolean}"` // Whether the connector is enabled or not -} - const StreamableHTTP = "streamable_http" const SSE = "sse" const Stdio = "stdio" -type SSEConfig struct { - URL string `json:"url" elastic_mapping:"url:{type:keyword}"` -} - -// StdioConfig is a struct for the standard input/output configuration -type StdioConfig struct { - Command string `json:"command"` // command to run, possible values: npx, uvx - Args []string `json:"args,omitempty"` // arguments to pass to the command - Env map[string]string `json:"env,omitempty"` // environment variables -} - -type StreamableHttpConfig struct { - URL string `json:"url" elastic_mapping:"url:{type:keyword}"` -} - const ( MCPServerCachePrimary = "mcp_server" MCPServerItemCacheKey = "mcp_server_item" EnabledMCPServerIDsCacheKey = "enabled_mcp_server_ids" ) -func GetMPCServer(id string) (*MCPServer, error) { +func GetMPCServer(id string) (*core.MCPServer, error) { item := GeneralObjectCache.Get(MCPServerItemCacheKey, id) - var server *MCPServer + var server *core.MCPServer if item != nil && !item.Expired() { var ok bool - if server, ok = item.Value().(*MCPServer); ok { + if server, ok = item.Value().(*core.MCPServer); ok { return server, nil } } - server = &MCPServer{} + server = &core.MCPServer{} server.ID = id _, err := orm.Get(server) if err != nil { @@ -84,7 +57,7 @@ func GetAllEnabledMCPServerIDs() ([]string, error) { } } // Cache is empty, read from database and cache the IDs - var server []MCPServer + var server []core.MCPServer q := orm.Query{ Conds: orm.And(orm.Eq("enabled", true)), } diff --git a/modules/common/model_provider.go b/modules/common/model_provider.go index fa50c036..2f17154f 100644 --- a/modules/common/model_provider.go +++ b/modules/common/model_provider.go @@ -5,39 +5,26 @@ package common import ( + "infini.sh/coco/core" "infini.sh/framework/core/orm" "time" ) -type ModelProvider struct { - CombinedFullText - - Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:combined_fulltext}"` // Name of the model provider - APIKey string `json:"api_key" elastic_mapping:"api_key:{type:keyword}"` // API key of the model provider - APIType string `json:"api_type" elastic_mapping:"api_type:{type:keyword}"` // API type of the model provider, possible values: openai,gemini, anthropic - Icon string `json:"icon" elastic_mapping:"icon:{enabled:false}"` // Icon of the model provider - Models []ModelConfig `json:"models" elastic_mapping:"models:{type:object,enabled:false}"` // Models provided by the model provider - BaseURL string `json:"base_url" elastic_mapping:"base_url:{enabled:false}"` // Base URL of the model provider - Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:keyword}"` // Whether the model provider is enabled - Builtin bool `json:"builtin" elastic_mapping:"builtin:{type:keyword}"` // Whether the model provider is builtin - Description string `json:"description" elastic_mapping:"description:{type:text,copy_to:combined_fulltext}"` // Description of the model provider -} - const ( ModelProviderCachePrimary = "model_provider" ) // GetModelProvider retrieves the model provider object from the cache or database. -func GetModelProvider(providerID string) (*ModelProvider, error) { +func GetModelProvider(providerID string) (*core.ModelProvider, error) { item := GeneralObjectCache.Get(ModelProviderCachePrimary, providerID) - var provider *ModelProvider + var provider *core.ModelProvider if item != nil && !item.Expired() { var ok bool - if provider, ok = item.Value().(*ModelProvider); ok { + if provider, ok = item.Value().(*core.ModelProvider); ok { return provider, nil } } - provider = &ModelProvider{} + provider = &core.ModelProvider{} provider.ID = providerID _, err := orm.Get(provider) if err != nil { diff --git a/modules/connector/connector.go b/modules/connector/connector.go index 0b97599d..2b7bf71d 100644 --- a/modules/connector/connector.go +++ b/modules/connector/connector.go @@ -5,6 +5,7 @@ package connector import ( + "infini.sh/coco/core" "infini.sh/framework/core/elastic" "infini.sh/framework/core/errors" "infini.sh/framework/core/security" @@ -18,7 +19,7 @@ import ( ) func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.Connector{} + var obj = &core.Connector{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -44,11 +45,14 @@ func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Connector{} + obj := core.Connector{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "connector") + exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { h.WriteJSON(w, util.MapStr{ @@ -65,8 +69,9 @@ func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter }, 200) } -func GetConnectorByID(id string) (*common.Connector, error) { - obj := common.Connector{} +// TODO cache +func GetConnectorByID(id string) (*core.Connector, error) { + obj := core.Connector{} obj.ID = id ctx := orm.NewContext() @@ -81,7 +86,7 @@ func GetConnectorByID(id string) (*common.Connector, error) { func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Connector{} + obj := core.Connector{} replace := h.GetBoolOrDefault(req, "replace", false) ctx := orm.NewContextWithParent(req.Context()) @@ -109,7 +114,7 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou create = &t } - obj = common.Connector{} + obj = core.Connector{} err = h.DecodeJSON(req, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -120,6 +125,8 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou obj.ID = id obj.Created = create obj.Builtin = builtin + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "connector") ctx.Refresh = orm.WaitForRefresh ctx.DirectReadAccess() //TODO platform permission, rather user level permission @@ -138,7 +145,7 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) delete(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Connector{} + obj := core.Connector{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -181,14 +188,18 @@ func (h *APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprou return } + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } + builder.EnableBodyBytes() ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Connector{}) + orm.WithModel(ctx, &core.Connector{}) ctx.Set(orm.ReadPermissionCheckingScope, []int{security.PermissionScopePlatform}) appConfig := common.AppConfig() - var connectors []common.Connector + var connectors []core.Connector itemMapFunc := func(source map[string]interface{}, targetRef interface{}) error { if !appConfig.ServerInfo.EncodeIconToBase64 { @@ -224,6 +235,9 @@ func (h *APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprou return nil } + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "connector") + err, res := elastic.SearchV2WithResultItemMapper(ctx, &connectors, builder, itemMapFunc) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) diff --git a/modules/connector/init.go b/modules/connector/init.go index 967d8814..47f34481 100644 --- a/modules/connector/init.go +++ b/modules/connector/init.go @@ -6,7 +6,6 @@ package connector import ( "infini.sh/coco/core" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" "infini.sh/framework/core/security" ) @@ -35,10 +34,10 @@ func init() { api.HandleUIMethod(api.PUT, "/connector/:id", handler.update, api.RequirePermission(updatePermission)) api.HandleUIMethod(api.DELETE, "/connector/:id", handler.delete, api.RequirePermission(deletePermission)) - api.HandleUIMethod(api.OPTIONS, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(filter.FeatureCORS), - api.Feature(filter.FeatureMaskSensitiveField)) - api.HandleUIMethod(api.POST, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(filter.FeatureCORS), - api.Feature(filter.FeatureMaskSensitiveField)) + api.HandleUIMethod(api.OPTIONS, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(core.FeatureCORS), + api.Feature(core.FeatureMaskSensitiveField)) + api.HandleUIMethod(api.POST, "/connector/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(core.FeatureCORS), + api.Feature(core.FeatureMaskSensitiveField)) } diff --git a/modules/connector/service.go b/modules/connector/service.go new file mode 100644 index 00000000..6800e13f --- /dev/null +++ b/modules/connector/service.go @@ -0,0 +1,40 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package connector + +import ( + "errors" + "infini.sh/coco/core" + "infini.sh/framework/core/orm" + "infini.sh/framework/core/util" + ccache "infini.sh/framework/lib/cache" + "time" +) + +var connectorCacheKey = "Datasource" +var configCache = ccache.Layered(ccache.Configure().MaxSize(10000).ItemsToPrune(100)) + +func GetConnectorConfig(id string) (*core.Connector, error) { + v := configCache.Get(connectorCacheKey, id) + if v != nil { + if !v.Expired() { + x, ok := v.Value().(*core.Connector) + if ok && x != nil { + return x, nil + } + } + } + + obj := core.Connector{} + obj.ID = id + + exists, err := orm.Get(&obj) + if err == nil && exists { + configCache.Set(connectorCacheKey, id, &obj, util.GetDurationOrDefault("30m", time.Duration(30)*time.Minute)) + return &obj, nil + } + + return nil, errors.New("not found") +} diff --git a/modules/datasource/datasource.go b/modules/datasource/datasource.go index ac435f6e..8409a43b 100644 --- a/modules/datasource/datasource.go +++ b/modules/datasource/datasource.go @@ -15,7 +15,7 @@ import ( ) func (h *APIHandler) createDatasource(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.DataSource{} + var obj = &core.DataSource{} h.MustDecodeJSON(req, obj) if obj.Type == "connector" { @@ -26,7 +26,7 @@ func (h *APIHandler) createDatasource(w http.ResponseWriter, req *http.Request, ctx := orm.NewContextWithParent(req.Context()) //check connector - connector := common.Connector{} + connector := core.Connector{} connector.ID = obj.Connector.ConnectorID exists, err := orm.GetV2(ctx, &connector) if !exists || err != nil { @@ -58,7 +58,7 @@ func (h *APIHandler) createDatasource(w http.ResponseWriter, req *http.Request, func (h *APIHandler) deleteDatasource(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.DataSource{} + obj := core.DataSource{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) ctx.Refresh = orm.WaitForRefresh @@ -92,7 +92,7 @@ func (h *APIHandler) deleteDatasource(w http.ResponseWriter, req *http.Request, builder.Filter(orm.TermQuery("source.id", id)) ctx1 := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx1, &common.Document{}) + orm.WithModel(ctx1, &core.Document{}) _, err = orm.DeleteByQuery(ctx1, builder) if err != nil { @@ -111,9 +111,12 @@ func (h *APIHandler) deleteDatasource(w http.ResponseWriter, req *http.Request, func (h *APIHandler) getDatasource(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.DataSource{} + obj := core.DataSource{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "datasource") + ctx.Set(orm.SharingCategoryCheckingChildrenEnabled, true) exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { @@ -140,7 +143,7 @@ func (h *APIHandler) updateDatasource(w http.ResponseWriter, req *http.Request, replace := h.GetBoolOrDefault(req, "replace", false) var err error - obj := common.DataSource{} + obj := core.DataSource{} err = h.DecodeJSON(req, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -151,6 +154,8 @@ func (h *APIHandler) updateDatasource(w http.ResponseWriter, req *http.Request, obj.ID = id ctx := orm.NewContextWithParent(req.Context()) ctx.Refresh = orm.WaitForRefresh + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "datasource") if replace { err = orm.Upsert(ctx, &obj) @@ -173,7 +178,7 @@ func (h *APIHandler) updateDatasource(w http.ResponseWriter, req *http.Request, }, 200) } -func GetDatasourceByID(id []string) ([]common.DataSource, error) { +func GetDatasourceByID(id []string) ([]core.DataSource, error) { var err error q := orm.Query{} q.RawQuery, err = core.RewriteQueryWithFilter(q.RawQuery, util.MapStr{ @@ -182,7 +187,7 @@ func GetDatasourceByID(id []string) ([]common.DataSource, error) { }, }) - docs := []common.DataSource{} + docs := []core.DataSource{} err, _ = orm.SearchWithJSONMapper(&docs, &q) if err != nil { return nil, err @@ -204,27 +209,14 @@ func (h *APIHandler) searchDatasource(w http.ResponseWriter, req *http.Request, builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) } - //attach filter for cors request - if integrationID := req.Header.Get(core.HeaderIntegrationID); integrationID != "" { - // get datasource by api token - datasourceIDs, hasAll, err := common.GetDatasourceByIntegration(integrationID) - if err != nil { - panic(err) - } - if !hasAll { - if len(datasourceIDs) == 0 { - // return empty search result when no datasource found - h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) - return - } - builder.Must(orm.TermsQuery("id", datasourceIDs)) - } - } - ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.DataSource{}) - docs := []common.DataSource{} + orm.WithModel(ctx, &core.DataSource{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "datasource") + ctx.Set(orm.SharingCategoryCheckingChildrenEnabled, true) + + docs := []core.DataSource{} err, res := elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) if err != nil { @@ -239,7 +231,7 @@ func (h *APIHandler) searchDatasource(w http.ResponseWriter, req *http.Request, } func (h *APIHandler) createDocInDatasource(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.Document{} + var obj = &core.Document{} err := h.DecodeJSON(req, obj) if err != nil { panic(err) @@ -247,7 +239,7 @@ func (h *APIHandler) createDocInDatasource(w http.ResponseWriter, req *http.Requ //TODO cache for speed datasourceID := ps.MustGetParameter("id") - datasourceObj := common.DataSource{} + datasourceObj := core.DataSource{} datasourceObj.ID = datasourceID ctx := orm.NewContextWithParent(req.Context()) @@ -257,7 +249,7 @@ func (h *APIHandler) createDocInDatasource(w http.ResponseWriter, req *http.Requ } //replace datasource info - sourceRefer := common.DataSourceReference{} + sourceRefer := core.DataSourceReference{} sourceRefer.ID = datasourceObj.ID sourceRefer.Type = datasourceObj.Type sourceRefer.Name = datasourceObj.Name @@ -278,7 +270,7 @@ func (h *APIHandler) createDocInDatasource(w http.ResponseWriter, req *http.Requ } func (h *APIHandler) createDocInDatasourceWithID(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.Document{} + var obj = &core.Document{} err := h.DecodeJSON(req, obj) if err != nil { panic(err) @@ -288,7 +280,7 @@ func (h *APIHandler) createDocInDatasourceWithID(w http.ResponseWriter, req *htt datasourceID := ps.MustGetParameter("id") docID := ps.MustGetParameter("doc_id") obj.ID = docID - datasourceObj := common.DataSource{} + datasourceObj := core.DataSource{} datasourceObj.ID = datasourceID ctx := orm.NewContextWithParent(req.Context()) @@ -298,7 +290,7 @@ func (h *APIHandler) createDocInDatasourceWithID(w http.ResponseWriter, req *htt } //replace datasource info - sourceRefer := common.DataSourceReference{} + sourceRefer := core.DataSourceReference{} sourceRefer.ID = datasourceObj.ID sourceRefer.Type = datasourceObj.Type sourceRefer.Name = datasourceObj.Name diff --git a/modules/datasource/init.go b/modules/datasource/init.go index e76ffea8..81161aa9 100644 --- a/modules/datasource/init.go +++ b/modules/datasource/init.go @@ -7,7 +7,6 @@ package datasource import ( "infini.sh/coco/core" "infini.sh/coco/modules/document" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" "infini.sh/framework/core/security" ) @@ -38,19 +37,19 @@ func init() { api.HandleUIMethod(api.DELETE, "/datasource/:id", handler.deleteDatasource, api.RequirePermission(deletePermission)) api.HandleUIMethod(api.GET, "/datasource/:id", handler.getDatasource, api.RequirePermission(readPermission)) api.HandleUIMethod(api.PUT, "/datasource/:id", handler.updateDatasource, api.RequirePermission(updatePermission)) - api.HandleUIMethod(api.OPTIONS, "/datasource/_search", handler.searchDatasource, api.RequirePermission(searchPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/datasource/_search", handler.searchDatasource, api.RequirePermission(searchPermission), api.Feature(core.FeatureCORS)) var secretKeys = map[string]bool{} secretKeys["config"] = true api.HandleUIMethod(api.GET, "/datasource/_search", handler.searchDatasource, api.RequirePermission(searchPermission), - api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureMaskSensitiveField), api.Feature(filter.FeatureRemoveSensitiveField), - api.Label(filter.SensitiveFields, secretKeys)) + api.Feature(core.FeatureCORS), api.Feature(core.FeatureMaskSensitiveField), api.Feature(core.FeatureRemoveSensitiveField), + api.Label(core.SensitiveFields, secretKeys)) api.HandleUIMethod(api.POST, "/datasource/_search", handler.searchDatasource, api.RequirePermission(searchPermission), - api.Feature(filter.FeatureCORS), - api.Feature(filter.FeatureMaskSensitiveField), - api.Feature(filter.FeatureRemoveSensitiveField), - api.Label(filter.SensitiveFields, secretKeys)) + api.Feature(core.FeatureCORS), + api.Feature(core.FeatureMaskSensitiveField), + api.Feature(core.FeatureRemoveSensitiveField), + api.Label(core.SensitiveFields, secretKeys)) //shortcut to indexing docs into this datasource api.HandleUIMethod(api.POST, "/datasource/:id/_doc", handler.createDocInDatasource, api.RequirePermission(createPermission)) diff --git a/modules/document/document.go b/modules/document/document.go index 7d7fbf1d..acdd1ef9 100644 --- a/modules/document/document.go +++ b/modules/document/document.go @@ -6,16 +6,17 @@ package document import ( log "github.com/cihub/seelog" + "infini.sh/coco/core" "infini.sh/coco/modules/common" + "infini.sh/coco/modules/connector" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/orm" "infini.sh/framework/core/util" "net/http" - "path" ) func (h *APIHandler) createDoc(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.Document{} + var obj = &core.Document{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -30,20 +31,17 @@ func (h *APIHandler) createDoc(w http.ResponseWriter, req *http.Request, ps http return } - h.WriteJSON(w, util.MapStr{ - "_id": obj.ID, - "result": "created", - }, 200) - + h.WriteCreatedOKJSON(w, obj.ID) } func (h *APIHandler) getDoc(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("doc_id") - obj := common.Document{} + obj := core.Document{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) - + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "document") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { h.WriteJSON(w, util.MapStr{ @@ -64,7 +62,7 @@ func (h *APIHandler) updateDoc(w http.ResponseWriter, req *http.Request, ps http id := ps.MustGetParameter("doc_id") ctx := orm.NewContextWithParent(req.Context()) - obj := common.Document{} + obj := core.Document{} err := h.DecodeJSON(req, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -74,6 +72,17 @@ func (h *APIHandler) updateDoc(w http.ResponseWriter, req *http.Request, ps http //protect obj.ID = id ctx.Refresh = orm.WaitForRefresh + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "document") + + //update share context + ctx.Set(orm.SharingCheckingResourceCategoryEnabled, true) + ctx.Set(orm.SharingResourceCategoryType, "datasource") + ctx.Set(orm.SharingResourceCategoryFilterField, "source.id") + ctx.Set(orm.SharingResourceCategoryID, obj.Source.ID) + ctx.Set(orm.SharingResourceParentPath, obj.Category) + ctx.Set(orm.SharingCheckingInheritedRulesEnabled, true) + err = orm.Save(ctx, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -86,7 +95,7 @@ func (h *APIHandler) updateDoc(w http.ResponseWriter, req *http.Request, ps http func (h *APIHandler) deleteDoc(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("doc_id") - obj := common.Document{} + obj := core.Document{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -108,65 +117,82 @@ func (h *APIHandler) searchDocs(w http.ResponseWriter, req *http.Request, ps htt return } builder.EnableBodyBytes() + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } ctx := orm.NewContextWithParent(req.Context()) - - //TODO cache + view := h.GetParameter(req, "view") + //view := "list" sourceIDs := builder.GetFilterValues("source.id") + pathHierarchy := false + //apply datasource filter //TODO datasource may support multi ids if len(sourceIDs) == 1 { + ctx1 := orm.NewContext() + ctx1.DirectReadAccess() sourceIDArray, ok := sourceIDs[0].([]interface{}) - if ok && len(sourceIDArray) == 1 { + if ok { sourceID, ok := sourceIDArray[0].(string) if ok { - if sourceID != "" { - ds := common.DataSource{} - ds.ID = sourceID - exists, err := orm.GetV2(ctx, &ds) - if !exists || err != nil { - panic("invalid datasource") - } - - conn := common.Connector{} - conn.ID = ds.Connector.ConnectorID - exists, err = orm.GetV2(ctx, &conn) - if !exists || err != nil { - panic("invalid connector") + ds, err := common.GetDatasourceConfig(ctx1, sourceID) + if err != nil { + panic(err) + } + if ds != nil { + conn, err := connector.GetConnectorByID(ds.Connector.ConnectorID) + if err != nil { + panic(err) } if conn.PathHierarchy { pathHierarchy = true } + + ctx.Set(orm.SharingCheckingResourceCategoryEnabled, true) + ctx.Set(orm.SharingResourceCategoryType, "datasource") + ctx.Set(orm.SharingResourceCategoryFilterField, "source.id") + ctx.Set(orm.SharingResourceCategoryID, ds.ID) } } } } - if pathHierarchy { - pathFilterStr := h.GetParameter(req, "path") - if pathFilterStr != "" { - array := []string{} - err = util.FromJson(pathFilterStr, &array) - if err != nil { - panic(err) - } - if len(array) > 0 { - pathStr := path.Join(array...) - if pathStr != "" { - if !util.PrefixStr(pathStr, "/") { - pathStr = "/" + pathStr - } - } - builder.Filter(orm.TermQuery("_system.parent_path", pathStr)) - log.Trace("adding path hierarchy filter: ", pathStr) - } - } else { - //if connector enabled path hierarchy, the default path filter is / - builder.Filter(orm.TermQuery("_system.parent_path", "/")) - log.Trace("adding path hierarchy filter: /") + //TODO cache + var pathStr = "/" + pathFilterStr := h.GetParameter(req, "path") + if pathFilterStr != "" { + array := []string{} + err = util.FromJson(pathFilterStr, &array) + if err != nil { + panic(err) + } + if len(array) > 0 { + pathStr = common.GetFullPathForCategories(array) + //builder.Filter(orm.TermQuery("_system.parent_path", pathStr)) + //log.Trace("adding path hierarchy filter: ", pathStr) + //ctx.Set(orm.SharingResourceParentPath, pathStr) + } + } + + //path str + if view != "list" && pathHierarchy && pathStr != "" { + builder.Filter(orm.TermQuery("_system.parent_path", pathStr)) + log.Trace("adding path hierarchy filter: ", pathStr) + ctx.Set(orm.SharingResourceParentPath, pathStr) + } else { + //apply path filter to list view too + if pathStr != "/" { + builder.Filter(orm.TermQuery("_system.parent_path", pathStr)) + log.Trace("adding path hierarchy filter: ", pathStr) + ctx.Set(orm.SharingResourceParentPath, pathStr) } } - orm.WithModel(ctx, &common.Document{}) + orm.WithModel(ctx, &core.Document{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "document") + ctx.Set(orm.SharingCheckingInheritedRulesEnabled, true) + res, err := orm.SearchV2(ctx, builder) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -201,7 +227,7 @@ func (h *APIHandler) batchDeleteDoc(w http.ResponseWriter, req *http.Request, ps builder.Filter(orm.TermsQuery("id", ids)) ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Document{}) + orm.WithModel(ctx, &core.Document{}) _, err = orm.DeleteByQuery(ctx, builder) if err != nil { diff --git a/modules/document/init.go b/modules/document/init.go index 40550de3..93804abe 100644 --- a/modules/document/init.go +++ b/modules/document/init.go @@ -5,6 +5,7 @@ package document import ( + "infini.sh/coco/core" "infini.sh/framework/core/api" "infini.sh/framework/core/security" ) @@ -15,6 +16,9 @@ type APIHandler struct { const Category = "coco" const Resource = "document" +const Search = "search" +const Assistant = "assistant" +const QuickAISearchAction = "quick_ai_access" func init() { handler := APIHandler{} @@ -33,4 +37,19 @@ func init() { api.HandleUIMethod(api.DELETE, "/document/:doc_id", handler.deleteDoc, api.RequirePermission(deletePermission)) api.HandleUIMethod(api.GET, "/document/_search", handler.searchDocs, api.RequirePermission(searchPermission)) api.HandleUIMethod(api.DELETE, "/document/", handler.batchDeleteDoc, api.RequirePermission(deletePermission)) + + querySearchPermission := security.GetSimplePermission(Category, Search, string(security.Search)) + assistantSearchPermission := security.GetSimplePermission(Category, Assistant, string(QuickAISearchAction)) + security.GetOrInitPermissionKeys(querySearchPermission, assistantSearchPermission) + security.AssignPermissionsToRoles(querySearchPermission, core.WidgetRole) + + api.HandleUIMethod(api.OPTIONS, "/query/_search", handler.search, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/query/_search", handler.search, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.POST, "/query/_search", handler.search, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + + api.HandleUIMethod(api.GET, "/query/_suggest", handler.suggest, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/query/_suggest", handler.suggest, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/query/_recommend", handler.recommend, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/query/_recommend", handler.recommend, api.RequirePermission(querySearchPermission), api.Feature(core.FeatureCORS)) + } diff --git a/modules/document/recommend.go b/modules/document/recommend.go new file mode 100644 index 00000000..58772aaa --- /dev/null +++ b/modules/document/recommend.go @@ -0,0 +1,61 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package document + +import ( + "infini.sh/coco/core" + httprouter "infini.sh/framework/core/api/router" + "net/http" +) + +func (h APIHandler) recommend(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { + // Parse the request body + var recommendReq core.RecommendRequest + if err := h.DecodeJSON(req, &recommendReq); err != nil { + http.Error(w, "Invalid request body", http.StatusBadRequest) + return + } + + // Placeholder: Generate some recommendations based on the request (in a real scenario, this would query a recommendation engine) + recommendations := []core.RecommendEntityCard{ + { + Title: "Introduction to AI", + Description: "A comprehensive guide to artificial intelligence.", + Score: 0.98, + URL: "https://example.com/entity_101", + Category: "Technology", + Breadcrumbs: []core.Link{ + {Name: "Tech", URL: "/category/tech"}, + {Name: "AI", URL: "/category/ai"}, + }, + }, + { + Title: "Data Science for Beginners", + Description: "Learn the basics of data science with this beginner's guide.", + Score: 0.93, + URL: "https://example.com/entity_202", + Category: "Science", + Breadcrumbs: []core.Link{ + {Name: "Science", URL: "/category/science"}, + {Name: "Data Science", URL: "/category/data-science"}, + }, + }, + } + + // Limit the number of recommendations based on the request + if recommendReq.NumRecommendations > 0 && len(recommendations) > recommendReq.NumRecommendations { + recommendations = recommendations[:recommendReq.NumRecommendations] + } + + // Create the response + response := core.RecommendResponse{ + UserID: recommendReq.UserID, + Recommendations: recommendations, + Total: len(recommendations), + } + + h.WriteJSON(w, response, 200) + +} diff --git a/modules/document/search.go b/modules/document/search.go new file mode 100644 index 00000000..d89b2a7b --- /dev/null +++ b/modules/document/search.go @@ -0,0 +1,421 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package document + +import ( + "context" + "fmt" + "infini.sh/coco/core" + "infini.sh/coco/modules/common" + "infini.sh/coco/modules/connector" + "infini.sh/framework/core/api" + httprouter "infini.sh/framework/core/api/router" + "infini.sh/framework/core/elastic" + "infini.sh/framework/core/orm" + "infini.sh/framework/core/security" + "infini.sh/framework/core/util" + "net/http" + "strings" +) + +func (h APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { + + var ( + query = h.GetParameterOrDefault(req, "query", "") + datasource = h.GetParameterOrDefault(req, "datasource", "") + category = h.GetParameterOrDefault(req, "category", "") + subcategory = h.GetParameterOrDefault(req, "subcategory", "") + richCategory = h.GetParameterOrDefault(req, "rich_category", "") + ) + + query = util.CleanUserQuery(query) + + //try to collect assistants + if query != "" { + builder, err := orm.NewQueryBuilderFromRequest(req) + + if err != nil { + panic(err) + } + builder.EnableBodyBytes() + + reqUser := security.MustGetUserFromRequest(req) + //userID := reqUser.MustGetUserID() + integrationID := req.Header.Get(core.HeaderIntegrationID) + //log.Error("integrationID:", integrationID) + + docs1, resp, err := QueryDocumentsAndFilter(req.Context(), reqUser, builder, integrationID, query, datasource, category, subcategory, richCategory) + //log.Error(docs1, total, err) + if err != nil { + panic(err) + } + + size := h.GetIntOrDefault(req, "size", 10) + assistantSearchPermission := security.GetSimplePermission(Category, Assistant, string(QuickAISearchAction)) + perID := security.GetOrInitPermissionKey(assistantSearchPermission) + + //not for widget integration + if integrationID == "" && ((reqUser.Roles != nil && util.AnyInArrayEquals(reqUser.Roles, security.RoleAdmin)) || reqUser.UserAssignedPermission.ValidateFor(perID)) { + assistantSize := 2 + if len(docs1) < 5 { + assistantSize = size - (len(docs1)) + } + + assistants := searchAssistant(req, query, assistantSize) + if len(assistants) > 0 { + for _, assistant := range assistants { + doc := core.Document{} + doc.ID = assistant.ID + doc.Type = "AI Assistant" + doc.Icon = assistant.Icon + doc.Title = assistant.Name + doc.Summary = assistant.Description + doc.URL = fmt.Sprintf("coco://extenstions/infinilabs/ask_assistant/%v", assistant.ID) + doc.Source = core.DataSourceReference{ + ID: "assistant", + Name: "Assistant", + Icon: "font_robot", + } + //newHit := IndexDocument{Index: "assistant", ID: assistant.ID, Source: doc, Score: v2.Hits.MaxScore + 500} + newHit := elastic.DocumentWithMeta[core.Document]{ + ID: assistant.ID, + Index: "assistant", + Source: doc, + } + docs1 = append(docs1, newHit) + } + } + } + + result := elastic.SearchResponseWithMeta[core.Document]{} + util.FromJSONBytes(resp.Raw, &result) + + result.Hits.Hits = docs1 + result.Hits.Total = util.MapStr{ + "value": resp.Total, + "relation": "eq", + } + + api.WriteJSON(w, result, 200) + } else { + h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) + //api.WriteError(w,"query is empty",400) + } +} + +func RefineIcon(ctx context.Context, doc *core.Document) { + ctx1 := orm.NewContextWithParent(ctx) + ctx1.DirectReadAccess() + // Get the pointer to doc.Source to make sure you're modifying the original + datasourceConfig, err := common.GetDatasourceConfig(ctx1, doc.Source.ID) + if err == nil && datasourceConfig != nil && datasourceConfig.Connector.ConnectorID != "" { + connectorConfig, err := connector.GetConnectorConfig(datasourceConfig.Connector.ConnectorID) + + if connectorConfig != nil && err == nil { + icon := common.ParseAndGetIcon(connectorConfig, doc.Source.Icon) + if icon != "" { + doc.Source.Icon = icon + } + + if doc.Source.Icon != "" { + icon = common.ParseAndGetIcon(connectorConfig, doc.Source.Icon) + if icon != "" { + doc.Source.Icon = icon + } + } else { + //try datasource's icon + if datasourceConfig.Icon != "" { + icon = common.ParseAndGetIcon(connectorConfig, datasourceConfig.Icon) + if icon != "" { + doc.Source.Icon = icon + } + } else { + //try connector's icon + icon = common.ParseAndGetIcon(connectorConfig, connectorConfig.Icon) + if icon != "" { + doc.Source.Icon = icon + } + } + } + } + } +} + +func searchAssistant(req *http.Request, query string, size int) []core.Assistant { + docs := []core.Assistant{} + if size <= 0 { + size = 2 + } + + //handle url query args, convert to query builder + builder, err := orm.NewQueryBuilderFromRequest(req, "name", "combined_fulltext") + if err != nil { + return docs + } + builder.Query(query) + builder.Must(orm.TermQuery("enabled", true)) + builder.Size(size) + + ctx := orm.NewContextWithParent(req.Context()) + orm.WithModel(ctx, &core.Assistant{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "assistant") + err, _ = elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) + if err != nil { + return docs + } + + return docs +} + +func BuildTemplatedQuery(from int, size int, mustClauses []interface{}, shouldClauses interface{}, field string, query string, source string, tags string) *orm.Query { + templatedQuery := orm.TemplatedQuery{} + templatedQuery.TemplateID = "coco-query-string" + if shouldClauses != nil { + templatedQuery.TemplateID = "coco-query-string-extra-should" + } + + templatedQuery.Parameters = util.MapStr{ + "from": from, + "size": size, + "must_clauses": mustClauses, + "extra_should_clauses": shouldClauses, + "field": field, + "query": query, + "source": strings.Split(source, ","), + "tags": strings.Split(tags, ","), + } + q := orm.Query{} + q.TemplatedQuery = &templatedQuery + return &q +} + +func BuildDatasourceClause(datasource string, filterDisabled bool) interface{} { + var datasourceClause interface{} + if datasource != "" { + if strings.Contains(datasource, ",") { + arr := strings.Split(datasource, ",") + datasourceClause = map[string]interface{}{ + "terms": map[string]interface{}{ + "source.id": arr, + }, + } + } else { + datasourceClause = map[string]interface{}{ + "term": map[string]interface{}{ + "source.id": datasource, + }, + } + } + } + if !filterDisabled { + return datasourceClause + } + + disabledIDs, err := common.GetDisabledDatasourceIDs() + if err != nil { + panic(err) + } + if len(disabledIDs) == 0 { + return datasourceClause + } + mustNot := map[string]interface{}{ + "terms": map[string]interface{}{ + "source.id": disabledIDs, + }, + } + if datasourceClause == nil { + return map[string]interface{}{ + "bool": map[string]interface{}{ + "must_not": mustNot, + }, + } + } + return map[string]interface{}{ + "bool": map[string]interface{}{ + "must_not": mustNot, + "must": datasourceClause, + }, + } +} + +func BuildMustFilterClauses(category string, subcategory string, richCategory string, username string, userid string) []interface{} { + mustClauses := []interface{}{} + + // Check and add conditions to mustClauses + + if category != "" { + mustClauses = append(mustClauses, map[string]interface{}{ + "term": map[string]interface{}{ + "category": category, + }, + }) + } + + if subcategory != "" { + mustClauses = append(mustClauses, map[string]interface{}{ + "term": map[string]interface{}{ + "subcategory": subcategory, + }, + }) + } + + if richCategory != "" { + mustClauses = append(mustClauses, map[string]interface{}{ + "term": map[string]interface{}{ + "rich_categories.key": richCategory, + }, + }) + } + + if username != "" { + mustClauses = append(mustClauses, map[string]interface{}{ + "term": map[string]interface{}{ + "owner.username": username, + }, + }) + } + + if userid != "" { + mustClauses = append(mustClauses, map[string]interface{}{ + "term": map[string]interface{}{ + "owner.userid": userid, + }, + }) + } + return mustClauses +} + +func BuildFilters(category string, subcategory string, richCategory string) []*orm.Clause { + mustClauses := []*orm.Clause{} + + if category != "" { + mustClauses = append(mustClauses, orm.TermQuery("category", category)) + } + + if subcategory != "" { + mustClauses = append(mustClauses, orm.TermQuery("subcategory", subcategory)) + } + + if richCategory != "" { + mustClauses = append(mustClauses, orm.TermQuery("rich_categories.key", richCategory)) + } + + return mustClauses +} + +// GetDatasourceByIntegration returns the datasource IDs that the integration is allowed to access +func GetDatasourceByIntegration(integrationID string) ([]string, bool, error) { + var items = []core.Integration{} + q := orm.Query{ + Size: 1, + Conds: orm.And(orm.Eq("id", integrationID), orm.Eq("enabled", true)), + } + err, _ := orm.SearchWithJSONMapper(&items, &q) + if err != nil { + return nil, false, err + } + if len(items) == 0 { + return nil, false, nil + } + var ret = make([]string, 0, len(items)) + for _, item := range items { + for _, datasourceID := range item.EnabledModule.Search.Datasource { + if datasourceID == "*" { + return nil, true, nil + } + ret = append(ret, datasourceID) + } + } + return ret, false, nil +} + +func BuildDatasourceFilter(userID string, sharedDatasources []string, queryDatasourceIDs []string, integrationID string, filterDisabled bool) ([]string, []*orm.Clause) { + + //log.Error("userID:", userID, ",queryDatasource:", queryDatasourceIDs, ",integrationID:", integrationID) + + finalDatasourceIDs := []string{} + if integrationID != "" { + // get queryDatasource by integration id + datasourceIDs, hasAll, err := GetDatasourceByIntegration(integrationID) + if err != nil { + panic(err) + } + finalDatasourceIDs = datasourceIDs + if !hasAll { + if len(datasourceIDs) == 0 { + // return empty search result when no queryDatasource found + panic("integration datasource is empty") + } + // update queryDatasource filter + //if queryDatasource == "" { + // queryDatasource = strings.Join(datasourceIDs, ",") + //} else { + // calc intersection with queryDatasource and datasourceIDs + //queryDatasource = util.StringArrayIntersection(queryDatasourceIDs, datasourceIDs) + //if len(queryDatasource) == 0 { + // // return empty search result when intersection queryDatasource ids is empty + // panic("queryDatasource is empty") + //} + //finalDatasourceIDs = queryDatasource + //queryDatasource = strings.Join(queryDatasource, ",") + //} + } else { + //user is select all queryDatasource + finalDatasourceIDs = common.GetUsersOwnDatasource(userID) + } + } else { + //if queryDatasource == "" || util.ContainStr(queryDatasource, "*") { + //user is select all queryDatasource + finalDatasourceIDs = common.GetUsersOwnDatasource(userID) + //} else { + // queryDatasource := strings.Split(queryDatasource, ",") + // finalDatasourceIDs = queryDatasource + //} + } + + if len(queryDatasourceIDs) > 0 { + //only merge if the query are specify datasources + finalDatasourceIDs = append(finalDatasourceIDs, sharedDatasources...) + finalDatasourceIDs = util.StringArrayIntersection(queryDatasourceIDs, finalDatasourceIDs) + } + + //datasourceClause := BuildDatasourceClause(queryDatasource, true) + //if datasourceClause != nil { + // mustClauses = append(mustClauses, datasourceClause) + //} + + mustClauses := []*orm.Clause{} + if len(finalDatasourceIDs) > 0 { + //log.Error("HIT finalDatasourceIDs:", finalDatasourceIDs) + //mergedArray := []string{} + //mergedArray = append(finalDatasourceIDs, sharedDatasources...) + mustClauses = append(mustClauses, orm.TermsQuery("source.id", finalDatasourceIDs)) + } + + //if queryDatasource != "" { + // if strings.Contains(queryDatasource, ",") { + // arr := strings.Split(queryDatasource, ",") + // mustClauses = append(mustClauses, orm.TermsQuery("source.id", arr)) + // } else { + // mustClauses = append(mustClauses, orm.TermQuery("source.id", queryDatasource)) + // } + //} + if !filterDisabled { + return finalDatasourceIDs, mustClauses + } + + disabledIDs, err := common.GetDisabledDatasourceIDs() + if err != nil { + panic(err) + } + + //TODO verify this filter + if len(disabledIDs) > 0 { + mustClauses = append(mustClauses, orm.MustNotQuery(orm.TermsQuery("source.id", disabledIDs))) + } + + return finalDatasourceIDs, mustClauses +} diff --git a/modules/document/service.go b/modules/document/service.go new file mode 100644 index 00000000..16511066 --- /dev/null +++ b/modules/document/service.go @@ -0,0 +1,356 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package document + +import ( + "context" + log "github.com/cihub/seelog" + "infini.sh/coco/core" + "infini.sh/framework/core/elastic" + "infini.sh/framework/core/orm" + "infini.sh/framework/core/security" + "infini.sh/framework/core/util" + orm2 "infini.sh/framework/plugins/enterprise/security/orm" + "infini.sh/framework/plugins/enterprise/security/share" + "strings" +) + +func QueryDocuments(ctx1 context.Context, userID string, builder *orm.QueryBuilder, query string, datasource, integrationID, category, subcategory, richCategory string) ([]core.Document, *orm.SimpleResult, error) { + + //log.Error("old datasource:", datasource, ",integrationID:", integrationID) + + builder.Query(query) + builder.DefaultQueryField("title.keyword^100", "title^10", "title.pinyin^4", "combined_fulltext") + builder.Exclude("payload.*") + + filters := BuildFilters(category, subcategory, richCategory) + + //resource level share rules, get other user's shared for this user //TODO, get parent datasource by doc level sharing rules + //rules, err := sharingService.GetDirectResourceRulesByResourceTypeAndUserID(userID, "datasource", userOwnDatasourceIDs, share.View) + rules, err := sharingService.GetDirectResourceRulesByResourceTypeAndUserID(userID, "datasource", nil, share.View) + if err != nil { + panic(err) + } + //log.Error("rules: ", util.ToJson(rules, true)) + checkingScopeDatasources := []string{} + fullAccessSharedDatasources := []string{} + for _, rule := range rules { + fullAccessSharedDatasources = append(fullAccessSharedDatasources, rule.ResourceID) + checkingScopeDatasources = append(checkingScopeDatasources, rule.ResourceID) + } + //log.Error("fullAccessSharedDatasources: ", fullAccessSharedDatasources) + + rules, err = sharingService.GetAllCategoryVisibleWithChildrenSharedObjects(userID, "datasource") + for _, rule := range rules { + checkingScopeDatasources = append(checkingScopeDatasources, rule.ResourceCategoryID) + } + //log.Error("AGAIN checkingScopeDatasources: ", checkingScopeDatasources) + + //var mergedDatasourceIDS []string + + //get all directly assigned rules assign to document level + queryDatasourceIDs := []string{} + if datasource == "" || util.ContainStr(datasource, "*") { + //return finalDatasourceIDs + //queryDatasourceIDs + } else { + queryDatasourceIDs = strings.Split(datasource, ",") + } + + //(user own datasource + shared datasource) intersect query datasource + //if datasource != "" && !util.ContainStr(datasource, "*") { + mergedDatasourceIDS, datasourceFilter := BuildDatasourceFilter(userID, checkingScopeDatasources, queryDatasourceIDs, integrationID, true) + if datasourceFilter != nil { + filters = append(filters, datasourceFilter...) + } + //mergedDatasourceIDS = ds1 + log.Trace("AAA checkingScopeDatasources:", checkingScopeDatasources, "new mergedDatasourceIDS:", mergedDatasourceIDS, ",integrationID:", integrationID) + //} + + //if len(mergedDatasourceIDS) == 0 { + // panic("no datasources allow to access") + //} + + //filter enabled doc + filters = append(filters, orm.BoolQuery(orm.Should, orm.TermQuery("disabled", false), orm.MustNotQuery(orm.ExistsQuery("disabled"))).Parameter("minimum_should_match", 1)) + + builder.Filter(filters...) + + log.Trace("queryDatasourceIDs:", queryDatasourceIDs) + + rules, err = sharingService.GetDirectResourceRulesByResourceCategoryAndUserID(userID, "document", "datasource", checkingScopeDatasources, share.None) + if err != nil { + panic(err) + } + log.Trace("doc rules:", util.ToJson(rules, true)) + allowdDocs := []string{} + deniedDocs := []string{} + for _, rule := range rules { + if rule.Permission > share.None { + allowdDocs = append(allowdDocs, rule.ResourceID) + } else { + deniedDocs = append(deniedDocs, rule.ResourceID) + } + } + + shouldClauses := []*orm.Clause{} + shouldClauses = append(shouldClauses, orm.TermQuery(orm2.SystemOwnerQueryField, userID)) //user is the owner + + if len(fullAccessSharedDatasources) > 0 { + shouldClauses = append(shouldClauses, orm.TermsQuery("source.id", fullAccessSharedDatasources)) //shared with user + } + + if len(allowdDocs) > 0 { + shouldClauses = append(shouldClauses, orm.TermsQuery("id", allowdDocs)) //direct shared with user + } + + builder.Must(orm.BoolQuery(orm.Should, shouldClauses...).Parameter("minimum_should_match", 1)) + + if len(deniedDocs) > 0 { + builder.Must(orm.BoolQuery(orm.MustNot, orm.TermsQuery("id", deniedDocs))) + } + + ctx := orm.NewContextWithParent(ctx1) + ctx.DirectReadAccess() + orm.WithModel(ctx, &core.Document{}) + //ctx.Set(orm.SharingEnabled, true) + //ctx.Set(orm.SharingResourceType, "document") + //ctx.Set(orm.SharingCheckingResourceCategoryEnabled, true) + //ctx.Set(orm.SharingCheckingInheritedRulesEnabled, true) + + //if datasource != "" { + // ctx.Set(orm.SharingResourceCategoryType, "datasource") + // ctx.Set(orm.SharingResourceCategoryFilterField, "source.id") + // ctx.Set(orm.SharingResourceCategoryID, datasource) + //} + + log.Trace(builder.ToString()) + + docs := []core.Document{} + err, resp := elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) + if err != nil || resp == nil { + return nil, nil, err + } + + return docs, resp, nil +} + +func QueryDocumentsAndFilter(ctx1 context.Context, user *security.UserSessionInfo, builder *orm.QueryBuilder, integrationID string, query string, datasource, category, subcategory, richCategory string) ([]elastic.DocumentWithMeta[core.Document], *orm.SimpleResult, error) { + docs, resp, err := QueryDocuments(ctx1, user.MustGetUserID(), builder, query, datasource, integrationID, category, subcategory, richCategory) + if err != nil { + return nil, nil, err + } + + ////bypass admin + //if !util.AnyInArrayEquals(user.Roles, security.RoleAdmin) { + // docs, err = SecondStageFilter(ctx1, user.MustGetUserID(), query, docs) + // if err != nil { + // return nil, nil, err + // } + //} + + var final []elastic.DocumentWithMeta[core.Document] + for _, v := range docs { + doc := elastic.DocumentWithMeta[core.Document]{ + ID: v.ID, + Source: v, + } + RefineIcon(ctx1, &v) + final = append(final, doc) + } + + return final, resp, nil +} + +func SecondStageFilter(ctx1 context.Context, userID string, query string, docs []core.Document) ([]core.Document, error) { + //double check the document permission + var docs1 = []core.Document{} + for _, v := range docs { + valid := false + if v.GetOwnerID() == userID { + valid = true + } else { + shareEntity := share.NewResourceEntity("document", v.ID, "") + shareEntity.ResourceCategoryType = "datasource" + shareEntity.ResourceCategoryID = v.Source.ID + shareEntity.ResourceParentPath = v.Category + per, _ := sharingService.GetUserExplicitEffectivePermission(userID, shareEntity) + if per > share.None { + valid = true + } + } + + if valid { + docs1 = append(docs1, v) + } else { + log.Info("invalid permission to access doc:", v.Title, ",", query) + } + } + log.Infof("hit %v->%v docs for query: %v", len(docs), len(docs1), query) + return docs1, nil +} + +var sharingService = share.NewSharingService() + +// +//func QueryForMultiDatasource(ctx *orm.Context, user *security.UserSessionInfo, qb *orm.QueryBuilder, integrationID string, query string, datasource, category, subcategory, richCategory string) { +// if ctx == nil { +// panic("invalid data access") +// } +// +// sessionUser := security.MustGetUserFromContext(ctx.Context) +// userID := sessionUser.MustGetUserID() +// +// var bq *orm.Clause +// +// bq = orm.ShouldQuery( +// //orm.MustNotQuery(orm.ExistsQuery(SystemFieldsKey + "." + OwnerIDKey)), +// ) +// +// var globalShareMustFilters = []*orm.Clause{} +// ////apply sharing rules +// if ctx.GetBool(orm.SharingEnabled, false) { +// +// //log.Error("hit SharingEnabled") +// resourceType := ctx.MustGetString(orm.SharingResourceType) +// +// //var bypassByCategoryFilter = false //TODO support multi category filter and bypass +// //check category level filter first! +// //apply parent sharing rules, like if the parent object is shared, eg: datasource level, all docs will be marked as shared +// if ctx.GetBool(orm.SharingCheckingResourceCategoryEnabled, false) { +// //log.Error("hit SharingCheckingResourceCategoryEnabled") +// resourceCategoryType := "datasource" +// resourceCategoryID := ctx.MustGetString(orm.SharingResourceCategoryID) +// filterField := ctx.MustGetString(orm.SharingResourceCategoryFilterField) +// +// ids:=strings.Split(resourceCategoryID,",") +// if resourceCategoryID=="*" || util.ContainStr(resourceCategoryID,"*"){ +// ids=common.GetUserDatasource(ctx) //TODO, should reflect sharing rules +// log.Error("hit * by datasource ids:",ids) +// } +// +// log.Error("final ids:",ids) +// +// boolQuery:=orm.BooleanQuery() +// +// for _,resourceID:=range ids{ +// globalShareMustFilters = append(globalShareMustFilters, orm.TermQuery("resource_category_type", resourceCategoryType)) +// globalShareMustFilters = append(globalShareMustFilters, orm.TermQuery("resource_category_id", resourceID)) +// +// //check if the current user have access to this resource +// //log.Error("check if the current user have access to this resource") +// perm, err := sharingService.GetUserExplicitEffectivePermission(userID, share.NewResourceEntity(resourceCategoryType, resourceID, "")) +// //log.Error("user have access to this parent object", perm, err) +// if err == nil { +// //TODO, not permission, just 403 +// //self or not inherit any permission, we should throw a permission error +// if perm >= 1 { +// //bypassByCategoryFilter = true +// categoryFilter := orm.TermQuery(filterField, resourceID) +// bq.MustClauses = append(bq.MustClauses, categoryFilter) +// } +// } +// globalShareMustFilters=append(globalShareMustFilters,boolQuery) +// } +// }else{ +// //for none-documents search +// ids, err := sharingService.GetResourceIDsByResourceTypeAndUserID(userID, resourceType) +// //log.Error("user have access to this parent object", ids, err) +// if err == nil { +// //TODO, not permission, just 403 +// //self or not inherit any permission, we should throw a permission error +// if len(ids) >= 1 { +// bq.ShouldClauses = append(bq.ShouldClauses, orm.TermsQuery("id", ids)) +// } +// } +// } +// +// //only enable this for documents search +// if ctx.GetBool(orm.SharingCheckingInheritedRulesEnabled, false){ +// var rules []share.SharingRecord +// rules, _ = share.GetSharingRules(rbac.PrincipalTypeUser, userID, resourceType, "", "", globalShareMustFilters) +// log.Error("get all shared rules: ", resourceType, " => ", util.MustToJSON(rules)) +// +// if len(rules) > 0 { +// allowedIDs := []string{} +// allowedFolderPaths := []string{} +// deniedIDs := []string{} +// deniedFolderPaths := []string{} +// +// for _, v := range rules { +// switch { +// // ✅ Allow rules +// case v.Permission > share.None: +// allowedIDs = append(allowedIDs, v.ResourceID) +// if v.ResourceIsFolder { +// allowedFolderPaths = append(allowedFolderPaths, v.ResourceFullPath) +// } +// +// // ❌ Deny rules +// case v.Permission == share.None: +// if v.ResourceIsFolder { +// deniedFolderPaths = append(deniedFolderPaths, v.ResourceFullPath) +// } else { +// deniedIDs = append(deniedIDs, v.ResourceID) +// } +// +// default: +// log.Error("invalid permission rule: ", util.ToJson(v, true)) +// } +// } +// +// // --- Build final boolean query --- +// // ✅ allow items or folders +// shouldClauses := []*orm.Clause{} +// if len(allowedIDs) > 0 { +// shouldClauses = append(shouldClauses, orm.TermsQuery("id", allowedIDs)) +// } +// for _, path := range allowedFolderPaths { +// shouldClauses = append(shouldClauses, orm.PrefixQuery("_system.parent_path", path)) +// } +// if len(shouldClauses) > 0 { +// bq.ShouldClauses = append(bq.ShouldClauses, shouldClauses...) +// } +// +// // ❌ deny rules +// mustNotClauses := []*orm.Clause{} +// if len(deniedIDs) > 0 { +// mustNotClauses = append(mustNotClauses, orm.TermsQuery("id", deniedIDs)) +// } +// for _, path := range deniedFolderPaths { +// // exclude docs under this path except explicitly allowed IDs +// folderExclude := orm.BooleanQuery() +// folderExclude.MustClauses = append(folderExclude.MustClauses, +// orm.PrefixQuery("_system.parent_path", path)) +// if len(allowedIDs) > 0 { +// folderExclude.MustNotClauses = append(folderExclude.MustNotClauses, +// orm.TermsQuery("id", allowedIDs)) +// } +// mustNotClauses = append(mustNotClauses, folderExclude) +// } +// +// if len(mustNotClauses) > 0 { +// bq.MustNotClauses = append(bq.MustNotClauses, mustNotClauses...) +// } +// } +// +// } +// } +// +// bq.ShouldClauses = append(bq.ShouldClauses, orm.TermQuery(orm2.SystemOwnerQueryField, userID)) +// +// if len(bq.ShouldClauses) > 1 { +// bq.Parameter("minimum_should_match", 1) +// } +// +// // } +// //} +// +// if bq != nil { +// qb.Must(bq) +// } else { +// qb.Filter(orm.MustQuery(orm.TermQuery(orm2.SystemOwnerQueryField, userID))) +// } +//} diff --git a/modules/document/suggest.go b/modules/document/suggest.go new file mode 100644 index 00000000..f1605f63 --- /dev/null +++ b/modules/document/suggest.go @@ -0,0 +1,74 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package document + +import ( + "infini.sh/coco/core" + httprouter "infini.sh/framework/core/api/router" + "infini.sh/framework/core/orm" + "infini.sh/framework/core/util" + "net/http" + "strings" +) + +func (h APIHandler) suggest(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { + + var ( + //context = h.GetParameterOrDefault(req, "context", "") + query = h.GetParameterOrDefault(req, "query", "") + from = h.GetIntOrDefault(req, "from", 0) + size = h.GetIntOrDefault(req, "size", 10) + field = h.GetParameterOrDefault(req, "search_field", "title") + source = h.GetParameterOrDefault(req, "source_fields", "title,source,url") + ) + + q := orm.Query{} + if query != "" { + templatedQuery := orm.TemplatedQuery{} + templatedQuery.TemplateID = "coco-query-string" + templatedQuery.Parameters = util.MapStr{ + "from": from, + "size": size, + "field": field, + "query": query, + "source": strings.Split(source, ","), + } + q.TemplatedQuery = &templatedQuery + } else { + body, err := h.GetRawBody(req) + if err != nil { + http.Error(w, "query must be provided", http.StatusBadRequest) + return + } + q.RawQuery = body + } + + docs := []core.Document{} + err, _ := orm.SearchWithJSONMapper(&docs, &q) + + if err != nil { + h.WriteError(w, err.Error(), http.StatusInternalServerError) + return + } + + suggestions := []core.Suggestion{} + for _, item := range docs { + suggestions = append(suggestions, core.Suggestion{Suggestion: item.Title, Score: 0.99, Source: item.Source.Name}) + } + + // Limit the number of suggestions based on the size parameter + if len(suggestions) > size { + suggestions = suggestions[:size] + } + + // Create the response + response := core.SuggestResponse{ + Query: query, + Suggestions: suggestions, + } + + h.WriteJSON(w, response, 200) + +} diff --git a/modules/integration/init.go b/modules/integration/init.go index 8e2bde35..d42675ce 100644 --- a/modules/integration/init.go +++ b/modules/integration/init.go @@ -7,7 +7,6 @@ package integration import ( "infini.sh/coco/core" "infini.sh/coco/modules/document" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" "infini.sh/framework/core/global" "infini.sh/framework/core/security" @@ -44,7 +43,7 @@ const Datasource = "integration" func init() { // register allow origin function - filter.RegisterAllowOriginFunc("integration", IntegrationAllowOrigin) + security.RegisterAllowOriginFunc("integration", IntegrationAllowOrigin) createPermission := security.GetSimplePermission(Category, Datasource, string(security.Create)) updatePermission := security.GetSimplePermission(Category, Datasource, string(security.Update)) @@ -62,21 +61,21 @@ func init() { handler := NewAPIHandler() api.HandleUIMethod(api.POST, "/integration/", handler.create, api.RequirePermission(createPermission)) - api.HandleUIMethod(api.GET, "/integration/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(filter.FeatureRemoveSensitiveField)) - api.HandleUIMethod(api.POST, "/integration/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(filter.FeatureRemoveSensitiveField)) + api.HandleUIMethod(api.GET, "/integration/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(core.FeatureRemoveSensitiveField)) + api.HandleUIMethod(api.POST, "/integration/_search", handler.search, api.RequirePermission(searchPermission), api.Feature(core.FeatureRemoveSensitiveField)) - api.HandleUIMethod(api.OPTIONS, "/integration/:id", handler.get, api.RequirePermission(readPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/integration/:id", handler.get, api.RequirePermission(readPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/integration/:id", handler.get, api.RequirePermission(readPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/integration/:id", handler.get, api.OptionLogin(), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.PUT, "/integration/:id", handler.update, api.RequirePermission(updatePermission)) api.HandleUIMethod(api.DELETE, "/integration/:id", handler.delete, api.RequirePermission(deletePermission)) - api.HandleUIMethod(api.POST, "/integration/:id/_renew_token", handler.renewAPIToken, api.RequirePermission(updatePermission)) + //api.HandleUIMethod(api.POST, "/integration/:id/_renew_token", handler.renewAPIToken, api.RequirePermission(updatePermission)) - api.HandleUIMethod(api.POST, "/integration/:id/chat/_suggest", handler.updateSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/integration/:id/chat/_suggest", handler.viewSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/integration/:id/chat/_suggest", handler.viewSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(filter.FeatureCORS)) + api.HandleUIMethod(api.POST, "/integration/:id/chat/_suggest", handler.updateSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/integration/:id/chat/_suggest", handler.viewSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/integration/:id/chat/_suggest", handler.viewSuggestTopic, api.RequirePermission(viewSuggestTopicsPermission), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.GET, "/integration/:id/widget", handler.widgetWrapper, api.AllowPublicAccess(), - api.Feature(filter.FeatureCORS), api.Feature(core.FeatureByPassCORSCheck)) + api.Feature(core.FeatureCORS), api.Feature(core.FeatureByPassCORSCheck)) api.HandleUIMethod(api.OPTIONS, "/integration/:id/widget", handler.widgetWrapper, api.AllowPublicAccess(), - api.Feature(filter.FeatureCORS), api.Feature(core.FeatureByPassCORSCheck)) + api.Feature(core.FeatureCORS), api.Feature(core.FeatureByPassCORSCheck)) } diff --git a/modules/integration/integration.go b/modules/integration/integration.go index ed88cab4..f1c5f1b2 100644 --- a/modules/integration/integration.go +++ b/modules/integration/integration.go @@ -6,13 +6,10 @@ package integration import ( "infini.sh/coco/core" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/security" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/elastic" - "infini.sh/framework/core/kv" "infini.sh/framework/core/orm" - security2 "infini.sh/framework/core/security" "infini.sh/framework/core/util" "net/http" "sync" @@ -24,21 +21,22 @@ func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprou ctx := orm.NewContextWithParent(req.Context()) ctx.Refresh = orm.WaitForRefresh - var obj = &common.Integration{} + var obj = &core.Integration{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) return } - //get permissions for this token - ret, err := security.CreateAPIToken(ctx, "", "widget", []string{"widget"}) - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - obj.Token = ret["access_token"].(string) + //if obj.Guest.Enabled && obj.Guest.RunAs != "" { + // //get permissions for this token + // ret, err := security.CreateAPIToken(obj.Guest.RunAs, "", "widget", security2.MustGetPermissionKeysByRole([]string{"widget"})) + // if err != nil { + // h.WriteError(w, err.Error(), http.StatusInternalServerError) + // return + // } + // obj.Token = ret["access_token"].(string) + //} err = orm.Create(ctx, obj) if err != nil { @@ -56,10 +54,12 @@ func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Integration{} + obj := core.Integration{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) - + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "integration") + ctx.DirectReadAccess() exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { h.WriteGetMissingJSON(w, id) @@ -71,7 +71,7 @@ func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Integration{} + obj := core.Integration{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -81,7 +81,8 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou h.WriteError(w, err.Error(), http.StatusInternalServerError) return } - + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "integration") ctx.Refresh = orm.WaitForRefresh err = orm.UpdatePartialFields(ctx, &obj, delta) if err != nil { @@ -102,7 +103,7 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) delete(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.Integration{} + obj := core.Integration{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -126,10 +127,14 @@ func (h *APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprou return } builder.EnableBodyBytes() + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Integration{}) - + orm.WithModel(ctx, &core.Integration{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "integration") res, err := orm.SearchV2(ctx, builder) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -162,46 +167,51 @@ func (h *APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprou h.WriteJSON(w, searchRes, http.StatusOK) } -func (h *APIHandler) renewAPIToken(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - ctx := orm.NewContextWithParent(req.Context()) - ctx.Refresh = orm.WaitForRefresh - - reqUser, err := security2.GetUserFromContext(req.Context()) - if reqUser == nil || err != nil { - panic(err) - } - id := ps.MustGetParameter("id") - - obj := common.Integration{} - obj.ID = id - - exists, err := orm.GetV2(ctx, &obj) - if !exists || err != nil { - h.WriteJSON(w, util.MapStr{ - "_id": id, - "found": false, - }, http.StatusNotFound) - return - } - if obj.Token != "" { - // clear old token - kv.DeleteKey(core.KVAccessTokenBucket, []byte(obj.Token)) - } - //create new token form this integration - ret, err := security.CreateAPIToken(ctx, "", "widget", []string{"widget"}) - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - obj.Token = ret["access_token"].(string) - err = orm.Update(ctx, &obj) - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - h.WriteAckOKJSON(w) -} +//func (h *APIHandler) renewAPIToken(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { +// ctx := orm.NewContextWithParent(req.Context()) +// ctx.Refresh = orm.WaitForRefresh +// +// reqUser, err := security2.GetUserFromContext(req.Context()) +// if reqUser == nil || err != nil { +// panic(err) +// } +// id := ps.MustGetParameter("id") +// +// obj := core.Integration{} +// obj.ID = id +// +// ctx.Set(orm.SharingEnabled, true) +// ctx.Set(orm.SharingResourceType, "integration") +// +// exists, err := orm.GetV2(ctx, &obj) +// if !exists || err != nil { +// h.WriteJSON(w, util.MapStr{ +// "_id": id, +// "found": false, +// }, http.StatusNotFound) +// return +// } +// if obj.Token != "" { +// // clear old token +// kv.DeleteKey(core.KVAccessTokenBucket, []byte(obj.Token)) +// } +// //create new token form this integration +// if obj.Guest.Enabled && obj.Guest.RunAs != "" { +// ret, err := security.CreateAPIToken(obj.Guest.RunAs, "", "widget", security2.MustGetPermissionKeysByRole([]string{"widget"})) +// if err != nil { +// h.WriteError(w, err.Error(), http.StatusInternalServerError) +// return +// } +// +// obj.Token = ret["access_token"].(string) +// err = orm.Update(ctx, &obj) +// if err != nil { +// h.WriteError(w, err.Error(), http.StatusInternalServerError) +// return +// } +// } +// h.WriteAckOKJSON(w) +//} func IntegrationAllowOrigin(origin string, req *http.Request) bool { appIntegrationID := req.Header.Get(core.HeaderIntegrationID) @@ -223,7 +233,7 @@ var ( ) func InitIntegrationOrigins() { - integrations := []common.Integration{} + integrations := []core.Integration{} err, _ := orm.SearchWithJSONMapper(&integrations, &orm.Query{ Size: 100, Conds: orm.And(orm.Eq("enabled", true), orm.Eq("cors.enabled", true)), diff --git a/modules/integration/wrapper.go b/modules/integration/wrapper.go index 1eb2be40..ac65e720 100644 --- a/modules/integration/wrapper.go +++ b/modules/integration/wrapper.go @@ -5,6 +5,7 @@ package integration import ( + "infini.sh/coco/core" "infini.sh/coco/modules/common" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/orm" @@ -19,7 +20,7 @@ var ver = util.GetUUID() func (h *APIHandler) widgetWrapper(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { integrationID := ps.MustGetParameter("id") - obj := common.Integration{} + obj := core.Integration{} obj.ID = integrationID ctx := orm.NewContextWithParent(req.Context()).DirectReadAccess() ctx.Set(orm.ReadPermissionCheckingScope, security.PermissionScopePublic) @@ -49,7 +50,7 @@ func (h *APIHandler) widgetWrapper(w http.ResponseWriter, req *http.Request, ps } info := common.AppConfig() - token := obj.Token + //token := obj.Token str = h.fullscreenWrapperTemplate.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { switch tag { @@ -60,9 +61,9 @@ func (h *APIHandler) widgetWrapper(w http.ResponseWriter, req *http.Request, ps case "ENDPOINT": endpoint := strings.TrimRight(info.ServerInfo.Endpoint, "/") return w.Write([]byte(endpoint)) - case "TOKEN": - endpoint := token - return w.Write([]byte(endpoint)) + //case "TOKEN": + // endpoint := token + // return w.Write([]byte(endpoint)) } return -1, nil }) @@ -74,7 +75,7 @@ func (h *APIHandler) widgetWrapper(w http.ResponseWriter, req *http.Request, ps } info := common.AppConfig() - token := obj.Token + //token := obj.Token str = h.searchBoxWrapperTemplate.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { switch tag { @@ -85,9 +86,9 @@ func (h *APIHandler) widgetWrapper(w http.ResponseWriter, req *http.Request, ps case "ENDPOINT": endpoint := strings.TrimRight(info.ServerInfo.Endpoint, "/") return w.Write([]byte(endpoint)) - case "TOKEN": - endpoint := token - return w.Write([]byte(endpoint)) + //case "TOKEN": + // endpoint := token + // return w.Write([]byte(endpoint)) } return -1, nil }) diff --git a/modules/llm/init.go b/modules/llm/init.go index 3b0dba34..fbd8516d 100644 --- a/modules/llm/init.go +++ b/modules/llm/init.go @@ -6,7 +6,6 @@ package llm import ( "infini.sh/coco/core" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" "infini.sh/framework/core/security" ) @@ -45,15 +44,15 @@ func init() { api.HandleUIMethod(api.GET, "/model_provider/:id", handler.get, api.RequireLogin(), api.RequirePermission(readLLMPermission)) api.HandleUIMethod(api.PUT, "/model_provider/:id", handler.update, api.RequireLogin(), api.RequirePermission(updateLLMPermission)) api.HandleUIMethod(api.DELETE, "/model_provider/:id", handler.delete, api.RequireLogin(), api.RequirePermission(deleteLLMPermission)) - api.HandleUIMethod(api.GET, "/model_provider/_search", handler.search, api.RequireLogin(), api.RequirePermission(searchLLMPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureRemoveSensitiveField), api.Label(filter.SensitiveFields, secretKeys)) - api.HandleUIMethod(api.POST, "/model_provider/_search", handler.search, api.RequireLogin(), api.RequirePermission(searchLLMPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureRemoveSensitiveField), api.Label(filter.SensitiveFields, secretKeys)) + api.HandleUIMethod(api.GET, "/model_provider/_search", handler.search, api.RequireLogin(), api.RequirePermission(searchLLMPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureRemoveSensitiveField), api.Label(core.SensitiveFields, secretKeys)) + api.HandleUIMethod(api.POST, "/model_provider/_search", handler.search, api.RequireLogin(), api.RequirePermission(searchLLMPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureRemoveSensitiveField), api.Label(core.SensitiveFields, secretKeys)) api.HandleUIMethod(api.POST, "/mcp_server/", handler.createMCPServer, api.RequirePermission(createMCPServerPermission)) api.HandleUIMethod(api.GET, "/mcp_server/:id", handler.getMCPServer, api.RequirePermission(readMCPServerPermission)) api.HandleUIMethod(api.PUT, "/mcp_server/:id", handler.updateMCPServer, api.RequirePermission(updateMCPServerPermission)) api.HandleUIMethod(api.DELETE, "/mcp_server/:id", handler.deleteMCPServer, api.RequirePermission(deleteMCPServerPermission)) - api.HandleUIMethod(api.GET, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(filter.FeatureCORS), api.RequirePermission(searchMCPServerPermission), api.Feature(filter.FeatureRemoveSensitiveField), api.Label(filter.SensitiveFields, secretKeys)) - api.HandleUIMethod(api.OPTIONS, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(filter.FeatureCORS), api.RequirePermission(searchMCPServerPermission)) - api.HandleUIMethod(api.POST, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(filter.FeatureCORS), api.RequirePermission(searchMCPServerPermission), api.Feature(filter.FeatureRemoveSensitiveField), api.Label(filter.SensitiveFields, secretKeys)) + api.HandleUIMethod(api.GET, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(core.FeatureCORS), api.RequirePermission(searchMCPServerPermission), api.Feature(core.FeatureRemoveSensitiveField), api.Label(core.SensitiveFields, secretKeys)) + api.HandleUIMethod(api.OPTIONS, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(core.FeatureCORS), api.RequirePermission(searchMCPServerPermission)) + api.HandleUIMethod(api.POST, "/mcp_server/_search", handler.searchMCPServer, api.RequireLogin(), api.Feature(core.FeatureCORS), api.RequirePermission(searchMCPServerPermission), api.Feature(core.FeatureRemoveSensitiveField), api.Label(core.SensitiveFields, secretKeys)) } diff --git a/modules/llm/mcp_server.go b/modules/llm/mcp_server.go index ad71773d..189be720 100644 --- a/modules/llm/mcp_server.go +++ b/modules/llm/mcp_server.go @@ -15,7 +15,7 @@ import ( func (h *APIHandler) createMCPServer(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.MCPServer{} + var obj = &core.MCPServer{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -40,7 +40,7 @@ func (h *APIHandler) createMCPServer(w http.ResponseWriter, req *http.Request, p } -func GetMCPServersByID(id []string) ([]common.MCPServer, error) { +func GetMCPServersByID(id []string) ([]core.MCPServer, error) { var err error q := orm.Query{} q.RawQuery, err = core.RewriteQueryWithFilter(q.RawQuery, util.MapStr{ @@ -49,7 +49,7 @@ func GetMCPServersByID(id []string) ([]common.MCPServer, error) { }, }) - docs := []common.MCPServer{} + docs := []core.MCPServer{} err, _ = orm.SearchWithJSONMapper(&docs, &q) if err != nil { return nil, err @@ -60,9 +60,11 @@ func GetMCPServersByID(id []string) ([]common.MCPServer, error) { func (h *APIHandler) getMCPServer(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.MCPServer{} + obj := core.MCPServer{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "mcp-server") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { @@ -82,9 +84,11 @@ func (h *APIHandler) getMCPServer(w http.ResponseWriter, req *http.Request, ps h func (h *APIHandler) updateMCPServer(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.MCPServer{} + obj := core.MCPServer{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "mcp-server") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { @@ -95,7 +99,7 @@ func (h *APIHandler) updateMCPServer(w http.ResponseWriter, req *http.Request, p return } - newObj := common.MCPServer{} + newObj := core.MCPServer{} err = h.DecodeJSON(req, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -107,6 +111,8 @@ func (h *APIHandler) updateMCPServer(w http.ResponseWriter, req *http.Request, p newObj.Created = obj.Created ctx.Refresh = orm.WaitForRefresh + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "mcp-server") err = orm.Update(ctx, &obj) if err != nil { @@ -123,7 +129,7 @@ func (h *APIHandler) updateMCPServer(w http.ResponseWriter, req *http.Request, p func (h *APIHandler) deleteMCPServer(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.MCPServer{} + obj := core.MCPServer{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -158,9 +164,14 @@ func (h *APIHandler) searchMCPServer(w http.ResponseWriter, req *http.Request, p return } builder.EnableBodyBytes() - ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.MCPServer{}) + if len(builder.Sorts()) == 0 { + builder.SortBy(orm.Sort{Field: "created", SortType: orm.DESC}) + } + ctx := orm.NewContextWithParent(req.Context()) + orm.WithModel(ctx, &core.MCPServer{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "mcp-server") res, err := orm.SearchV2(ctx, builder) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) diff --git a/modules/llm/model_provider.go b/modules/llm/model_provider.go index be532825..4031cb48 100644 --- a/modules/llm/model_provider.go +++ b/modules/llm/model_provider.go @@ -5,6 +5,7 @@ package llm import ( + "infini.sh/coco/core" "net/http" "infini.sh/coco/modules/common" @@ -14,7 +15,7 @@ import ( func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - var obj = &common.ModelProvider{} + var obj = &core.ModelProvider{} err := h.DecodeJSON(req, obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -38,10 +39,11 @@ func (h *APIHandler) create(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.ModelProvider{} + obj := core.ModelProvider{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) - + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "llm-provider") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { h.WriteGetMissingJSON(w, id) @@ -53,9 +55,11 @@ func (h *APIHandler) get(w http.ResponseWriter, req *http.Request, ps httprouter func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.ModelProvider{} + obj := core.ModelProvider{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "llm-provider") exists, err := orm.GetV2(ctx, &obj) if !exists || err != nil { @@ -63,7 +67,7 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou return } - newObj := common.ModelProvider{} + newObj := core.ModelProvider{} err = h.DecodeJSON(req, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -79,7 +83,8 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou newObj.Created = obj.Created ctx.Refresh = orm.WaitForRefresh - + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "llm-provider") err = orm.Update(ctx, &obj) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) @@ -94,7 +99,7 @@ func (h *APIHandler) update(w http.ResponseWriter, req *http.Request, ps httprou func (h *APIHandler) delete(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { id := ps.MustGetParameter("id") - obj := common.ModelProvider{} + obj := core.ModelProvider{} obj.ID = id ctx := orm.NewContextWithParent(req.Context()) @@ -132,8 +137,9 @@ func (h *APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprou builder.EnableBodyBytes() ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.ModelProvider{}) - + orm.WithModel(ctx, &core.ModelProvider{}) + ctx.Set(orm.SharingEnabled, true) + ctx.Set(orm.SharingResourceType, "llm-provider") res, err := orm.SearchV2(ctx, builder) if err != nil { h.WriteError(w, err.Error(), http.StatusInternalServerError) diff --git a/modules/search/init.go b/modules/search/init.go deleted file mode 100644 index d5ce1f16..00000000 --- a/modules/search/init.go +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package search - -import ( - "infini.sh/coco/core" - "infini.sh/coco/plugins/security/filter" - "infini.sh/framework/core/api" - "infini.sh/framework/core/security" -) - -type APIHandler struct { - api.Handler -} - -const Category = "coco" -const Resource = "search" -const Assistant = "assistant" -const QuickAISearchAction = "quick_ai_access" - -func init() { - - permission := security.GetSimplePermission(Category, Resource, string(security.Search)) - assistantSearchPermission := security.GetSimplePermission(Category, Assistant, string(QuickAISearchAction)) - - security.GetOrInitPermissionKeys(assistantSearchPermission) - security.AssignPermissionsToRoles(permission, core.WidgetRole) - - handler := APIHandler{} - api.HandleUIMethod(api.GET, "/query/_suggest", handler.suggest, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/query/_suggest", handler.suggest, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/query/_recommend", handler.recommend, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.OPTIONS, "/query/_recommend", handler.recommend, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - - api.HandleUIMethod(api.OPTIONS, "/query/_search", handler.search, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/query/_search", handler.search, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.POST, "/query/_search", handler.search, api.RequirePermission(permission), api.Feature(filter.FeatureCORS)) - -} diff --git a/modules/search/recommend.go b/modules/search/recommend.go deleted file mode 100644 index 4f548ded..00000000 --- a/modules/search/recommend.go +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package search - -import ( - httprouter "infini.sh/framework/core/api/router" - "net/http" -) - -// RecommendRequest represents the input for the recommend API -type RecommendRequest struct { - UserID string `json:"user_id"` // ID of the user making the recommendation request - RecentInteractions []string `json:"recent_interactions,omitempty"` // Optional, list of recent user interactions (e.g., clicks, views) - Context string `json:"context,omitempty"` // Optional, current context of the user (e.g., active category, search context) - Filters []string `json:"filters,omitempty"` // Optional, filters applied to recommendations (e.g., category, tags) - NumRecommendations int `json:"num_recommendations,omitempty"` // Optional, number of recommendations requested -} - -// EntityCard represents an individual recommendation returned by the API -type EntityCard struct { - Title string `json:"title"` // Title of the entity card - Description string `json:"description,omitempty"` // Optional, description of the entity - Score float64 `json:"score,omitempty"` // Optional, relevance score of the recommendation - Icon string `json:"icon,omitempty"` // Optional, icon for the entity card - Banner *Link `json:"banner,omitempty"` - URL string `json:"url"` // URL to the entity - Category string `json:"category,omitempty"` // Optional, category of the entity - Breadcrumbs []Link `json:"breadcrumbs,omitempty"` // Optional, breadcrumb navigation links - Context interface{} `json:"context,omitempty"` // Optional, additional context for the entity -} - -// RecommendResponse represents the response structure for the recommend API -type RecommendResponse struct { - UserID string `json:"user_id"` // ID of the user receiving recommendations - Recommendations []EntityCard `json:"recommendations"` // List of recommended entity cards - Total int `json:"total"` // Total number of recommendations -} - -func (h APIHandler) recommend(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - // Parse the request body - var recommendReq RecommendRequest - if err := h.DecodeJSON(req, &recommendReq); err != nil { - http.Error(w, "Invalid request body", http.StatusBadRequest) - return - } - - // Placeholder: Generate some recommendations based on the request (in a real scenario, this would query a recommendation engine) - recommendations := []EntityCard{ - { - Title: "Introduction to AI", - Description: "A comprehensive guide to artificial intelligence.", - Score: 0.98, - URL: "https://example.com/entity_101", - Category: "Technology", - Breadcrumbs: []Link{ - {Name: "Tech", URL: "/category/tech"}, - {Name: "AI", URL: "/category/ai"}, - }, - }, - { - Title: "Data Science for Beginners", - Description: "Learn the basics of data science with this beginner's guide.", - Score: 0.93, - URL: "https://example.com/entity_202", - Category: "Science", - Breadcrumbs: []Link{ - {Name: "Science", URL: "/category/science"}, - {Name: "Data Science", URL: "/category/data-science"}, - }, - }, - } - - // Limit the number of recommendations based on the request - if recommendReq.NumRecommendations > 0 && len(recommendations) > recommendReq.NumRecommendations { - recommendations = recommendations[:recommendReq.NumRecommendations] - } - - // Create the response - response := RecommendResponse{ - UserID: recommendReq.UserID, - Recommendations: recommendations, - Total: len(recommendations), - } - - h.WriteJSON(w, response, 200) - -} diff --git a/modules/search/search.go b/modules/search/search.go deleted file mode 100644 index 20478b3f..00000000 --- a/modules/search/search.go +++ /dev/null @@ -1,610 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package search - -import ( - "errors" - "fmt" - log "github.com/cihub/seelog" - "infini.sh/coco/core" - "infini.sh/coco/modules/common" - httprouter "infini.sh/framework/core/api/router" - "infini.sh/framework/core/elastic" - "infini.sh/framework/core/orm" - "infini.sh/framework/core/security" - "infini.sh/framework/core/util" - ccache "infini.sh/framework/lib/cache" - "net/http" - "strings" - "time" -) - -// MatchQuery represents a match query in Elasticsearch -type MatchQuery struct { - Field string `json:"field"` - Query string `json:"query"` -} - -// TermQuery represents a term query in Elasticsearch -type TermQuery struct { - Field string `json:"field"` - Value string `json:"value"` -} - -type QueryStringQuery struct { - Field string `json:"field"` - Value string `json:"query"` -} - -// RangeQuery represents a range query in Elasticsearch -type RangeQuery struct { - Field string `json:"field"` - GTE *int `json:"gte,omitempty"` // Greater than or equal - LTE *int `json:"lte,omitempty"` // Less than or equal -} - -// BoolQuery supports combining multiple queries -type BoolQuery struct { - Must []interface{} `json:"must,omitempty"` - Should []interface{} `json:"should,omitempty"` - MustNot []interface{} `json:"must_not,omitempty"` - Filter []interface{} `json:"filter,omitempty"` -} - -// Aggregation represents a basic metric aggregation -type Aggregation struct { - Field string `json:"field"` -} - -// SortOption defines sorting for search results -type SortOption struct { - Field string `json:"field"` - Order string `json:"order"` // "asc" or "desc" -} - -// TotalHits represents the total number of hits in the search response -type TotalHits struct { - Value int `json:"value"` - Relation string `json:"relation"` // "eq" (exact) or "gte" (greater than or equal) -} - -// IndexDocument used to construct indexing document -type IndexDocument struct { - Index string `json:"_index,omitempty"` - Type string `json:"_type,omitempty"` - ID string `json:"_id,omitempty"` - Routing string `json:"_routing,omitempty"` - Score float32 `json:"_score,omitempty"` - Source common.Document `json:"_source,omitempty"` - Highlight map[string][]interface{} `json:"highlight,omitempty"` -} - -type SearchResponse struct { - Took int `json:"took"` - TimedOut bool `json:"timed_out"` - Hits struct { - Total interface{} `json:"total"` - MaxScore float32 `json:"max_score"` - Hits []IndexDocument `json:"hits,omitempty"` - } `json:"hits"` - //Aggregations map[string]AggregationResponse `json:"aggregations,omitempty"` -} - -var configCache = ccache.Layered(ccache.Configure().MaxSize(10000).ItemsToPrune(100)) - -func (h APIHandler) search(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - - reqUser := security.MustGetUserFromRequest(req) - log.Error(util.MustToJSON(reqUser)) - - var ( - query = h.GetParameterOrDefault(req, "query", "") - - //TODO tobe removed - datasource = h.GetParameterOrDefault(req, "datasource", "") - category = h.GetParameterOrDefault(req, "category", "") - - //TODO tobe removed - username = h.GetParameterOrDefault(req, "username", "") - userid = h.GetParameterOrDefault(req, "userid", "") - - tags = h.GetParameterOrDefault(req, "tags", "") - subcategory = h.GetParameterOrDefault(req, "subcategory", "") - richCategory = h.GetParameterOrDefault(req, "rich_category", "") - - //TODO tobe merged into query builder - field = h.GetParameterOrDefault(req, "search_field", "title") - - source = h.GetParameterOrDefault(req, "source_fields", "*") - ) - - query = util.CleanUserQuery(query) - - newQuery := h.GetParameterOrDefault(req, "v2", "false") - if newQuery != "true" { - //TODO tobe removed - from := h.GetIntOrDefault(req, "from", 0) - size := h.GetIntOrDefault(req, "size", 10) - - mustClauses := BuildMustFilterClauses(category, subcategory, richCategory, username, userid) - if integrationID := req.Header.Get(core.HeaderIntegrationID); integrationID != "" { - // get datasource by integration id - datasourceIDs, hasAll, err := common.GetDatasourceByIntegration(integrationID) - if err != nil { - panic(err) - } - if !hasAll { - if len(datasourceIDs) == 0 { - // return empty search result when no datasource found - h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) - return - } - // update datasource filter - if datasource == "" { - datasource = strings.Join(datasourceIDs, ",") - } else { - // calc intersection with datasource and datasourceIDs - queryDatasource := strings.Split(datasource, ",") - queryDatasource = util.StringArrayIntersection(queryDatasource, datasourceIDs) - if len(queryDatasource) == 0 { - // return empty search result when intersection datasource ids is empty - h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) - return - } - datasource = strings.Join(queryDatasource, ",") - } - } - } - datasourceClause := BuildDatasourceClause(datasource, true) - if datasourceClause != nil { - mustClauses = append(mustClauses, datasourceClause) - } - mustClauses = append(mustClauses, map[string]interface{}{ - "bool": map[string]interface{}{ - "minimum_should_match": 1, - "should": []interface{}{ - map[string]interface{}{ - "term": map[string]interface{}{ - "disabled": false, - }, - }, - map[string]interface{}{ - "bool": map[string]interface{}{ - "must_not": map[string]interface{}{ - "exists": map[string]interface{}{ - "field": "disabled", - }, - }, - }, - }, - }, - }, - }) - - var q *orm.Query - if query != "" || len(mustClauses) > 0 { - q = BuildTemplatedQuery(from, size, mustClauses, nil, field, query, source, tags) - } else { - body, err := h.GetRawBody(req) - if err != nil { - http.Error(w, "query must be provided", http.StatusBadRequest) - return - } - if len(body) == 0 { - //ignore empty query - return - } - q = &orm.Query{} - q.RawQuery = body - } - - err, res := orm.Search(common.Document{}, q) - if err != nil || res.Raw == nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - v2 := SearchResponse{} - err = util.FromJSONBytes(res.Raw, &v2) - if err != nil { - panic(err) - } - - hits := v2.Hits.Hits - - ctx := orm.NewContextWithParent(req.Context()) - - // Loop over the hits and ensure Source is modified correctly - for i, doc := range hits { - // Get the pointer to doc.Source to make sure you're modifying the original - datasourceConfig, err := common.GetDatasourceConfig(ctx, doc.Source.Source.ID) - if err == nil && datasourceConfig != nil && datasourceConfig.Connector.ConnectorID != "" { - connectorConfig, err := getConnectorConfig(datasourceConfig.Connector.ConnectorID) - - if connectorConfig != nil && err == nil { - icon := common.ParseAndGetIcon(connectorConfig, doc.Source.Icon) - if icon != "" { - hits[i].Source.Icon = icon - } - - if doc.Source.Source.Icon != "" { - icon = common.ParseAndGetIcon(connectorConfig, doc.Source.Source.Icon) - if icon != "" { - hits[i].Source.Source.Icon = icon - } - } else { - //try datasource's icon - if datasourceConfig.Icon != "" { - icon = common.ParseAndGetIcon(connectorConfig, datasourceConfig.Icon) - if icon != "" { - hits[i].Source.Source.Icon = icon - } - } else { - //try connector's icon - icon = common.ParseAndGetIcon(connectorConfig, connectorConfig.Icon) - if icon != "" { - hits[i].Source.Source.Icon = icon - } - } - } - } - } - } - - if query != "" { - - reqUser, err := security.GetUserFromContext(req.Context()) - if err == nil && reqUser != nil { - assistantSearchPermission := security.GetSimplePermission(Category, Assistant, string(QuickAISearchAction)) - perID := security.GetOrInitPermissionKey(assistantSearchPermission) - - if (reqUser.Roles != nil && util.AnyInArrayEquals(reqUser.Roles, security.RoleAdmin)) || reqUser.UserAssignedPermission.ValidateFor(perID) { - assistantSize := 2 - if len(hits) < 5 { - assistantSize = size - (len(hits)) - } - - assistants := searchAssistant(query, assistantSize) - if len(assistants) > 0 { - for _, assistant := range assistants { - doc := common.Document{} - doc.ID = assistant.ID - doc.Type = "AI Assistant" - doc.Icon = assistant.Icon - doc.Title = assistant.Name - doc.Summary = assistant.Description - doc.URL = fmt.Sprintf("coco://extenstions/infinilabs/ask_assistant/%v", assistant.ID) - doc.Source = common.DataSourceReference{ - ID: "assistant", - Name: "Assistant", - Icon: "font_robot", - } - newHit := IndexDocument{Index: "assistant", ID: assistant.ID, Source: doc, Score: v2.Hits.MaxScore + 500} - hits = append(hits, newHit) - } - } - } - } - } - - v2.Hits.Hits = hits - - h.WriteJSON(w, v2, 200) - - return - } - - //NEW Query - builder, err := orm.NewQueryBuilderFromRequest(req) - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - builder.DefaultQueryField("title.keyword^100", "title^10", "title.pinyin^4", "combined_fulltext") - builder.Exclude("payload.*") - - if source != "" && source != "*" { - builder.Include(strings.Split(source, ",")...) - } - - filters := BuildFilters(category, subcategory, richCategory, username, userid) - if integrationID := req.Header.Get(core.HeaderIntegrationID); integrationID != "" { - // get datasource by integration id - datasourceIDs, hasAll, err := common.GetDatasourceByIntegration(integrationID) - if err != nil { - panic(err) - } - if !hasAll { - if len(datasourceIDs) == 0 { - // return empty search result when no datasource found - h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) - return - } - // update datasource filter - if datasource == "" { - datasource = strings.Join(datasourceIDs, ",") - } else { - // calc intersection with datasource and datasourceIDs - queryDatasource := strings.Split(datasource, ",") - queryDatasource = util.StringArrayIntersection(queryDatasource, datasourceIDs) - if len(queryDatasource) == 0 { - // return empty search result when intersection datasource ids is empty - h.WriteJSON(w, elastic.SearchResponse{}, http.StatusOK) - return - } - datasource = strings.Join(queryDatasource, ",") - } - } - } - datasourceFilter := BuildDatasourceFilter(datasource, true) - if datasourceFilter != nil { - filters = append(filters, datasourceFilter...) - } - - //filter enabled doc - filters = append(filters, orm.BoolQuery(orm.Should, orm.TermQuery("disabled", false), orm.MustNotQuery(orm.ExistsQuery("disabled"))).Parameter("minimum_should_match", 1)) - - builder.Filter(filters...) - - ctx := orm.NewContextWithParent(req.Context()) - orm.WithModel(ctx, &common.Document{}) - - docs := []common.Document{} - err, resp := elastic.SearchV2WithResultItemMapper(ctx, &docs, builder, nil) - if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return - } - - _, err = h.Write(w, resp.Raw) - if err != nil { - h.Error(w, err) - } - -} - -func searchAssistant(query string, size int) []common.Assistant { - - if size <= 0 { - size = 2 - } - - q := orm.Query{} - q.Size = size - q.Conds = orm.And(orm.QueryString("combined_fulltext", query)) - q.Filter = orm.Eq("enabled", true) - docs := []common.Assistant{} - err, _ := orm.SearchWithJSONMapper(&docs, &q) - if err != nil { - _ = log.Error(err) - } - return docs -} - -var connectorCacheKey = "Datasource" - -func getConnectorConfig(id string) (*common.Connector, error) { - v := configCache.Get(connectorCacheKey, id) - if v != nil { - if !v.Expired() { - x, ok := v.Value().(*common.Connector) - if ok && x != nil { - return x, nil - } - } - } - - obj := common.Connector{} - obj.ID = id - - exists, err := orm.Get(&obj) - if err == nil && exists { - configCache.Set(connectorCacheKey, id, &obj, util.GetDurationOrDefault("30m", time.Duration(30)*time.Minute)) - return &obj, nil - } - - return nil, errors.New("not found") -} - -func BuildTemplatedQuery(from int, size int, mustClauses []interface{}, shouldClauses interface{}, field string, query string, source string, tags string) *orm.Query { - templatedQuery := orm.TemplatedQuery{} - templatedQuery.TemplateID = "coco-query-string" - if shouldClauses != nil { - templatedQuery.TemplateID = "coco-query-string-extra-should" - } - - templatedQuery.Parameters = util.MapStr{ - "from": from, - "size": size, - "must_clauses": mustClauses, - "extra_should_clauses": shouldClauses, - "field": field, - "query": query, - "source": strings.Split(source, ","), - "tags": strings.Split(tags, ","), - } - q := orm.Query{} - q.TemplatedQuery = &templatedQuery - return &q -} - -func BuildDatasourceClause(datasource string, filterDisabled bool) interface{} { - var datasourceClause interface{} - if datasource != "" { - if strings.Contains(datasource, ",") { - arr := strings.Split(datasource, ",") - datasourceClause = map[string]interface{}{ - "terms": map[string]interface{}{ - "source.id": arr, - }, - } - } else { - datasourceClause = map[string]interface{}{ - "term": map[string]interface{}{ - "source.id": datasource, - }, - } - } - } - if !filterDisabled { - return datasourceClause - } - - disabledIDs, err := common.GetDisabledDatasourceIDs() - if err != nil { - panic(err) - } - if len(disabledIDs) == 0 { - return datasourceClause - } - mustNot := map[string]interface{}{ - "terms": map[string]interface{}{ - "source.id": disabledIDs, - }, - } - if datasourceClause == nil { - return map[string]interface{}{ - "bool": map[string]interface{}{ - "must_not": mustNot, - }, - } - } - return map[string]interface{}{ - "bool": map[string]interface{}{ - "must_not": mustNot, - "must": datasourceClause, - }, - } -} - -func BuildMustFilterClauses(category string, subcategory string, richCategory string, username string, userid string) []interface{} { - mustClauses := []interface{}{} - - // Check and add conditions to mustClauses - - if category != "" { - mustClauses = append(mustClauses, map[string]interface{}{ - "term": map[string]interface{}{ - "category": category, - }, - }) - } - - if subcategory != "" { - mustClauses = append(mustClauses, map[string]interface{}{ - "term": map[string]interface{}{ - "subcategory": subcategory, - }, - }) - } - - if richCategory != "" { - mustClauses = append(mustClauses, map[string]interface{}{ - "term": map[string]interface{}{ - "rich_categories.key": richCategory, - }, - }) - } - - if username != "" { - mustClauses = append(mustClauses, map[string]interface{}{ - "term": map[string]interface{}{ - "owner.username": username, - }, - }) - } - - if userid != "" { - mustClauses = append(mustClauses, map[string]interface{}{ - "term": map[string]interface{}{ - "owner.userid": userid, - }, - }) - } - return mustClauses -} - -func BuildFilters(category string, subcategory string, richCategory string, username string, userid string) []*orm.Clause { - mustClauses := []*orm.Clause{} - - if category != "" { - mustClauses = append(mustClauses, orm.TermQuery("category", category)) - } - - if subcategory != "" { - mustClauses = append(mustClauses, orm.TermQuery("subcategory", subcategory)) - } - - if richCategory != "" { - mustClauses = append(mustClauses, orm.TermQuery("rich_categories.key", richCategory)) - } - - if username != "" { - mustClauses = append(mustClauses, orm.TermQuery("owner.username", username)) - } - - if userid != "" { - mustClauses = append(mustClauses, orm.TermQuery("owner.userid", userid)) - } - return mustClauses -} - -func BuildDatasourceFilter(datasource string, filterDisabled bool) []*orm.Clause { - mustClauses := []*orm.Clause{} - if datasource != "" { - if strings.Contains(datasource, ",") { - arr := strings.Split(datasource, ",") - mustClauses = append(mustClauses, orm.TermsQuery("source.id", arr)) - } else { - mustClauses = append(mustClauses, orm.TermQuery("source.id", datasource)) - } - } - if !filterDisabled { - return mustClauses - } - - disabledIDs, err := common.GetDisabledDatasourceIDs() - if err != nil { - panic(err) - } - - //TODO verify this filter - if len(disabledIDs) > 0 { - mustClauses = append(mustClauses, orm.MustNotQuery(orm.TermsQuery("source.id", disabledIDs))) - } - - return mustClauses -} - -func BuildShouldClauses(query []string, keyword []string) interface{} { - clauses := []interface{}{} - - if len(query) > 0 { - for _, v := range query { - clauses = append(clauses, map[string]interface{}{ - "match": map[string]interface{}{ - "combined_fulltext": v, - }, - }) - } - } - - if len(keyword) > 0 { - clauses = append(clauses, map[string]interface{}{ - "terms": map[string]interface{}{ - "combined_fulltext": keyword, - }, - }) - } - - clause := util.MapStr{} - clause["bool"] = util.MapStr{ - "should": clauses, - "boost": 1, - } - - return clause -} diff --git a/modules/system/init.go b/modules/system/init.go index e2a8c185..ef141cca 100644 --- a/modules/system/init.go +++ b/modules/system/init.go @@ -9,7 +9,6 @@ import ( "infini.sh/coco/core" "infini.sh/coco/modules/common" - "infini.sh/coco/plugins/security/filter" "infini.sh/framework/core/api" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/global" @@ -36,9 +35,9 @@ func init() { api.HandleUIMethod(api.GET, "/provider/_info", handler.providerInfo, api.AllowPublicAccess()) api.HandleUIMethod(api.POST, "/setup/_initialize", handler.setupServer, api.AllowPublicAccess()) - api.HandleUIMethod(api.OPTIONS, "/settings", handler.getServerSettings, api.RequirePermission(readPermission), api.Feature(filter.FeatureCORS)) - api.HandleUIMethod(api.GET, "/settings", handler.getServerSettings, api.RequirePermission(readPermission), api.Feature(filter.FeatureCORS), api.Feature(filter.FeatureMaskSensitiveField), - api.Feature(filter.FeatureRemoveSensitiveField)) + api.HandleUIMethod(api.OPTIONS, "/settings", handler.getServerSettings, api.RequirePermission(readPermission), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.GET, "/settings", handler.getServerSettings, api.RequirePermission(readPermission), api.Feature(core.FeatureCORS), api.Feature(core.FeatureMaskSensitiveField), + api.Feature(core.FeatureRemoveSensitiveField)) api.HandleUIMethod(api.PUT, "/settings", handler.updateServerSettings, api.RequirePermission(updatePermission)) //list all icons for connectors @@ -84,9 +83,11 @@ func (h *APIHandler) providerInfo(w http.ResponseWriter, req *http.Request, ps h if info.ServerInfo.Provider.AuthProvider.SSO.URL == "" { panic("sso url can't be nil") } + } else { + output["managed"] = false } stats := util.MapStr{} - claims, _ := core.ValidateLogin(req) + claims, _ := core.ValidateLogin(w, req) if claims != nil { count, err := common.CountAssistants() if err != nil { diff --git a/modules/system/initialize.go b/modules/system/initialize.go index 1e696457..4cfc56f8 100644 --- a/modules/system/initialize.go +++ b/modules/system/initialize.go @@ -8,6 +8,7 @@ import ( "bufio" "bytes" "fmt" + "infini.sh/framework/core/security" "io" "io/fs" "net/http" @@ -16,11 +17,8 @@ import ( "strings" "time" - security2 "infini.sh/framework/core/security" - "infini.sh/coco/core" "infini.sh/coco/modules/common" - "infini.sh/coco/plugins/security" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/elastic" "infini.sh/framework/core/env" @@ -91,22 +89,13 @@ func (h *APIHandler) setupServer(w http.ResponseWriter, req *http.Request, ps ht panic("password can't be empty") } - //save user's profile - profile := security2.UserProfile{Name: input.Name} - profile.Email = input.Email - profile.ID = core.DefaultUserLogin - err = kv.AddValue(core.DefaultSettingBucketKey, []byte(core.DefaultUserProfileKey), util.MustToJSONBytes(profile)) - if err != nil { - panic(err) + user, err := security.MustGetAuthenticationProvider(security.DefaultNativeAuthBackend).CreateUser(input.Name, input.Email, input.Password, true) + if user == nil || user.ID == "" { + panic("failed to init user") } - //save user's password - err = security.SavePassword(input.Password) - if err != nil { - panic(err) - } //initialize setup templates - err = h.initializeSetupTemplates(input, info.ServerInfo.Endpoint) + err = h.initializeSetupTemplates(user.ID, input, info.ServerInfo.Endpoint) if err != nil { panic(err) } @@ -205,7 +194,7 @@ func (h *APIHandler) initializeConnector() error { return err } -func (h *APIHandler) initializeSetupTemplates(setupCfg SetupConfig, serverEndpoint string) error { +func (h *APIHandler) initializeSetupTemplates(userID string, setupCfg SetupConfig, serverEndpoint string) error { if setupCfg.Language != "en-US" { setupCfg.Language = "zh-CN" } @@ -238,11 +227,11 @@ func (h *APIHandler) initializeSetupTemplates(setupCfg SetupConfig, serverEndpoi if !strings.HasSuffix(path, ".tpl") { return nil } - return h.initializeTemplate(path, cfg1.IndexPrefix, docType, &setupCfg, serverEndpoint) + return h.initializeTemplate(userID, path, cfg1.IndexPrefix, docType, &setupCfg, serverEndpoint) }) } -func (h *APIHandler) initializeTemplate(dslTplFile string, indexPrefix string, docType string, setupCfg *SetupConfig, serverEndpoint string) error { +func (h *APIHandler) initializeTemplate(userID string, dslTplFile string, indexPrefix string, docType string, setupCfg *SetupConfig, serverEndpoint string) error { dsl, err := util.FileGetContent(dslTplFile) if err != nil { return err @@ -270,8 +259,14 @@ func (h *APIHandler) initializeTemplate(dslTplFile string, indexPrefix string, d answeringModel = fmt.Sprintf(`{"provider_id": "coco", "name": "%s", "prompt": { "template": "{{.query}}" }}`, setupCfg.LLM.DefaultModel) } + if tpl == nil { + panic("invalid template file") + } + output := tpl.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { switch tag { + case "SETUP_OWNER_ID": + return w.Write([]byte(userID)) case "SETUP_INDEX_PREFIX": return w.Write([]byte(indexPrefix)) case "SETUP_SCHEMA_VER": diff --git a/modules/system/settings.go b/modules/system/settings.go index 678d9c1d..40f00129 100644 --- a/modules/system/settings.go +++ b/modules/system/settings.go @@ -6,6 +6,7 @@ package system import ( log "github.com/cihub/seelog" + "infini.sh/coco/core" "infini.sh/coco/modules/common" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/util" @@ -21,7 +22,7 @@ func (h *APIHandler) getServerSettings(w http.ResponseWriter, req *http.Request, } func (h *APIHandler) updateServerSettings(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - appConfig := common.Config{} + appConfig := core.Config{} if err := h.DecodeJSON(req, &appConfig); err != nil { _ = log.Error(err) h.WriteError(w, err.Error(), http.StatusBadRequest) @@ -30,7 +31,7 @@ func (h *APIHandler) updateServerSettings(w http.ResponseWriter, req *http.Reque oldAppConfig := common.AppConfig() if appConfig.ServerInfo != nil { //merge settings - serverCfg := common.ServerInfo{} + serverCfg := core.ServerInfo{} err := mergeSettings(oldAppConfig.ServerInfo, appConfig.ServerInfo, &serverCfg) if err != nil { _ = log.Error(err) @@ -41,7 +42,7 @@ func (h *APIHandler) updateServerSettings(w http.ResponseWriter, req *http.Reque } if appConfig.AppSettings != nil { //merge settings - appSettings := common.AppSettings{} + appSettings := core.AppSettings{} err := mergeSettings(oldAppConfig.AppSettings, appConfig.AppSettings, &appSettings) if err != nil { _ = log.Error(err) @@ -52,7 +53,7 @@ func (h *APIHandler) updateServerSettings(w http.ResponseWriter, req *http.Reque } if appConfig.SearchSettings != nil { //merge settings - searchSettings := common.SearchSettings{} + searchSettings := core.SearchSettings{} err := mergeSettings(oldAppConfig.SearchSettings, appConfig.SearchSettings, &searchSettings) if err != nil { _ = log.Error(err) diff --git a/plugins/connectors/common/connector.go b/plugins/connectors/common/connector.go index 818d4959..d2379be1 100644 --- a/plugins/connectors/common/connector.go +++ b/plugins/connectors/common/connector.go @@ -5,10 +5,10 @@ package common import ( - "infini.sh/coco/modules/common" + "infini.sh/coco/core" "infini.sh/framework/core/pipeline" ) type ConnectorAPI interface { - Fetch(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error + Fetch(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error } diff --git a/plugins/connectors/common/converter.go b/plugins/connectors/common/converter.go index 4c829dfa..ec970c6d 100644 --- a/plugins/connectors/common/converter.go +++ b/plugins/connectors/common/converter.go @@ -6,13 +6,12 @@ package common import ( "fmt" + "infini.sh/coco/core" "strconv" "strings" "time" log "github.com/cihub/seelog" - - "infini.sh/coco/modules/common" ) type Transformer struct { @@ -20,7 +19,7 @@ type Transformer struct { Visited map[string]bool } -func (t *Transformer) Transform(doc *common.Document, m *Mapping) { +func (t *Transformer) Transform(doc *core.Document, m *Mapping) { doc.ID = t.getString(m.ID) doc.Title = t.getString(m.Title) doc.URL = t.getString(m.URL) @@ -38,7 +37,7 @@ func (t *Transformer) Transform(doc *common.Document, m *Mapping) { doc.Tags = t.getStringSlice(m.Tags) doc.Size = t.getInt(m.Size) - owner := &common.UserInfo{ + owner := &core.UserInfo{ UserAvatar: t.getString(m.Owner.Avatar), UserName: t.getString(m.Owner.UserName), UserID: t.getString(m.Owner.UserID), @@ -62,11 +61,11 @@ func (t *Transformer) Transform(doc *common.Document, m *Mapping) { } } - doc.LastUpdatedBy = &common.EditorInfo{ + doc.LastUpdatedBy = &core.EditorInfo{ UpdatedAt: t.getTime(m.LastUpdatedBy.Timestamp), } - user := &common.UserInfo{ + user := &core.UserInfo{ UserAvatar: t.getString(m.LastUpdatedBy.UserInfo.Avatar), UserName: t.getString(m.LastUpdatedBy.UserInfo.UserName), UserID: t.getString(m.LastUpdatedBy.UserInfo.UserID), @@ -239,7 +238,7 @@ func (t *Transformer) getRaw(column string) interface{} { return nil } -func isUserEmpty(u *common.UserInfo) bool { +func isUserEmpty(u *core.UserInfo) bool { if u == nil { return true } diff --git a/plugins/connectors/common/plugin.go b/plugins/connectors/common/plugin.go index cf1b5892..69f3013f 100644 --- a/plugins/connectors/common/plugin.go +++ b/plugins/connectors/common/plugin.go @@ -8,12 +8,12 @@ import ( "context" "database/sql" "fmt" + "infini.sh/coco/core" "time" "infini.sh/framework/core/orm" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" "infini.sh/framework/core/global" "infini.sh/framework/core/util" @@ -26,12 +26,12 @@ const ( type Scanner struct { Name string DriverName string - Connector *common.Connector - Datasource *common.DataSource + Connector *core.Connector + Datasource *core.DataSource // CollectFunc is called to collect each document (replaces direct queue.Push) // This allows using the ConnectorProcessorBase.Collect() method - CollectFunc func(doc common.Document) error + CollectFunc func(doc core.Document) error // SqlWithLastModified used to query incremental data SqlWithLastModified func(baseQuery string, lastSyncField string) string @@ -276,9 +276,9 @@ func (s *Scanner) scanRowToMap(rows *sql.Rows, columns []string) (map[string]int } // transformRowToDocument converts a database row (as a map) to a common.Document using field mappings. -func (s *Scanner) transformRowToDocument(rowMap map[string]interface{}, cfg *Config) (*common.Document, error) { - doc := &common.Document{ - Source: common.DataSourceReference{ +func (s *Scanner) transformRowToDocument(rowMap map[string]interface{}, cfg *Config) (*core.Document, error) { + doc := &core.Document{ + Source: core.DataSourceReference{ ID: s.Datasource.ID, Type: "connector", Name: s.Datasource.Name, @@ -320,7 +320,7 @@ func (s *Scanner) GetLastSyncValue(datasourceID string) (*time.Time, error) { Value: []interface{}{datasourceID}, } - var results []common.Document + var results []core.Document err, _ = orm.SearchWithJSONMapper(&results, &q) if err != nil { diff --git a/plugins/connectors/common/processor.go b/plugins/connectors/common/processor.go index c673187d..0fccb768 100644 --- a/plugins/connectors/common/processor.go +++ b/plugins/connectors/common/processor.go @@ -35,7 +35,7 @@ type ConnectorProcessorBase struct { connector ConnectorAPI } -func (base *ConnectorProcessorBase) MustParseConfig(datasource *common.DataSource, cfgObj interface{}) { +func (base *ConnectorProcessorBase) MustParseConfig(datasource *core.DataSource, cfgObj interface{}) { cfg, err := config.NewConfigFrom(datasource.Connector.Config) if err != nil { log.Errorf("Failed to create config from datasource [%s]: %v", datasource.Name, err) @@ -79,29 +79,31 @@ func (processor *ConnectorProcessorBase) Process(ctx *pipeline.Context) error { return processor.connector.Fetch(ctx, conn, ds) } -func (base *ConnectorProcessorBase) GetBasicInfo(ctx *pipeline.Context) (connector *common.Connector, datasource *common.DataSource) { +func (base *ConnectorProcessorBase) GetBasicInfo(ctx *pipeline.Context) (connector *core.Connector, datasource *core.DataSource) { tempConnector := ctx.Get(core.PipelineContextConnector) - connector, ok := tempConnector.(*common.Connector) + connector, ok := tempConnector.(*core.Connector) if !ok || connector == nil { panic(errors.Errorf("invalid connector in pipeline context [%s][%s]", ctx.Config.Name, ctx.ID())) } tempDatasource := ctx.Get(core.PipelineContextDatasource) - datasource, ok = tempDatasource.(*common.DataSource) + datasource, ok = tempDatasource.(*core.DataSource) if !ok || datasource == nil { panic(errors.Errorf("invalid datasource in pipeline context [%s][%s]", ctx.Config.Name, ctx.ID())) } return connector, datasource } -func (processor *ConnectorProcessorBase) Collect(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, doc common.Document) { - processor.BatchCollect(ctx, connector, datasource, []common.Document{doc}) +func (processor *ConnectorProcessorBase) Collect(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, doc core.Document) { + processor.BatchCollect(ctx, connector, datasource, []core.Document{doc}) } -func (processor *ConnectorProcessorBase) BatchCollect(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, docs []common.Document) { +func (processor *ConnectorProcessorBase) BatchCollect(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, docs []core.Document) { //append enrichment pipeline process if datasource.EnrichmentPipeline != nil { + //log.Error("running enrichment pipeline") + ctx.Set("documents", docs) err := pipeline.RunPipelineSync(*datasource.EnrichmentPipeline, ctx) if err != nil { panic(err) diff --git a/plugins/connectors/confluence/converter.go b/plugins/connectors/confluence/converter.go index 388c315a..adde6026 100644 --- a/plugins/connectors/confluence/converter.go +++ b/plugins/connectors/confluence/converter.go @@ -5,16 +5,16 @@ package confluence import ( + "infini.sh/coco/core" "net/url" "strings" "time" "github.com/PuerkitoBio/goquery" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" ) -func convertFromWiki(src *Content, doc *common.Document, baseURL *url.URL) { +func convertFromWiki(src *Content, doc *core.Document, baseURL *url.URL) { if src.Body.View != nil { textContent, err := htmlToText(src.Body.View.Value) if err != nil { @@ -40,7 +40,7 @@ func convertFromWiki(src *Content, doc *common.Document, baseURL *url.URL) { doc.Created = &t } if src.History.CreatedBy.DisplayName != "" { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserName: src.History.CreatedBy.DisplayName, UserID: src.History.CreatedBy.UserKey, } @@ -51,7 +51,7 @@ func convertFromWiki(src *Content, doc *common.Document, baseURL *url.URL) { doc.Updated = &t } if src.Version.By != nil && src.Version.By.DisplayName != "" { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserName: src.Version.By.DisplayName, UserID: src.Version.By.UserKey, } @@ -63,7 +63,7 @@ func convertFromWiki(src *Content, doc *common.Document, baseURL *url.URL) { doc.Metadata["type"] = src.Type } -func convertFromAttachment(src *Content, doc *common.Document, baseURL *url.URL) { +func convertFromAttachment(src *Content, doc *core.Document, baseURL *url.URL) { doc.Content = "" // Attachment src is not indexed directly // for attachment get size from `Extensions` @@ -83,7 +83,7 @@ func convertFromAttachment(src *Content, doc *common.Document, baseURL *url.URL) doc.Updated = &t // For attachments, updated time is same as created time } if src.History.CreatedBy.DisplayName != "" { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserName: src.History.CreatedBy.DisplayName, UserID: src.History.CreatedBy.AccountID, } diff --git a/plugins/connectors/confluence/plugin.go b/plugins/connectors/confluence/plugin.go index b19ce82c..741b9a70 100644 --- a/plugins/connectors/confluence/plugin.go +++ b/plugins/connectors/confluence/plugin.go @@ -8,11 +8,11 @@ import ( "context" "errors" "fmt" + "infini.sh/coco/core" "net/url" "strings" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/global" @@ -57,7 +57,7 @@ func (p *Plugin) Name() string { return ConnectorConfluence } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) cfg.Endpoint = strings.TrimRight(cfg.Endpoint, "/") @@ -99,7 +99,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas return nil } -func (p *Plugin) processContent(ctx *pipeline.Context, scanCtx context.Context, handler *ConfluenceHandler, connector *common.Connector, datasource *common.DataSource, cfg *Config, space string, typeName string) error { +func (p *Plugin) processContent(ctx *pipeline.Context, scanCtx context.Context, handler *ConfluenceHandler, connector *core.Connector, datasource *core.DataSource, cfg *Config, space string, typeName string) error { req := SearchContentRequest{ Limit: PageSize, Expand: strings.Split(PageExpanded, ","), @@ -141,7 +141,7 @@ func (p *Plugin) processContent(ctx *pipeline.Context, scanCtx context.Context, return fmt.Errorf("fetching content failed: %v", err) } - var docs []common.Document + var docs []core.Document for _, content := range res.Results { // Check for global shutdown if global.ShuttingDown() { @@ -172,9 +172,9 @@ func (p *Plugin) processContent(ctx *pipeline.Context, scanCtx context.Context, } // transformToDocument converts a Confluence Content object to a common.Document. -func (p *Plugin) transformToDocument(content *Content, datasource *common.DataSource, cfg *Config) (*common.Document, error) { - doc := common.Document{ - Source: common.DataSourceReference{ +func (p *Plugin) transformToDocument(content *Content, datasource *core.DataSource, cfg *Config) (*core.Document, error) { + doc := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Type: "connector", Name: datasource.Name, diff --git a/plugins/connectors/document.go b/plugins/connectors/document.go index 24f75aef..8ab307d0 100644 --- a/plugins/connectors/document.go +++ b/plugins/connectors/document.go @@ -6,6 +6,7 @@ package connectors import ( "fmt" + "infini.sh/coco/core" "path/filepath" "strings" "time" @@ -87,7 +88,7 @@ func BuildParentCategoryArray(filePath string) []string { // SetDocumentHierarchy sets the hierarchy information on a document based on the parent category array. // This is a common utility function used by connectors to establish document hierarchy relationships. -func SetDocumentHierarchy(doc *common.Document, parentCategoryArray []string) { +func SetDocumentHierarchy(doc *core.Document, parentCategoryArray []string) { if len(parentCategoryArray) > 0 { categoryPath := common.GetFullPathForCategories(parentCategoryArray) doc.Category = categoryPath @@ -103,10 +104,10 @@ func SetDocumentHierarchy(doc *common.Document, parentCategoryArray []string) { // CreateDocumentWithHierarchy creates a document with proper hierarchy settings and basic metadata. // This is a common utility function used by connectors to create documents with consistent structure. func CreateDocumentWithHierarchy(docType, icon, title, url string, size int, - parentCategoryArray []string, datasource *common.DataSource, idSuffix string) common.Document { + parentCategoryArray []string, datasource *core.DataSource, idSuffix string) core.Document { - doc := common.Document{ - Source: common.DataSourceReference{ + doc := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Type: "connector", Name: datasource.Name, @@ -205,7 +206,7 @@ func (tracker *GitFolderTracker) TrackGitFolders(owner, repo string, contentType } // CreateGitFolderDocuments creates folder documents for all tracked git hierarchy levels -func (tracker *GitFolderTracker) CreateGitFolderDocuments(datasource *common.DataSource, pushFunc func(doc common.Document)) { +func (tracker *GitFolderTracker) CreateGitFolderDocuments(datasource *core.DataSource, pushFunc func(doc core.Document)) { // Create organization/user folder documents (Level 1) for owner := range tracker.Organizations { idSuffix := fmt.Sprintf("git-folder-%s", owner) diff --git a/plugins/connectors/document_test.go b/plugins/connectors/document_test.go index d1073682..99299c7c 100644 --- a/plugins/connectors/document_test.go +++ b/plugins/connectors/document_test.go @@ -5,6 +5,7 @@ package connectors import ( + "infini.sh/coco/core" "reflect" "testing" @@ -310,7 +311,7 @@ func TestSetDocumentHierarchy(t *testing.T) { func TestCreateDocumentWithHierarchy(t *testing.T) { // Create a test datasource - datasource := &common.DataSource{ + datasource := &core.DataSource{ Name: "Test DataSource", } datasource.ID = "test-datasource-id" diff --git a/plugins/connectors/feishu/api.go b/plugins/connectors/feishu/api.go index dfc91e62..5ba42aa9 100644 --- a/plugins/connectors/feishu/api.go +++ b/plugins/connectors/feishu/api.go @@ -2,12 +2,12 @@ package feishu import ( "fmt" + "infini.sh/coco/core" "net/http" "net/url" "strings" "time" - "infini.sh/coco/modules/common" httprouter "infini.sh/framework/core/api/router" "infini.sh/framework/core/orm" "infini.sh/framework/core/util" @@ -110,8 +110,8 @@ func oAuthRedirect(w http.ResponseWriter, req *http.Request, ps httprouter.Param log.Infof("[%s connector] Successfully authenticated user: %v", pluginType, profile) // Create datasource with OAuth tokens - datasource := common.DataSource{ - SyncConfig: common.SyncConfig{Enabled: true, Interval: "30s"}, + datasource := core.DataSource{ + SyncConfig: core.SyncConfig{Enabled: true, Interval: "30s"}, Enabled: true, } @@ -136,7 +136,7 @@ func oAuthRedirect(w http.ResponseWriter, req *http.Request, ps httprouter.Param } // Create datasource config with OAuth tokens - datasource.Connector = common.ConnectorConfig{ + datasource.Connector = core.ConnectorConfig{ ConnectorID: string(pluginType), Config: util.MapStr{ "access_token": token.AccessToken, @@ -211,7 +211,7 @@ func getOAuthConfigFromConnector(connectorID string, pluginType PluginType) (*OA } // Try to load connector to get OAuth credentials - connector := common.Connector{} + connector := core.Connector{} connector.ID = connectorID exists, err := orm.Get(&connector) if err == nil && exists && connector.Config != nil { diff --git a/plugins/connectors/feishu/plugin.go b/plugins/connectors/feishu/plugin.go index c69d4103..cf621350 100644 --- a/plugins/connectors/feishu/plugin.go +++ b/plugins/connectors/feishu/plugin.go @@ -7,6 +7,7 @@ package feishu import ( "encoding/json" "fmt" + "infini.sh/coco/core" "net/url" "strings" "time" @@ -124,12 +125,12 @@ type Config struct { // SearchContext holds parameters for recursive file search type SearchContext struct { Ctx *pipeline.Context - Connector *common.Connector + Connector *core.Connector Token string FolderToken string DocTypes []string PageSize int - DataSource *common.DataSource + DataSource *core.DataSource ParentPath string ParentPathArray []string LastKnown time.Time @@ -170,7 +171,7 @@ func init() { api.HandleUIMethod(api.GET, "/connector/:id/lark/oauth_redirect", handleOAuthRedirect(PluginTypeLark), api.RequireLogin()) } -func (this *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (this *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { if connector == nil || datasource == nil { return errors.Errorf("invalid connector config") } @@ -404,8 +405,8 @@ func (this *Plugin) searchFilesRecursively(ctx *SearchContext) { } // Process document - doc := common.Document{ - Source: common.DataSourceReference{ + doc := core.Document{ + Source: core.DataSourceReference{ ID: ctx.DataSource.ID, Type: "connector", Name: ctx.DataSource.Name, diff --git a/plugins/connectors/gitea/converter.go b/plugins/connectors/gitea/converter.go index 9ed766d8..36bc7d67 100644 --- a/plugins/connectors/gitea/converter.go +++ b/plugins/connectors/gitea/converter.go @@ -6,11 +6,11 @@ package gitea import ( "fmt" + "infini.sh/coco/core" "strings" sdk "code.gitea.io/sdk/gitea" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" "infini.sh/framework/core/global" "infini.sh/framework/core/pipeline" @@ -22,7 +22,7 @@ const ( TypeRepository = "repository" ) -func (p *Plugin) processRepos(ctx *pipeline.Context, client *sdk.Client, cfg *Config, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processRepos(ctx *pipeline.Context, client *sdk.Client, cfg *Config, connector *core.Connector, datasource *core.DataSource) { isOrg, err := p.isOrgUser(client, cfg.Owner) if err != nil { _ = log.Errorf("[%s connector] failed to get user for [name=%s]: %v", ConnectorGitea, cfg.Owner, err) @@ -76,8 +76,8 @@ func (p *Plugin) processRepos(ctx *pipeline.Context, client *sdk.Client, cfg *Co // Track folders for hierarchy folderTracker.TrackGitFolders(cfg.Owner, repo.Name, contentTypes) // Create all folder documents for the hierarchy - var folderDocs []common.Document - folderTracker.CreateGitFolderDocuments(datasource, func(doc common.Document) { + var folderDocs []core.Document + folderTracker.CreateGitFolderDocuments(datasource, func(doc core.Document) { folderDocs = append(folderDocs, doc) }) if len(folderDocs) > 0 { @@ -110,7 +110,7 @@ func (p *Plugin) processRepos(ctx *pipeline.Context, client *sdk.Client, cfg *Co } } -func (p *Plugin) processIssues(ctx *pipeline.Context, client *sdk.Client, repo *sdk.Repository, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processIssues(ctx *pipeline.Context, client *sdk.Client, repo *sdk.Repository, connector *core.Connector, datasource *core.DataSource) { cursor := NewListIssuesCursor(repo.Owner.UserName, repo.Name) for { @@ -120,7 +120,7 @@ func (p *Plugin) processIssues(ctx *pipeline.Context, client *sdk.Client, repo * break } - var docs []common.Document + var docs []core.Document for _, issue := range issues { if global.ShuttingDown() { return @@ -148,7 +148,7 @@ func (p *Plugin) processIssues(ctx *pipeline.Context, client *sdk.Client, repo * } } -func (p *Plugin) processPullRequests(ctx *pipeline.Context, client *sdk.Client, repo *sdk.Repository, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processPullRequests(ctx *pipeline.Context, client *sdk.Client, repo *sdk.Repository, connector *core.Connector, datasource *core.DataSource) { cursor := NewListPullRequestsCursor(repo.Owner.UserName, repo.Name) for { @@ -158,7 +158,7 @@ func (p *Plugin) processPullRequests(ctx *pipeline.Context, client *sdk.Client, break } - var docs []common.Document + var docs []core.Document for _, pr := range prs { if global.ShuttingDown() { return @@ -197,7 +197,7 @@ func (p *Plugin) isOrgUser(client *sdk.Client, owner string) (bool, error) { return false, err } -func (p *Plugin) transformRepoToDocument(repo *sdk.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformRepoToDocument(repo *sdk.Repository, datasource *core.DataSource) *core.Document { owner := repo.Owner.UserName // Repository info document - belongs to owner category @@ -210,7 +210,7 @@ func (p *Plugin) transformRepoToDocument(repo *sdk.Repository, datasource *commo doc.Summary = repo.Description if repo.Owner != nil { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: fmt.Sprintf("%d", repo.Owner.ID), UserName: repo.Owner.UserName, UserAvatar: repo.Owner.AvatarURL, @@ -237,7 +237,7 @@ func (p *Plugin) transformRepoToDocument(repo *sdk.Repository, datasource *commo } // transformContentableToDocument is a generic function to transform issue-like objects into a document. -func (p *Plugin) transformContentableToDocument(item contentable, comments []*sdk.Comment, itemType string, repo *sdk.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformContentableToDocument(item contentable, comments []*sdk.Comment, itemType string, repo *sdk.Repository, datasource *core.DataSource) *core.Document { owner := repo.Owner.UserName repoName := repo.Name @@ -268,7 +268,7 @@ func (p *Plugin) transformContentableToDocument(item contentable, comments []*sd poster := item.GetPoster() if poster != nil { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: fmt.Sprintf("%d", poster.ID), UserName: poster.UserName, UserAvatar: poster.AvatarURL, @@ -299,10 +299,10 @@ func (p *Plugin) transformContentableToDocument(item contentable, comments []*sd return &doc } -func (p *Plugin) transformIssueToDocument(issue *sdk.Issue, comments []*sdk.Comment, repo *sdk.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformIssueToDocument(issue *sdk.Issue, comments []*sdk.Comment, repo *sdk.Repository, datasource *core.DataSource) *core.Document { return p.transformContentableToDocument(&issueWrapper{issue}, comments, TypeIssue, repo, datasource) } -func (p *Plugin) transformPullRequestToDocument(pr *sdk.PullRequest, comments []*sdk.Comment, repo *sdk.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformPullRequestToDocument(pr *sdk.PullRequest, comments []*sdk.Comment, repo *sdk.Repository, datasource *core.DataSource) *core.Document { return p.transformContentableToDocument(&prWrapper{pr}, comments, TypePullRequest, repo, datasource) } diff --git a/plugins/connectors/gitea/plugin.go b/plugins/connectors/gitea/plugin.go index 0cd6801d..7297c1f4 100644 --- a/plugins/connectors/gitea/plugin.go +++ b/plugins/connectors/gitea/plugin.go @@ -6,9 +6,9 @@ package gitea import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -36,7 +36,7 @@ func (p *Plugin) Name() string { return ConnectorGitea } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) diff --git a/plugins/connectors/github/converter.go b/plugins/connectors/github/converter.go index a360abe9..18270171 100644 --- a/plugins/connectors/github/converter.go +++ b/plugins/connectors/github/converter.go @@ -7,11 +7,11 @@ package github import ( "context" "fmt" + "infini.sh/coco/core" "strings" log "github.com/cihub/seelog" githubv3 "github.com/google/go-github/v74/github" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" "infini.sh/framework/core/global" "infini.sh/framework/core/pipeline" @@ -23,7 +23,7 @@ const ( TypeRepository = "repository" ) -func (p *Plugin) processRepos(ctx *pipeline.Context, client *githubv3.Client, cfg *Config, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processRepos(ctx *pipeline.Context, client *githubv3.Client, cfg *Config, connector *core.Connector, datasource *core.DataSource) { scanCtx := context.Background() user, _, err := client.Users.Get(scanCtx, cfg.Owner) if err != nil { @@ -67,8 +67,8 @@ func (p *Plugin) processRepos(ctx *pipeline.Context, client *githubv3.Client, cf // Track folders for hierarchy folderTracker.TrackGitFolders(cfg.Owner, repo.GetName(), contentTypes) // Create all folder documents for the hierarchy - var folderDocs []common.Document - folderTracker.CreateGitFolderDocuments(datasource, func(doc common.Document) { + var folderDocs []core.Document + folderTracker.CreateGitFolderDocuments(datasource, func(doc core.Document) { folderDocs = append(folderDocs, doc) }) @@ -105,9 +105,9 @@ func (p *Plugin) processRepos(ctx *pipeline.Context, client *githubv3.Client, cf } } -func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, client *githubv3.Client, owner string, repo *githubv3.Repository, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, client *githubv3.Client, owner string, repo *githubv3.Repository, connector *core.Connector, datasource *core.DataSource) { err := ListIssues(scanCtx, client, owner, repo.GetName(), func(issues []*githubv3.Issue) bool { - var docs []common.Document + var docs []core.Document for _, issue := range issues { if global.ShuttingDown() { return false @@ -132,9 +132,9 @@ func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, c } -func (p *Plugin) processPullRequests(ctx *pipeline.Context, scanCtx context.Context, client *githubv3.Client, owner string, repo *githubv3.Repository, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processPullRequests(ctx *pipeline.Context, scanCtx context.Context, client *githubv3.Client, owner string, repo *githubv3.Repository, connector *core.Connector, datasource *core.DataSource) { err := ListPullRequests(scanCtx, client, owner, repo.GetName(), func(prs []*githubv3.PullRequest) bool { - var docs []common.Document + var docs []core.Document for _, pr := range prs { if global.ShuttingDown() { return false @@ -155,7 +155,7 @@ func (p *Plugin) processPullRequests(ctx *pipeline.Context, scanCtx context.Cont } -func (p *Plugin) transformRepoToDocument(repo *githubv3.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformRepoToDocument(repo *githubv3.Repository, datasource *core.DataSource) *core.Document { owner := repo.Owner.GetLogin() // Level 3A: Repository info document - belongs to owner category @@ -167,7 +167,7 @@ func (p *Plugin) transformRepoToDocument(repo *githubv3.Repository, datasource * // Add GitHub-specific repository metadata doc.Summary = repo.GetDescription() doc.Tags = repo.Topics - doc.Owner = &common.UserInfo{UserID: owner, UserName: owner, UserAvatar: repo.Owner.GetAvatarURL()} + doc.Owner = &core.UserInfo{UserID: owner, UserName: owner, UserAvatar: repo.Owner.GetAvatarURL()} created := repo.GetCreatedAt().Time doc.Created = &created @@ -226,7 +226,7 @@ func (p *pullRequestWrapper) GetLabels() []*githubv3.Label { } // transformContentableToDocument is a generic function to transform issue-like objects into a document. -func (p *Plugin) transformContentableToDocument(item Contentable, itemType string, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformContentableToDocument(item Contentable, itemType string, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *core.DataSource) *core.Document { owner := repo.Owner.GetLogin() repoName := repo.GetName() @@ -255,7 +255,7 @@ func (p *Plugin) transformContentableToDocument(item Contentable, itemType strin } doc.Tags = tags - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: item.GetUser().GetLogin(), UserName: item.GetUser().GetLogin(), UserAvatar: item.GetUser().GetAvatarURL(), @@ -285,10 +285,10 @@ func (p *Plugin) transformContentableToDocument(item Contentable, itemType strin return &doc } -func (p *Plugin) transformIssueToDocument(issue *githubv3.Issue, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformIssueToDocument(issue *githubv3.Issue, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *core.DataSource) *core.Document { return p.transformContentableToDocument(&issueWrapper{issue}, TypeIssue, comments, repo, datasource) } -func (p *Plugin) transformPullRequestToDocument(pr *githubv3.PullRequest, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformPullRequestToDocument(pr *githubv3.PullRequest, comments []*githubv3.IssueComment, repo *githubv3.Repository, datasource *core.DataSource) *core.Document { return p.transformContentableToDocument(&pullRequestWrapper{pr}, TypePullRequest, comments, repo, datasource) } diff --git a/plugins/connectors/github/plugin.go b/plugins/connectors/github/plugin.go index 4f9ff657..4967991c 100644 --- a/plugins/connectors/github/plugin.go +++ b/plugins/connectors/github/plugin.go @@ -6,10 +6,10 @@ package github import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" _ "github.com/google/go-github/v74/github" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -37,7 +37,7 @@ func (p *Plugin) Name() string { return ConnectorGitHub } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) diff --git a/plugins/connectors/gitlab/converter.go b/plugins/connectors/gitlab/converter.go index cb18a4f5..cf4127d7 100644 --- a/plugins/connectors/gitlab/converter.go +++ b/plugins/connectors/gitlab/converter.go @@ -7,12 +7,12 @@ package gitlab import ( "context" "fmt" + "infini.sh/coco/core" "net/url" "strings" log "github.com/cihub/seelog" gitlabv4 "gitlab.com/gitlab-org/api/client-go" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" "infini.sh/framework/core/global" "infini.sh/framework/core/pipeline" @@ -41,7 +41,7 @@ func (w *wikiWrapper) BuildWikiURL(project *gitlabv4.Project) string { return w.baseURL.JoinPath(wikiPath).String() } -func (p *Plugin) processProjects(ctx *pipeline.Context, client *gitlabv4.Client, cfg *Config, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processProjects(ctx *pipeline.Context, client *gitlabv4.Client, cfg *Config, connector *core.Connector, datasource *core.DataSource) { scanCtx := context.Background() isGroup, err := isGroupOwner(scanCtx, client, cfg.Owner) if err != nil { @@ -66,8 +66,8 @@ func (p *Plugin) processProjects(ctx *pipeline.Context, client *gitlabv4.Client, // Initialize folder tracker for hierarchical structure folderTracker := connectors.NewGitFolderTracker() // Create all folder documents for the hierarchy - var folderDocs []common.Document - folderTracker.CreateGitFolderDocuments(datasource, func(doc common.Document) { + var folderDocs []core.Document + folderTracker.CreateGitFolderDocuments(datasource, func(doc core.Document) { folderDocs = append(folderDocs, doc) }) if len(folderDocs) > 0 { @@ -144,9 +144,9 @@ func (p *Plugin) processProjects(ctx *pipeline.Context, client *gitlabv4.Client, } -func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *core.Connector, datasource *core.DataSource) { err := ListIssues(scanCtx, client, project.ID, func(issues []*gitlabv4.Issue) bool { - var docs []common.Document + var docs []core.Document for _, issue := range issues { if global.ShuttingDown() { return false @@ -178,9 +178,9 @@ func (p *Plugin) processIssues(ctx *pipeline.Context, scanCtx context.Context, c } } -func (p *Plugin) processMergeRequests(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processMergeRequests(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *core.Connector, datasource *core.DataSource) { err := ListMergeRequests(scanCtx, client, project.ID, func(mrs []*gitlabv4.BasicMergeRequest) bool { - var docs []common.Document + var docs []core.Document for _, mr := range mrs { if global.ShuttingDown() { return false @@ -211,9 +211,9 @@ func (p *Plugin) processMergeRequests(ctx *pipeline.Context, scanCtx context.Con } } -func (p *Plugin) processWikis(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processWikis(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *core.Connector, datasource *core.DataSource) { err := ListWikiPages(scanCtx, client, project.ID, func(wikis []*gitlabv4.Wiki) bool { - var docs []common.Document + var docs []core.Document for _, wiki := range wikis { if global.ShuttingDown() { return false @@ -232,9 +232,9 @@ func (p *Plugin) processWikis(ctx *pipeline.Context, scanCtx context.Context, cl } } -func (p *Plugin) processSnippets(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processSnippets(ctx *pipeline.Context, scanCtx context.Context, client *gitlabv4.Client, project *gitlabv4.Project, connector *core.Connector, datasource *core.DataSource) { err := ListProjectSnippets(scanCtx, client, project.ID, func(snippets []*gitlabv4.Snippet) bool { - var docs []common.Document + var docs []core.Document for _, sn := range snippets { if global.ShuttingDown() { return false @@ -253,7 +253,7 @@ func (p *Plugin) processSnippets(ctx *pipeline.Context, scanCtx context.Context, } } -func (p *Plugin) transformProjectToDocument(project *gitlabv4.Project, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformProjectToDocument(project *gitlabv4.Project, datasource *core.DataSource) *core.Document { owner := project.Namespace.Name // Repository info document - belongs to owner category @@ -268,7 +268,7 @@ func (p *Plugin) transformProjectToDocument(project *gitlabv4.Project, datasourc doc.Cover = project.AvatarURL if project.Owner != nil { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: project.Owner.Username, UserName: project.Owner.Name, UserAvatar: project.Owner.AvatarURL, @@ -305,7 +305,7 @@ func (p *Plugin) transformProjectToDocument(project *gitlabv4.Project, datasourc return &doc } -func (p *Plugin) transformIssueToDocument(issue *gitlabv4.Issue, comments []*gitlabv4.Note, project *gitlabv4.Project, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformIssueToDocument(issue *gitlabv4.Issue, comments []*gitlabv4.Note, project *gitlabv4.Project, datasource *core.DataSource) *core.Document { owner := project.Namespace.Name repoName := project.Name @@ -332,7 +332,7 @@ func (p *Plugin) transformIssueToDocument(issue *gitlabv4.Issue, comments []*git doc.Tags = tags if issue.Author != nil { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: issue.Author.Username, UserName: issue.Author.Name, UserAvatar: issue.Author.AvatarURL, @@ -356,7 +356,7 @@ func (p *Plugin) transformIssueToDocument(issue *gitlabv4.Issue, comments []*git return &doc } -func (p *Plugin) transformMergeRequestToDocument(mr *gitlabv4.BasicMergeRequest, comments []*gitlabv4.Note, project *gitlabv4.Project, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformMergeRequestToDocument(mr *gitlabv4.BasicMergeRequest, comments []*gitlabv4.Note, project *gitlabv4.Project, datasource *core.DataSource) *core.Document { owner := project.Namespace.Name repoName := project.Name @@ -383,7 +383,7 @@ func (p *Plugin) transformMergeRequestToDocument(mr *gitlabv4.BasicMergeRequest, doc.Tags = tags if mr.Author != nil { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: mr.Author.Username, UserName: mr.Author.Name, UserAvatar: mr.Author.AvatarURL, @@ -407,7 +407,7 @@ func (p *Plugin) transformMergeRequestToDocument(mr *gitlabv4.BasicMergeRequest, return &doc } -func (p *Plugin) transformWikiToDocument(wiki *wikiWrapper, project *gitlabv4.Project, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformWikiToDocument(wiki *wikiWrapper, project *gitlabv4.Project, datasource *core.DataSource) *core.Document { owner := project.Namespace.Name repoName := project.Name @@ -437,7 +437,7 @@ func (p *Plugin) transformWikiToDocument(wiki *wikiWrapper, project *gitlabv4.Pr return &doc } -func (p *Plugin) transformSnippetToDocument(sn *gitlabv4.Snippet, project *gitlabv4.Project, datasource *common.DataSource) *common.Document { +func (p *Plugin) transformSnippetToDocument(sn *gitlabv4.Snippet, project *gitlabv4.Project, datasource *core.DataSource) *core.Document { owner := project.Namespace.Name repoName := project.Name @@ -450,7 +450,7 @@ func (p *Plugin) transformSnippetToDocument(sn *gitlabv4.Snippet, project *gitla // Add GitLab-specific snippet metadata doc.Content = sn.Description - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: sn.Author.Username, UserName: sn.Author.Name, } diff --git a/plugins/connectors/gitlab/plugin.go b/plugins/connectors/gitlab/plugin.go index 96904c98..68c18ef7 100644 --- a/plugins/connectors/gitlab/plugin.go +++ b/plugins/connectors/gitlab/plugin.go @@ -6,9 +6,9 @@ package gitlab import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -36,7 +36,7 @@ func (p *Plugin) Name() string { return ConnectorGitLab } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) diff --git a/plugins/connectors/google_drive/api.go b/plugins/connectors/google_drive/api.go index 517a19bb..484e4866 100644 --- a/plugins/connectors/google_drive/api.go +++ b/plugins/connectors/google_drive/api.go @@ -10,6 +10,7 @@ import ( log "github.com/cihub/seelog" "golang.org/x/oauth2" "golang.org/x/oauth2/google" + "infini.sh/coco/core" "infini.sh/coco/modules/common" "infini.sh/coco/modules/connector" "infini.sh/coco/plugins/connectors" @@ -138,8 +139,8 @@ func oAuthRedirect(w http.ResponseWriter, req *http.Request, ps httprouter.Param // Use the unique user ID (userInfo.Sub) or email (userInfo.Email) as the unique identifier log.Debugf("google drive authenticated user: ID=%s, Email=%s", userInfo.Sub, userInfo.Email) - datasource := common.DataSource{ - SyncConfig: common.SyncConfig{Enabled: true, Interval: "30s"}, + datasource := core.DataSource{ + SyncConfig: core.SyncConfig{Enabled: true, Interval: "30s"}, Enabled: true, } datasource.ID = util.MD5digest(fmt.Sprintf("%v,%v,%v,%v", "google_drive", connectorID, userInfo.Sub, userInfo.Email)) @@ -151,7 +152,7 @@ func oAuthRedirect(w http.ResponseWriter, req *http.Request, ps httprouter.Param datasource.Name = "My Google Drive" } - datasource.Connector = common.ConnectorConfig{ + datasource.Connector = core.ConnectorConfig{ ConnectorID: connectorID, Config: util.MapStr{ "access_token": token.AccessToken, // Store access token diff --git a/plugins/connectors/google_drive/files.go b/plugins/connectors/google_drive/files.go index 5ce3f589..2621aadd 100644 --- a/plugins/connectors/google_drive/files.go +++ b/plugins/connectors/google_drive/files.go @@ -11,6 +11,7 @@ import ( "golang.org/x/oauth2" "google.golang.org/api/drive/v3" "google.golang.org/api/option" + "infini.sh/coco/core" "infini.sh/coco/modules/common" "infini.sh/framework/core/errors" "infini.sh/framework/core/global" @@ -211,7 +212,7 @@ func isSamePermission(a, b []*drive.Permission) bool { return true } -func (this *Processor) IndexingFolder(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, doc common.Document, srv *drive.Service, q string, batchNumber string) { +func (this *Processor) IndexingFolder(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, doc core.Document, srv *drive.Service, q string, batchNumber string) { //save current folder to index log.Tracef("saving folder: %v, %v, %v", doc.Category, doc.Title, doc.ID) @@ -347,7 +348,7 @@ func (this *Processor) IndexingFolder(pipeCtx *pipeline.Context, connector *comm return } -func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, parent []string, folder common.Document, srv *drive.Service, i *drive.File, batchNumber string) { +func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, parent []string, folder core.Document, srv *drive.Service, i *drive.File, batchNumber string) { //if processedFileIDs[i.Id] { //check bitmap, if files are processed already, no duplicated progressing @@ -382,8 +383,8 @@ func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common } // Map Google Drive file to Document struct - document := common.Document{ - Source: common.DataSourceReference{ + document := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", @@ -393,7 +394,7 @@ func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common Type: getType(i.MimeType), Size: int(i.Size), URL: fmt.Sprintf("https://drive.google.com/file/d/%s/view", i.Id), - Owner: &common.UserInfo{ + Owner: &core.UserInfo{ UserAvatar: i.Owners[0].PhotoLink, UserName: i.Owners[0].DisplayName, UserID: i.Owners[0].EmailAddress, @@ -464,8 +465,8 @@ func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common //} if i.LastModifyingUser != nil { - document.LastUpdatedBy = &common.EditorInfo{ - UserInfo: &common.UserInfo{ + document.LastUpdatedBy = &core.EditorInfo{ + UserInfo: &core.UserInfo{ UserAvatar: i.LastModifyingUser.PhotoLink, UserName: i.LastModifyingUser.DisplayName, UserID: i.LastModifyingUser.EmailAddress, @@ -478,7 +479,7 @@ func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common // Handle optional fields if i.SharingUser != nil { - document.Payload["sharingUser"] = common.UserInfo{ + document.Payload["sharingUser"] = core.UserInfo{ UserAvatar: i.SharingUser.PhotoLink, UserName: i.SharingUser.DisplayName, UserID: i.SharingUser.EmailAddress, @@ -496,13 +497,13 @@ func (this *Processor) IndexingFile(pipeCtx *pipeline.Context, connector *common this.Collect(pipeCtx, connector, datasource, document) } -func (this *Processor) createFolderDoc(id, name string, parent []string, datasource *common.DataSource) common.Document { +func (this *Processor) createFolderDoc(id, name string, parent []string, datasource *core.DataSource) core.Document { shareWithMe := common.CreateHierarchyPathFolderDoc(datasource, id, name, parent) shareWithMe.URL = fmt.Sprintf("https://drive.google.com/file/d/%s/view", id) return shareWithMe } -func (this *Processor) startIndexingFiles(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, tok *oauth2.Token) { +func (this *Processor) startIndexingFiles(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, tok *oauth2.Token) { defer func() { if !global.Env().IsDebug { if r := recover(); r != nil { @@ -685,7 +686,7 @@ func exportFile(srv *drive.Service, fileID, mimeType, outputPath string) error { } // createDocumentFromFile creates a Document from a Google Drive file -func (this *Processor) createDocumentFromFile(file *drive.File, datasource *common.DataSource, folderPath []string, ft *FolderTreeBuilder, currentUserEmail string, isMyDrive bool) *common.Document { +func (this *Processor) createDocumentFromFile(file *drive.File, datasource *core.DataSource, folderPath []string, ft *FolderTreeBuilder, currentUserEmail string, isMyDrive bool) *core.Document { if file == nil { return nil } @@ -712,8 +713,8 @@ func (this *Processor) createDocumentFromFile(file *drive.File, datasource *comm log.Tracef("Google Drive File: %s (ID: %s) | CreatedAt: %s | UpdatedAt: %s | Parents: %s", file.Name, file.Id, createdAt, updatedAt, file.Parents) // Map Google Drive file to Document struct - document := common.Document{ - Source: common.DataSourceReference{ + document := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", @@ -723,7 +724,7 @@ func (this *Processor) createDocumentFromFile(file *drive.File, datasource *comm Type: getType(file.MimeType), Size: int(file.Size), URL: fmt.Sprintf("https://drive.google.com/file/d/%s/view", file.Id), - Owner: &common.UserInfo{ + Owner: &core.UserInfo{ UserAvatar: file.Owners[0].PhotoLink, UserName: file.Owners[0].DisplayName, UserID: file.Owners[0].EmailAddress, @@ -787,8 +788,8 @@ func (this *Processor) createDocumentFromFile(file *drive.File, datasource *comm } if file.LastModifyingUser != nil { - document.LastUpdatedBy = &common.EditorInfo{ - UserInfo: &common.UserInfo{ + document.LastUpdatedBy = &core.EditorInfo{ + UserInfo: &core.UserInfo{ UserAvatar: file.LastModifyingUser.PhotoLink, UserName: file.LastModifyingUser.DisplayName, UserID: file.LastModifyingUser.EmailAddress, @@ -801,7 +802,7 @@ func (this *Processor) createDocumentFromFile(file *drive.File, datasource *comm // Handle optional fields if file.SharingUser != nil { - document.Payload["sharingUser"] = common.UserInfo{ + document.Payload["sharingUser"] = core.UserInfo{ UserAvatar: file.SharingUser.PhotoLink, UserName: file.SharingUser.DisplayName, UserID: file.SharingUser.EmailAddress, diff --git a/plugins/connectors/google_drive/plugin.go b/plugins/connectors/google_drive/plugin.go index 73930a29..41aff27a 100644 --- a/plugins/connectors/google_drive/plugin.go +++ b/plugins/connectors/google_drive/plugin.go @@ -7,13 +7,13 @@ package google_drive import ( "context" "errors" + "infini.sh/coco/core" "infini.sh/framework/core/pipeline" "strings" "time" log "github.com/cihub/seelog" "golang.org/x/oauth2" - "infini.sh/coco/modules/common" "infini.sh/framework/core/orm" "infini.sh/framework/core/util" ) @@ -33,7 +33,7 @@ type Config struct { Profile util.MapStr `config:"profile" json:"profile"` } -func (this *Processor) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (this *Processor) Fetch(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { config := Config{} this.MustParseConfig(datasource, &config) diff --git a/plugins/connectors/helper.go b/plugins/connectors/helper.go index 6f67afce..e846534c 100644 --- a/plugins/connectors/helper.go +++ b/plugins/connectors/helper.go @@ -8,10 +8,10 @@ import ( "context" stderrors "errors" "fmt" + "infini.sh/coco/core" "sync" "time" - "infini.sh/coco/modules/common" config3 "infini.sh/framework/core/config" "infini.sh/framework/core/errors" ) @@ -26,7 +26,7 @@ var ( var locker = sync.RWMutex{} -func CanDoSync(datasource common.DataSource) (bool, error) { +func CanDoSync(datasource core.DataSource) (bool, error) { locker.Lock() defer locker.Unlock() @@ -55,7 +55,7 @@ func CanDoSync(datasource common.DataSource) (bool, error) { return toSync, nil } -func ParseConnectorBaseConfigure(connector *common.Connector, config interface{}) error { +func ParseConnectorBaseConfigure(connector *core.Connector, config interface{}) error { if connector == nil { return errors.New("invalid connector or datasource config") } @@ -73,7 +73,7 @@ func ParseConnectorBaseConfigure(connector *common.Connector, config interface{} } // ParseConnectorConfigure parse connector data source config -func ParseConnectorConfigure(connector *common.Connector, datasource *common.DataSource, config interface{}) error { +func ParseConnectorConfigure(connector *core.Connector, datasource *core.DataSource, config interface{}) error { if connector == nil || datasource == nil { return errors.New("invalid connector or datasource config") } diff --git a/plugins/connectors/hugo_site/processor.go b/plugins/connectors/hugo_site/processor.go index d3b091b9..4fe4eb5a 100644 --- a/plugins/connectors/hugo_site/processor.go +++ b/plugins/connectors/hugo_site/processor.go @@ -8,7 +8,6 @@ import ( "fmt" log "github.com/cihub/seelog" "infini.sh/coco/core" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/errors" @@ -43,7 +42,7 @@ func (processor *Processor) Name() string { return processorName } -func (processor *Processor) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (processor *Processor) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} processor.MustParseConfig(datasource, &cfg) @@ -71,7 +70,7 @@ func (processor *Processor) Fetch(ctx *pipeline.Context, connector *common.Conne panic(errors.Errorf("Failed to parse JSON: %v", err)) } - outputDocs := []common.Document{} + outputDocs := []core.Document{} // Output the parsed data for i, v := range documents { @@ -80,7 +79,7 @@ func (processor *Processor) Fetch(ctx *pipeline.Context, connector *common.Conne break } - doc := common.Document{Source: common.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}} + doc := core.Document{Source: core.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}} if v.Created != "" { doc.Created = ParseTimestamp(v.Created) diff --git a/plugins/connectors/local_fs/plugin.go b/plugins/connectors/local_fs/plugin.go index 5d41fc54..50eb730f 100644 --- a/plugins/connectors/local_fs/plugin.go +++ b/plugins/connectors/local_fs/plugin.go @@ -6,6 +6,7 @@ package local_fs import ( "fmt" + "infini.sh/coco/core" "io/fs" "os" "path/filepath" @@ -47,7 +48,7 @@ func (p *Plugin) Name() string { return ConnectorLocalFs } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) @@ -81,7 +82,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas } // scanPath performs a single DFS traversal to collect files and determine which folders to save -func (p *Plugin) scanPath(ctx *pipeline.Context, basePath string, connector *common.Connector, datasource *common.DataSource, extMap map[string]bool) { +func (p *Plugin) scanPath(ctx *pipeline.Context, basePath string, connector *core.Connector, datasource *core.DataSource, extMap map[string]bool) { // Track which folders contain matching files and collect folder info foldersWithMatchingFiles := make(map[string]bool) folderInfos := make(map[string]os.FileInfo) @@ -147,10 +148,10 @@ func (p *Plugin) markParentFoldersAsValid(filePath, basePath string, foldersWith } // saveDocument saves a document directly without additional folder content checking -func (p *Plugin) saveDocument(ctx *pipeline.Context, currentPath, basePath string, fileInfo os.FileInfo, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) saveDocument(ctx *pipeline.Context, currentPath, basePath string, fileInfo os.FileInfo, connector *core.Connector, datasource *core.DataSource) { modTime := fileInfo.ModTime() - doc := common.Document{ - Source: common.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}, + doc := core.Document{ + Source: core.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}, Type: connectors.TypeFile, Category: filepath.Dir(currentPath), Content: "", // skip content diff --git a/plugins/connectors/mssql/plugin.go b/plugins/connectors/mssql/plugin.go index be02ca32..1a6e0f12 100644 --- a/plugins/connectors/mssql/plugin.go +++ b/plugins/connectors/mssql/plugin.go @@ -6,10 +6,10 @@ package mssql import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" _ "github.com/microsoft/go-mssqldb" // Import the MSSQL driver - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -37,7 +37,7 @@ func (p *Plugin) Name() string { return ConnectorMSSQL } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { log.Debugf("[%s connector] handling datasource: %v", ConnectorMSSQL, datasource.Name) dialect := &SQLServerDialect{} @@ -48,7 +48,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas Datasource: datasource, DriverName: "mssql", // Use Collect pattern instead of direct queue.Push - CollectFunc: func(doc common.Document) error { + CollectFunc: func(doc core.Document) error { p.Collect(ctx, connector, datasource, doc) return nil }, diff --git a/plugins/connectors/mysql/plugin.go b/plugins/connectors/mysql/plugin.go index fa775fc9..07394b13 100644 --- a/plugins/connectors/mysql/plugin.go +++ b/plugins/connectors/mysql/plugin.go @@ -6,10 +6,10 @@ package mysql import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" _ "github.com/go-sql-driver/mysql" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -37,7 +37,7 @@ func (p *Plugin) Name() string { return ConnectorMySQL } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { log.Debugf("[%s connector] handling datasource: %v", ConnectorMySQL, datasource.Name) scanner := &cmn.Scanner{ Name: ConnectorMySQL, @@ -45,7 +45,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas Datasource: datasource, DriverName: "mysql", // Use Collect pattern instead of direct queue.Push - CollectFunc: func(doc common.Document) error { + CollectFunc: func(doc core.Document) error { p.Collect(ctx, connector, datasource, doc) return nil }, diff --git a/plugins/connectors/neo4j/plugin.go b/plugins/connectors/neo4j/plugin.go index ea8bf4fa..52456b2c 100644 --- a/plugins/connectors/neo4j/plugin.go +++ b/plugins/connectors/neo4j/plugin.go @@ -2,9 +2,9 @@ package neo4j import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" @@ -31,14 +31,14 @@ func (p *Plugin) Name() string { return ConnectorNeo4j } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { worker := &scanner{ name: ConnectorNeo4j, connector: connector, datasource: datasource, stateStore: connectors.NewSyncStateStore(), // Use Collect pattern instead of direct queue.Push - collectFunc: func(doc common.Document) error { + collectFunc: func(doc core.Document) error { p.Collect(ctx, connector, datasource, doc) return nil }, diff --git a/plugins/connectors/neo4j/scanner.go b/plugins/connectors/neo4j/scanner.go index c32c4a4b..6a6f8b11 100644 --- a/plugins/connectors/neo4j/scanner.go +++ b/plugins/connectors/neo4j/scanner.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "infini.sh/coco/core" "strings" "time" @@ -11,7 +12,6 @@ import ( "github.com/neo4j/neo4j-go-driver/v5/neo4j" "infini.sh/framework/core/pipeline" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" rdbms "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/global" @@ -33,12 +33,12 @@ const ( type scanner struct { name string - connector *common.Connector - datasource *common.DataSource + connector *core.Connector + datasource *core.DataSource stateStore *connectors.SyncStateStore // CollectFunc is called to collect each document (replaces direct queue.Push) // This allows using the ConnectorProcessorBase.Collect() method - collectFunc func(doc common.Document) error + collectFunc func(doc core.Document) error } type Config struct { @@ -412,9 +412,9 @@ func (s *scanner) processResult(ctx context.Context, result neo4j.ResultWithCont return processed, lastCursor, nil } -func (s *scanner) transform(payload map[string]interface{}, cfg *Config) (*common.Document, error) { - doc := &common.Document{ - Source: common.DataSourceReference{ +func (s *scanner) transform(payload map[string]interface{}, cfg *Config) (*core.Document, error) { + doc := &core.Document{ + Source: core.DataSourceReference{ ID: s.datasource.ID, Type: "connector", Name: s.datasource.Name, diff --git a/plugins/connectors/network_drive/plugin.go b/plugins/connectors/network_drive/plugin.go index 8ef90aa5..e395b8b6 100644 --- a/plugins/connectors/network_drive/plugin.go +++ b/plugins/connectors/network_drive/plugin.go @@ -8,6 +8,7 @@ import ( "context" "errors" "fmt" + "infini.sh/coco/core" "io/fs" "net" "path/filepath" @@ -16,7 +17,6 @@ import ( log "github.com/cihub/seelog" "github.com/hirochachacha/go-smb2" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" @@ -60,7 +60,7 @@ func (p *Plugin) Name() string { return ConnectorNetworkDrive } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) @@ -78,14 +78,13 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas _ = conn.Close() }() - dialer := &smb2.Dialer{ + var dialer = &smb2.Dialer{ Initiator: &smb2.NTLMInitiator{ User: cfg.Username, Password: cfg.Password, Domain: cfg.Domain, }, } - scanCtx := context.Background() deadline := time.Now().Add(ConnectionTimeout) dialCtx, cancelOnTimeout := context.WithDeadline(scanCtx, deadline) @@ -164,7 +163,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas } // processFile is a helper function to filter, transform, and queue a single file. -func (p *Plugin) processFile(ctx *pipeline.Context, d fs.DirEntry, currentPath string, cfg *Config, connector *common.Connector, datasource *common.DataSource) { +func (p *Plugin) processFile(ctx *pipeline.Context, d fs.DirEntry, currentPath string, cfg *Config, connector *core.Connector, datasource *core.DataSource) { // Construct a full UNC-style path for the URL field fullPath := fmt.Sprintf("//%s/%s/%s", cfg.Endpoint, cfg.Share, currentPath) @@ -191,8 +190,8 @@ func (p *Plugin) processFile(ctx *pipeline.Context, d fs.DirEntry, currentPath s } // createFolderDocuments creates document entries for all folders that contain matching files -func (p *Plugin) createFolderDocuments(ctx *pipeline.Context, foldersWithMatchingFiles map[string]bool, connector *common.Connector, datasource *common.DataSource, cfg *Config) { - var docs []common.Document +func (p *Plugin) createFolderDocuments(ctx *pipeline.Context, foldersWithMatchingFiles map[string]bool, connector *core.Connector, datasource *core.DataSource, cfg *Config) { + var docs []core.Document for folderPath := range foldersWithMatchingFiles { if global.ShuttingDown() { log.Info("[network_drive connector] Shutdown signal received, stopping folder creation.") diff --git a/plugins/connectors/network_drive/plugin_test.go b/plugins/connectors/network_drive/plugin_test.go index 545209f5..17c937fb 100644 --- a/plugins/connectors/network_drive/plugin_test.go +++ b/plugins/connectors/network_drive/plugin_test.go @@ -5,6 +5,7 @@ package network_drive import ( + "infini.sh/coco/core" "reflect" "testing" @@ -147,7 +148,7 @@ func TestMarkParentFoldersAsValid(t *testing.T) { } func TestCreateDocumentWithHierarchy(t *testing.T) { - datasource := &common.DataSource{ + datasource := &core.DataSource{ Name: "Test Network Drive", } // Set the ID manually via the embedded ID field diff --git a/plugins/connectors/notion/plugin.go b/plugins/connectors/notion/plugin.go index f000c582..04c3c2ea 100644 --- a/plugins/connectors/notion/plugin.go +++ b/plugins/connectors/notion/plugin.go @@ -7,13 +7,13 @@ package notion import ( "encoding/json" "fmt" + "infini.sh/coco/core" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/pipeline" "strings" "time" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" config3 "infini.sh/framework/core/config" "infini.sh/framework/core/errors" "infini.sh/framework/core/util" @@ -47,7 +47,7 @@ func (processor *Plugin) Name() string { return Name } -func (this *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (this *Plugin) Fetch(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} this.MustParseConfig(datasource, &cfg) @@ -57,7 +57,7 @@ func (this *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector // Process the current page's results here for i, res := range result.Results { // Process individual result - doc := common.Document{Source: common.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}} + doc := core.Document{Source: core.DataSourceReference{ID: datasource.ID, Type: "connector", Name: datasource.Name}} doc.Created = &res.Created doc.Created = &res.Updated diff --git a/plugins/connectors/oracle/plugin.go b/plugins/connectors/oracle/plugin.go index d05c20c4..fa3fdab0 100644 --- a/plugins/connectors/oracle/plugin.go +++ b/plugins/connectors/oracle/plugin.go @@ -6,12 +6,12 @@ package oracle import ( "fmt" + "infini.sh/coco/core" "regexp" "strings" log "github.com/cihub/seelog" _ "github.com/sijms/go-ora/v2" // Import the Oracle driver - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -39,7 +39,7 @@ func (p *Plugin) Name() string { return ConnectorOracle } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { log.Debugf("[%s connector] handling datasource: %v", ConnectorOracle, datasource.Name) scanner := &cmn.Scanner{ @@ -48,7 +48,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas Datasource: datasource, DriverName: "oracle", // Use Collect pattern instead of direct queue.Push - CollectFunc: func(doc common.Document) error { + CollectFunc: func(doc core.Document) error { p.Collect(ctx, connector, datasource, doc) return nil }, diff --git a/plugins/connectors/postgresql/plugin.go b/plugins/connectors/postgresql/plugin.go index ffd20495..20dbb73b 100644 --- a/plugins/connectors/postgresql/plugin.go +++ b/plugins/connectors/postgresql/plugin.go @@ -6,10 +6,10 @@ package postgresql import ( "fmt" + "infini.sh/coco/core" log "github.com/cihub/seelog" _ "github.com/lib/pq" - "infini.sh/coco/modules/common" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -37,7 +37,7 @@ func (p *Plugin) Name() string { return ConnectorPostgreSQL } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { log.Debugf("[%s connector] handling datasource: %v", ConnectorPostgreSQL, datasource.Name) scanner := &cmn.Scanner{ @@ -46,7 +46,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas Datasource: datasource, DriverName: "postgres", // Use Collect pattern instead of direct queue.Push - CollectFunc: func(doc common.Document) error { + CollectFunc: func(doc core.Document) error { p.Collect(ctx, connector, datasource, doc) return nil }, diff --git a/plugins/connectors/rss/plugin.go b/plugins/connectors/rss/plugin.go index 528086a2..613dd7ff 100644 --- a/plugins/connectors/rss/plugin.go +++ b/plugins/connectors/rss/plugin.go @@ -6,12 +6,12 @@ package rss import ( "fmt" + "infini.sh/coco/core" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/pipeline" log "github.com/cihub/seelog" "github.com/mmcdole/gofeed" - "infini.sh/coco/modules/common" config3 "infini.sh/framework/core/config" "infini.sh/framework/core/global" "infini.sh/framework/core/util" @@ -25,7 +25,7 @@ type Config struct { } // Fetch handles the logic of fetching, parsing, and indexing a single RSS feed. -func (p *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { config := Config{} p.MustParseConfig(datasource, &config) @@ -51,8 +51,8 @@ func (p *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, d break } - doc := common.Document{ - Source: common.DataSourceReference{ + doc := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Type: "connector", Name: datasource.Name, @@ -73,7 +73,7 @@ func (p *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, d } if len(item.Authors) > 0 { - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserName: item.Authors[0].Name, } } diff --git a/plugins/connectors/s3/plugin.go b/plugins/connectors/s3/plugin.go index 49ea6dd2..7ac00b76 100644 --- a/plugins/connectors/s3/plugin.go +++ b/plugins/connectors/s3/plugin.go @@ -7,12 +7,12 @@ package s3 import ( "context" "fmt" + "infini.sh/coco/core" "path/filepath" "strings" log "github.com/cihub/seelog" "github.com/minio/minio-go/v7" - "infini.sh/coco/modules/common" "infini.sh/coco/plugins/connectors" cmn "infini.sh/coco/plugins/connectors/common" "infini.sh/framework/core/config" @@ -41,7 +41,7 @@ func (p *Plugin) Name() string { return ConnectorS3 } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) @@ -102,7 +102,7 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas doc.Metadata[k] = v } - doc.Owner = &common.UserInfo{ + doc.Owner = &core.UserInfo{ UserID: obj.Owner.ID, UserName: obj.Owner.DisplayName, } @@ -135,8 +135,8 @@ func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datas } // createFolderDocuments creates document entries for all folders that contain matching files -func (p *Plugin) createFolderDocuments(ctx *pipeline.Context, foldersWithMatchingFiles map[string]bool, connector *common.Connector, datasource *common.DataSource, cfg Config) { - var docs []common.Document +func (p *Plugin) createFolderDocuments(ctx *pipeline.Context, foldersWithMatchingFiles map[string]bool, connector *core.Connector, datasource *core.DataSource, cfg Config) { + var docs []core.Document for folderPath := range foldersWithMatchingFiles { if global.ShuttingDown() { log.Info("[s3 connector] Shutdown signal received, stopping folder creation.") diff --git a/plugins/connectors/salesforce/converter.go b/plugins/connectors/salesforce/converter.go index a696d831..45ee9d2d 100644 --- a/plugins/connectors/salesforce/converter.go +++ b/plugins/connectors/salesforce/converter.go @@ -6,6 +6,7 @@ package salesforce import ( "fmt" + "infini.sh/coco/core" "strconv" "strings" "time" @@ -15,13 +16,13 @@ import ( ) // convertToDocument converts a Salesforce record to a common.Document -func convertToDocument(record map[string]interface{}, objectType string, datasource *common.DataSource, instanceUrl string) *common.Document { +func convertToDocument(record map[string]interface{}, objectType string, datasource *core.DataSource, instanceUrl string) *core.Document { if record == nil { return nil } - doc := &common.Document{ - Source: common.DataSourceReference{ + doc := &core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Type: "connector", Name: datasource.Name, @@ -83,7 +84,7 @@ func convertToDocument(record map[string]interface{}, objectType string, datasou } // convertToDocumentWithHierarchy converts a Salesforce record to a common.Document with proper hierarchy path -func convertToDocumentWithHierarchy(record map[string]interface{}, objectType string, datasource *common.DataSource, instanceUrl string) *common.Document { +func convertToDocumentWithHierarchy(record map[string]interface{}, objectType string, datasource *core.DataSource, instanceUrl string) *core.Document { doc := convertToDocument(record, objectType, datasource, instanceUrl) if doc == nil { return nil @@ -361,8 +362,8 @@ func getTags(record map[string]interface{}, objectType string) []string { } // getOwner extracts owner information from the record -func getOwner(record map[string]interface{}) common.UserInfo { - owner := common.UserInfo{} +func getOwner(record map[string]interface{}) core.UserInfo { + owner := core.UserInfo{} if ownerData, ok := record["Owner"].(map[string]interface{}); ok { owner.UserName = getString(ownerData, "Name") diff --git a/plugins/connectors/salesforce/plugin.go b/plugins/connectors/salesforce/plugin.go index 24dfb7c2..797c45e0 100644 --- a/plugins/connectors/salesforce/plugin.go +++ b/plugins/connectors/salesforce/plugin.go @@ -7,6 +7,7 @@ package salesforce import ( "context" "fmt" + "infini.sh/coco/core" "strings" "infini.sh/coco/modules/common" @@ -68,7 +69,7 @@ func (p *Plugin) extractOAuthConfig(connectorConfig map[string]interface{}) (OAu return oauthConfig, nil } -func (p *Plugin) Fetch(ctx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (p *Plugin) Fetch(ctx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { cfg := Config{} p.MustParseConfig(datasource, &cfg) @@ -109,8 +110,8 @@ func (p *Plugin) processSalesforceData( ctx *pipeline.Context, client *SalesforceClient, cfg *Config, - connector *common.Connector, - datasource *common.DataSource, + connector *core.Connector, + datasource *core.DataSource, ) error { // Authenticate with Salesforce authCtx := context.Background() @@ -174,8 +175,8 @@ func (p *Plugin) processCustomObjects( authCtx context.Context, client *SalesforceClient, cfg *Config, - connector *common.Connector, - datasource *common.DataSource, + connector *core.Connector, + datasource *core.DataSource, ) error { // Determine which custom objects to sync var customObjectsToSync []string @@ -219,8 +220,8 @@ func (p *Plugin) processObjectType( authCtx context.Context, client *SalesforceClient, objType string, - connector *common.Connector, - datasource *common.DataSource, + connector *core.Connector, + datasource *core.DataSource, ) error { log.Debugf("[%s connector] processing object type: %s", ConnectorSalesforce, objType) @@ -257,8 +258,8 @@ func (p *Plugin) processCaseWithFeeds( ctx *pipeline.Context, authCtx context.Context, client *SalesforceClient, - connector *common.Connector, - datasource *common.DataSource, + connector *core.Connector, + datasource *core.DataSource, ) error { log.Debugf("[%s connector] processing Case objects with Feeds", ConnectorSalesforce) @@ -374,8 +375,8 @@ func (p *Plugin) createSObjectDirectories( authCtx context.Context, client *SalesforceClient, cfg *Config, - connector *common.Connector, - datasource *common.DataSource, + connector *core.Connector, + datasource *core.DataSource, ) error { // Create Standard Objects directory standardObjectsDoc := common.CreateHierarchyPathFolderDoc( diff --git a/plugins/connectors/yuque/collect.go b/plugins/connectors/yuque/collect.go index e9e4ac1b..86618f1c 100644 --- a/plugins/connectors/yuque/collect.go +++ b/plugins/connectors/yuque/collect.go @@ -6,12 +6,12 @@ package yuque import ( "fmt" + "infini.sh/coco/core" "infini.sh/framework/core/pipeline" "sort" "strings" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" "infini.sh/framework/core/errors" "infini.sh/framework/core/global" "infini.sh/framework/core/queue" @@ -60,7 +60,7 @@ func (this *Plugin) save(obj interface{}) { } } -func (this *Plugin) collect(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, cfg *YuqueConfig) error { +func (this *Plugin) collect(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, cfg *YuqueConfig) error { token := cfg.Token @@ -102,11 +102,11 @@ func (this *Plugin) collect(pipeCtx *pipeline.Context, connector *common.Connect // Define a temporary struct for sorting that includes the Level type FolderInfo struct { // Temporary struct with RichLabel and Level - RichLabel common.RichLabel + RichLabel core.RichLabel Level int } -func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, login, token string, cfg *YuqueConfig) { +func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, login, token string, cfg *YuqueConfig) { const limit = 100 offset := 0 @@ -145,7 +145,7 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co //index toc // Create a map to store folder info by doc's slug, now using RichLabel - bookTocMap := make(map[string][]common.RichLabel) + bookTocMap := make(map[string][]core.RichLabel) if !cfg.SkipIndexingBookToc { res = get(fmt.Sprintf("/api/v2/repos/%v/toc", bookID), token) bookToc := struct { @@ -176,7 +176,7 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co for currentDoc.ParentUUID != "" { folderPath = append([]FolderInfo{ { - RichLabel: common.RichLabel{ + RichLabel: core.RichLabel{ Key: currentDoc.Slug, Label: currentDoc.Title, Icon: "folder", @@ -189,7 +189,7 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co // Add the current document itself to the path folderPath = append([]FolderInfo{ { - RichLabel: common.RichLabel{ + RichLabel: core.RichLabel{ Key: currentDoc.Slug, Label: currentDoc.Title, Icon: "folder", @@ -204,8 +204,8 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co }) // Extract the RichLabel part of the sorted folder path and store in bookTocMap - var sortedLabels []common.RichLabel - sortedLabels = append(sortedLabels, common.RichLabel{ + var sortedLabels []core.RichLabel + sortedLabels = append(sortedLabels, core.RichLabel{ Key: bookDetail.Book.Slug, Label: bookDetail.Book.Name, Icon: "folder", @@ -222,8 +222,8 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co if cfg.IndexingBooks && (bookDetail.Book.Public > 0 || (cfg.IncludePrivateBook)) { //index books - document := common.Document{ - Source: common.DataSourceReference{ + document := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", @@ -233,7 +233,7 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co Type: book.Type, Size: bookDetail.Book.ItemsCount, URL: fmt.Sprintf("https://yuque.com/%v/%v", login, bookDetail.Book.Slug), - Owner: &common.UserInfo{ + Owner: &core.UserInfo{ UserAvatar: bookDetail.Book.User.AvatarURL, UserName: bookDetail.Book.User.Name, UserID: bookDetail.Book.User.Login, @@ -302,7 +302,7 @@ func (this *Plugin) collectBooks(pipeCtx *pipeline.Context, connector *common.Co } -func (this *Plugin) collectDocs(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, login string, bookSlug string, bookID int64, token string, cfg *YuqueConfig, toc *map[string][]common.RichLabel) { +func (this *Plugin) collectDocs(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, login string, bookSlug string, bookID int64, token string, cfg *YuqueConfig, toc *map[string][]core.RichLabel) { const limit = 100 offset := 0 @@ -351,7 +351,7 @@ func (this *Plugin) collectDocs(pipeCtx *pipeline.Context, connector *common.Con } -func (this *Plugin) collectDocDetails(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, bookID int64, docID int64, token string, cfg *YuqueConfig, toc *map[string][]common.RichLabel) { +func (this *Plugin) collectDocDetails(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, bookID int64, docID int64, token string, cfg *YuqueConfig, toc *map[string][]core.RichLabel) { res := get(fmt.Sprintf("/api/v2/repos/%v/docs/%v", bookID, docID), token) doc := struct { @@ -365,8 +365,8 @@ func (this *Plugin) collectDocDetails(pipeCtx *pipeline.Context, connector *comm if cfg.IndexingDocs && (doc.Doc.Public > 0 || (cfg.IncludePrivateDoc)) { //index doc - document := common.Document{ - Source: common.DataSourceReference{ + document := core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", @@ -378,7 +378,7 @@ func (this *Plugin) collectDocDetails(pipeCtx *pipeline.Context, connector *comm Type: doc.Doc.Type, Size: doc.Doc.WordCount, URL: fmt.Sprintf("https://yuque.com/go/doc/%v", doc.Doc.ID), - Owner: &common.UserInfo{ + Owner: &core.UserInfo{ UserAvatar: doc.Doc.User.AvatarURL, UserName: doc.Doc.User.Name, UserID: doc.Doc.User.Login, @@ -434,7 +434,7 @@ func (this *Plugin) collectDocDetails(pipeCtx *pipeline.Context, connector *comm } } -func (this *Plugin) collectUsers(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource, login, token string, cfg *YuqueConfig) { +func (this *Plugin) collectUsers(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource, login, token string, cfg *YuqueConfig) { const pageSize = 100 offset := 0 @@ -458,7 +458,7 @@ func (this *Plugin) collectUsers(pipeCtx *pipeline.Context, connector *common.Co // Process users or groups in the response for _, groupUser := range users.GroupUsers { - var document common.Document + var document core.Document var idPrefix, docType string var metadata util.MapStr @@ -474,8 +474,8 @@ func (this *Plugin) collectUsers(pipeCtx *pipeline.Context, connector *common.Co "public_books_count": groupUser.User.PublicBooksCount, } - document = common.Document{ - Source: common.DataSourceReference{ + document = core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", @@ -503,8 +503,8 @@ func (this *Plugin) collectUsers(pipeCtx *pipeline.Context, connector *common.Co "public_books_count": groupUser.Group.PublicBooksCount, } - document = common.Document{ - Source: common.DataSourceReference{ + document = core.Document{ + Source: core.DataSourceReference{ ID: datasource.ID, Name: datasource.Name, Type: "connector", diff --git a/plugins/connectors/yuque/plugin.go b/plugins/connectors/yuque/plugin.go index d16c399e..878397a7 100644 --- a/plugins/connectors/yuque/plugin.go +++ b/plugins/connectors/yuque/plugin.go @@ -7,7 +7,7 @@ package yuque import ( "fmt" log "github.com/cihub/seelog" - "infini.sh/coco/modules/common" + "infini.sh/coco/core" cmn "infini.sh/coco/plugins/connectors/common" config3 "infini.sh/framework/core/config" "infini.sh/framework/core/pipeline" @@ -30,7 +30,7 @@ type Plugin struct { cmn.ConnectorProcessorBase } -func (this *Plugin) Fetch(pipeCtx *pipeline.Context, connector *common.Connector, datasource *common.DataSource) error { +func (this *Plugin) Fetch(pipeCtx *pipeline.Context, connector *core.Connector, datasource *core.DataSource) error { config := YuqueConfig{} this.MustParseConfig(datasource, &config) diff --git a/plugins/processors/dispatcher/config.go b/plugins/processors/dispatcher/config.go index d7ca7a63..afd882b0 100644 --- a/plugins/processors/dispatcher/config.go +++ b/plugins/processors/dispatcher/config.go @@ -6,5 +6,5 @@ package dispatcher type Config struct { MaxRunningTimeoutInSeconds int `json:"max_running_timeout_in_seconds" config:"max_running_timeout_in_seconds"` - PipelinesInSync bool `config:"pipelines_in_sync"` + PipelinesInSync bool `json:"pipelines_in_sync" config:"pipelines_in_sync"` } diff --git a/plugins/processors/dispatcher/datasource.go b/plugins/processors/dispatcher/datasource.go index 157a6a03..9fc4a863 100644 --- a/plugins/processors/dispatcher/datasource.go +++ b/plugins/processors/dispatcher/datasource.go @@ -7,13 +7,12 @@ package dispatcher import ( "fmt" "infini.sh/coco/core" - "infini.sh/coco/modules/common" "infini.sh/framework/core/errors" "infini.sh/framework/core/orm" "infini.sh/framework/core/pipeline" ) -func (processor *Dispatcher) syncDatasource(c *common.DataSource) error { +func (processor *Dispatcher) syncDatasource(c *core.DataSource) error { //check datasource and connector's config //create pipeline based sub tasks @@ -22,7 +21,7 @@ func (processor *Dispatcher) syncDatasource(c *common.DataSource) error { ctx := orm.NewContext() ctx.DirectReadAccess() - connector := common.Connector{} + connector := core.Connector{} connector.ID = c.Connector.ConnectorID exists, err := orm.GetV2(ctx, &connector) diff --git a/plugins/processors/dispatcher/dispatcher.go b/plugins/processors/dispatcher/dispatcher.go index 7b892190..333e2c88 100644 --- a/plugins/processors/dispatcher/dispatcher.go +++ b/plugins/processors/dispatcher/dispatcher.go @@ -6,6 +6,7 @@ package dispatcher import ( "fmt" + "infini.sh/coco/core" "infini.sh/framework/core/api" "infini.sh/framework/core/elastic" "infini.sh/framework/core/global" @@ -53,9 +54,9 @@ func (processor *Dispatcher) Process(ctx *pipeline.Context) error { // get active datasource list ctx1 := orm.NewContextWithParent(ctx) ctx1.DirectReadAccess() - orm.WithModel(ctx1, &common.DataSource{}) + orm.WithModel(ctx1, &core.DataSource{}) - docs := []common.DataSource{} + docs := []core.DataSource{} from := int64(0) size := int64(10) diff --git a/plugins/processors/summary/processor.go b/plugins/processors/summary/processor.go index f780501e..650b4073 100644 --- a/plugins/processors/summary/processor.go +++ b/plugins/processors/summary/processor.go @@ -11,7 +11,6 @@ import ( "github.com/tmc/langchaingo/llms" "github.com/tmc/langchaingo/llms/ollama" "infini.sh/coco/core" - "infini.sh/coco/modules/common" "infini.sh/framework/core/config" "infini.sh/framework/core/errors" "infini.sh/framework/core/global" @@ -121,7 +120,7 @@ func (processor *DocumentSummarizationProcessor) Process(ctx *pipeline.Context) if len(pop) > processor.config.MinInputDocumentLength { - doc := common.Document{} + doc := core.Document{} err := util.FromJSONBytes(pop, &doc) if err != nil { log.Error("error on handle document:", i, err) diff --git a/plugins/security/access_token.go b/plugins/security/access_token.go index 09ef616b..04922d0e 100644 --- a/plugins/security/access_token.go +++ b/plugins/security/access_token.go @@ -6,6 +6,8 @@ package security import ( "fmt" + "github.com/emirpasic/gods/sets/hashset" + "infini.sh/framework/core/api" "infini.sh/framework/core/orm" "net/http" "time" @@ -19,6 +21,22 @@ import ( "infini.sh/framework/core/util" ) +func GetPermissionKeys(u *security.UserSessionInfo) []security.PermissionKey { + //TODO cache, catch permission updates + keys := security.MustGetPermissionKeysByRole(u.Roles) + if len(u.Permissions) > 0 { + keys = append(keys, u.Permissions...) + } + return keys +} + +func GetPermissionHashSet(u *security.UserSessionInfo) *hashset.Set { + //TODO cache, catch permission updates + keys := GetPermissionKeys(u) + set := security.ConvertPermissionKeysToHashSet(keys) + return set +} + func GenerateJWTAccessToken(user *security.UserSessionInfo) (map[string]interface{}, error) { var data map[string]interface{} @@ -57,8 +75,6 @@ func GenerateJWTAccessToken(user *security.UserSessionInfo) (map[string]interfac func (h *APIHandler) RequestAccessToken(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { - ctx := orm.NewContextWithParent(req.Context()) - //user already login reqUser, err := security.GetUserFromContext(req.Context()) if reqUser == nil || err != nil { @@ -66,35 +82,39 @@ func (h *APIHandler) RequestAccessToken(w http.ResponseWriter, req *http.Request } reqBody := struct { - Name string `json:"name"` //custom access token name + Name string `json:"name"` //custom access token name + Permissions []security.PermissionKey `json:"permissions,omitempty"` //custom access token name }{} - err = h.DecodeJSON(req, &reqBody) + err = api.DecodeJSON(req, &reqBody) if err != nil { panic(err) } if reqBody.Name == "" { reqBody.Name = GenerateApiTokenName("") } - res, err := CreateAPIToken(ctx, reqBody.Name, "general", []string{security.RoleAdmin}) + + permission := security.MustGetPermissionKeysByUserID(reqUser.MustGetUserID()) + if len(reqBody.Permissions) > 0 { + //the permissions should be within' user's own permission scope + if !util.IsSuperset(security.ConvertPermissionKeysToHashSet(permission), security.ConvertPermissionKeysToHashSet(reqBody.Permissions)) { + panic("invalid permissions") + } + } + + res, err := CreateAPIToken(reqUser.MustGetUserID(), reqBody.Name, "general", permission) if err != nil { panic(err) } - h.WriteJSON(w, res, 200) + api.WriteJSON(w, res, 200) } -func CreateAPIToken(ctx *orm.Context, tokenName, typeName string, Roles []string) (util.MapStr, error) { +func CreateAPIToken(userID string, tokenName, typeName string, permissions []security.PermissionKey) (util.MapStr, error) { + if tokenName == "" { tokenName = GenerateApiTokenName("") } - reqUser, err := security.GetUserFromContext(ctx) - if reqUser == nil || err != nil { - panic(err) - } - - provider := "access_token" - res := util.MapStr{} accessTokenStr := util.GetUUID() + util.GenerateRandomString(64) res["access_token"] = accessTokenStr @@ -105,16 +125,17 @@ func CreateAPIToken(ctx *orm.Context, tokenName, typeName string, Roles []string tokenID := util.GetUUID() accessToken.ID = tokenID accessToken.AccessToken = accessTokenStr - accessToken.Provider = provider - accessToken.Login = reqUser.Login + accessToken.SetOwnerID(userID) + accessToken.Type = typeName - accessToken.Roles = Roles - accessToken.Permissions = []string{} + accessToken.Permissions = permissions accessToken.ExpireIn = expiredAT accessToken.Name = tokenName + ctx := orm.NewContext() + ctx.DirectAccess() ctx.Refresh = orm.WaitForRefresh - err = orm.Create(ctx, &accessToken) + err := orm.Create(ctx, &accessToken) if err != nil { panic(err) } @@ -122,7 +143,7 @@ func CreateAPIToken(ctx *orm.Context, tokenName, typeName string, Roles []string // save access token to store err = kv.AddValue(core.KVAccessTokenBucket, []byte(accessTokenStr), util.MustToJSONBytes(accessToken)) if err != nil { - return nil, err + panic(err) } return res, err } @@ -131,8 +152,7 @@ func (h *APIHandler) SearchAccessToken(w http.ResponseWriter, req *http.Request, //handle url query args, convert to query builder builder, err := orm.NewQueryBuilderFromRequest(req, "name") if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return + panic(err) } ctx := orm.NewContextWithParent(req.Context()) @@ -140,13 +160,12 @@ func (h *APIHandler) SearchAccessToken(w http.ResponseWriter, req *http.Request, res, err := orm.SearchV2(ctx, builder) if err != nil { - h.WriteError(w, err.Error(), http.StatusInternalServerError) - return + panic(err) } - _, err = h.Write(w, res.Payload.([]byte)) + _, err = api.Write(w, res.Payload.([]byte)) if err != nil { - h.Error(w, err) + api.Error(w, err) } } @@ -174,36 +193,37 @@ func (h *APIHandler) DeleteAccessToken(w http.ResponseWriter, req *http.Request, } } - h.WriteDeletedOKJSON(w, tokenID) + api.WriteDeletedOKJSON(w, tokenID) } func GetToken(token string) (*security.AccessToken, error) { tokenBytes, err := kv.GetValue(core.KVAccessTokenBucket, []byte(token)) if err != nil { - return nil, err + panic(err) } var accessToken = security.AccessToken{} err = util.FromJSONBytes(tokenBytes, &accessToken) if err != nil { - return nil, err + panic(err) } return &accessToken, nil } -func (h *APIHandler) RenameAccessToken(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { +func (h *APIHandler) UpdateAccessToken(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { reqUser, err := security.GetUserFromContext(req.Context()) if reqUser == nil || err != nil { panic(err) } reqBody := struct { - Name string `json:"name"` //custom access token name + Name string `json:"name,omitempty"` //custom access token name + Permissions []security.PermissionKey `json:"permissions,omitempty"` //custom access token name }{} - err = h.DecodeJSON(req, &reqBody) + err = api.DecodeJSON(req, &reqBody) if err != nil { panic(err) } if reqBody.Name == "" { - h.WriteError(w, "name is required", 400) + api.WriteError(w, "name is required", 400) return } tokenID := ps.ByName("token_id") @@ -214,22 +234,38 @@ func (h *APIHandler) RenameAccessToken(w http.ResponseWriter, req *http.Request, exists, err := orm.GetV2(ctx, &token) if err != nil { - h.WriteError(w, err.Error(), 400) - return + panic(err) } if !exists { - h.WriteError(w, "access token not found", 404) + api.WriteError(w, "access token not found", 404) return } - token.Name = reqBody.Name + if token.Name != "" { + token.Name = reqBody.Name + } + if len(reqBody.Permissions) > 0 { + //the permissions should be within' user's own permission scope + newPermission := security.ConvertPermissionKeysToHashSet(token.Permissions) + if !util.IsSuperset(GetPermissionHashSet(reqUser), newPermission) { + panic("invalid permissions") + } + token.Permissions = reqBody.Permissions + } + ctx.Refresh = orm.WaitForRefresh err = orm.Save(ctx, &token) if err != nil { - h.WriteError(w, err.Error(), 400) - return + panic(err) } - h.WriteUpdatedOKJSON(w, tokenID) + + // save access token to store + err = kv.AddValue(core.KVAccessTokenBucket, []byte(token.AccessToken), util.MustToJSONBytes(token)) + if err != nil { + panic(err) + } + + api.WriteUpdatedOKJSON(w, tokenID) } // GenerateApiTokenName generates a unique API token name diff --git a/plugins/security/account.go b/plugins/security/account.go index 6a9a14a0..f69d2108 100644 --- a/plugins/security/account.go +++ b/plugins/security/account.go @@ -6,7 +6,9 @@ package security import ( "fmt" + log "github.com/cihub/seelog" "infini.sh/framework/core/global" + "infini.sh/framework/core/orm" "net/http" "strings" @@ -41,13 +43,29 @@ func (h APIHandler) Profile(w http.ResponseWriter, r *http.Request, ps httproute panic("invalid user") } - var data []byte - data, err = kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultUserProfileKey)) + if reqUser.Provider == core.ProviderIntegration { + log.Trace("user login via INTEGRATION, guest user!") + h.WriteError(w, "no profile for guest user", 401) + return + } + + //TODO get from user's profile, or fallback to account info + + _, user, err := security.GetUserByID(reqUser.MustGetUserID()) if err != nil { panic(err) } + if user == nil { + panic("user not found") + } - h.WriteBytes(w, data, 200) + profile := security.UserProfile{Name: user.Name} + profile.Email = user.Email + profile.ID = user.ID + profile.Name = user.Name + profile.Permissions = security.MustGetPermissionKeysByRole(user.Roles) + + h.WriteJSON(w, profile, 200) } func (h APIHandler) UpdatePassword(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { @@ -69,28 +87,27 @@ func (h APIHandler) UpdatePassword(w http.ResponseWriter, r *http.Request, ps ht return } - err, success := h.checkPassword(req.OldPassword) + id := reqUser.MustGetUserID() + err, account, success := h.checkPasswordForUserID(id, req.OldPassword) if !success { h.WriteError(w, "failed to login", 403) return } - err = SavePassword(req.NewPassword) + hash, err := bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost) if err != nil { - h.ErrorInternalServer(w, err.Error()) - return + panic(err) } - h.WriteOKJSON(w, api.UpdateResponse(reqUser.Login)) - return -} - -func SavePassword(password string) error { - hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) + account.Password = string(hash) + ctx := orm.NewContextWithParent(r.Context()) + ctx.Refresh = orm.WaitForRefresh + err = orm.Save(ctx, account) if err != nil { - return err + panic(err) } - err = kv.AddValue(core.DefaultSettingBucketKey, []byte(core.DefaultUserPasswordKey), hash) - return err + + h.WriteUpdatedOKJSON(w, id) + return } func (h APIHandler) Login(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { @@ -100,6 +117,7 @@ func (h APIHandler) Login(w http.ResponseWriter, r *http.Request, ps httprouter. } var req struct { + Email string `json:"email,omitempty"` Password string `json:"password"` } @@ -138,25 +156,37 @@ func (h APIHandler) Login(w http.ResponseWriter, r *http.Request, ps httprouter. return } - // Rest of your existing logic - err, success := h.checkPassword(req.Password) - if !success { - h.WriteError(w, "failed to login", http.StatusForbidden) - return - } + sessionInfo := security.UserSessionInfo{} - var user = &security.UserProfile{ - Name: core.DefaultUserLogin, - } - user.ID = core.DefaultUserLogin + if req.Email == "" { + err, success := h.checkPassword(req.Password) + if err != nil { + panic(err) + } + if !success { + h.WriteError(w, "failed to login", http.StatusForbidden) + return + } - sessionInfo := security.UserSessionInfo{} - sessionInfo.Source = "simple" - sessionInfo.Provider = "simple" - sessionInfo.Login = core.DefaultUserLogin + sessionInfo.Provider = core.DefaultSimpleAuthBackend + sessionInfo.Login = core.DefaultSimpleAuthUserLogin + sessionInfo.Roles = []string{security.RoleAdmin} + sessionInfo.SetGetUserID(core.DefaultSimpleAuthUserLogin) + } else { + err, account, success := h.checkPasswordForEmail(req.Email, req.Password) + if err != nil { + panic(err) + } + if !success { + h.WriteError(w, "failed to login", http.StatusForbidden) + return + } - //sessionInfo.Profile = user - sessionInfo.Roles = []string{security.RoleAdmin} + sessionInfo.Provider = security.DefaultNativeAuthBackend + sessionInfo.Login = account.Email + sessionInfo.Roles = account.Roles + sessionInfo.SetGetUserID(account.ID) + } err, token := AddUserAccessTokenToSession(w, r, &sessionInfo) if err != nil { @@ -187,12 +217,50 @@ func AddUserAccessTokenToSession(w http.ResponseWriter, r *http.Request, user *s return nil, token } +func (h APIHandler) checkPasswordForEmail(email, password string) (error, *security.UserAccount, bool) { + + exists, account, err := security.MustGetAuthenticationProvider(security.DefaultNativeAuthBackend).GetUserByLogin(email) + if err != nil { + return err, nil, false + } + if !exists || account == nil || account.Password == "" { + //user not exists + return nil, nil, false + } + err = bcrypt.CompareHashAndPassword([]byte(account.Password), []byte(password)) + if err == nil { + return nil, account, true + } + return nil, nil, false +} + +func (h APIHandler) checkPasswordForUserID(id, password string) (error, *security.UserAccount, bool) { + + _, account, err := security.GetUserByID(id) + if err != nil { + return err, nil, false + } + if account == nil || account.Password == "" { + //user not exists + return nil, nil, false + } + err = bcrypt.CompareHashAndPassword([]byte(account.Password), []byte(password)) + if err == nil { + return nil, account, true + } + return nil, nil, false +} + func (h APIHandler) checkPassword(password string) (error, bool) { savedPassword, err := kv.GetValue(core.DefaultSettingBucketKey, []byte(core.DefaultUserPasswordKey)) if err != nil { return err, false } + if savedPassword == nil || len(savedPassword) == 0 { + panic("previous password was not set") + } + err = bcrypt.CompareHashAndPassword([]byte(savedPassword), []byte(password)) if err != nil { return err, false diff --git a/plugins/security/filter/auth.go b/plugins/security/filter/auth.go index ca99b85b..bde87a66 100644 --- a/plugins/security/filter/auth.go +++ b/plugins/security/filter/auth.go @@ -42,13 +42,15 @@ func (f *AuthFilter) ApplyFilter( return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - claims, err1 := core.ValidateLogin(r) + claims, err1 := core.ValidateLogin(w, r) if global.Env().IsDebug { log.Debug(method, ",", pattern, ",", util.MustToJSON(claims), ",", err1) } - if claims != nil && claims.ValidInfo() { + if claims != nil && claims.IsValid() { + //update the initial permission + claims.UserAssignedPermission = security.GetUserPermissions(claims) r = r.WithContext(security.AddUserToContext(r.Context(), claims)) } diff --git a/plugins/security/filter/cors.go b/plugins/security/filter/cors.go deleted file mode 100644 index e8182461..00000000 --- a/plugins/security/filter/cors.go +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright © INFINI Ltd. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package filter - -import ( - log "github.com/cihub/seelog" - "infini.sh/coco/core" - "infini.sh/framework/core/api" - httprouter "infini.sh/framework/core/api/router" - "infini.sh/framework/core/global" - "net/http" - "sync" -) - -func init() { - api.RegisterUIFilter(&CORSFilter{}) -} - -type CORSFilter struct { - api.Handler -} - -func (f *CORSFilter) GetPriority() int { - return 100 -} - -const FeatureCORS = "feature_cors" -const FeatureNotAllowCredentials = "feature_not_allow_credentials" - -func (f *CORSFilter) ApplyFilter( - method string, - pattern string, - options *api.HandlerOptions, - next httprouter.Handle, -) httprouter.Handle { - - //option not enabled - if options == nil || !options.Feature(FeatureCORS) { - log.Debug(method, ",", pattern, ",skip feature ", FeatureCORS) - return next - } - - return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - - origin := r.Header.Get("Origin") - if options.Feature(core.FeatureByPassCORSCheck) || (origin != "" && (r.Method == http.MethodOptions || isAllowedOrigin(origin, r))) { - w.Header().Set("Access-Control-Allow-Origin", origin) - w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") - w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, X-API-TOKEN, APP-INTEGRATION-ID, WEBSOCKET-SESSION-ID") - if options.Feature(FeatureNotAllowCredentials) { - w.Header().Set("Access-Control-Allow-Credentials", "false") - } else { - w.Header().Set("Access-Control-Allow-Credentials", "true") - } - // Handle preflight (OPTIONS) requests - if r.Method == "OPTIONS" && r.Header.Get("Access-Control-Request-Method") != "" { - // Respond with 200 OK for OPTIONS requests - w.WriteHeader(http.StatusOK) - return - } - } else { - if global.Env().IsDebug { - log.Warn("skipping place CORS headers: ", method, ",", pattern, ",origin:", origin, ",", origin != "", ",", r.Method == http.MethodOptions, ",", isAllowedOrigin(origin, r)) - } - } - - next(w, r, ps) - } -} - -var ( - allowOriginFuncs sync.Map -) - -// RegisterAllowOriginFunc registers a function to check if the origin is allowed. -// The key is used to identify the function. -func RegisterAllowOriginFunc(key string, fn AllowOriginFunc) { - if _, exists := allowOriginFuncs.Load(key); exists { - panic("key already exists, maybe you can remove it first") - } - allowOriginFuncs.Store(key, fn) -} - -// RemoveAllowOriginFunc removes the function to check if the origin is allowed. -func RemoveAllowOriginFunc(key string) { - allowOriginFuncs.Delete(key) -} - -// AllowOriginFunc is a function that checks if the origin is allowed. -type AllowOriginFunc func(origin string, req *http.Request) bool - -func isAllowedOrigin(origin string, req *http.Request) bool { - isAllowed := false - allowOriginFuncs.Range(func(key, value interface{}) bool { - if fn, ok := value.(AllowOriginFunc); ok { - //note: hear we pass the request to the function to allow the function to implement more complex logic - if fn != nil && fn(origin, req) { - isAllowed = true - // break the loop - return false - } - } - return true - }) - return isAllowed -} diff --git a/plugins/security/filter/fingerprint_throttle.go b/plugins/security/filter/fingerprint_throttle.go deleted file mode 100644 index 04177a18..00000000 --- a/plugins/security/filter/fingerprint_throttle.go +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package filter - -import ( - "crypto/sha256" - "encoding/hex" - "infini.sh/framework/core/global" - "io" - "net" - "net/http" - "strings" - "sync" - "time" - - log "github.com/cihub/seelog" - "infini.sh/framework/core/api" - httprouter "infini.sh/framework/core/api/router" -) - -func init() { - f := &FingerprintThrottleFilter{} - - // Register cleanup task only once - global.RegisterBackgroundCallback(&global.BackgroundTask{ - Tag: "fingerprint_throttle_filter_cleanup", - Func: func() { f.cleanupOldEntries() }, - Interval: 10 * time.Second, - }) - - api.RegisterUIFilter(f) -} - -type FingerprintThrottleFilter struct { - api.Handler - recent sync.Map -} - -func (f *FingerprintThrottleFilter) GetPriority() int { - return 20 -} - -const FeatureFingerprintThrottle = "fingerprint_throttle" -const throttleWindow = 100 * time.Millisecond - -func (f *FingerprintThrottleFilter) ApplyFilter( - method string, - pattern string, - options *api.HandlerOptions, - next httprouter.Handle, -) httprouter.Handle { - - //option not enabled - if options == nil || !options.Feature(FeatureFingerprintThrottle) { - log.Debug(method, ",", pattern, ",skip feature ", FeatureFingerprintThrottle) - return next - } - - return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - - fingerprint, err := f.computeFingerprint(r) - if global.Env().IsDebug { - log.Tracef("req: %v, fingerprint: %v", r.URL.String(), fingerprint) - } - if err != nil { - log.Warn("could not compute fingerprint:", err) - next(w, r, ps) - return - } - - now := time.Now() - - if tsRaw, exists := f.recent.Load(fingerprint); exists { - if ts, ok := tsRaw.(time.Time); ok && now.Sub(ts) < throttleWindow { - log.Warnf("duplicate request throttled: %s", fingerprint) - http.Error(w, "Too many duplicate requests", http.StatusTooManyRequests) - return - } - } - - // Store/Update fingerprint - f.recent.Store(fingerprint, now) - - next(w, r, ps) - } -} - -func (f *FingerprintThrottleFilter) computeFingerprint(r *http.Request) (string, error) { - hasher := sha256.New() - - ip, _, err := net.SplitHostPort(r.RemoteAddr) - if err != nil { - ip = r.RemoteAddr // fallback - } - method := r.Method - path := r.URL.Path - - // Basic fingerprint parts - hasher.Write([]byte(ip)) - hasher.Write([]byte(method)) - hasher.Write([]byte(path)) - - // Headers of interest - headers := []string{"Authorization", "User-Agent", "Content-Type"} - for _, h := range headers { - hasher.Write([]byte(r.Header.Get(h))) - } - - // Include body if available (e.g., POST/PUT) - if method == http.MethodPost || method == http.MethodPut { - // Ensure body is always closed, even if panic occurs - defer r.Body.Close() - - bodyBytes, err := io.ReadAll(r.Body) - if err != nil { - return "", err - } - - // Reconstruct Body so it can be read again downstream - r.Body = io.NopCloser(strings.NewReader(string(bodyBytes))) - - hasher.Write(bodyBytes) - } - - return hex.EncodeToString(hasher.Sum(nil)), nil -} - -func (f *FingerprintThrottleFilter) cleanupOldEntries() { - now := time.Now() - f.recent.Range(func(key, value any) bool { - if ts, ok := value.(time.Time); ok { - if now.Sub(ts) > 2*throttleWindow { - f.recent.Delete(key) - } - } - return true - }) -} diff --git a/plugins/security/filter/json_mask.go b/plugins/security/filter/json_mask.go deleted file mode 100644 index d1e418b8..00000000 --- a/plugins/security/filter/json_mask.go +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ -package filter - -import ( - "bytes" - "encoding/json" - log "github.com/cihub/seelog" - "infini.sh/framework/core/api" - httprouter "infini.sh/framework/core/api/router" - "net/http" -) - -const FeatureMaskSensitiveField = "feature_sensitive_fields" -const FeatureRemoveSensitiveField = "feature_sensitive_fields_remove_sensitive_field" - -const SensitiveFields = "feature_sensitive_fields_extra_keys" - -var sensitiveFields = map[string]bool{ - "password": true, - "token": true, - "secret": true, - "access_token": true, - "refresh_token": true, -} - -type JSONMaskFilter struct{} - -func init() { - api.RegisterUIFilter(&JSONMaskFilter{}) -} - -func (f *JSONMaskFilter) GetPriority() int { - // Lower values execute first - return 1000 -} - -func (f *JSONMaskFilter) ApplyFilter( - method string, - pattern string, - options *api.HandlerOptions, - next httprouter.Handle, -) httprouter.Handle { - - //option not enabled - if options == nil || !(options.Feature(FeatureRemoveSensitiveField) || options.Feature(FeatureMaskSensitiveField)) { - log.Debug(method, ",", pattern, ",skip feature ", FeatureMaskSensitiveField, ",", options.Feature(FeatureRemoveSensitiveField), ",", options.Feature(FeatureMaskSensitiveField)) - return next - } - - return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - - // Create a response recorder to capture the response - rec := &responseInterceptor{ResponseWriter: w, buf: new(bytes.Buffer)} - next(rec, r, ps) - - var extraFields map[string]bool - extra, ok := options.Labels[SensitiveFields] - if ok { - extraFields = map[string]bool{} - extraFields, ok = extra.(map[string]bool) - } - - var remove = options.Feature(FeatureRemoveSensitiveField) - - // Process and modify the response body - maskedBody := maskJSONFields(rec.buf.Bytes(), extraFields, remove) - - // Write the modified response - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(rec.statusCode) - w.Write(maskedBody) - } -} - -// Interceptor to capture the response body -type responseInterceptor struct { - http.ResponseWriter - buf *bytes.Buffer - statusCode int -} - -func (r *responseInterceptor) WriteHeader(code int) { - r.statusCode = code - r.ResponseWriter.WriteHeader(code) -} - -func (r *responseInterceptor) Write(b []byte) (int, error) { - return r.buf.Write(b) -} - -// Function to mask sensitive fields in JSON -func maskJSONFields(data []byte, secretFields map[string]bool, remove bool) []byte { - var result map[string]interface{} - err := json.Unmarshal(data, &result) - if err != nil { - return data // Return original data if parsing fails - } - - maskFields(result, secretFields, remove) - - modified, err := json.Marshal(result) - if err != nil { - return data // Return original data if re-encoding fails - } - return modified -} -func maskFields(obj map[string]interface{}, secretFields map[string]bool, remove bool) { - for key, value := range obj { - // If the key is in the sensitive list, either remove it or mask it - if _, found := sensitiveFields[key]; found || secretFields[key] { - if remove { - delete(obj, key) - } else { - obj[key] = "***" - } - continue - } - - // Recursively process nested objects - switch v := value.(type) { - case map[string]interface{}: - maskFields(v, secretFields, remove) // Recursive call for nested maps - - case []interface{}: - newArray := make([]interface{}, 0, len(v)) // Create a new slice - - for _, item := range v { - if nestedObj, ok := item.(map[string]interface{}); ok { - maskFields(nestedObj, secretFields, remove) // Process objects inside arrays - newArray = append(newArray, nestedObj) - } else { - // If the key is sensitive and the array contains raw values, mask or remove - if secretFields[key] || sensitiveFields[key] { - if !remove { - newArray = append(newArray, "***") // Mask - } - } else { - newArray = append(newArray, item) // Keep non-sensitive values - } - } - } - - obj[key] = newArray // Replace with modified array - } - } -} diff --git a/plugins/security/filter/permission.go b/plugins/security/filter/permission.go deleted file mode 100644 index 7d445e5f..00000000 --- a/plugins/security/filter/permission.go +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright © INFINI LTD. All rights reserved. - * Web: https://infinilabs.com - * Email: hello#infini.ltd */ - -package filter - -import ( - log "github.com/cihub/seelog" - "infini.sh/framework/core/api" - common "infini.sh/framework/core/api/common" - httprouter "infini.sh/framework/core/api/router" - "infini.sh/framework/core/errors" - "infini.sh/framework/core/global" - "infini.sh/framework/core/security" - "infini.sh/framework/core/util" - ccache "infini.sh/framework/lib/cache" - "net/http" - "time" -) - -func init() { - api.RegisterUIFilter(&PermissionFilter{}) -} - -type PermissionFilter struct { - api.Handler -} - -func (f *PermissionFilter) GetPriority() int { - return 500 -} - -func (f *PermissionFilter) ApplyFilter( - method string, - pattern string, - options *api.HandlerOptions, - next httprouter.Handle, -) httprouter.Handle { - - if options == nil || options.RequirePermission == nil || len(options.RequirePermission) == 0 || !common.IsAuthEnable() { - log.Debug(method, ",", pattern, ",skip permission check") - return next - } - - return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - - reqUser, err := security.GetUserFromContext(r.Context()) - if reqUser == nil || err != nil { - o := api.PrepareErrorJson("invalid login", 401) - f.WriteJSON(w, o, 401) - return - } - - //bypass admin - if reqUser.Roles != nil && util.AnyInArrayEquals(reqUser.Roles, security.RoleAdmin) { - next(w, r, ps) - return - } - - if reqUser.UserAssignedPermission == nil || reqUser.UserAssignedPermission.NeedRefresh() { - reqUser.UserAssignedPermission = GetUserPermissions(reqUser) - } - - if reqUser.UserAssignedPermission == nil || options.RequirePermission == nil || len(options.RequirePermission) == 0 { - panic("invalid permission state") - } - - if global.Env().IsDebug { - log.Tracef("perm key: %v", options.RequirePermission) - } - - if reqUser.UserAssignedPermission.Validate(security.MustRegisterPermissionByKeys(options.RequirePermission)) { - next(w, r, ps) - } else { - f.WriteErrorObject(w, errors.Errorf("permission [%v] not allowed", options.RequirePermission), 403) - } - } -} - -var permissionCache = ccache.Layered(ccache.Configure().MaxSize(10000).ItemsToPrune(100)) - -func GetUserPermissions(shortUser *security.UserSessionInfo) *security.UserAssignedPermission { - - var skipCache = false - if shortUser.UserAssignedPermission != nil && shortUser.UserAssignedPermission.NeedRefresh() { - skipCache = true - } - - if !skipCache { - v := permissionCache.Get(PermissionCache, shortUser.GetKey()) - if v != nil { - if !v.Expired() { - x, ok := v.Value().(*security.UserAssignedPermission) - if ok { - if global.Env().IsDebug { - log.Debug("hit permission cache") - x.Dump() - } - return x - } - } - } - } - - var allowedPermissions = []string{} - if len(shortUser.Roles) > 0 { - for _, v := range shortUser.Roles { - perms, ok := security.GetPermissionsForRole(v) - if !ok { - panic(errors.Errorf("invalid role: %v", v)) - } - allowedPermissions = append(allowedPermissions, perms...) - } - } - - //user, err := security.GetUser(shortUser.UserID) - //if err != nil { - // panic(err) - //} - - //privilege := api2.GetUserAllowedPrivileges(shortUser, user) - //log.Debugf("get user's privileges: %v, %v", shortUser.UserID, privilege) - - //for _, v := range privilege { - // p := security.DefaultRBAC.GetPrivilege(v) - // if p != nil { - // for resource, n := range p.Grants { - // for x, _ := range n { - // id := security.GetSimplePermission(permission.CategoryPlatform, resource, string(x)) - // allowedPermissions = append(allowedPermissions, id) - // log.Debugf("register permission: %v, category: %v, resource: %v, action: %v", id, permission.CategoryPlatform, resource, string(x)) - // } - // } - // } - //} - - //log.Error("user's permissioins:", allowedPermissions) - perms := security.NewUserAssignedPermission(allowedPermissions, nil) - if perms != nil { - permissionCache.Set(PermissionCache, shortUser.GetKey(), perms, util.GetDurationOrDefault("30m", time.Duration(30)*time.Minute)) - return perms - } - return nil -} - -const PermissionCache = "UserPermissionCache" diff --git a/plugins/security/init.go b/plugins/security/init.go index 90c01d68..ff64cbe2 100644 --- a/plugins/security/init.go +++ b/plugins/security/init.go @@ -5,9 +5,10 @@ package security import ( - "infini.sh/coco/plugins/security/filter" + "infini.sh/coco/core" "infini.sh/framework/core/api" "infini.sh/framework/core/global" + "infini.sh/framework/core/security" ) type APIHandler struct { @@ -21,17 +22,25 @@ func init() { global.RegisterFuncBeforeSetup(func() { //for not managed only if !global.Env().SystemConfig.WebAppConfig.Security.Managed { - api.HandleUIMethod(api.GET, "/account/profile", apiHandler.Profile, api.RequireLogin()) + api.HandleUIMethod(api.GET, "/account/profile", apiHandler.Profile, api.RequireLogin(), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/account/profile", apiHandler.Profile, api.RequireLogin(), api.Feature(core.FeatureCORS)) api.HandleUIMethod(api.POST, "/account/login", apiHandler.Login) api.HandleUIMethod(api.PUT, "/account/password", apiHandler.UpdatePassword, api.RequireLogin()) } }) - api.HandleUIMethod(api.POST, "/account/logout", apiHandler.Logout, api.OptionLogin()) + api.HandleUIMethod(api.POST, "/account/logout", apiHandler.Logout, api.OptionLogin(), api.Feature(core.FeatureCORS)) + api.HandleUIMethod(api.OPTIONS, "/account/logout", apiHandler.Logout, api.OptionLogin(), api.Feature(core.FeatureCORS)) - api.HandleUIMethod(api.POST, "/auth/access_token", apiHandler.RequestAccessToken, api.RequireLogin()) - api.HandleUIMethod(api.GET, "/auth/access_token/_search", apiHandler.SearchAccessToken, api.RequireLogin(), api.Feature(filter.FeatureMaskSensitiveField)) - api.HandleUIMethod(api.DELETE, "/auth/access_token/:token_id", apiHandler.DeleteAccessToken, api.RequireLogin()) - api.HandleUIMethod(api.POST, "/auth/access_token/:token_id/_rename", apiHandler.RenameAccessToken, api.RequireLogin()) + createTokenPermission := security.GetSimplePermission("generic", "security:auth:api-token", security.Create) + updateTokenPermission := security.GetSimplePermission("generic", "security:auth:api-token", security.Update) + deleteTokenPermission := security.GetSimplePermission("generic", "security:auth:api-token", security.Delete) + searchTokenPermission := security.GetSimplePermission("generic", "security:auth:api-token", security.Search) + security.GetOrInitPermissionKeys(createTokenPermission, updateTokenPermission, deleteTokenPermission, searchTokenPermission) + + api.HandleUIMethod(api.POST, "/auth/access_token", apiHandler.RequestAccessToken, api.RequirePermission(createTokenPermission)) + api.HandleUIMethod(api.GET, "/auth/access_token/_search", apiHandler.SearchAccessToken, api.RequirePermission(searchTokenPermission), api.Feature(core.FeatureMaskSensitiveField)) + api.HandleUIMethod(api.DELETE, "/auth/access_token/:token_id", apiHandler.DeleteAccessToken, api.RequirePermission(deleteTokenPermission)) + api.HandleUIMethod(api.PUT, "/auth/access_token/:token_id", apiHandler.UpdateAccessToken, api.RequirePermission(updateTokenPermission)) } diff --git a/plugins/webhooks/gitlab/core/core.go b/plugins/webhooks/gitlab/core/core.go new file mode 100644 index 00000000..cea43baa --- /dev/null +++ b/plugins/webhooks/gitlab/core/core.go @@ -0,0 +1,284 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package core + +type MergeRequestEvent struct { + ObjectKind string `json:"object_kind"` + EventType string `json:"event_type"` + User UserInfo `json:"user"` + Project ProjectInfo `json:"project"` + Repository RepositoryInfo `json:"repository"` + ObjectAttributes MergeRequestAttrs `json:"object_attributes"` + Labels []LabelInfo `json:"labels"` + Changes map[string]Change `json:"changes,omitempty"` +} + +type UserInfo struct { + ID int64 `json:"id"` + Name string `json:"name"` + Username string `json:"username"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` + Email string `json:"email"` + State string `json:"state"` +} + +type ProjectInfo struct { + ID int64 `json:"id"` + Name string `json:"name"` + Namespace string `json:"namespace"` + PathWithNamespace string `json:"path_with_namespace"` + WebURL string `json:"web_url"` + GitSSHURL string `json:"git_ssh_url"` + GitHTTPURL string `json:"git_http_url"` + DefaultBranch string `json:"default_branch"` + Description *string `json:"description"` +} + +type RepositoryInfo struct { + Name string `json:"name"` + URL string `json:"url"` + Description *string `json:"description"` + Homepage string `json:"homepage"` +} + +type MergeRequestAttrs struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + TargetBranch string `json:"target_branch"` + SourceBranch string `json:"source_branch"` + Title string `json:"title"` + Description string `json:"description"` + Action string `json:"action"` + State string `json:"state"` + StateID int64 `json:"state_id"` + MergeStatus string `json:"merge_status"` + DetailedMergeStatus string `json:"detailed_merge_status"` + URL string `json:"url"` + AuthorID int64 `json:"author_id"` + AssigneeIDs []int64 `json:"assignee_ids"` + ReviewerIDs []int64 `json:"reviewer_ids"` + SourceProjectID int64 `json:"source_project_id"` + TargetProjectID int64 `json:"target_project_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + LastCommit CommitInfo `json:"last_commit"` + MergeParams map[string]any `json:"merge_params"` + WorkInProgress bool `json:"work_in_progress"` + Draft bool `json:"draft"` + BlockingDiscussionsResolved bool `json:"blocking_discussions_resolved"` + FirstContribution bool `json:"first_contribution"` + Source ProjectInfo `json:"source"` + Target ProjectInfo `json:"target"` +} + +type CommitInfo struct { + ID string `json:"id"` + Message string `json:"message"` + Title string `json:"title"` + Timestamp string `json:"timestamp"` + URL string `json:"url"` + Author CommitAuthor `json:"author"` +} + +type CommitAuthor struct { + Name string `json:"name"` + Email string `json:"email"` +} + +type LabelInfo struct { + ID int64 `json:"id,omitempty"` + Title string `json:"title,omitempty"` +} + +type Change struct { + Previous any `json:"previous,omitempty"` + Current any `json:"current,omitempty"` +} + +type MergeRequestDetail struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + ProjectID int64 `json:"project_id"` + Title string `json:"title"` + Description string `json:"description"` + State string `json:"state"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + MergedBy *UserInfo `json:"merged_by"` + MergeUser *UserInfo `json:"merge_user"` + MergedAt *string `json:"merged_at"` + ClosedBy *UserInfo `json:"closed_by"` + ClosedAt *string `json:"closed_at"` + TargetBranch string `json:"target_branch"` + SourceBranch string `json:"source_branch"` + UserNotesCount int64 `json:"user_notes_count"` + Upvotes int64 `json:"upvotes"` + Downvotes int64 `json:"downvotes"` + Author UserInfo `json:"author"` + Assignees []UserInfo `json:"assignees"` + Assignee *UserInfo `json:"assignee"` + Reviewers []UserInfo `json:"reviewers"` + SourceProjectID int64 `json:"source_project_id"` + TargetProjectID int64 `json:"target_project_id"` + Labels []string `json:"labels"` + Draft bool `json:"draft"` + WorkInProgress bool `json:"work_in_progress"` + Milestone *MilestoneInfo `json:"milestone"` + MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` + MergeStatus string `json:"merge_status"` + DetailedMergeStatus string `json:"detailed_merge_status"` + SHA string `json:"sha"` + MergeCommitSHA *string `json:"merge_commit_sha"` + SquashCommitSHA *string `json:"squash_commit_sha"` + DiscussionLocked *bool `json:"discussion_locked"` + ShouldRemoveSourceBranch *bool `json:"should_remove_source_branch"` + ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` + PreparedAt string `json:"prepared_at"` + Reference string `json:"reference"` + References MRReferences `json:"references"` + WebURL string `json:"web_url"` + TimeStats MRTimeStats `json:"time_stats"` + Squash bool `json:"squash"` + SquashOnMerge bool `json:"squash_on_merge"` + TaskCompletionStatus TaskCompletionStatus `json:"task_completion_status"` + HasConflicts bool `json:"has_conflicts"` + BlockingDiscussionsResolved bool `json:"blocking_discussions_resolved"` + ApprovalsBeforeMerge *int `json:"approvals_before_merge"` + Subscribed bool `json:"subscribed"` + ChangesCount string `json:"changes_count"` + LatestBuildStartedAt *string `json:"latest_build_started_at"` + LatestBuildFinishedAt *string `json:"latest_build_finished_at"` + FirstDeployedToProductionAt *string `json:"first_deployed_to_production_at"` + Pipeline *PipelineInfo `json:"pipeline"` + HeadPipeline *PipelineInfo `json:"head_pipeline"` + DiffRefs DiffRefs `json:"diff_refs"` + MergeError *string `json:"merge_error"` + FirstContribution bool `json:"first_contribution"` + User MRUserPermission `json:"user"` +} + +type MilestoneInfo struct { + ID int64 `json:"id"` + IID int64 `json:"iid"` + Title string `json:"title"` + Description *string `json:"description"` + DueDate *string `json:"due_date"` + StartDate *string `json:"start_date"` + State string `json:"state"` +} + +type MRReferences struct { + Short string `json:"short"` + Relative string `json:"relative"` + Full string `json:"full"` +} + +type MRTimeStats struct { + TimeEstimate int64 `json:"time_estimate"` + TotalTimeSpent int64 `json:"total_time_spent"` + HumanTimeEstimate *string `json:"human_time_estimate"` + HumanTotalTimeSpent *string `json:"human_total_time_spent"` +} + +type TaskCompletionStatus struct { + Count int64 `json:"count"` + CompletedCount int64 `json:"completed_count"` +} + +type PipelineInfo struct { + ID int64 `json:"id,omitempty"` + Status string `json:"status,omitempty"` + Ref string `json:"ref,omitempty"` + SHA string `json:"sha,omitempty"` + WebURL string `json:"web_url,omitempty"` +} + +type DiffRefs struct { + BaseSHA string `json:"base_sha"` + HeadSHA string `json:"head_sha"` + StartSHA string `json:"start_sha"` +} + +type MRUserPermission struct { + CanMerge bool `json:"can_merge"` +} + +type MRCommit struct { + ID string `json:"id"` + ShortID string `json:"short_id"` + CreatedAt string `json:"created_at"` + ParentIDs []string `json:"parent_ids"` + Title string `json:"title"` + Message string `json:"message"` + AuthorName string `json:"author_name"` + AuthorEmail string `json:"author_email"` + AuthoredDate string `json:"authored_date"` + CommitterName string `json:"committer_name"` + CommitterEmail string `json:"committer_email"` + CommittedDate string `json:"committed_date"` + Trailers map[string]string `json:"trailers"` + ExtendedTrailers map[string]string `json:"extended_trailers"` + WebURL string `json:"web_url"` +} + +type MRDiff struct { + Diff string `json:"diff"` + Collapsed bool `json:"collapsed"` + TooLarge bool `json:"too_large"` + NewPath string `json:"new_path"` + OldPath string `json:"old_path"` + AMode string `json:"a_mode"` + BMode string `json:"b_mode"` + NewFile bool `json:"new_file"` + RenamedFile bool `json:"renamed_file"` + DeletedFile bool `json:"deleted_file"` + GeneratedFile bool `json:"generated_file"` +} + +type FileContent struct { + FileName string `json:"file_name"` + FilePath string `json:"file_path"` + Size int `json:"size"` + Encoding string `json:"encoding"` + ContentSHA256 string `json:"content_sha256"` + Ref string `json:"ref"` + BlobID string `json:"blob_id"` + CommitID string `json:"commit_id"` + LastCommitID string `json:"last_commit_id"` + ExecuteFilemode bool `json:"execute_filemode"` + Content string `json:"content"` +} + +type MergeRequestNote struct { + ID int64 `json:"id"` + Type *string `json:"type"` // nullable + Body string `json:"body"` + Author NoteAuthor `json:"author"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + System bool `json:"system"` + NoteableID int64 `json:"noteable_id"` + NoteableType string `json:"noteable_type"` + ProjectID int64 `json:"project_id"` + Resolvable bool `json:"resolvable"` + Confidential bool `json:"confidential"` + Internal bool `json:"internal"` + Imported bool `json:"imported"` + ImportedFrom string `json:"imported_from"` + NoteableIID int64 `json:"noteable_iid"` + CommandsChange map[string]interface{} `json:"commands_changes"` +} + +type NoteAuthor struct { + ID int64 `json:"id"` + Username string `json:"username"` + PublicEmail *string `json:"public_email"` // nullable + Name string `json:"name"` + State string `json:"state"` + Locked bool `json:"locked"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` +} diff --git a/plugins/webhooks/gitlab/incoming/incoming_event_processor.go b/plugins/webhooks/gitlab/incoming/incoming_event_processor.go new file mode 100644 index 00000000..918bd7fa --- /dev/null +++ b/plugins/webhooks/gitlab/incoming/incoming_event_processor.go @@ -0,0 +1,361 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package incoming + +import ( + "context" + "fmt" + log "github.com/cihub/seelog" + core2 "infini.sh/coco/core" + "infini.sh/coco/modules/assistant" + "infini.sh/coco/plugins/webhooks/gitlab/core" + "infini.sh/framework/core/api" + "infini.sh/framework/core/config" + "infini.sh/framework/core/pipeline" + "infini.sh/framework/core/queue" + "infini.sh/framework/core/util" + url2 "net/url" + "strings" + "time" +) + +func init() { + //fetch related files and save to db? + //prepare context for LLM process + //send event to Gitlab? + +} + +type Config struct { + Token string `json:"token" config:"token"` + Endpoint string `json:"endpoint" config:"endpoint"` + FinalReviewAssistant string `json:"report_assistant" config:"report_assistant"` + SummaryAssistant string `json:"summary_assistant" config:"summary_assistant"` + PageSize int `json:"page_size" config:"page_size"` + MaxInputLength int `json:"max_input_length" config:"max_input_length"` + MaxBatchSize int `json:"max_batch_size" config:"max_batch_size"` + IncludeOldFile bool `json:"include_old_file" config:"include_old_file"` + OnEvents []string `json:"on_events" config:"on_events"` +} + +type Processor struct { + api.Handler + Queue *queue.QueueConfig `config:"queue"` + + config *Config +} + +const processorName = "gitlab_incoming_message" + +func init() { + pipeline.RegisterProcessorPlugin(processorName, New) +} + +func New(c *config.Config) (pipeline.Processor, error) { + cfg := Config{PageSize: 10, MaxBatchSize: 10, MaxInputLength: 10 * 1024, OnEvents: []string{"open", "update", "reopen"}} + if err := c.Unpack(&cfg); err != nil { + return nil, fmt.Errorf("failed to unpack the configuration of flow_replay processor: %s", err) + } + runner := Processor{config: &cfg} + return &runner, nil +} + +func (processor *Processor) Name() string { + return processorName +} + +func (processor *Processor) Process(ctx *pipeline.Context) error { + + bodyBytes, ok := ctx.GetBytes("body_bytes") + if ok { + event := core.MergeRequestEvent{} + util.MustFromJSONBytes(bodyBytes, &event) + log.Debug(util.MustToJSON(event)) + + docV := ctx.Get("document") + doc, ok := docV.(core2.Document) + if ok { + switch event.ObjectAttributes.Action { + case "open": + doc.Title = fmt.Sprintf("[%v] 创建了 MR: %v", event.User.Name, event.ObjectAttributes.Title) + break + case "update": + doc.Title = fmt.Sprintf("[%v] 更新了 MR: %v", event.User.Name, event.ObjectAttributes.Title) + break + case "close": + doc.Title = fmt.Sprintf("[%v] 关闭了 MR: %v", event.User.Name, event.ObjectAttributes.Title) + break + case "reopen": + doc.Title = fmt.Sprintf("[%v] 重新打开了 MR: %v", event.User.Name, event.ObjectAttributes.Title) + break + default: + //save to store + doc.Title = fmt.Sprintf("[%v] [%v] on MR: %v", event.User.Name, event.ObjectAttributes.Action, event.ObjectAttributes.Title) + } + + if util.ContainsAnyInArray(event.ObjectAttributes.Action, processor.config.OnEvents) { + processor.onOpenMR(&doc, &event) + } + + doc.ID = util.GetUUID() + doc.Category = event.Repository.Name + doc.Metadata["project_id"] = event.Project.ID + doc.Metadata["action"] = event.ObjectAttributes.Action + doc.Metadata["mr_id"] = event.ObjectAttributes.IID + doc.Metadata["target_branch"] = event.ObjectAttributes.TargetBranch + doc.Payload["raw_event"] = event + + ctx.Set("document", doc) + } + + } + + return nil +} + +func (processor *Processor) onOpenMR(doc *core2.Document, event *core.MergeRequestEvent) { + details, _ := processor.getMRDetail(event.Project.ID, event.ObjectAttributes.IID) + + var ( + pageNo = 1 + allSummaries []string + ) + + log.Debug(util.ToJson(processor.config, true)) + + for { + log.Infof("Processing MR diffs, page: %d", pageNo) + diffs, _ := processor.getMRDiffs(event.Project.ID, event.ObjectAttributes.IID, pageNo) + if len(diffs) == 0 { + break + } + pageNo++ + + total := len(diffs) + batchSize := processor.config.MaxBatchSize + totalBatches := (total + batchSize - 1) / batchSize + + for batchIndex := 0; batchIndex < totalBatches; batchIndex++ { + start := batchIndex * batchSize + end := start + batchSize + if end > total { + end = total + } + + batch := diffs[start:end] + previousFiles := make(map[string]*core.FileContent, len(batch)) + for _, diff := range batch { + if v, _ := processor.getPreviousFile(event.Project.ID, diff.OldPath, event.ObjectAttributes.TargetBranch); v != nil { + previousFiles[diff.OldPath] = v + } + } + + localVars := map[string]interface{}{ + "details": util.SubStringWithSuffix(util.MustToJSON(details), processor.config.MaxInputLength, "..."), + "diffs": util.SubStringWithSuffix(util.MustToJSON(batch), processor.config.MaxInputLength, "..."), + "old_files": util.SubStringWithSuffix(util.MustToJSON(previousFiles), processor.config.MaxInputLength, "..."), + "is_batch": true, + "review_hits": batchIndex + 1, + "batch_total": totalBatches, + "batch_size": len(batch), + "batch_context_note": "本次审查只关注当前批次文件,请不要包含前批次内容。", + } + + // --- Single AI call per batch/page to produce incremental summary --- + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + log.Infof("Calling AI summary assistant for page %d, batch %d/%d...", pageNo-1, batchIndex+1, totalBatches) + + pageSummary, err := assistant.AskAssistantSync(ctx, doc.GetOwnerID(), processor.config.SummaryAssistant, doc.Title, localVars) + cancel() + + if err != nil { + log.Errorf("Summary assistant error (page %d, batch %d): %v", pageNo-1, batchIndex+1, err) + continue + } + + if pageSummary != "" { + log.Infof("Incremental summary collected for page %d, batch %d,\n%v", pageNo-1, batchIndex+1, pageSummary) + allSummaries = append(allSummaries, pageSummary) + log.Infof("Incremental summary collected for page %d, batch %d", pageNo-1, batchIndex+1) + } + } + } + + // ---- Final MR Review ---- + if len(allSummaries) > 0 { + log.Info("Generating final MR review report...") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + defer cancel() + + finalVars := map[string]interface{}{ + "merge_request_details": util.SubStringWithSuffix(util.MustToJSON(details), processor.config.MaxInputLength, "..."), + "all_page_summaries": strings.Join(allSummaries, "\n\n"), + "summary_count": len(allSummaries), + } + + finalReport, err := assistant.AskAssistantSync(ctx, doc.GetOwnerID(), processor.config.FinalReviewAssistant, "Final MR Review Report", finalVars) + if err != nil { + log.Errorf("Final report generation error: %v", err) + return + } + + if finalReport != "" { + log.Info("Posting final AI review to GitLab...") + res, err := processor.postReply(event.Project.ID, event.ObjectAttributes.IID, finalReport) + if err != nil { + log.Error(err, ",", util.MustToJSON(res)) + } + } + } +} + +func JoinAPIURL(base string, apiPath string, query map[string]string) string { + base = strings.TrimRight(base, "/") + apiPath = strings.TrimLeft(apiPath, "/") + + fullURL := base + "/" + apiPath + + if len(query) > 0 { + values := url2.Values{} + for k, v := range query { + values.Set(k, v) + } + fullURL += "?" + values.Encode() + } + + log.Debug(fullURL) + return fullURL +} + +func (processor *Processor) getMRDetail(projectID, mrID int64) (*core.MergeRequestDetail, error) { + url := JoinAPIURL( + processor.config.Endpoint, + fmt.Sprintf("/api/v4/projects/%v/merge_requests/%v", projectID, mrID), + nil, // no query params + ) + + req1 := util.NewGetRequest(url, nil) + req1.AddHeader("PRIVATE-TOKEN", processor.config.Token) + res, err := util.ExecuteRequest(req1) + if err != nil { + return nil, err + } + + if res != nil { + //log.Error(string(res.Body)) + detail := core.MergeRequestDetail{} + log.Debug(string(res.Body)) + util.MustFromJSONBytes(res.Body, &detail) + return &detail, nil + } + + return nil, err +} +func (processor *Processor) getMRCommits(projectID, mrID int64) ([]core.MRCommit, error) { + url := JoinAPIURL( + processor.config.Endpoint, + fmt.Sprintf("/api/v4/projects/%v/merge_requests/%v/commits", projectID, mrID), + nil, // no query params + ) + req1 := util.NewGetRequest(url, nil) + req1.AddHeader("PRIVATE-TOKEN", processor.config.Token) + res, err := util.ExecuteRequest(req1) + if err != nil { + return nil, err + } + + if res != nil { + //log.Error(string(res.Body)) + commits := []core.MRCommit{} + log.Debug(string(res.Body)) + util.MustFromJSONBytes(res.Body, &commits) + log.Debug(util.MustToJSON(commits)) + return commits, nil + } + + return nil, err +} +func (processor *Processor) getMRDiffs(projectID, mrID int64, pageNo int) ([]core.MRDiff, error) { + args := map[string]string{"per_page": util.IntToString(processor.config.PageSize)} + args["page"] = fmt.Sprintf("%v", pageNo) + url := JoinAPIURL( + processor.config.Endpoint, + fmt.Sprintf("/api/v4/projects/%v/merge_requests/%v/diffs", projectID, mrID), + args, + ) + req1 := util.NewGetRequest(url, nil) + req1.AddHeader("PRIVATE-TOKEN", processor.config.Token) + res, err := util.ExecuteRequest(req1) + if err != nil { + return nil, err + } + + if res != nil { + log.Debug(string(res.Body)) + commits := []core.MRDiff{} + util.MustFromJSONBytes(res.Body, &commits) + log.Debug(util.MustToJSON(commits)) + return commits, nil + } + + return nil, err +} + +func (processor *Processor) getPreviousFile(projectID int64, file string, branch string) (*core.FileContent, error) { + url := JoinAPIURL( + processor.config.Endpoint, + fmt.Sprintf("/api/v4/projects/%v/repository/files/%v", projectID, util.UrlEncode(file)), + map[string]string{"ref": branch}, + ) + req1 := util.NewGetRequest(url, nil) + req1.AddHeader("PRIVATE-TOKEN", processor.config.Token) + res, err := util.ExecuteRequest(req1) + if err != nil { + return nil, err + } + + if res != nil { + //log.Error(string(res.Body)) + file := core.FileContent{} + log.Debug(string(res.Body)) + util.MustFromJSONBytes(res.Body, &file) + log.Debug(util.MustToJSON(file)) + return &file, nil + } + + return nil, err +} + +func (processor *Processor) postReply(projectID, mrID int64, msg string) (*core.MergeRequestNote, error) { + url := JoinAPIURL( + processor.config.Endpoint, + fmt.Sprintf("/api/v4/projects/%v/merge_requests/%v/notes", projectID, mrID), + nil, + //map[string]string{"body": util.IntToString(processor.config.PageSize)}, + ) + + bytes := util.MustToJSONBytes(util.MapStr{ + "body": msg, + }) + req1 := util.NewPostRequest(url, bytes) + req1.AddHeader("PRIVATE-TOKEN", processor.config.Token) + req1.AddHeader("Content-Type", "application/json") + + res, err := util.ExecuteRequest(req1) + if err != nil { + return nil, err + } + + if res != nil { + log.Debug(string(res.Body)) + commits := core.MergeRequestNote{} + util.MustFromJSONBytes(res.Body, &commits) + log.Debug(util.MustToJSON(commits)) + return &commits, nil + } + + return nil, err +} diff --git a/plugins/webhooks/webhook.go b/plugins/webhooks/webhook.go new file mode 100644 index 00000000..659d752b --- /dev/null +++ b/plugins/webhooks/webhook.go @@ -0,0 +1,83 @@ +/* Copyright © INFINI LTD. All rights reserved. + * Web: https://infinilabs.com + * Email: hello#infini.ltd */ + +package webhooks + +import ( + "context" + log "github.com/cihub/seelog" + "infini.sh/coco/core" + "infini.sh/coco/modules/common" + "infini.sh/framework/core/api" + httprouter "infini.sh/framework/core/api/router" + "infini.sh/framework/core/errors" + "infini.sh/framework/core/orm" + "infini.sh/framework/core/pipeline" + "infini.sh/framework/core/queue" + "infini.sh/framework/core/task" + "infini.sh/framework/core/util" + "net/http" +) + +func WebhookHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { + datasourceID := ps.MustGetParameter("id") + ctx := orm.NewContext() + ctx.DirectReadAccess() + datasource, err := common.GetDatasourceConfig(ctx, datasourceID) + if err != nil { + panic(err) + } + + if datasource.WebhookConfig.Enabled { + //append enrichment pipeline process + if datasource.EnrichmentPipeline != nil { + b, err := util.ReadBody(req) + doc := core.Document{} + doc.Metadata = map[string]interface{}{} + doc.Payload = map[string]interface{}{} + doc.Source.ID = datasource.ID + doc.SetOwnerID(datasource.GetOwnerID()) + + //log.Error(util.MustToJSON(datasource.EnrichmentPipeline)) + + ctx := pipeline.AcquireContext(*datasource.EnrichmentPipeline) + log.Trace("running enrichment pipeline") + + ctx.Set("body_bytes", b) + ctx.Set("document", doc) + + task.RunWithContext("refresh_cluster_health", func(ctx context.Context) error { + pipeCtx := ctx.Value("ctx") + ctx1, ok := pipeCtx.(*pipeline.Context) + if ok { + err = pipeline.RunPipelineSync(*datasource.EnrichmentPipeline, ctx1) + if err != nil { + panic(err) + } + + docV := ctx1.Get("document") + document, ok := docV.(core.Document) + if ok { + if document.ID != "" { + queueCfg := &queue.QueueConfig{Name: "indexing_documents"} + data := util.MustToJSONBytes(document) + err := queue.Push(queue.SmartGetOrInitConfig(queueCfg), data) + if err != nil { + panic(err) + } + } + } + } + return nil + }, context.WithValue(context.Background(), "ctx", ctx)) + } + } else { + panic(errors.Errorf("invalid webhook config: %v", datasource.Name)) + } + api.WriteAckOKJSON(w) +} + +func init() { + api.HandleUIMethod(api.POST, "/webhooks/:id", WebhookHandler) +} diff --git a/web/.env.test b/web/.env.test index c78d09b8..f84c1dd8 100644 --- a/web/.env.test +++ b/web/.env.test @@ -1,9 +1,11 @@ # backend service base url, test environment VITE_SERVICE_BASE_URL=http://localhost:9000 +# VITE_SERVICE_BASE_URL=https://dev.infini.cloud:27200 # other backend service base url, test environment VITE_OTHER_SERVICE_BASE_URL= `{ "demo": "http://localhost:9528", "/assets": "http://localhost:9000", "/integration": "http://localhost:9000", + "/security": "http://localhost:9000", }` diff --git a/web/.prettierrc b/web/.prettierrc new file mode 100644 index 00000000..3df871f6 --- /dev/null +++ b/web/.prettierrc @@ -0,0 +1,9 @@ +{ + "singleQuote": true, + "jsxSingleQuote": true, + "semi": true, + "trailingComma": "none", + "endOfLine": "lf", + "tabWidth": 2, + "useTabs": false +} \ No newline at end of file diff --git a/web/build/config/proxy.ts b/web/build/config/proxy.ts index 65a3eb29..19c9108f 100644 --- a/web/build/config/proxy.ts +++ b/web/build/config/proxy.ts @@ -28,6 +28,7 @@ function createProxyItem(item: App.Service.ServiceConfigItem) { const proxy: Record = {}; proxy[item.proxyPattern] = { + secure: false, changeOrigin: true, rewrite: path => path?.replace(new RegExp(`^${item.proxyPattern}`), item.key?.startsWith('/') ? item.proxyPattern : ''), diff --git a/web/eslint.config.js b/web/eslint.config.js index d66fca48..f48ef636 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -5,7 +5,9 @@ export default defineConfig( { ignores: ['ErrorBoundary.tsx'], prettierRules: { + jsxSingleQuote: true, singleAttributePerLine: true, + singleQuote: true, trailingCommas: 'none' }, react: true, @@ -28,19 +30,9 @@ export default defineConfig( } ], - 'import/order': [ - 'error', - { - alphabetize: { - order: 'asc' - }, - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'], - 'newlines-between': 'always', - pathGroups: [{ group: 'internal', pattern: '{{@,~}/,#}**' }], - pathGroupsExcludedImportTypes: ['builtin'] - } - ], - + 'import/order': 'off', + 'sort/object-properties': 'off', + 'prettier/prettier': 'off', 'no-underscore-dangle': 'off', 'react/hook-use-state': [ 'error', // or "warn" to only warn instead of error @@ -86,12 +78,15 @@ export default defineConfig( } ], 'react-refresh/only-export-components': ['warn', { allowExportNames: ['loader', 'action'] }], - 'sort/import-members': ['error', { caseSensitive: true, natural: true }], - 'sort/imports': ['off'], + + 'sort/import-members': 'off', + 'sort/imports': 'off', 'sort/string-enums': ['error', { caseSensitive: false, natural: true }], 'sort/string-unions': ['error', { caseSensitive: false, natural: true }], - 'sort/type-properties': ['warn', { caseSensitive: false, natural: true }], - 'sort/type-properties': ['error', { caseSensitive: false, natural: true }] + 'sort/type-properties': 'off', + 'sort/destructuring-properties': 'off', + + quotes: ['error', 'single', { avoidEscape: true }] } } ); diff --git a/web/package.json b/web/package.json index 93064d27..e9ef1766 100644 --- a/web/package.json +++ b/web/package.json @@ -52,6 +52,7 @@ "@ant-design/icons": "5.x", "@better-scroll/core": "2.5.1", "@iconify/react": "5.0.2", + "@infinilabs/entity-ui": "^0.0.4", "@reduxjs/toolkit": "2.3.0", "@sa/axios": "workspace:*", "@sa/color": "workspace:*", @@ -63,6 +64,8 @@ "antd": "5.21.6", "classnames": "2.5.1", "clipboard": "2.0.11", + "clsx": "2.1.1", + "copy-to-clipboard": "^3.3.3", "dayjs": "1.11.13", "echarts": "5.5.1", "framer-motion": "11.11.11", @@ -70,6 +73,7 @@ "keepalive-for-react": "3.0.2", "lodash": "^4.17.21", "lucide-react": "^0.546.0", + "mermaid": "11.6.0", "nprogress": "0.2.0", "query-string": "^9.2.1", "react": "18.3.1", @@ -79,10 +83,18 @@ "react-error-boundary": "4.1.2", "react-hotkeys-hook": "^4.6.1", "react-i18next": "15.1.0", + "react-markdown": "10.1.0", "react-redux": "9.1.2", "react-router-dom": "6.27.0", "react-svg": "^16.3.0", - "typeit": "8.8.7" + "rehype-highlight": "7.0.2", + "rehype-katex": "7.0.1", + "rehype-raw": "7.0.0", + "remark-breaks": "4.0.0", + "remark-gfm": "4.0.1", + "remark-math": "6.0.0", + "typeit": "8.8.7", + "use-debounce": "10.0.4" }, "devDependencies": { "@iconify/json": "2.2.266", diff --git a/web/packages/simple-router/src/matcher/shared.ts b/web/packages/simple-router/src/matcher/shared.ts index 855a9f61..d238d6ae 100644 --- a/web/packages/simple-router/src/matcher/shared.ts +++ b/web/packages/simple-router/src/matcher/shared.ts @@ -43,13 +43,13 @@ export function normalizeRouteRecord(record: ElegantConstRoute): RouteRecordNorm return { children: record.children?.map(child => { - child.redirect ||= child.children && child.children[0].path; + child.redirect ||= child.children?.[0]?.path; return child; }) || [], meta: record.meta || {}, name: record.name, path: record.path || '', - redirect: record.redirect || (record.children && record.children[0].path) + redirect: record.redirect || record.children?.[0]?.path }; } diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 6f50851c..a2f9bd3a 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@iconify/react': specifier: 5.0.2 version: 5.0.2(react@18.3.1) + '@infinilabs/entity-ui': + specifier: ^0.0.4 + version: 0.0.4(antd@5.21.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@reduxjs/toolkit': specifier: 2.3.0 version: 2.3.0(react-redux@9.1.2(@types/react@18.3.12)(react@18.3.1)(redux@5.0.1))(react@18.3.1) @@ -50,6 +53,12 @@ importers: clipboard: specifier: 2.0.11 version: 2.0.11 + clsx: + specifier: 2.1.1 + version: 2.1.1 + copy-to-clipboard: + specifier: ^3.3.3 + version: 3.3.3 dayjs: specifier: 1.11.13 version: 1.11.13 @@ -71,12 +80,15 @@ importers: lucide-react: specifier: ^0.546.0 version: 0.546.0(react@18.3.1) + mermaid: + specifier: 11.6.0 + version: 11.6.0 nprogress: specifier: 0.2.0 version: 0.2.0 query-string: specifier: ^9.2.1 - version: 9.2.2 + version: 9.3.1 react: specifier: 18.3.1 version: 18.3.1 @@ -98,6 +110,9 @@ importers: react-i18next: specifier: 15.1.0 version: 15.1.0(i18next@23.16.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-markdown: + specifier: 10.1.0 + version: 10.1.0(@types/react@18.3.12)(react@18.3.1) react-redux: specifier: 9.1.2 version: 9.1.2(@types/react@18.3.12)(react@18.3.1)(redux@5.0.1) @@ -107,9 +122,30 @@ importers: react-svg: specifier: ^16.3.0 version: 16.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rehype-highlight: + specifier: 7.0.2 + version: 7.0.2 + rehype-katex: + specifier: 7.0.1 + version: 7.0.1 + rehype-raw: + specifier: 7.0.0 + version: 7.0.0 + remark-breaks: + specifier: 4.0.0 + version: 4.0.0 + remark-gfm: + specifier: 4.0.1 + version: 4.0.1 + remark-math: + specifier: 6.0.0 + version: 6.0.0 typeit: specifier: 8.8.7 version: 8.8.7 + use-debounce: + specifier: 10.0.4 + version: 10.0.4(react@18.3.1) devDependencies: '@iconify/json': specifier: 2.2.266 @@ -128,7 +164,7 @@ importers: version: link:packages/uno-preset '@soybeanjs/eslint-config': specifier: 1.4.2 - version: 1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@svgr/core': specifier: 8.1.0 version: 8.1.0(typescript@5.6.3) @@ -161,13 +197,13 @@ importers: version: 4.4.11 '@typescript-eslint/eslint-plugin': specifier: 8.12.2 - version: 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@typescript-eslint/parser': specifier: 8.12.2 - version: 8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@unocss/eslint-config': specifier: 0.63.6 - version: 0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@unocss/preset-icons': specifier: 0.63.6 version: 0.63.6 @@ -182,28 +218,28 @@ importers: version: 0.63.6 '@unocss/vite': specifier: 0.63.6 - version: 0.63.6(rollup@4.46.1)(typescript@5.6.3)(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)) + version: 0.63.6(rollup@4.52.5)(typescript@5.6.3)(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)) '@vitejs/plugin-react': specifier: 4.3.3 - version: 4.3.3(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)) + version: 4.3.3(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)) boxen: specifier: 8.0.1 version: 8.0.1 eslint: specifier: 9.14.0 - version: 9.14.0(jiti@2.5.1) + version: 9.14.0(jiti@2.6.1) eslint-plugin-react: specifier: 7.37.2 - version: 7.37.2(eslint@9.14.0(jiti@2.5.1)) + version: 7.37.2(eslint@9.14.0(jiti@2.6.1)) eslint-plugin-react-hooks: specifier: 5.0.0 - version: 5.0.0(eslint@9.14.0(jiti@2.5.1)) + version: 5.0.0(eslint@9.14.0(jiti@2.6.1)) eslint-plugin-react-refresh: specifier: 0.4.14 - version: 0.4.14(eslint@9.14.0(jiti@2.5.1)) + version: 0.4.14(eslint@9.14.0(jiti@2.6.1)) eslint-plugin-sort: specifier: ^4.0.0 - version: 4.0.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 4.0.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) gradient-string: specifier: 3.0.0 version: 3.0.0 @@ -212,7 +248,7 @@ importers: version: 2.2.3 less: specifier: ^4.3.0 - version: 4.4.0 + version: 4.4.2 lint-staged: specifier: 15.2.10 version: 15.2.10 @@ -227,22 +263,22 @@ importers: version: 5.6.3 unplugin-auto-import: specifier: 0.18.3 - version: 0.18.3(rollup@4.46.1) + version: 0.18.3(rollup@4.52.5) unplugin-icons: specifier: 0.20.0 - version: 0.20.0(@svgr/core@8.1.0(typescript@5.6.3))(@vue/compiler-sfc@3.5.18) + version: 0.20.0(@svgr/core@8.1.0(typescript@5.6.3))(@vue/compiler-sfc@3.5.24) vite: specifier: 5.4.10 - version: 5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0) + version: 5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6) vite-plugin-inspect: specifier: 0.8.7 - version: 0.8.7(rollup@4.46.1)(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)) + version: 0.8.7(rollup@4.52.5)(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)) vite-plugin-remove-console: specifier: 2.2.0 version: 2.2.0 vite-plugin-svg-icons: specifier: 2.0.1 - version: 2.0.1(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)) + version: 2.0.1(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)) packages/axios: dependencies: @@ -301,7 +337,7 @@ importers: devDependencies: '@soybeanjs/changelog': specifier: 0.3.24 - version: 0.3.24(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + version: 0.3.24(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@types/yargs': specifier: 17.0.33 version: 17.0.33 @@ -422,16 +458,16 @@ packages: resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.28.0': - resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==} + '@babel/compat-data@7.28.5': + resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==} engines: {node: '>=6.9.0'} - '@babel/core@7.28.0': - resolution: {integrity: sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==} + '@babel/core@7.28.5': + resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} engines: {node: '>=6.9.0'} - '@babel/generator@7.28.0': - resolution: {integrity: sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==} + '@babel/generator@7.28.5': + resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} engines: {node: '>=6.9.0'} '@babel/helper-compilation-targets@7.27.2': @@ -446,8 +482,8 @@ packages: resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.27.3': - resolution: {integrity: sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==} + '@babel/helper-module-transforms@7.28.3': + resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -460,25 +496,20 @@ packages: resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.27.1': - resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} '@babel/helper-validator-option@7.27.1': resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.28.2': - resolution: {integrity: sha512-/V9771t+EgXz62aCcyofnQhGM8DQACbRhvzKFsXKC9QM+5MadF8ZmIm0crDMaz3+o0h0zXfJnd4EhbYbxsrcFw==} + '@babel/helpers@7.28.4': + resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} engines: {node: '>=6.9.0'} - '@babel/parser@7.28.0': - resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/parser@7.28.4': - resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==} + '@babel/parser@7.28.5': + resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} engines: {node: '>=6.0.0'} hasBin: true @@ -494,24 +525,20 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/runtime@7.28.2': - resolution: {integrity: sha512-KHp2IflsnGywDjBWDkR9iEqiWSpc8GIi0lgTT3mOElT0PP1tG26P4tmFI2YvAdzgq9RGyoHZQEIEdZy6Ec5xCA==} + '@babel/runtime@7.28.4': + resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.28.0': - resolution: {integrity: sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.28.2': - resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} + '@babel/traverse@7.28.5': + resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.28.4': - resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} + '@babel/types@7.28.5': + resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} engines: {node: '>=6.9.0'} '@better-scroll/core@2.5.1': @@ -520,6 +547,24 @@ packages: '@better-scroll/shared-utils@2.5.1': resolution: {integrity: sha512-AplkfSjXVYP9LZiD6JsKgmgQJ/mG4uuLmBuwLz8W5OsYc7AYTfN8kw6GqZ5OwCGoXkVhBGyd8NeC4xwYItp0aw==} + '@braintree/sanitize-url@7.1.1': + resolution: {integrity: sha512-i1L7noDNxtFyL5DmZafWy1wRVhGehQmzZaz1HiN5e7iylJMSZR7ekOV7NsIqa5qBldlLrsKv4HbgFUVlQrz8Mw==} + + '@chevrotain/cst-dts-gen@11.0.3': + resolution: {integrity: sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==} + + '@chevrotain/gast@11.0.3': + resolution: {integrity: sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==} + + '@chevrotain/regexp-to-ast@11.0.3': + resolution: {integrity: sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==} + + '@chevrotain/types@11.0.3': + resolution: {integrity: sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==} + + '@chevrotain/utils@11.0.3': + resolution: {integrity: sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==} + '@ctrl/tinycolor@3.6.1': resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} engines: {node: '>=10'} @@ -812,18 +857,18 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.7.0': - resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + '@eslint-community/eslint-utils@4.9.0': + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/compat@1.3.1': - resolution: {integrity: sha512-k8MHony59I5EPic6EQTCNOuPoVBnoYXkP+20xvwFjN7t0qI3ImyvyBgg+hIVPwC8JaxVjjUZld+cLfBLFDLucg==} + '@eslint/compat@1.4.1': + resolution: {integrity: sha512-cfO82V9zxxGBxcQDr1lfaYB7wykTa0b00mGa36FrJl7iTFd0Z2cHfEYuxcBRP/iNijCsWsEkA+jzT8hGYmv33w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.40 || 9 @@ -839,6 +884,10 @@ packages: resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.17.0': + resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.7.0': resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -859,8 +908,8 @@ packages: resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.6': - resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} + '@eslint/object-schema@2.1.7': + resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/plugin-kit@0.2.8': @@ -871,18 +920,14 @@ packages: resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} - '@humanfs/node@0.16.6': - resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + '@humanfs/node@0.16.7': + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/retry@0.3.1': - resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} - engines: {node: '>=18.18'} - '@humanwhocodes/retry@0.4.3': resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} @@ -901,6 +946,13 @@ packages: '@iconify/utils@2.3.0': resolution: {integrity: sha512-GmQ78prtwYW6EtzXRU1rY+KwOKfz32PD7iJh6Iyqw68GiKuoZ2A6pRtzWONz5VQJbp50mEjXh/7NkumtrAgRKA==} + '@infinilabs/entity-ui@0.0.4': + resolution: {integrity: sha512-SZaGMwOJ7GCYYU/KCkwR2+ucmNjI2aWkcNpvU3n7tglAeIt42JjesyXczlLXmeCAvg/4oKUbqpxrMI8LT0vwdA==} + peerDependencies: + antd: '>=5' + react: '>=17' + react-dom: '>=17' + '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} engines: {node: 20 || >=22} @@ -913,29 +965,29 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@jridgewell/gen-mapping@0.3.12': - resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/source-map@0.3.11': - resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - - '@jridgewell/sourcemap-codec@1.5.4': - resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} - '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.29': - resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} '@jsdevtools/ez-spawn@3.0.4': resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} engines: {node: '>=10'} + '@mermaid-js/parser@0.4.0': + resolution: {integrity: sha512-wla8XOWvQAwuqy+gxiZqY+c7FokraOTHRWMsbB4AgRx9Sy7zKslNyejy7E+a77qHfey5GXw/ik3IXv/NHMJgaA==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1084,8 +1136,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - '@rc-component/qrcode@1.0.0': - resolution: {integrity: sha512-L+rZ4HXP2sJ1gHMGHjsg9jlYBX/SLN2D6OxP9Zn3qgtpMWtO2vUfxVFwiogHpAIqs54FnALxraUy/BCO1yRIgg==} + '@rc-component/qrcode@1.0.1': + resolution: {integrity: sha512-g8eeeaMyFXVlq8cZUeaxCDhfIYjpao0l9cvm5gFwKXy/Vm1yDWV7h2sjH5jHYzdFedlVKBpATFB1VKMrHzwaWQ==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -1120,8 +1172,8 @@ packages: resolution: {integrity: sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==} engines: {node: '>=14.0.0'} - '@rollup/pluginutils@5.2.0': - resolution: {integrity: sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==} + '@rollup/pluginutils@5.3.0': + resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -1129,114 +1181,124 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.46.1': - resolution: {integrity: sha512-oENme6QxtLCqjChRUUo3S6X8hjCXnWmJWnedD7VbGML5GUtaOtAyx+fEEXnBXVf0CBZApMQU0Idwi0FmyxzQhw==} + '@rollup/rollup-android-arm-eabi@4.52.5': + resolution: {integrity: sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.46.1': - resolution: {integrity: sha512-OikvNT3qYTl9+4qQ9Bpn6+XHM+ogtFadRLuT2EXiFQMiNkXFLQfNVppi5o28wvYdHL2s3fM0D/MZJ8UkNFZWsw==} + '@rollup/rollup-android-arm64@4.52.5': + resolution: {integrity: sha512-mQGfsIEFcu21mvqkEKKu2dYmtuSZOBMmAl5CFlPGLY94Vlcm+zWApK7F/eocsNzp8tKmbeBP8yXyAbx0XHsFNA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.46.1': - resolution: {integrity: sha512-EFYNNGij2WllnzljQDQnlFTXzSJw87cpAs4TVBAWLdkvic5Uh5tISrIL6NRcxoh/b2EFBG/TK8hgRrGx94zD4A==} + '@rollup/rollup-darwin-arm64@4.52.5': + resolution: {integrity: sha512-takF3CR71mCAGA+v794QUZ0b6ZSrgJkArC+gUiG6LB6TQty9T0Mqh3m2ImRBOxS2IeYBo4lKWIieSvnEk2OQWA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.46.1': - resolution: {integrity: sha512-ZaNH06O1KeTug9WI2+GRBE5Ujt9kZw4a1+OIwnBHal92I8PxSsl5KpsrPvthRynkhMck4XPdvY0z26Cym/b7oA==} + '@rollup/rollup-darwin-x64@4.52.5': + resolution: {integrity: sha512-W901Pla8Ya95WpxDn//VF9K9u2JbocwV/v75TE0YIHNTbhqUTv9w4VuQ9MaWlNOkkEfFwkdNhXgcLqPSmHy0fA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.46.1': - resolution: {integrity: sha512-n4SLVebZP8uUlJ2r04+g2U/xFeiQlw09Me5UFqny8HGbARl503LNH5CqFTb5U5jNxTouhRjai6qPT0CR5c/Iig==} + '@rollup/rollup-freebsd-arm64@4.52.5': + resolution: {integrity: sha512-QofO7i7JycsYOWxe0GFqhLmF6l1TqBswJMvICnRUjqCx8b47MTo46W8AoeQwiokAx3zVryVnxtBMcGcnX12LvA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.46.1': - resolution: {integrity: sha512-8vu9c02F16heTqpvo3yeiu7Vi1REDEC/yES/dIfq3tSXe6mLndiwvYr3AAvd1tMNUqE9yeGYa5w7PRbI5QUV+w==} + '@rollup/rollup-freebsd-x64@4.52.5': + resolution: {integrity: sha512-jr21b/99ew8ujZubPo9skbrItHEIE50WdV86cdSoRkKtmWa+DDr6fu2c/xyRT0F/WazZpam6kk7IHBerSL7LDQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.46.1': - resolution: {integrity: sha512-K4ncpWl7sQuyp6rWiGUvb6Q18ba8mzM0rjWJ5JgYKlIXAau1db7hZnR0ldJvqKWWJDxqzSLwGUhA4jp+KqgDtQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.52.5': + resolution: {integrity: sha512-PsNAbcyv9CcecAUagQefwX8fQn9LQ4nZkpDboBOttmyffnInRy8R8dSg6hxxl2Re5QhHBf6FYIDhIj5v982ATQ==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.46.1': - resolution: {integrity: sha512-YykPnXsjUjmXE6j6k2QBBGAn1YsJUix7pYaPLK3RVE0bQL2jfdbfykPxfF8AgBlqtYbfEnYHmLXNa6QETjdOjQ==} + '@rollup/rollup-linux-arm-musleabihf@4.52.5': + resolution: {integrity: sha512-Fw4tysRutyQc/wwkmcyoqFtJhh0u31K+Q6jYjeicsGJJ7bbEq8LwPWV/w0cnzOqR2m694/Af6hpFayLJZkG2VQ==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.46.1': - resolution: {integrity: sha512-kKvqBGbZ8i9pCGW3a1FH3HNIVg49dXXTsChGFsHGXQaVJPLA4f/O+XmTxfklhccxdF5FefUn2hvkoGJH0ScWOA==} + '@rollup/rollup-linux-arm64-gnu@4.52.5': + resolution: {integrity: sha512-a+3wVnAYdQClOTlyapKmyI6BLPAFYs0JM8HRpgYZQO02rMR09ZcV9LbQB+NL6sljzG38869YqThrRnfPMCDtZg==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.46.1': - resolution: {integrity: sha512-zzX5nTw1N1plmqC9RGC9vZHFuiM7ZP7oSWQGqpbmfjK7p947D518cVK1/MQudsBdcD84t6k70WNczJOct6+hdg==} + '@rollup/rollup-linux-arm64-musl@4.52.5': + resolution: {integrity: sha512-AvttBOMwO9Pcuuf7m9PkC1PUIKsfaAJ4AYhy944qeTJgQOqJYJ9oVl2nYgY7Rk0mkbsuOpCAYSs6wLYB2Xiw0Q==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loongarch64-gnu@4.46.1': - resolution: {integrity: sha512-O8CwgSBo6ewPpktFfSDgB6SJN9XDcPSvuwxfejiddbIC/hn9Tg6Ai0f0eYDf3XvB/+PIWzOQL+7+TZoB8p9Yuw==} + '@rollup/rollup-linux-loong64-gnu@4.52.5': + resolution: {integrity: sha512-DkDk8pmXQV2wVrF6oq5tONK6UHLz/XcEVow4JTTerdeV1uqPeHxwcg7aFsfnSm9L+OO8WJsWotKM2JJPMWrQtA==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-gnu@4.46.1': - resolution: {integrity: sha512-JnCfFVEKeq6G3h3z8e60kAp8Rd7QVnWCtPm7cxx+5OtP80g/3nmPtfdCXbVl063e3KsRnGSKDHUQMydmzc/wBA==} + '@rollup/rollup-linux-ppc64-gnu@4.52.5': + resolution: {integrity: sha512-W/b9ZN/U9+hPQVvlGwjzi+Wy4xdoH2I8EjaCkMvzpI7wJUs8sWJ03Rq96jRnHkSrcHTpQe8h5Tg3ZzUPGauvAw==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.46.1': - resolution: {integrity: sha512-dVxuDqS237eQXkbYzQQfdf/njgeNw6LZuVyEdUaWwRpKHhsLI+y4H/NJV8xJGU19vnOJCVwaBFgr936FHOnJsQ==} + '@rollup/rollup-linux-riscv64-gnu@4.52.5': + resolution: {integrity: sha512-sjQLr9BW7R/ZiXnQiWPkErNfLMkkWIoCz7YMn27HldKsADEKa5WYdobaa1hmN6slu9oWQbB6/jFpJ+P2IkVrmw==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.46.1': - resolution: {integrity: sha512-CvvgNl2hrZrTR9jXK1ye0Go0HQRT6ohQdDfWR47/KFKiLd5oN5T14jRdUVGF4tnsN8y9oSfMOqH6RuHh+ck8+w==} + '@rollup/rollup-linux-riscv64-musl@4.52.5': + resolution: {integrity: sha512-hq3jU/kGyjXWTvAh2awn8oHroCbrPm8JqM7RUpKjalIRWWXE01CQOf/tUNWNHjmbMHg/hmNCwc/Pz3k1T/j/Lg==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.46.1': - resolution: {integrity: sha512-x7ANt2VOg2565oGHJ6rIuuAon+A8sfe1IeUx25IKqi49OjSr/K3awoNqr9gCwGEJo9OuXlOn+H2p1VJKx1psxA==} + '@rollup/rollup-linux-s390x-gnu@4.52.5': + resolution: {integrity: sha512-gn8kHOrku8D4NGHMK1Y7NA7INQTRdVOntt1OCYypZPRt6skGbddska44K8iocdpxHTMMNui5oH4elPH4QOLrFQ==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.46.1': - resolution: {integrity: sha512-9OADZYryz/7E8/qt0vnaHQgmia2Y0wrjSSn1V/uL+zw/i7NUhxbX4cHXdEQ7dnJgzYDS81d8+tf6nbIdRFZQoQ==} + '@rollup/rollup-linux-x64-gnu@4.52.5': + resolution: {integrity: sha512-hXGLYpdhiNElzN770+H2nlx+jRog8TyynpTVzdlc6bndktjKWyZyiCsuDAlpd+j+W+WNqfcyAWz9HxxIGfZm1Q==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.46.1': - resolution: {integrity: sha512-NuvSCbXEKY+NGWHyivzbjSVJi68Xfq1VnIvGmsuXs6TCtveeoDRKutI5vf2ntmNnVq64Q4zInet0UDQ+yMB6tA==} + '@rollup/rollup-linux-x64-musl@4.52.5': + resolution: {integrity: sha512-arCGIcuNKjBoKAXD+y7XomR9gY6Mw7HnFBv5Rw7wQRvwYLR7gBAgV7Mb2QTyjXfTveBNFAtPt46/36vV9STLNg==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-win32-arm64-msvc@4.46.1': - resolution: {integrity: sha512-mWz+6FSRb82xuUMMV1X3NGiaPFqbLN9aIueHleTZCc46cJvwTlvIh7reQLk4p97dv0nddyewBhwzryBHH7wtPw==} + '@rollup/rollup-openharmony-arm64@4.52.5': + resolution: {integrity: sha512-QoFqB6+/9Rly/RiPjaomPLmR/13cgkIGfA40LHly9zcH1S0bN2HVFYk3a1eAyHQyjs3ZJYlXvIGtcCs5tko9Cw==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.52.5': + resolution: {integrity: sha512-w0cDWVR6MlTstla1cIfOGyl8+qb93FlAVutcor14Gf5Md5ap5ySfQ7R9S/NjNaMLSFdUnKGEasmVnu3lCMqB7w==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.46.1': - resolution: {integrity: sha512-7Thzy9TMXDw9AU4f4vsLNBxh7/VOKuXi73VH3d/kHGr0tZ3x/ewgL9uC7ojUKmH1/zvmZe2tLapYcZllk3SO8Q==} + '@rollup/rollup-win32-ia32-msvc@4.52.5': + resolution: {integrity: sha512-Aufdpzp7DpOTULJCuvzqcItSGDH73pF3ko/f+ckJhxQyHtp67rHw3HMNxoIdDMUITJESNE6a8uh4Lo4SLouOUg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.46.1': - resolution: {integrity: sha512-7GVB4luhFmGUNXXJhH2jJwZCFB3pIOixv2E3s17GQHBFUOQaISlt7aGcQgqvCaDSxTZJUzlK/QJ1FN8S94MrzQ==} + '@rollup/rollup-win32-x64-gnu@4.52.5': + resolution: {integrity: sha512-UGBUGPFp1vkj6p8wCRraqNhqwX/4kNQPS57BCFc8wYh0g94iVIW33wJtQAx3G7vrjjNtRaxiMUylM0ktp/TRSQ==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.52.5': + resolution: {integrity: sha512-TAcgQh2sSkykPRWLrdyy2AiceMckNf5loITqXxFI5VuQjS5tSuw3WlwdN8qv8vzjLAUTvYaH/mVjSFpbkFbpTg==} cpu: [x64] os: [win32] @@ -1384,21 +1446,123 @@ packages: '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - '@types/babel__traverse@7.20.7': - resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==} + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} '@types/crypto-js@4.2.2': resolution: {integrity: sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==} + '@types/d3-array@3.2.2': + resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==} + + '@types/d3-axis@3.0.6': + resolution: {integrity: sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==} + + '@types/d3-brush@3.0.6': + resolution: {integrity: sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==} + + '@types/d3-chord@3.0.6': + resolution: {integrity: sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==} + + '@types/d3-color@3.1.3': + resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==} + + '@types/d3-contour@3.0.6': + resolution: {integrity: sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==} + + '@types/d3-delaunay@6.0.4': + resolution: {integrity: sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==} + + '@types/d3-dispatch@3.0.7': + resolution: {integrity: sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==} + + '@types/d3-drag@3.0.7': + resolution: {integrity: sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==} + + '@types/d3-dsv@3.0.7': + resolution: {integrity: sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==} + + '@types/d3-ease@3.0.2': + resolution: {integrity: sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==} + + '@types/d3-fetch@3.0.7': + resolution: {integrity: sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==} + + '@types/d3-force@3.0.10': + resolution: {integrity: sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==} + + '@types/d3-format@3.0.4': + resolution: {integrity: sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==} + + '@types/d3-geo@3.1.0': + resolution: {integrity: sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==} + + '@types/d3-hierarchy@3.1.7': + resolution: {integrity: sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==} + + '@types/d3-interpolate@3.0.4': + resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==} + + '@types/d3-path@3.1.1': + resolution: {integrity: sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==} + + '@types/d3-polygon@3.0.2': + resolution: {integrity: sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==} + + '@types/d3-quadtree@3.0.6': + resolution: {integrity: sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==} + + '@types/d3-random@3.0.3': + resolution: {integrity: sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==} + + '@types/d3-scale-chromatic@3.1.0': + resolution: {integrity: sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==} + + '@types/d3-scale@4.0.9': + resolution: {integrity: sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==} + + '@types/d3-selection@3.0.11': + resolution: {integrity: sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==} + + '@types/d3-shape@3.1.7': + resolution: {integrity: sha512-VLvUQ33C+3J+8p+Daf+nYSOsjB4GXp19/S/aGo60m9h1v6XaxjiT82lKVWJCfzhtuZ3yD7i/TPeC/fuKLLOSmg==} + + '@types/d3-time-format@4.0.3': + resolution: {integrity: sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==} + + '@types/d3-time@3.0.4': + resolution: {integrity: sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==} + + '@types/d3-timer@3.0.2': + resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} + + '@types/d3-transition@3.0.9': + resolution: {integrity: sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==} + + '@types/d3-zoom@3.0.8': + resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==} + + '@types/d3@7.4.3': + resolution: {integrity: sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/estree-jsx@1.0.5': + resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} + '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/geojson@7946.0.16': + resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==} + '@types/gradient-string@1.1.6': resolution: {integrity: sha512-LkaYxluY4G5wR1M4AKQUal2q61Di1yVVCw42ImFTuaIoQVgmV0WP1xUaLB8zwb47mp82vWTpePI9JmrjEnJ7nQ==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/hoist-non-react-statics@3.3.7': resolution: {integrity: sha512-PQTyIulDkIDro8P+IHbKCsw7U2xxBYflVzW/FgWdCAePD9xGSidgA76/GeJ6lBKoblyhf9pBY763gbrN+1dI8g==} peerDependencies: @@ -1407,6 +1571,9 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/katex@0.16.7': + resolution: {integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==} + '@types/lodash@4.17.20': resolution: {integrity: sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==} @@ -1452,6 +1619,12 @@ packages: '@types/tinycolor2@1.4.6': resolution: {integrity: sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==} + '@types/trusted-types@2.0.7': + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + + '@types/unist@2.0.11': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -1509,11 +1682,11 @@ packages: typescript: optional: true - '@typescript-eslint/project-service@8.38.0': - resolution: {integrity: sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==} + '@typescript-eslint/project-service@8.46.3': + resolution: {integrity: sha512-Fz8yFXsp2wDFeUElO88S9n4w1I4CWDTXDqDr9gYvZgUpwXQqmZBr9+NTTql5R3J7+hrJZPdpiWaB9VNhAKYLuQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' '@typescript-eslint/scope-manager@8.11.0': resolution: {integrity: sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==} @@ -1523,15 +1696,15 @@ packages: resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.38.0': - resolution: {integrity: sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==} + '@typescript-eslint/scope-manager@8.46.3': + resolution: {integrity: sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.38.0': - resolution: {integrity: sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==} + '@typescript-eslint/tsconfig-utils@8.46.3': + resolution: {integrity: sha512-GLupljMniHNIROP0zE7nCcybptolcH8QZfXOpCfhQDAdwJ/ZTlcaBOYebSOZotpti/3HrHSw7D3PZm75gYFsOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' '@typescript-eslint/type-utils@8.11.0': resolution: {integrity: sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==} @@ -1559,8 +1732,8 @@ packages: resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.38.0': - resolution: {integrity: sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==} + '@typescript-eslint/types@8.46.3': + resolution: {integrity: sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@8.11.0': @@ -1581,11 +1754,11 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@8.38.0': - resolution: {integrity: sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==} + '@typescript-eslint/typescript-estree@8.46.3': + resolution: {integrity: sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' '@typescript-eslint/utils@8.11.0': resolution: {integrity: sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==} @@ -1599,12 +1772,12 @@ packages: peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/utils@8.38.0': - resolution: {integrity: sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==} + '@typescript-eslint/utils@8.46.3': + resolution: {integrity: sha512-VXw7qmdkucEx9WkmR3ld/u6VhRyKeiF1uxWwCy/iuNfokjJ7VhsgLSOTjsol8BunSw190zABzpwdNsze2Kpo4g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' '@typescript-eslint/visitor-keys@8.11.0': resolution: {integrity: sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==} @@ -1614,10 +1787,13 @@ packages: resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/visitor-keys@8.38.0': - resolution: {integrity: sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==} + '@typescript-eslint/visitor-keys@8.46.3': + resolution: {integrity: sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/structured-clone@1.3.0': + resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + '@unocss/config@0.63.6': resolution: {integrity: sha512-+4Lt5uTwRgu1z7vhOUzDf+mL+BQYdaa/Z8NMT2Fiqb37tcjEKvmwaUHdfE22Vif1luDgC6xqFsn6qqFtOxhoWQ==} engines: {node: '>=14'} @@ -1672,34 +1848,34 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vue/compiler-core@3.5.18': - resolution: {integrity: sha512-3slwjQrrV1TO8MoXgy3aynDQ7lslj5UqDxuHnrzHtpON5CBinhWjJETciPngpin/T3OuW3tXUf86tEurusnztw==} + '@vue/compiler-core@3.5.24': + resolution: {integrity: sha512-eDl5H57AOpNakGNAkFDH+y7kTqrQpJkZFXhWZQGyx/5Wh7B1uQYvcWkvZi11BDhscPgj8N7XV3oRwiPnx1Vrig==} - '@vue/compiler-dom@3.5.18': - resolution: {integrity: sha512-RMbU6NTU70++B1JyVJbNbeFkK+A+Q7y9XKE2EM4NLGm2WFR8x9MbAtWxPPLdm0wUkuZv9trpwfSlL6tjdIa1+A==} + '@vue/compiler-dom@3.5.24': + resolution: {integrity: sha512-1QHGAvs53gXkWdd3ZMGYuvQFXHW4ksKWPG8HP8/2BscrbZ0brw183q2oNWjMrSWImYLHxHrx1ItBQr50I/q2zw==} - '@vue/compiler-sfc@3.5.18': - resolution: {integrity: sha512-5aBjvGqsWs+MoxswZPoTB9nSDb3dhd1x30xrrltKujlCxo48j8HGDNj3QPhF4VIS0VQDUrA1xUfp2hEa+FNyXA==} + '@vue/compiler-sfc@3.5.24': + resolution: {integrity: sha512-8EG5YPRgmTB+YxYBM3VXy8zHD9SWHUJLIGPhDovo3Z8VOgvP+O7UP5vl0J4BBPWYD9vxtBabzW1EuEZ+Cqs14g==} - '@vue/compiler-ssr@3.5.18': - resolution: {integrity: sha512-xM16Ak7rSWHkM3m22NlmcdIM+K4BMyFARAfV9hYFl+SFuRzrZ3uGMNW05kA5pmeMa0X9X963Kgou7ufdbpOP9g==} + '@vue/compiler-ssr@3.5.24': + resolution: {integrity: sha512-trOvMWNBMQ/odMRHW7Ae1CdfYx+7MuiQu62Jtu36gMLXcaoqKvAyh+P73sYG9ll+6jLB6QPovqoKGGZROzkFFg==} - '@vue/reactivity@3.5.18': - resolution: {integrity: sha512-x0vPO5Imw+3sChLM5Y+B6G1zPjwdOri9e8V21NnTnlEvkxatHEH5B5KEAJcjuzQ7BsjGrKtfzuQ5eQwXh8HXBg==} + '@vue/reactivity@3.5.24': + resolution: {integrity: sha512-BM8kBhtlkkbnyl4q+HiF5R5BL0ycDPfihowulm02q3WYp2vxgPcJuZO866qa/0u3idbMntKEtVNuAUp5bw4teg==} - '@vue/runtime-core@3.5.18': - resolution: {integrity: sha512-DUpHa1HpeOQEt6+3nheUfqVXRog2kivkXHUhoqJiKR33SO4x+a5uNOMkV487WPerQkL0vUuRvq/7JhRgLW3S+w==} + '@vue/runtime-core@3.5.24': + resolution: {integrity: sha512-RYP/byyKDgNIqfX/gNb2PB55dJmM97jc9wyF3jK7QUInYKypK2exmZMNwnjueWwGceEkP6NChd3D2ZVEp9undQ==} - '@vue/runtime-dom@3.5.18': - resolution: {integrity: sha512-YwDj71iV05j4RnzZnZtGaXwPoUWeRsqinblgVJwR8XTXYZ9D5PbahHQgsbmzUvCWNF6x7siQ89HgnX5eWkr3mw==} + '@vue/runtime-dom@3.5.24': + resolution: {integrity: sha512-Z8ANhr/i0XIluonHVjbUkjvn+CyrxbXRIxR7wn7+X7xlcb7dJsfITZbkVOeJZdP8VZwfrWRsWdShH6pngMxRjw==} - '@vue/server-renderer@3.5.18': - resolution: {integrity: sha512-PvIHLUoWgSbDG7zLHqSqaCoZvHi6NNmfVFOqO+OnwvqMz/tqQr3FuGWS8ufluNddk7ZLBJYMrjcw1c6XzR12mA==} + '@vue/server-renderer@3.5.24': + resolution: {integrity: sha512-Yh2j2Y4G/0/4z/xJ1Bad4mxaAk++C2v4kaa8oSYTMJBJ00/ndPuxCnWeot0/7/qafQFLh5pr6xeV6SdMcE/G1w==} peerDependencies: - vue: 3.5.18 + vue: 3.5.24 - '@vue/shared@3.5.18': - resolution: {integrity: sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA==} + '@vue/shared@3.5.24': + resolution: {integrity: sha512-9cwHL2EsJBdi8NY22pngYYWzkTDhld6fAD6jlaeloNGciNSJL6bLpbxVgXl96X00Jtc6YWQv96YA/0sxex/k1A==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -1727,8 +1903,8 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + ansi-escapes@7.2.0: + resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} engines: {node: '>=18'} ansi-regex@2.1.1: @@ -1739,8 +1915,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.1.0: - resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} ansi-styles@2.2.1: @@ -1751,8 +1927,8 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} antd@5.21.6: @@ -1847,6 +2023,9 @@ packages: axios@1.7.7: resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1854,6 +2033,10 @@ packages: resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} engines: {node: '>=0.10.0'} + baseline-browser-mapping@2.8.25: + resolution: {integrity: sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==} + hasBin: true + big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} @@ -1888,14 +2071,11 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.25.1: - resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==} + browserslist@4.27.0: + resolution: {integrity: sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -1966,8 +2146,11 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001727: - resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==} + caniuse-lite@1.0.30001754: + resolution: {integrity: sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==} + + ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} chalk@1.1.3: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} @@ -1981,13 +2164,30 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chalk@5.4.1: - resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + character-reference-invalid@2.0.1: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + + chevrotain-allstar@0.3.1: + resolution: {integrity: sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==} + peerDependencies: + chevrotain: ^11.0.0 + + chevrotain@11.0.3: + resolution: {integrity: sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -2000,8 +2200,8 @@ packages: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} - ci-info@4.3.0: - resolution: {integrity: sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==} + ci-info@4.3.1: + resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} engines: {node: '>=8'} citty@0.1.6: @@ -2045,6 +2245,10 @@ packages: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} engines: {node: '>=0.8'} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + collection-visit@1.0.0: resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} engines: {node: '>=0.10.0'} @@ -2066,17 +2270,21 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} - commander@2.20.3: - resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} + commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + comment-parser@1.4.1: resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} engines: {node: '>= 12.0.0'} @@ -2124,13 +2332,19 @@ packages: copy-to-clipboard@3.3.3: resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} - core-js-compat@3.44.0: - resolution: {integrity: sha512-JepmAj2zfl6ogy34qfWtcE7nHKAJnKsQFRn++scjVS2bZFllwptzw61BZcZFYBPpUznLfAvh0LGhxKppk04ClA==} + core-js-compat@3.46.0: + resolution: {integrity: sha512-p9hObIIEENxSV8xIu+V68JjSeARg6UVMG5mR+JEUguG3sI6MsiS1njz2jHmyJDvA+8jX/sytkBHup6kxhM9law==} cors@2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} + cose-base@1.0.3: + resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} + + cose-base@2.2.0: + resolution: {integrity: sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==} + cosmiconfig@8.3.6: resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} @@ -2180,6 +2394,162 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + cytoscape-cose-bilkent@4.1.0: + resolution: {integrity: sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==} + peerDependencies: + cytoscape: ^3.2.0 + + cytoscape-fcose@2.2.0: + resolution: {integrity: sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==} + peerDependencies: + cytoscape: ^3.2.0 + + cytoscape@3.33.1: + resolution: {integrity: sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==} + engines: {node: '>=0.10'} + + d3-array@2.12.1: + resolution: {integrity: sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==} + + d3-array@3.2.4: + resolution: {integrity: sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==} + engines: {node: '>=12'} + + d3-axis@3.0.0: + resolution: {integrity: sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==} + engines: {node: '>=12'} + + d3-brush@3.0.0: + resolution: {integrity: sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==} + engines: {node: '>=12'} + + d3-chord@3.0.1: + resolution: {integrity: sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==} + engines: {node: '>=12'} + + d3-color@3.1.0: + resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==} + engines: {node: '>=12'} + + d3-contour@4.0.2: + resolution: {integrity: sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==} + engines: {node: '>=12'} + + d3-delaunay@6.0.4: + resolution: {integrity: sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==} + engines: {node: '>=12'} + + d3-dispatch@3.0.1: + resolution: {integrity: sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==} + engines: {node: '>=12'} + + d3-drag@3.0.0: + resolution: {integrity: sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==} + engines: {node: '>=12'} + + d3-dsv@3.0.1: + resolution: {integrity: sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==} + engines: {node: '>=12'} + hasBin: true + + d3-ease@3.0.1: + resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==} + engines: {node: '>=12'} + + d3-fetch@3.0.1: + resolution: {integrity: sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==} + engines: {node: '>=12'} + + d3-force@3.0.0: + resolution: {integrity: sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==} + engines: {node: '>=12'} + + d3-format@3.1.0: + resolution: {integrity: sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==} + engines: {node: '>=12'} + + d3-geo@3.1.1: + resolution: {integrity: sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==} + engines: {node: '>=12'} + + d3-hierarchy@3.1.2: + resolution: {integrity: sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==} + engines: {node: '>=12'} + + d3-interpolate@3.0.1: + resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==} + engines: {node: '>=12'} + + d3-path@1.0.9: + resolution: {integrity: sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==} + + d3-path@3.1.0: + resolution: {integrity: sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==} + engines: {node: '>=12'} + + d3-polygon@3.0.1: + resolution: {integrity: sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==} + engines: {node: '>=12'} + + d3-quadtree@3.0.1: + resolution: {integrity: sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==} + engines: {node: '>=12'} + + d3-random@3.0.1: + resolution: {integrity: sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==} + engines: {node: '>=12'} + + d3-sankey@0.12.3: + resolution: {integrity: sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==} + + d3-scale-chromatic@3.1.0: + resolution: {integrity: sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==} + engines: {node: '>=12'} + + d3-scale@4.0.2: + resolution: {integrity: sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==} + engines: {node: '>=12'} + + d3-selection@3.0.0: + resolution: {integrity: sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==} + engines: {node: '>=12'} + + d3-shape@1.3.7: + resolution: {integrity: sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==} + + d3-shape@3.2.0: + resolution: {integrity: sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==} + engines: {node: '>=12'} + + d3-time-format@4.1.0: + resolution: {integrity: sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==} + engines: {node: '>=12'} + + d3-time@3.1.0: + resolution: {integrity: sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==} + engines: {node: '>=12'} + + d3-timer@3.0.1: + resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==} + engines: {node: '>=12'} + + d3-transition@3.0.1: + resolution: {integrity: sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==} + engines: {node: '>=12'} + peerDependencies: + d3-selection: 2 - 3 + + d3-zoom@3.0.0: + resolution: {integrity: sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==} + engines: {node: '>=12'} + + d3@7.9.0: + resolution: {integrity: sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==} + engines: {node: '>=12'} + + dagre-d3-es@7.0.11: + resolution: {integrity: sha512-tvlJLyQf834SylNKax8Wkzco/1ias1OPw8DcUMDE7oUIoSEW25riQVuiu/0OWEFqT0cxHT3Pa9/D82Jr47IONw==} + data-view-buffer@1.0.2: resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} engines: {node: '>= 0.4'} @@ -2223,8 +2593,8 @@ packages: supports-color: optional: true - debug@4.4.1: - resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -2281,6 +2651,9 @@ packages: defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + delaunator@5.0.1: + resolution: {integrity: sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -2330,6 +2703,9 @@ packages: resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} engines: {node: '>= 4'} + dompurify@3.3.0: + resolution: {integrity: sha512-r+f6MYR1gGN1eJv0TVQbhA7if/U7P87cdPl3HN5rikqaBSBxLiCb/b9O+2eG0cxz0ghyU+mU1QkbsOwERMYlWQ==} + domutils@1.7.0: resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==} @@ -2356,11 +2732,11 @@ packages: echarts@5.5.1: resolution: {integrity: sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==} - electron-to-chromium@1.5.191: - resolution: {integrity: sha512-xcwe9ELcuxYLUFqZZxL19Z6HVKcvNkIwhbHUz7L3us6u12yR+7uY89dSl570f/IqNthx8dAw3tojG7i4Ni4tDA==} + electron-to-chromium@1.5.248: + resolution: {integrity: sha512-zsur2yunphlyAO4gIubdJEXCK6KOVvtpiuDfCIqbM9FjcnMYiyn0ICa3hWfPr0nc41zcLWobgy1iL7VvoOyA2Q==} - emoji-regex@10.4.0: - resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@10.6.0: + resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2372,8 +2748,8 @@ packages: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} - enhanced-resolve@5.18.2: - resolution: {integrity: sha512-6Jw4sE1maoRJo3q8MsSIn2onJFbLTOjY9hlx4DZXmOKvLRd1Ok2kXmAGXaafL2+ijsJZ1ClYbl/pmqr9+k4iUQ==} + enhanced-resolve@5.18.3: + resolution: {integrity: sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==} engines: {node: '>=10.13.0'} enquirer@2.4.1: @@ -2390,6 +2766,10 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + entities@6.0.1: + resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} + engines: {node: '>=0.12'} + environment@1.1.0: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} @@ -2398,8 +2778,8 @@ packages: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true - error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} error-stack-parser-es@0.1.5: resolution: {integrity: sha512-xHku1X40RO+fO8yJ8Wh2f2rZWVjqyhb1zgq1yZ8aZRQkv6OOKhKWRUaht3eSCUbAOBaKIgM+ykwFLE+QUxgGeg==} @@ -2588,6 +2968,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-util-is-identifier-name@3.0.0: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -2632,6 +3015,9 @@ packages: resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==} engines: {node: '>=0.10.0'} + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + extglob@2.0.4: resolution: {integrity: sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==} engines: {node: '>=0.10.0'} @@ -2655,8 +3041,9 @@ packages: fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.4.6: - resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -2702,8 +3089,8 @@ packages: flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - follow-redirects@1.15.9: - resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + follow-redirects@1.15.11: + resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -2749,8 +3136,8 @@ packages: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} - fs-extra@11.3.0: - resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==} + fs-extra@11.3.2: + resolution: {integrity: sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==} engines: {node: '>=14.14'} fs-minipass@2.1.0: @@ -2772,6 +3159,10 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + generator-function@2.0.1: + resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} + engines: {node: '>= 0.4'} + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -2780,8 +3171,8 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.3.0: - resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + get-east-asian-width@1.4.0: + resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} get-intrinsic@1.3.0: @@ -2804,8 +3195,8 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - get-tsconfig@4.10.1: - resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} + get-tsconfig@4.13.0: + resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} get-value@2.0.6: resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==} @@ -2873,6 +3264,9 @@ packages: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} + hachure-fill@0.5.2: + resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==} + has-ansi@2.0.0: resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} engines: {node: '>=0.10.0'} @@ -2924,10 +3318,50 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hast-util-from-dom@5.0.1: + resolution: {integrity: sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==} + + hast-util-from-html-isomorphic@2.0.0: + resolution: {integrity: sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==} + + hast-util-from-html@2.0.3: + resolution: {integrity: sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==} + + hast-util-from-parse5@8.0.3: + resolution: {integrity: sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==} + + hast-util-is-element@3.0.0: + resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} + + hast-util-parse-selector@4.0.0: + resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} + + hast-util-raw@9.1.0: + resolution: {integrity: sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==} + + hast-util-to-jsx-runtime@2.3.6: + resolution: {integrity: sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==} + + hast-util-to-parse5@8.0.0: + resolution: {integrity: sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==} + + hast-util-to-text@4.0.2: + resolution: {integrity: sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==} + + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + + hastscript@9.0.1: + resolution: {integrity: sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + highlight.js@11.11.1: + resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} + engines: {node: '>=12.0.0'} + hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} @@ -2937,6 +3371,12 @@ packages: html-parse-stringify@3.0.1: resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} + html-url-attributes@3.0.1: + resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==} + + html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + htmlparser2@3.10.1: resolution: {integrity: sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==} @@ -2980,8 +3420,8 @@ packages: immediate@3.0.6: resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - immer@10.1.1: - resolution: {integrity: sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==} + immer@10.2.0: + resolution: {integrity: sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==} immutable@4.3.7: resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} @@ -3004,10 +3444,20 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + inline-style-parser@0.2.6: + resolution: {integrity: sha512-gtGXVaBdl5mAes3rPcMedEBm12ibjt1kDMFfheul1wUAOVEJW60voNdMVzVkfLN06O7ZaD/rxhfKgtlgtTbMjg==} + internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} + internmap@1.0.1: + resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==} + + internmap@2.0.3: + resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==} + engines: {node: '>=12'} + intersection-observer@0.12.2: resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} @@ -3015,6 +3465,12 @@ packages: resolution: {integrity: sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==} engines: {node: '>= 0.10'} + is-alphabetical@2.0.1: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + + is-alphanumerical@2.0.1: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + is-array-buffer@3.0.5: resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} @@ -3065,6 +3521,9 @@ packages: resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} engines: {node: '>= 0.4'} + is-decimal@2.0.1: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + is-descriptor@0.1.7: resolution: {integrity: sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==} engines: {node: '>= 0.4'} @@ -3102,18 +3561,21 @@ packages: resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} engines: {node: '>=12'} - is-fullwidth-code-point@5.0.0: - resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + is-fullwidth-code-point@5.1.0: + resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} - is-generator-function@1.1.0: - resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + is-generator-function@1.1.2: + resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} engines: {node: '>= 0.4'} is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-hexadecimal@2.0.1: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -3256,8 +3718,8 @@ packages: resolution: {integrity: sha512-pmfRbVRs/7khFrSAYnSiJ8C0D5GvzkE4Ey2pAvUcJsw1ly/p+7ut27jbJrjY79BpAJQJ4gXYFtK6d1Aub+9baQ==} hasBin: true - jiti@2.5.1: - resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==} + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true js-base64@2.6.4: @@ -3313,13 +3775,17 @@ packages: jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} - jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + jsonfile@6.2.0: + resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} + katex@0.16.25: + resolution: {integrity: sha512-woHRUZ/iF23GBP1dkDQMh1QBad9dmr8/PAwNA54VrSOVYgI12MAcE14TqnDdQOdzyEonGzMepYnqBMYdsoAr8Q==} + hasBin: true + keepalive-for-react@3.0.2: resolution: {integrity: sha512-9KFH5XzLH0M8243DMno4Kx/VNVedgrPLYHQkgDJqIK7nJ2RnhRx5lp0SGFiLS6T8TU7LlNO136ooaJTxZSvlFA==} peerDependencies: @@ -3330,6 +3796,9 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + khroma@2.1.0: + resolution: {integrity: sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==} + kind-of@3.2.2: resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} engines: {node: '>=0.10.0'} @@ -3357,8 +3826,18 @@ packages: kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} - less@4.4.0: - resolution: {integrity: sha512-kdTwsyRuncDfjEs0DlRILWNvxhDG/Zij4YLO4TMJgDLW+8OzpfkdPnRgrsRuY1o+oaxJGWsps5f/RVBgGmmN0w==} + langium@3.3.1: + resolution: {integrity: sha512-QJv/h939gDpvT+9SiLVlY7tZC3xB2qK57v0J04Sh9wpMb6MP1q8gB21L3WIo8T5P1MSMg3Ep14L7KkDCFG3y4w==} + engines: {node: '>=16.0.0'} + + layout-base@1.0.2: + resolution: {integrity: sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==} + + layout-base@2.0.1: + resolution: {integrity: sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==} + + less@4.4.2: + resolution: {integrity: sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==} engines: {node: '>=14'} hasBin: true @@ -3401,8 +3880,8 @@ packages: resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} - local-pkg@1.1.1: - resolution: {integrity: sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==} + local-pkg@1.1.2: + resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==} engines: {node: '>=14'} localforage@1.10.0: @@ -3429,6 +3908,9 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} + longest-streak@3.1.0: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -3436,26 +3918,31 @@ packages: lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + lowlight@3.3.0: + resolution: {integrity: sha512-0JNhgFoPvP6U6lE/UdVsSq99tn6DhjjpAj5MxG49ewd2mOBVtwWYIT8ClyABhq198aXXODMU6Ox8DrGy/CpTZQ==} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.1.0: - resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} + lru-cache@11.2.2: + resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} engines: {node: 20 || >=22} lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lucide-react@0.461.0: + resolution: {integrity: sha512-Scpw3D/dV1bgVRC5Kh774RCm99z0iZpPv75M6kg7QL1lLvkQ1rmI1Sjjic1aGp1ULBwd7FokV6ry0g+d6pMB+w==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc + lucide-react@0.546.0: resolution: {integrity: sha512-Z94u6fKT43lKeYHiVyvyR8fT7pwCzDu7RyMPpTvh054+xahSgj4HFQ+NmflvzdXsoAjYGdCguGaFKYuvq0ThCQ==} peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} - - magic-string@0.30.19: - resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==} + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} magicast@0.3.4: resolution: {integrity: sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==} @@ -3472,13 +3959,66 @@ packages: resolution: {integrity: sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==} engines: {node: '>=0.10.0'} + markdown-table@3.0.4: + resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} + + marked@15.0.12: + resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==} + engines: {node: '>= 18'} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} + mdast-util-find-and-replace@3.0.2: + resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==} + mdast-util-from-markdown@2.0.2: resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + mdast-util-gfm-autolink-literal@2.0.1: + resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} + + mdast-util-gfm-footnote@2.1.0: + resolution: {integrity: sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==} + + mdast-util-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} + + mdast-util-gfm-table@2.0.0: + resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} + + mdast-util-gfm-task-list-item@2.0.0: + resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} + + mdast-util-gfm@3.1.0: + resolution: {integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==} + + mdast-util-math@3.0.0: + resolution: {integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==} + + mdast-util-mdx-expression@2.0.1: + resolution: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==} + + mdast-util-mdx-jsx@3.2.0: + resolution: {integrity: sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==} + + mdast-util-mdxjs-esm@2.0.1: + resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + + mdast-util-newline-to-break@2.0.0: + resolution: {integrity: sha512-MbgeFca0hLYIEx/2zGsszCSEJJ1JSCdiY5xQxRcLDDGa8EPvlLPupJ4DSajbMPAnC0je8jfb9TiUATnxxrHUog==} + + mdast-util-phrasing@4.1.0: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + + mdast-util-to-markdown@2.1.2: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} @@ -3502,9 +4042,36 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + mermaid@11.6.0: + resolution: {integrity: sha512-PE8hGUy1LDlWIHWBP05SFdqUHGmRcCcK4IzpOKPE35eOw+G9zZgcnMpyunJVUEOgb//KBORPjysKndw8bFLuRg==} + micromark-core-commonmark@2.0.3: resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} + micromark-extension-gfm-autolink-literal@2.1.0: + resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} + + micromark-extension-gfm-footnote@2.1.0: + resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} + + micromark-extension-gfm-strikethrough@2.1.0: + resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} + + micromark-extension-gfm-table@2.1.1: + resolution: {integrity: sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==} + + micromark-extension-gfm-tagfilter@2.0.0: + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} + + micromark-extension-gfm-task-list-item@2.1.0: + resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} + + micromark-extension-gfm@3.0.0: + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + + micromark-extension-math@3.1.0: + resolution: {integrity: sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==} + micromark-factory-destination@2.0.1: resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} @@ -3602,8 +4169,8 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - minimatch@10.0.3: - resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==} + minimatch@10.1.1: + resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} engines: {node: 20 || >=22} minimatch@3.1.2: @@ -3646,8 +4213,8 @@ packages: engines: {node: '>=10'} hasBin: true - mlly@1.7.4: - resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + mlly@1.8.0: + resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} mrmime@2.0.1: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} @@ -3687,11 +4254,11 @@ packages: node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} - node-fetch-native@1.6.6: - resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==} + node-fetch-native@1.6.7: + resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} - node-releases@2.0.19: - resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + node-releases@2.0.27: + resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} @@ -3819,13 +4386,16 @@ packages: package-manager-detector@0.2.11: resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} - package-manager-detector@1.3.0: - resolution: {integrity: sha512-ZsEbbZORsyHuO00lY1kV3/t72yp6Ysay6Pd17ZAlNGuGwmWDLCJxFpRs0IzfXfj1o4icJOkUEioexFHzyPurSQ==} + package-manager-detector@1.5.0: + resolution: {integrity: sha512-uBj69dVlYe/+wxj8JOpr97XfsxH/eumMt6HqjNTmJDf/6NO9s+0uxeOneIz3AsPt2m6y9PqzDzd3ATcU17MNfw==} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + parse-entities@4.0.2: + resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -3838,10 +4408,16 @@ packages: resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} engines: {node: '>= 0.10'} + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} + pascalcase@0.1.1: resolution: {integrity: sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==} engines: {node: '>=0.10.0'} + path-data-parser@0.1.0: + resolution: {integrity: sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3904,13 +4480,19 @@ packages: pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - pkg-types@2.2.0: - resolution: {integrity: sha512-2SM/GZGAEkPp3KWORxQZns4M+WSeXbC2HEvmOIJe3Cmiv6ieAJvdVhDldtHqM5J1Y7MrR1XhkBT/rMlhh9FdqQ==} + pkg-types@2.3.0: + resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==} pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + points-on-curve@0.2.0: + resolution: {integrity: sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==} + + points-on-path@0.2.1: + resolution: {integrity: sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==} + posix-character-classes@0.1.1: resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} engines: {node: '>=0.10.0'} @@ -4004,8 +4586,8 @@ packages: engines: {node: '>=14'} hasBin: true - pretty-ms@9.2.0: - resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} + pretty-ms@9.3.0: + resolution: {integrity: sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==} engines: {node: '>=18'} prompts@2.4.2: @@ -4015,6 +4597,12 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + + property-information@7.1.0: + resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -4029,15 +4617,15 @@ packages: resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} engines: {node: '>=0.6'} - quansync@0.2.10: - resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} query-string@4.3.4: resolution: {integrity: sha512-O2XLNDBIg1DnTOa+2XrIwSiXEV8h2KImXUnjhhn2+UsvZ+Es2uyd5CCRTNQlDGbzUQOW3aYCBx9rVA6dzsiY7Q==} engines: {node: '>=0.10.0'} - query-string@9.2.2: - resolution: {integrity: sha512-pDSIZJ9sFuOp6VnD+5IkakSVf+rICAuuU88Hcsr6AKL0QtxSIfVuKiVP2oahFI7tk3CRSexwV+Ya6MOoTxzg9g==} + query-string@9.3.1: + resolution: {integrity: sha512-5fBfMOcDi5SA9qj5jZhWAcTtDfKF5WFdd2uD9nVNlbxVv1baq65aALy6qofpNEGELHvisjjasxQp7BlM9gvMzw==} engines: {node: '>=18'} queue-microtask@1.2.3: @@ -4132,8 +4720,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-overflow@1.4.1: - resolution: {integrity: sha512-3MoPQQPV1uKyOMVNd6SZfONi+f3st0r8PksexIdBTeIYbMX0Jr+k7pHEDvsXtR4BpCv90/Pv2MovVNhktKrwvw==} + rc-overflow@1.5.0: + resolution: {integrity: sha512-Lm/v9h0LymeUYJf0x39OveU52InkdRXqnn2aYXfWmo8WdOonIKB2kfau+GF0fWq6jPgtdO9yMqveGcK6aIhJmg==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -4196,8 +4784,8 @@ packages: react: '*' react-dom: '*' - rc-slider@11.1.8: - resolution: {integrity: sha512-2gg/72YFSpKP+Ja5AjC5DPL1YnV8DEITDQrcc1eASrUYjl0esptaBVJBh5nLTXCCp15eD8EuGjwezVGSHhs9tQ==} + rc-slider@11.1.9: + resolution: {integrity: sha512-h8IknhzSh3FEM9u8ivkskh+Ef4Yo4JRIY2nj7MrH6GQmrwV6mcpJf5/4KgH5JaVI1H3E52yCdpOlVyGZIeph5A==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -4267,8 +4855,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-virtual-list@3.19.1: - resolution: {integrity: sha512-DCapO2oyPqmooGhxBuXHM4lFuX+sshQwWqqkuyFA+4rShLe//+GEPVwiDgO+jKtKHtbeYwZoNvetwfHdOf+iUQ==} + rc-virtual-list@3.19.2: + resolution: {integrity: sha512-Ys6NcjwGkuwkeaWBDqfI3xWuZ7rDiQXlH1o2zLfFzATfEgXcqpk8CkgMfbJD81McqjcJVez25a3kPxCR807evA==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -4330,6 +4918,12 @@ packages: react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react-markdown@10.1.0: + resolution: {integrity: sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==} + peerDependencies: + '@types/react': '>=18' + react: '>=18' + react-redux@7.2.9: resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==} peerDependencies: @@ -4436,6 +5030,33 @@ packages: resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} hasBin: true + rehype-highlight@7.0.2: + resolution: {integrity: sha512-k158pK7wdC2qL3M5NcZROZ2tR/l7zOzjxXd5VGdcfIyoijjQqpHd3JKtYSBDpDZ38UI2WJWuFAtkMDxmx5kstA==} + + rehype-katex@7.0.1: + resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==} + + rehype-raw@7.0.0: + resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==} + + remark-breaks@4.0.0: + resolution: {integrity: sha512-IjEjJOkH4FuJvHZVIW0QCDWxcG96kCq7An/KVH2NfJe6rKZU2AsHeB3OEjPNRxi4QC34Xdx7I2KGYn6IpT7gxQ==} + + remark-gfm@4.0.1: + resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==} + + remark-math@6.0.0: + resolution: {integrity: sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==} + + remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + + remark-rehype@11.1.2: + resolution: {integrity: sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==} + + remark-stringify@11.0.0: + resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + repeat-element@1.1.4: resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} engines: {node: '>=0.10.0'} @@ -4465,8 +5086,8 @@ packages: resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} deprecated: https://github.com/lydell/resolve-url#deprecated - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} hasBin: true @@ -4494,18 +5115,27 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.46.1: - resolution: {integrity: sha512-33xGNBsDJAkzt0PvninskHlWnTIPgDtTwhg0U38CUoNP/7H6wI2Cz6dUeoNPbjdTdsYTGuiFFASuUOWovH0SyQ==} + robust-predicates@3.0.2: + resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} + + rollup@4.52.5: + resolution: {integrity: sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - run-applescript@7.0.0: - resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + roughjs@4.6.6: + resolution: {integrity: sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==} + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} engines: {node: '>=18'} run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rw@1.3.3: + resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==} + safe-array-concat@1.1.3: resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} @@ -4532,8 +5162,8 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - sax@1.4.1: - resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + sax@1.4.3: + resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} @@ -4564,8 +5194,8 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.7.2: - resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} engines: {node: '>=10'} hasBin: true @@ -4632,8 +5262,8 @@ packages: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} - slice-ansi@7.1.0: - resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + slice-ansi@7.1.2: + resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} snake-case@3.0.4: @@ -4659,9 +5289,6 @@ packages: resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} deprecated: See https://github.com/lydell/source-map-resolve#deprecated - source-map-support@0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} - source-map-url@0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} deprecated: See https://github.com/lydell/source-map-url#deprecated @@ -4674,6 +5301,9 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} @@ -4683,8 +5313,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.21: - resolution: {integrity: sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==} + spdx-license-ids@3.0.22: + resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} split-on-first@3.0.0: resolution: {integrity: sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==} @@ -4754,6 +5384,9 @@ packages: string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + strip-ansi@3.0.1: resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} engines: {node: '>=0.10.0'} @@ -4762,8 +5395,8 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} strip-final-newline@3.0.0: @@ -4785,6 +5418,12 @@ packages: strip-literal@2.1.1: resolution: {integrity: sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==} + style-to-js@1.1.19: + resolution: {integrity: sha512-Ev+SgeqiNGT1ufsXyVC5RrJRXdrkRJ1Gol9Qw7Pb72YCKJXrBvP0ckZhBeVSrw2m06DJpei2528uIpjMb4TsoQ==} + + style-to-object@1.0.12: + resolution: {integrity: sha512-ddJqYnoT4t97QvN2C95bCgt+m7AAgXjVnkk/jxAfmp7EAB8nnqqZYEbMd3em7/vEomDb2LAQKAy1RFfv41mdNw==} + stylis@4.3.6: resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==} @@ -4819,19 +5458,14 @@ packages: resolution: {integrity: sha512-JJoOEKTfL1urb1mDoEblhD9NhEbWmq9jHEMEnxoC4ujUaZ4itA8vKgwkFAyNClgxplLi9tsUKX+EduK0p/l7sg==} engines: {node: ^14.18.0 || >=16.0.0} - tapable@2.2.2: - resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==} + tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} - terser@5.44.0: - resolution: {integrity: sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==} - engines: {node: '>=10'} - hasBin: true - text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -4851,11 +5485,12 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyexec@1.0.1: - resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} + tinyexec@1.0.2: + resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} + engines: {node: '>=18'} - tinyglobby@0.2.14: - resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} tinygradient@1.1.5: @@ -4888,6 +5523,12 @@ packages: resolution: {integrity: sha512-vxXDZg8/+p3gblxB6BhhG5yWVn1kGRlaL8O78UDXc3wRnPizB5g83dcvWV1jpDMIPnjZjOFuxlMmE82XJ4407w==} engines: {node: '>= 0.4'} + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + + trough@2.2.0: + resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + ts-api-utils@1.4.3: resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} engines: {node: '>=16'} @@ -4900,6 +5541,10 @@ packages: peerDependencies: typescript: '>=4.8.4' + ts-dedent@2.2.0: + resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} + engines: {node: '>=6.10'} + tslib@2.3.0: resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} @@ -4981,6 +5626,9 @@ packages: resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} engines: {node: '>=18'} + unified@11.0.5: + resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} + unimport@3.14.6: resolution: {integrity: sha512-CYvbDaTT04Rh8bmD8jz3WPmHYZRG/NnvYVzwD6V1YAlvvKROlAeNDUBhkBGzNav2RKaeuXvlWYaa1V4Lfi/O0g==} @@ -4988,9 +5636,27 @@ packages: resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} engines: {node: '>=0.10.0'} + unist-util-find-after@5.0.0: + resolution: {integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==} + + unist-util-is@6.0.1: + resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} + + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + + unist-util-remove-position@5.0.0: + resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} + unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + unist-util-visit-parents@6.0.2: + resolution: {integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==} + + unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} @@ -5042,8 +5708,8 @@ packages: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} - update-browserslist-db@1.1.3: - resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} + update-browserslist-db@1.1.4: + resolution: {integrity: sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -5055,13 +5721,19 @@ packages: resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} deprecated: Please see https://github.com/lydell/urix#deprecated + use-debounce@10.0.4: + resolution: {integrity: sha512-6Cf7Yr7Wk7Kdv77nnJMf6de4HuDE4dTxKij+RqE9rufDsI6zsbjyAxcH5y2ueJCQAnfgKbzXbZHYlkFwmBlWkw==} + engines: {node: '>= 16.0.0'} + peerDependencies: + react: '*' + use-memo-one@1.1.3: resolution: {integrity: sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 - use-sync-external-store@1.5.0: - resolution: {integrity: sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==} + use-sync-external-store@1.6.0: + resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -5072,6 +5744,10 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + uuid@11.1.0: + resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + hasBin: true + validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -5079,6 +5755,15 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + vfile-location@5.0.3: + resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} + + vfile-message@4.0.3: + resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} + + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-plugin-inspect@0.8.7: resolution: {integrity: sha512-/XXou3MVc13A5O9/2Nd6xczjrUwt7ZyI9h8pTnUMkr5SshLcb0PJUOVq2V+XVkdeU4njsqAtmK87THZuO2coGA==} engines: {node: '>=14'} @@ -5132,17 +5817,40 @@ packages: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} + vscode-jsonrpc@8.2.0: + resolution: {integrity: sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==} + engines: {node: '>=14.0.0'} + + vscode-languageserver-protocol@3.17.5: + resolution: {integrity: sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==} + + vscode-languageserver-textdocument@1.0.12: + resolution: {integrity: sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==} + + vscode-languageserver-types@3.17.5: + resolution: {integrity: sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==} + + vscode-languageserver@9.0.1: + resolution: {integrity: sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==} + hasBin: true + + vscode-uri@3.0.8: + resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} + vue-flow-layout@0.0.5: resolution: {integrity: sha512-lZlqQ/Se1trGMtBMneZDWaiQiQBuxU8ivZ+KpJMem5zKROFpzuPq9KqyWABbSYbxq0qhqZs1I4DBwrY041rtOA==} - vue@3.5.18: - resolution: {integrity: sha512-7W4Y4ZbMiQ3SEo+m9lnoNpV9xG7QVMLa+/0RFwwiAVkeYoyGXqWE85jabU4pllJNUzqfLShJ5YLptewhCWUgNA==} + vue@3.5.24: + resolution: {integrity: sha512-uTHDOpVQTMjcGgrqFPSb8iO2m1DUvo+WbGqoXQz8Y1CeBYQ0FXf2z1gLRaBtHjlRz7zZUBHxjVB5VTLzYkvftg==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true + web-namespaces@2.0.1: + resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + webpack-sources@3.3.3: resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} engines: {node: '>=10.13.0'} @@ -5187,8 +5895,8 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.0: - resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + wrap-ansi@9.0.2: + resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} engines: {node: '>=18'} wsl-utils@0.1.0: @@ -5222,19 +5930,22 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yoctocolors@2.1.1: - resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==} + yoctocolors@2.1.2: + resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} engines: {node: '>=18'} zrender@5.6.0: resolution: {integrity: sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==} + zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + snapshots: '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 '@ant-design/colors@7.2.1': dependencies: @@ -5243,14 +5954,14 @@ snapshots: '@ant-design/cssinjs-utils@1.1.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@ant-design/cssinjs': 1.24.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) '@ant-design/cssinjs@1.24.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@emotion/hash': 0.8.0 '@emotion/unitless': 0.7.5 classnames: 2.5.1 @@ -5262,7 +5973,7 @@ snapshots: '@ant-design/fast-color@2.0.6': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@ant-design/icons-svg@4.4.2': {} @@ -5270,7 +5981,7 @@ snapshots: dependencies: '@ant-design/colors': 7.2.1 '@ant-design/icons-svg': 4.4.2 - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -5278,7 +5989,7 @@ snapshots: '@ant-design/react-slick@1.1.2(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 json2mq: 0.2.0 react: 18.3.1 @@ -5294,8 +6005,8 @@ snapshots: '@antfu/install-pkg@1.1.0': dependencies: - package-manager-detector: 1.3.0 - tinyexec: 1.0.1 + package-manager-detector: 1.5.0 + tinyexec: 1.0.2 '@antfu/utils@0.7.10': {} @@ -5303,45 +6014,45 @@ snapshots: '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.28.0': {} + '@babel/compat-data@7.28.5': {} - '@babel/core@7.28.0': + '@babel/core@7.28.5': dependencies: - '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.0 + '@babel/generator': 7.28.5 '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.27.3(@babel/core@7.28.0) - '@babel/helpers': 7.28.2 - '@babel/parser': 7.28.0 + '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) + '@babel/helpers': 7.28.4 + '@babel/parser': 7.28.5 '@babel/template': 7.27.2 - '@babel/traverse': 7.28.0 - '@babel/types': 7.28.2 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 + '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.1 + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.28.0': + '@babel/generator@7.28.5': dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 '@babel/helper-compilation-targets@7.27.2': dependencies: - '@babel/compat-data': 7.28.0 + '@babel/compat-data': 7.28.5 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.25.1 + browserslist: 4.27.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -5349,17 +6060,17 @@ snapshots: '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/traverse': 7.28.0 - '@babel/types': 7.28.2 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.27.3(@babel/core@7.28.0)': + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.28.0 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color @@ -5367,62 +6078,53 @@ snapshots: '@babel/helper-string-parser@7.27.1': {} - '@babel/helper-validator-identifier@7.27.1': {} + '@babel/helper-validator-identifier@7.28.5': {} '@babel/helper-validator-option@7.27.1': {} - '@babel/helpers@7.28.2': + '@babel/helpers@7.28.4': dependencies: '@babel/template': 7.27.2 - '@babel/types': 7.28.2 - - '@babel/parser@7.28.0': - dependencies: - '@babel/types': 7.28.2 + '@babel/types': 7.28.5 - '@babel/parser@7.28.4': + '@babel/parser@7.28.5': dependencies: - '@babel/types': 7.28.4 + '@babel/types': 7.28.5 - '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.0)': + '@babel/plugin-transform-react-jsx-self@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.0)': + '@babel/plugin-transform-react-jsx-source@7.27.1(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 - '@babel/runtime@7.28.2': {} + '@babel/runtime@7.28.4': {} '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 - '@babel/traverse@7.28.0': + '@babel/traverse@7.28.5': dependencies: '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.0 + '@babel/generator': 7.28.5 '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.28.0 + '@babel/parser': 7.28.5 '@babel/template': 7.27.2 - '@babel/types': 7.28.2 - debug: 4.4.1 + '@babel/types': 7.28.5 + debug: 4.4.3 transitivePeerDependencies: - supports-color - '@babel/types@7.28.2': - dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - - '@babel/types@7.28.4': + '@babel/types@7.28.5': dependencies: '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 '@better-scroll/core@2.5.1': dependencies: @@ -5430,6 +6132,25 @@ snapshots: '@better-scroll/shared-utils@2.5.1': {} + '@braintree/sanitize-url@7.1.1': {} + + '@chevrotain/cst-dts-gen@11.0.3': + dependencies: + '@chevrotain/gast': 11.0.3 + '@chevrotain/types': 11.0.3 + lodash-es: 4.17.21 + + '@chevrotain/gast@11.0.3': + dependencies: + '@chevrotain/types': 11.0.3 + lodash-es: 4.17.21 + + '@chevrotain/regexp-to-ast@11.0.3': {} + + '@chevrotain/types@11.0.3': {} + + '@chevrotain/utils@11.0.3': {} + '@ctrl/tinycolor@3.6.1': {} '@emotion/hash@0.8.0': {} @@ -5577,21 +6298,23 @@ snapshots: '@esbuild/win32-x64@0.23.1': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.14.0(jiti@2.5.1))': + '@eslint-community/eslint-utils@4.9.0(eslint@9.14.0(jiti@2.6.1))': dependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.12.1': {} + '@eslint-community/regexpp@4.12.2': {} - '@eslint/compat@1.3.1(eslint@9.14.0(jiti@2.5.1))': + '@eslint/compat@1.4.1(eslint@9.14.0(jiti@2.6.1))': + dependencies: + '@eslint/core': 0.17.0 optionalDependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) '@eslint/config-array@0.18.0': dependencies: - '@eslint/object-schema': 2.1.6 - debug: 4.4.1 + '@eslint/object-schema': 2.1.7 + debug: 4.4.3 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -5600,12 +6323,16 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 + '@eslint/core@0.17.0': + dependencies: + '@types/json-schema': 7.0.15 + '@eslint/core@0.7.0': {} '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.4.1 + debug: 4.4.3 espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -5619,7 +6346,7 @@ snapshots: '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.1 + debug: 4.4.3 espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -5634,7 +6361,7 @@ snapshots: '@eslint/js@9.14.0': {} - '@eslint/object-schema@2.1.6': {} + '@eslint/object-schema@2.1.7': {} '@eslint/plugin-kit@0.2.8': dependencies: @@ -5643,15 +6370,13 @@ snapshots: '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.6': + '@humanfs/node@0.16.7': dependencies: '@humanfs/core': 0.19.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.3 '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.1': {} - '@humanwhocodes/retry@0.4.3': {} '@iconify/json@2.2.266': @@ -5671,14 +6396,21 @@ snapshots: '@antfu/install-pkg': 1.1.0 '@antfu/utils': 8.1.1 '@iconify/types': 2.0.0 - debug: 4.4.1 + debug: 4.4.3 globals: 15.15.0 kolorist: 1.8.0 - local-pkg: 1.1.1 - mlly: 1.7.4 + local-pkg: 1.1.2 + mlly: 1.8.0 transitivePeerDependencies: - supports-color + '@infinilabs/entity-ui@0.0.4(antd@5.21.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + antd: 5.21.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + lucide-react: 0.461.0(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.0': @@ -5689,29 +6421,26 @@ snapshots: dependencies: string-width: 5.1.2 string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 strip-ansi-cjs: strip-ansi@6.0.1 wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@jridgewell/gen-mapping@0.3.12': + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.29 - - '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/source-map@0.3.11': + '@jridgewell/remapping@2.3.5': dependencies: - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 - optional: true + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/sourcemap-codec@1.5.4': {} + '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.29': + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 @@ -5723,6 +6452,10 @@ snapshots: string-argv: 0.3.2 type-detect: 4.1.0 + '@mermaid-js/parser@0.4.0': + dependencies: + langium: 3.3.1 + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5816,12 +6549,12 @@ snapshots: '@rc-component/async-validator@5.0.4': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/color-picker@2.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@ant-design/fast-color': 2.0.6 - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -5829,18 +6562,18 @@ snapshots: '@rc-component/context@1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) '@rc-component/mini-decimal@1.1.0': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/mutate-observer@1.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -5848,23 +6581,22 @@ snapshots: '@rc-component/portal@1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@rc-component/qrcode@1.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@rc-component/qrcode@1.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 - rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) '@rc-component/tour@1.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 @@ -5874,7 +6606,7 @@ snapshots: '@rc-component/trigger@2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -5885,7 +6617,7 @@ snapshots: '@reduxjs/toolkit@2.3.0(react-redux@9.1.2(@types/react@18.3.12)(react@18.3.1)(redux@5.0.1))(react@18.3.1)': dependencies: - immer: 10.1.1 + immer: 10.2.0 redux: 5.0.1 redux-thunk: 3.1.0(redux@5.0.1) reselect: 5.1.1 @@ -5895,81 +6627,87 @@ snapshots: '@remix-run/router@1.20.0': {} - '@rollup/pluginutils@5.2.0(rollup@4.46.1)': + '@rollup/pluginutils@5.3.0(rollup@4.52.5)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.46.1 + rollup: 4.52.5 + + '@rollup/rollup-android-arm-eabi@4.52.5': + optional: true + + '@rollup/rollup-android-arm64@4.52.5': + optional: true - '@rollup/rollup-android-arm-eabi@4.46.1': + '@rollup/rollup-darwin-arm64@4.52.5': optional: true - '@rollup/rollup-android-arm64@4.46.1': + '@rollup/rollup-darwin-x64@4.52.5': optional: true - '@rollup/rollup-darwin-arm64@4.46.1': + '@rollup/rollup-freebsd-arm64@4.52.5': optional: true - '@rollup/rollup-darwin-x64@4.46.1': + '@rollup/rollup-freebsd-x64@4.52.5': optional: true - '@rollup/rollup-freebsd-arm64@4.46.1': + '@rollup/rollup-linux-arm-gnueabihf@4.52.5': optional: true - '@rollup/rollup-freebsd-x64@4.46.1': + '@rollup/rollup-linux-arm-musleabihf@4.52.5': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.46.1': + '@rollup/rollup-linux-arm64-gnu@4.52.5': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.46.1': + '@rollup/rollup-linux-arm64-musl@4.52.5': optional: true - '@rollup/rollup-linux-arm64-gnu@4.46.1': + '@rollup/rollup-linux-loong64-gnu@4.52.5': optional: true - '@rollup/rollup-linux-arm64-musl@4.46.1': + '@rollup/rollup-linux-ppc64-gnu@4.52.5': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.46.1': + '@rollup/rollup-linux-riscv64-gnu@4.52.5': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.46.1': + '@rollup/rollup-linux-riscv64-musl@4.52.5': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.46.1': + '@rollup/rollup-linux-s390x-gnu@4.52.5': optional: true - '@rollup/rollup-linux-riscv64-musl@4.46.1': + '@rollup/rollup-linux-x64-gnu@4.52.5': optional: true - '@rollup/rollup-linux-s390x-gnu@4.46.1': + '@rollup/rollup-linux-x64-musl@4.52.5': optional: true - '@rollup/rollup-linux-x64-gnu@4.46.1': + '@rollup/rollup-openharmony-arm64@4.52.5': optional: true - '@rollup/rollup-linux-x64-musl@4.46.1': + '@rollup/rollup-win32-arm64-msvc@4.52.5': optional: true - '@rollup/rollup-win32-arm64-msvc@4.46.1': + '@rollup/rollup-win32-ia32-msvc@4.52.5': optional: true - '@rollup/rollup-win32-ia32-msvc@4.46.1': + '@rollup/rollup-win32-x64-gnu@4.52.5': optional: true - '@rollup/rollup-win32-x64-msvc@4.46.1': + '@rollup/rollup-win32-x64-msvc@4.52.5': optional: true '@sec-ant/readable-stream@0.4.1': {} '@sindresorhus/merge-streams@4.0.0': {} - '@soybeanjs/changelog@0.3.24(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@soybeanjs/changelog@0.3.24(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@soybeanjs/eslint-config': 1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@soybeanjs/eslint-config': 1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) cli-progress: 3.12.0 convert-gitmoji: 0.1.5 dayjs: 1.11.11 @@ -5996,22 +6734,22 @@ snapshots: - typescript - vue-eslint-parser - '@soybeanjs/eslint-config@1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@soybeanjs/eslint-config@1.4.2(@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)))(eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: '@antfu/eslint-define-config': 1.23.0-2 '@antfu/install-pkg': 0.4.1 '@eslint/eslintrc': 3.1.0 '@eslint/js': 9.13.0 - '@typescript-eslint/eslint-plugin': 8.11.0(@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - '@typescript-eslint/parser': 8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - eslint: 9.14.0(jiti@2.5.1) - eslint-config-flat-gitignore: 0.3.0(eslint@9.14.0(jiti@2.5.1)) - eslint-config-prettier: 9.1.0(eslint@9.14.0(jiti@2.5.1)) + '@typescript-eslint/eslint-plugin': 8.11.0(@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + '@typescript-eslint/parser': 8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + eslint: 9.14.0(jiti@2.6.1) + eslint-config-flat-gitignore: 0.3.0(eslint@9.14.0(jiti@2.6.1)) + eslint-config-prettier: 9.1.0(eslint@9.14.0(jiti@2.6.1)) eslint-parser-plain: 0.1.0 - eslint-plugin-import-x: 4.3.1(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - eslint-plugin-n: 17.11.1(eslint@9.14.0(jiti@2.5.1)) - eslint-plugin-prettier: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(prettier@3.3.3) - eslint-plugin-unicorn: 56.0.0(eslint@9.14.0(jiti@2.5.1)) + eslint-plugin-import-x: 4.3.1(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + eslint-plugin-n: 17.11.1(eslint@9.14.0(jiti@2.6.1)) + eslint-plugin-prettier: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(prettier@3.3.3) + eslint-plugin-unicorn: 56.0.0(eslint@9.14.0(jiti@2.6.1)) globals: 15.11.0 local-pkg: 0.5.0 prettier: 3.3.3 @@ -6020,62 +6758,62 @@ snapshots: prompts: 2.4.2 typescript: 5.6.3 optionalDependencies: - '@unocss/eslint-config': 0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - eslint-plugin-react: 7.37.2(eslint@9.14.0(jiti@2.5.1)) - eslint-plugin-react-hooks: 5.0.0(eslint@9.14.0(jiti@2.5.1)) - eslint-plugin-react-refresh: 0.4.14(eslint@9.14.0(jiti@2.5.1)) + '@unocss/eslint-config': 0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + eslint-plugin-react: 7.37.2(eslint@9.14.0(jiti@2.6.1)) + eslint-plugin-react-hooks: 5.0.0(eslint@9.14.0(jiti@2.6.1)) + eslint-plugin-react-refresh: 0.4.14(eslint@9.14.0(jiti@2.6.1)) transitivePeerDependencies: - '@types/eslint' - supports-color - '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-remove-jsx-attribute@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-remove-jsx-attribute@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-svg-dynamic-title@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-svg-dynamic-title@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-svg-em-dimensions@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-svg-em-dimensions@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-transform-react-native-svg@8.1.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-transform-react-native-svg@8.1.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-plugin-transform-svg-component@8.0.0(@babel/core@7.28.0)': + '@svgr/babel-plugin-transform-svg-component@8.0.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 + '@babel/core': 7.28.5 - '@svgr/babel-preset@8.1.0(@babel/core@7.28.0)': + '@svgr/babel-preset@8.1.0(@babel/core@7.28.5)': dependencies: - '@babel/core': 7.28.0 - '@svgr/babel-plugin-add-jsx-attribute': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-replace-jsx-attribute-value': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-svg-dynamic-title': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-svg-em-dimensions': 8.0.0(@babel/core@7.28.0) - '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.28.0) - '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.28.0) + '@babel/core': 7.28.5 + '@svgr/babel-plugin-add-jsx-attribute': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-replace-jsx-attribute-value': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-svg-dynamic-title': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-svg-em-dimensions': 8.0.0(@babel/core@7.28.5) + '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.28.5) + '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.28.5) '@svgr/core@8.1.0(typescript@5.6.3)': dependencies: - '@babel/core': 7.28.0 - '@svgr/babel-preset': 8.1.0(@babel/core@7.28.0) + '@babel/core': 7.28.5 + '@svgr/babel-preset': 8.1.0(@babel/core@7.28.5) camelcase: 6.3.0 cosmiconfig: 8.3.6(typescript@5.6.3) snake-case: 3.0.4 @@ -6085,13 +6823,13 @@ snapshots: '@svgr/hast-util-to-babel-ast@8.0.0': dependencies: - '@babel/types': 7.28.2 + '@babel/types': 7.28.5 entities: 4.5.0 '@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.6.3))': dependencies: - '@babel/core': 7.28.0 - '@svgr/babel-preset': 8.1.0(@babel/core@7.28.0) + '@babel/core': 7.28.5 + '@svgr/babel-preset': 8.1.0(@babel/core@7.28.5) '@svgr/core': 8.1.0(typescript@5.6.3) '@svgr/hast-util-to-babel-ast': 8.0.0 svg-parser: 2.0.4 @@ -6100,7 +6838,7 @@ snapshots: '@tanem/svg-injector@10.1.68': dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 content-type: 1.0.5 tslib: 2.8.1 @@ -6108,37 +6846,164 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.28.4 - '@babel/types': 7.28.4 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.7 + '@types/babel__traverse': 7.28.0 '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.28.4 + '@babel/types': 7.28.5 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.28.4 - '@babel/types': 7.28.4 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 - '@types/babel__traverse@7.20.7': + '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.28.4 + '@babel/types': 7.28.5 '@types/crypto-js@4.2.2': {} + '@types/d3-array@3.2.2': {} + + '@types/d3-axis@3.0.6': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-brush@3.0.6': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-chord@3.0.6': {} + + '@types/d3-color@3.1.3': {} + + '@types/d3-contour@3.0.6': + dependencies: + '@types/d3-array': 3.2.2 + '@types/geojson': 7946.0.16 + + '@types/d3-delaunay@6.0.4': {} + + '@types/d3-dispatch@3.0.7': {} + + '@types/d3-drag@3.0.7': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-dsv@3.0.7': {} + + '@types/d3-ease@3.0.2': {} + + '@types/d3-fetch@3.0.7': + dependencies: + '@types/d3-dsv': 3.0.7 + + '@types/d3-force@3.0.10': {} + + '@types/d3-format@3.0.4': {} + + '@types/d3-geo@3.1.0': + dependencies: + '@types/geojson': 7946.0.16 + + '@types/d3-hierarchy@3.1.7': {} + + '@types/d3-interpolate@3.0.4': + dependencies: + '@types/d3-color': 3.1.3 + + '@types/d3-path@3.1.1': {} + + '@types/d3-polygon@3.0.2': {} + + '@types/d3-quadtree@3.0.6': {} + + '@types/d3-random@3.0.3': {} + + '@types/d3-scale-chromatic@3.1.0': {} + + '@types/d3-scale@4.0.9': + dependencies: + '@types/d3-time': 3.0.4 + + '@types/d3-selection@3.0.11': {} + + '@types/d3-shape@3.1.7': + dependencies: + '@types/d3-path': 3.1.1 + + '@types/d3-time-format@4.0.3': {} + + '@types/d3-time@3.0.4': {} + + '@types/d3-timer@3.0.2': {} + + '@types/d3-transition@3.0.9': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-zoom@3.0.8': + dependencies: + '@types/d3-interpolate': 3.0.4 + '@types/d3-selection': 3.0.11 + + '@types/d3@7.4.3': + dependencies: + '@types/d3-array': 3.2.2 + '@types/d3-axis': 3.0.6 + '@types/d3-brush': 3.0.6 + '@types/d3-chord': 3.0.6 + '@types/d3-color': 3.1.3 + '@types/d3-contour': 3.0.6 + '@types/d3-delaunay': 6.0.4 + '@types/d3-dispatch': 3.0.7 + '@types/d3-drag': 3.0.7 + '@types/d3-dsv': 3.0.7 + '@types/d3-ease': 3.0.2 + '@types/d3-fetch': 3.0.7 + '@types/d3-force': 3.0.10 + '@types/d3-format': 3.0.4 + '@types/d3-geo': 3.1.0 + '@types/d3-hierarchy': 3.1.7 + '@types/d3-interpolate': 3.0.4 + '@types/d3-path': 3.1.1 + '@types/d3-polygon': 3.0.2 + '@types/d3-quadtree': 3.0.6 + '@types/d3-random': 3.0.3 + '@types/d3-scale': 4.0.9 + '@types/d3-scale-chromatic': 3.1.0 + '@types/d3-selection': 3.0.11 + '@types/d3-shape': 3.1.7 + '@types/d3-time': 3.0.4 + '@types/d3-time-format': 4.0.3 + '@types/d3-timer': 3.0.2 + '@types/d3-transition': 3.0.9 + '@types/d3-zoom': 3.0.8 + '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 + '@types/estree-jsx@1.0.5': + dependencies: + '@types/estree': 1.0.8 + '@types/estree@1.0.8': {} + '@types/geojson@7946.0.16': {} + '@types/gradient-string@1.1.6': dependencies: '@types/tinycolor2': 1.4.6 + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.3 + '@types/hoist-non-react-statics@3.3.7(@types/react@18.3.12)': dependencies: '@types/react': 18.3.12 @@ -6146,6 +7011,8 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/katex@0.16.7': {} + '@types/lodash@4.17.20': {} '@types/mdast@4.0.4': @@ -6196,6 +7063,11 @@ snapshots: '@types/tinycolor2@1.4.6': {} + '@types/trusted-types@2.0.7': + optional: true + + '@types/unist@2.0.11': {} + '@types/unist@3.0.3': {} '@types/use-sync-external-store@0.0.3': {} @@ -6208,15 +7080,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.11.0(@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/eslint-plugin@8.11.0(@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@typescript-eslint/scope-manager': 8.11.0 - '@typescript-eslint/type-utils': 8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - '@typescript-eslint/utils': 8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@typescript-eslint/type-utils': 8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + '@typescript-eslint/utils': 8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.11.0 - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -6226,15 +7098,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3))(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@typescript-eslint/scope-manager': 8.12.2 - '@typescript-eslint/type-utils': 8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - '@typescript-eslint/utils': 8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@typescript-eslint/type-utils': 8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + '@typescript-eslint/utils': 8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.12.2 - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -6244,37 +7116,37 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/parser@8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: '@typescript-eslint/scope-manager': 8.11.0 '@typescript-eslint/types': 8.11.0 '@typescript-eslint/typescript-estree': 8.11.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.11.0 - debug: 4.4.1 - eslint: 9.14.0(jiti@2.5.1) + debug: 4.4.3 + eslint: 9.14.0(jiti@2.6.1) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: '@typescript-eslint/scope-manager': 8.12.2 '@typescript-eslint/types': 8.12.2 '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.12.2 - debug: 4.4.1 - eslint: 9.14.0(jiti@2.5.1) + debug: 4.4.3 + eslint: 9.14.0(jiti@2.6.1) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.38.0(typescript@5.6.3)': + '@typescript-eslint/project-service@8.46.3(typescript@5.6.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.6.3) - '@typescript-eslint/types': 8.38.0 - debug: 4.4.1 + '@typescript-eslint/tsconfig-utils': 8.46.3(typescript@5.6.3) + '@typescript-eslint/types': 8.46.3 + debug: 4.4.3 typescript: 5.6.3 transitivePeerDependencies: - supports-color @@ -6289,20 +7161,20 @@ snapshots: '@typescript-eslint/types': 8.12.2 '@typescript-eslint/visitor-keys': 8.12.2 - '@typescript-eslint/scope-manager@8.38.0': + '@typescript-eslint/scope-manager@8.46.3': dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 + '@typescript-eslint/types': 8.46.3 + '@typescript-eslint/visitor-keys': 8.46.3 - '@typescript-eslint/tsconfig-utils@8.38.0(typescript@5.6.3)': + '@typescript-eslint/tsconfig-utils@8.46.3(typescript@5.6.3)': dependencies: typescript: 5.6.3 - '@typescript-eslint/type-utils@8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/type-utils@8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 8.11.0(typescript@5.6.3) - '@typescript-eslint/utils': 8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - debug: 4.4.1 + '@typescript-eslint/utils': 8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + debug: 4.4.3 ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 @@ -6310,11 +7182,11 @@ snapshots: - eslint - supports-color - '@typescript-eslint/type-utils@8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/type-utils@8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) - '@typescript-eslint/utils': 8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - debug: 4.4.1 + '@typescript-eslint/utils': 8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + debug: 4.4.3 ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 @@ -6326,17 +7198,17 @@ snapshots: '@typescript-eslint/types@8.12.2': {} - '@typescript-eslint/types@8.38.0': {} + '@typescript-eslint/types@8.46.3': {} '@typescript-eslint/typescript-estree@8.11.0(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 8.11.0 '@typescript-eslint/visitor-keys': 8.11.0 - debug: 4.4.1 + debug: 4.4.3 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 @@ -6347,62 +7219,62 @@ snapshots: dependencies: '@typescript-eslint/types': 8.12.2 '@typescript-eslint/visitor-keys': 8.12.2 - debug: 4.4.1 + debug: 4.4.3 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.38.0(typescript@5.6.3)': + '@typescript-eslint/typescript-estree@8.46.3(typescript@5.6.3)': dependencies: - '@typescript-eslint/project-service': 8.38.0(typescript@5.6.3) - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.6.3) - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 - debug: 4.4.1 + '@typescript-eslint/project-service': 8.46.3(typescript@5.6.3) + '@typescript-eslint/tsconfig-utils': 8.46.3(typescript@5.6.3) + '@typescript-eslint/types': 8.46.3 + '@typescript-eslint/visitor-keys': 8.46.3 + debug: 4.4.3 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 ts-api-utils: 2.1.0(typescript@5.6.3) typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.11.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/utils@8.11.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) '@typescript-eslint/scope-manager': 8.11.0 '@typescript-eslint/types': 8.11.0 '@typescript-eslint/typescript-estree': 8.11.0(typescript@5.6.3) - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.12.2(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/utils@8.12.2(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) '@typescript-eslint/scope-manager': 8.12.2 '@typescript-eslint/types': 8.12.2 '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.38.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@typescript-eslint/utils@8.46.3(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.6.3) - eslint: 9.14.0(jiti@2.5.1) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.46.3 + '@typescript-eslint/types': 8.46.3 + '@typescript-eslint/typescript-estree': 8.46.3(typescript@5.6.3) + eslint: 9.14.0(jiti@2.6.1) typescript: 5.6.3 transitivePeerDependencies: - supports-color @@ -6417,11 +7289,13 @@ snapshots: '@typescript-eslint/types': 8.12.2 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.38.0': + '@typescript-eslint/visitor-keys@8.46.3': dependencies: - '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/types': 8.46.3 eslint-visitor-keys: 4.2.1 + '@ungap/structured-clone@1.3.0': {} + '@unocss/config@0.63.6': dependencies: '@unocss/core': 0.63.6 @@ -6431,20 +7305,20 @@ snapshots: '@unocss/core@0.63.6': {} - '@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@unocss/eslint-config@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@unocss/eslint-plugin': 0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@unocss/eslint-plugin': 0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) transitivePeerDependencies: - eslint - supports-color - typescript - '@unocss/eslint-plugin@0.63.6(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3)': + '@unocss/eslint-plugin@0.63.6(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3)': dependencies: - '@typescript-eslint/utils': 8.38.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) + '@typescript-eslint/utils': 8.46.3(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) '@unocss/config': 0.63.6 '@unocss/core': 0.63.6 - magic-string: 0.30.17 + magic-string: 0.30.21 synckit: 0.9.3 transitivePeerDependencies: - eslint @@ -6495,7 +7369,7 @@ snapshots: '@unocss/rule-utils@0.63.6': dependencies: '@unocss/core': 0.63.6 - magic-string: 0.30.19 + magic-string: 0.30.21 '@unocss/transformer-directives@0.63.6': dependencies: @@ -6507,86 +7381,86 @@ snapshots: dependencies: '@unocss/core': 0.63.6 - '@unocss/vite@0.63.6(rollup@4.46.1)(typescript@5.6.3)(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0))': + '@unocss/vite@0.63.6(rollup@4.52.5)(typescript@5.6.3)(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6))': dependencies: '@ampproject/remapping': 2.3.0 - '@rollup/pluginutils': 5.2.0(rollup@4.46.1) + '@rollup/pluginutils': 5.3.0(rollup@4.52.5) '@unocss/config': 0.63.6 '@unocss/core': 0.63.6 '@unocss/inspector': 0.63.6(typescript@5.6.3) chokidar: 3.6.0 - magic-string: 0.30.17 - tinyglobby: 0.2.14 - vite: 5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0) + magic-string: 0.30.21 + tinyglobby: 0.2.15 + vite: 5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6) transitivePeerDependencies: - rollup - supports-color - typescript - '@vitejs/plugin-react@4.3.3(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0))': + '@vitejs/plugin-react@4.3.3(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6))': dependencies: - '@babel/core': 7.28.0 - '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.0) - '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.0) + '@babel/core': 7.28.5 + '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5) + '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.5) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0) + vite: 5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6) transitivePeerDependencies: - supports-color - '@vue/compiler-core@3.5.18': + '@vue/compiler-core@3.5.24': dependencies: - '@babel/parser': 7.28.4 - '@vue/shared': 3.5.18 + '@babel/parser': 7.28.5 + '@vue/shared': 3.5.24 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.1 - '@vue/compiler-dom@3.5.18': + '@vue/compiler-dom@3.5.24': dependencies: - '@vue/compiler-core': 3.5.18 - '@vue/shared': 3.5.18 + '@vue/compiler-core': 3.5.24 + '@vue/shared': 3.5.24 - '@vue/compiler-sfc@3.5.18': + '@vue/compiler-sfc@3.5.24': dependencies: - '@babel/parser': 7.28.4 - '@vue/compiler-core': 3.5.18 - '@vue/compiler-dom': 3.5.18 - '@vue/compiler-ssr': 3.5.18 - '@vue/shared': 3.5.18 + '@babel/parser': 7.28.5 + '@vue/compiler-core': 3.5.24 + '@vue/compiler-dom': 3.5.24 + '@vue/compiler-ssr': 3.5.24 + '@vue/shared': 3.5.24 estree-walker: 2.0.2 - magic-string: 0.30.19 + magic-string: 0.30.21 postcss: 8.5.6 source-map-js: 1.2.1 - '@vue/compiler-ssr@3.5.18': + '@vue/compiler-ssr@3.5.24': dependencies: - '@vue/compiler-dom': 3.5.18 - '@vue/shared': 3.5.18 + '@vue/compiler-dom': 3.5.24 + '@vue/shared': 3.5.24 - '@vue/reactivity@3.5.18': + '@vue/reactivity@3.5.24': dependencies: - '@vue/shared': 3.5.18 + '@vue/shared': 3.5.24 - '@vue/runtime-core@3.5.18': + '@vue/runtime-core@3.5.24': dependencies: - '@vue/reactivity': 3.5.18 - '@vue/shared': 3.5.18 + '@vue/reactivity': 3.5.24 + '@vue/shared': 3.5.24 - '@vue/runtime-dom@3.5.18': + '@vue/runtime-dom@3.5.24': dependencies: - '@vue/reactivity': 3.5.18 - '@vue/runtime-core': 3.5.18 - '@vue/shared': 3.5.18 + '@vue/reactivity': 3.5.24 + '@vue/runtime-core': 3.5.24 + '@vue/shared': 3.5.24 csstype: 3.1.3 - '@vue/server-renderer@3.5.18(vue@3.5.18(typescript@5.6.3))': + '@vue/server-renderer@3.5.24(vue@3.5.24(typescript@5.6.3))': dependencies: - '@vue/compiler-ssr': 3.5.18 - '@vue/shared': 3.5.18 - vue: 3.5.18(typescript@5.6.3) + '@vue/compiler-ssr': 3.5.24 + '@vue/shared': 3.5.24 + vue: 3.5.24(typescript@5.6.3) - '@vue/shared@3.5.18': {} + '@vue/shared@3.5.24': {} acorn-jsx@5.3.2(acorn@8.15.0): dependencies: @@ -6596,7 +7470,7 @@ snapshots: ahooks@3.8.1(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 dayjs: 1.11.13 intersection-observer: 0.12.2 js-cookie: 3.0.5 @@ -6620,7 +7494,7 @@ snapshots: ansi-colors@4.1.3: {} - ansi-escapes@7.0.0: + ansi-escapes@7.2.0: dependencies: environment: 1.1.0 @@ -6628,7 +7502,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.1.0: {} + ansi-regex@6.2.2: {} ansi-styles@2.2.1: {} @@ -6636,7 +7510,7 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@6.2.1: {} + ansi-styles@6.2.3: {} antd@5.21.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: @@ -6645,11 +7519,11 @@ snapshots: '@ant-design/cssinjs-utils': 1.1.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ant-design/icons': 5.6.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ant-design/react-slick': 1.1.2(react@18.3.1) - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@ctrl/tinycolor': 3.6.1 '@rc-component/color-picker': 2.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/mutate-observer': 1.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@rc-component/qrcode': 1.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/qrcode': 1.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/tour': 1.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 @@ -6676,7 +7550,7 @@ snapshots: rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-segmented: 2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-select: 14.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-slider: 11.1.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-slider: 11.1.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-steps: 6.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-switch: 4.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-table: 7.47.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -6793,12 +7667,14 @@ snapshots: axios@1.7.7: dependencies: - follow-redirects: 1.15.9 + follow-redirects: 1.15.11 form-data: 4.0.4 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + bail@2.0.2: {} + balanced-match@1.0.2: {} base@0.11.2: @@ -6811,6 +7687,8 @@ snapshots: mixin-deep: 1.3.2 pascalcase: 0.1.1 + baseline-browser-mapping@2.8.25: {} + big.js@5.2.2: {} binary-extensions@2.3.0: {} @@ -6825,12 +7703,12 @@ snapshots: dependencies: ansi-align: 3.0.1 camelcase: 8.0.0 - chalk: 5.4.1 + chalk: 5.6.2 cli-boxes: 3.0.0 string-width: 7.2.0 type-fest: 4.41.0 widest-line: 5.0.0 - wrap-ansi: 9.0.0 + wrap-ansi: 9.0.2 brace-expansion@1.1.12: dependencies: @@ -6860,15 +7738,13 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.25.1: + browserslist@4.27.0: dependencies: - caniuse-lite: 1.0.30001727 - electron-to-chromium: 1.5.191 - node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.25.1) - - buffer-from@1.1.2: - optional: true + baseline-browser-mapping: 2.8.25 + caniuse-lite: 1.0.30001754 + electron-to-chromium: 1.5.248 + node-releases: 2.0.27 + update-browserslist-db: 1.1.4(browserslist@4.27.0) builtin-modules@3.3.0: {} @@ -6881,14 +7757,14 @@ snapshots: js-yaml: 4.1.0 jsonc-parser: 3.3.1 prompts: 2.4.2 - semver: 7.7.2 - tinyglobby: 0.2.14 + semver: 7.7.3 + tinyglobby: 0.2.15 transitivePeerDependencies: - magicast bundle-name@4.1.0: dependencies: - run-applescript: 7.0.0 + run-applescript: 7.1.0 bundle-require@5.1.0(esbuild@0.23.1): dependencies: @@ -6903,7 +7779,7 @@ snapshots: dotenv: 16.6.1 giget: 1.2.5 jiti: 1.21.7 - mlly: 1.7.4 + mlly: 1.8.0 ohash: 1.1.6 pathe: 1.1.2 perfect-debounce: 1.0.0 @@ -6917,8 +7793,8 @@ snapshots: defu: 6.1.4 dotenv: 16.6.1 giget: 1.2.5 - jiti: 2.5.1 - mlly: 1.7.4 + jiti: 2.6.1 + mlly: 1.8.0 ohash: 1.1.6 pathe: 1.1.2 perfect-debounce: 1.0.0 @@ -6964,7 +7840,9 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001727: {} + caniuse-lite@1.0.30001754: {} + + ccount@2.0.1: {} chalk@1.1.3: dependencies: @@ -6981,10 +7859,30 @@ snapshots: chalk@5.3.0: {} - chalk@5.4.1: {} + chalk@5.6.2: {} + + character-entities-html4@2.1.0: {} + + character-entities-legacy@3.0.0: {} character-entities@2.0.2: {} + character-reference-invalid@2.0.1: {} + + chevrotain-allstar@0.3.1(chevrotain@11.0.3): + dependencies: + chevrotain: 11.0.3 + lodash-es: 4.17.21 + + chevrotain@11.0.3: + dependencies: + '@chevrotain/cst-dts-gen': 11.0.3 + '@chevrotain/gast': 11.0.3 + '@chevrotain/regexp-to-ast': 11.0.3 + '@chevrotain/types': 11.0.3 + '@chevrotain/utils': 11.0.3 + lodash-es: 4.17.21 + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -7003,7 +7901,7 @@ snapshots: chownr@2.0.0: {} - ci-info@4.3.0: {} + ci-info@4.3.1: {} citty@0.1.6: dependencies: @@ -7051,6 +7949,8 @@ snapshots: clone@2.1.2: {} + clsx@2.1.1: {} + collection-visit@1.0.0: dependencies: map-visit: 1.0.0 @@ -7070,13 +7970,14 @@ snapshots: dependencies: delayed-stream: 1.0.0 - commander@12.1.0: {} + comma-separated-tokens@2.0.3: {} - commander@2.20.3: - optional: true + commander@12.1.0: {} commander@7.2.0: {} + commander@8.3.0: {} + comment-parser@1.4.1: {} component-emitter@1.3.1: {} @@ -7109,15 +8010,23 @@ snapshots: dependencies: toggle-selection: 1.0.6 - core-js-compat@3.44.0: + core-js-compat@3.46.0: dependencies: - browserslist: 4.25.1 + browserslist: 4.27.0 cors@2.8.5: dependencies: object-assign: 4.1.1 vary: 1.1.2 + cose-base@1.0.3: + dependencies: + layout-base: 1.0.2 + + cose-base@2.2.0: + dependencies: + layout-base: 2.0.1 + cosmiconfig@8.3.6(typescript@5.6.3): dependencies: import-fresh: 3.3.1 @@ -7169,6 +8078,190 @@ snapshots: csstype@3.1.3: {} + cytoscape-cose-bilkent@4.1.0(cytoscape@3.33.1): + dependencies: + cose-base: 1.0.3 + cytoscape: 3.33.1 + + cytoscape-fcose@2.2.0(cytoscape@3.33.1): + dependencies: + cose-base: 2.2.0 + cytoscape: 3.33.1 + + cytoscape@3.33.1: {} + + d3-array@2.12.1: + dependencies: + internmap: 1.0.1 + + d3-array@3.2.4: + dependencies: + internmap: 2.0.3 + + d3-axis@3.0.0: {} + + d3-brush@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-drag: 3.0.0 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-transition: 3.0.1(d3-selection@3.0.0) + + d3-chord@3.0.1: + dependencies: + d3-path: 3.1.0 + + d3-color@3.1.0: {} + + d3-contour@4.0.2: + dependencies: + d3-array: 3.2.4 + + d3-delaunay@6.0.4: + dependencies: + delaunator: 5.0.1 + + d3-dispatch@3.0.1: {} + + d3-drag@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-selection: 3.0.0 + + d3-dsv@3.0.1: + dependencies: + commander: 7.2.0 + iconv-lite: 0.6.3 + rw: 1.3.3 + + d3-ease@3.0.1: {} + + d3-fetch@3.0.1: + dependencies: + d3-dsv: 3.0.1 + + d3-force@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-quadtree: 3.0.1 + d3-timer: 3.0.1 + + d3-format@3.1.0: {} + + d3-geo@3.1.1: + dependencies: + d3-array: 3.2.4 + + d3-hierarchy@3.1.2: {} + + d3-interpolate@3.0.1: + dependencies: + d3-color: 3.1.0 + + d3-path@1.0.9: {} + + d3-path@3.1.0: {} + + d3-polygon@3.0.1: {} + + d3-quadtree@3.0.1: {} + + d3-random@3.0.1: {} + + d3-sankey@0.12.3: + dependencies: + d3-array: 2.12.1 + d3-shape: 1.3.7 + + d3-scale-chromatic@3.1.0: + dependencies: + d3-color: 3.1.0 + d3-interpolate: 3.0.1 + + d3-scale@4.0.2: + dependencies: + d3-array: 3.2.4 + d3-format: 3.1.0 + d3-interpolate: 3.0.1 + d3-time: 3.1.0 + d3-time-format: 4.1.0 + + d3-selection@3.0.0: {} + + d3-shape@1.3.7: + dependencies: + d3-path: 1.0.9 + + d3-shape@3.2.0: + dependencies: + d3-path: 3.1.0 + + d3-time-format@4.1.0: + dependencies: + d3-time: 3.1.0 + + d3-time@3.1.0: + dependencies: + d3-array: 3.2.4 + + d3-timer@3.0.1: {} + + d3-transition@3.0.1(d3-selection@3.0.0): + dependencies: + d3-color: 3.1.0 + d3-dispatch: 3.0.1 + d3-ease: 3.0.1 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-timer: 3.0.1 + + d3-zoom@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-drag: 3.0.0 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-transition: 3.0.1(d3-selection@3.0.0) + + d3@7.9.0: + dependencies: + d3-array: 3.2.4 + d3-axis: 3.0.0 + d3-brush: 3.0.0 + d3-chord: 3.0.1 + d3-color: 3.1.0 + d3-contour: 4.0.2 + d3-delaunay: 6.0.4 + d3-dispatch: 3.0.1 + d3-drag: 3.0.0 + d3-dsv: 3.0.1 + d3-ease: 3.0.1 + d3-fetch: 3.0.1 + d3-force: 3.0.0 + d3-format: 3.1.0 + d3-geo: 3.1.1 + d3-hierarchy: 3.1.2 + d3-interpolate: 3.0.1 + d3-path: 3.1.0 + d3-polygon: 3.0.1 + d3-quadtree: 3.0.1 + d3-random: 3.0.1 + d3-scale: 4.0.2 + d3-scale-chromatic: 3.1.0 + d3-selection: 3.0.0 + d3-shape: 3.2.0 + d3-time: 3.1.0 + d3-time-format: 4.1.0 + d3-timer: 3.0.1 + d3-transition: 3.0.1(d3-selection@3.0.0) + d3-zoom: 3.0.0 + + dagre-d3-es@7.0.11: + dependencies: + d3: 7.9.0 + lodash-es: 4.17.21 + data-view-buffer@1.0.2: dependencies: call-bound: 1.0.4 @@ -7203,7 +8296,7 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.1: + debug@4.4.3: dependencies: ms: 2.1.3 @@ -7253,6 +8346,10 @@ snapshots: defu@6.1.4: {} + delaunator@5.0.1: + dependencies: + robust-predicates: 3.0.2 + delayed-stream@1.0.0: {} delegate@3.2.0: {} @@ -7299,6 +8396,10 @@ snapshots: dependencies: domelementtype: 2.3.0 + dompurify@3.3.0: + optionalDependencies: + '@types/trusted-types': 2.0.7 + domutils@1.7.0: dependencies: dom-serializer: 0.2.2 @@ -7332,9 +8433,9 @@ snapshots: tslib: 2.3.0 zrender: 5.6.0 - electron-to-chromium@1.5.191: {} + electron-to-chromium@1.5.248: {} - emoji-regex@10.4.0: {} + emoji-regex@10.6.0: {} emoji-regex@8.0.0: {} @@ -7342,10 +8443,10 @@ snapshots: emojis-list@3.0.0: {} - enhanced-resolve@5.18.2: + enhanced-resolve@5.18.3: dependencies: graceful-fs: 4.2.11 - tapable: 2.2.2 + tapable: 2.3.0 enquirer@2.4.1: dependencies: @@ -7358,6 +8459,8 @@ snapshots: entities@4.5.0: {} + entities@6.0.1: {} + environment@1.1.0: {} errno@0.1.8: @@ -7365,7 +8468,7 @@ snapshots: prr: 1.0.1 optional: true - error-ex@1.3.2: + error-ex@1.3.4: dependencies: is-arrayish: 0.2.1 @@ -7533,85 +8636,85 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-compat-utils@0.5.1(eslint@9.14.0(jiti@2.5.1)): + eslint-compat-utils@0.5.1(eslint@9.14.0(jiti@2.6.1)): dependencies: - eslint: 9.14.0(jiti@2.5.1) - semver: 7.7.2 + eslint: 9.14.0(jiti@2.6.1) + semver: 7.7.3 - eslint-config-flat-gitignore@0.3.0(eslint@9.14.0(jiti@2.5.1)): + eslint-config-flat-gitignore@0.3.0(eslint@9.14.0(jiti@2.6.1)): dependencies: - '@eslint/compat': 1.3.1(eslint@9.14.0(jiti@2.5.1)) - eslint: 9.14.0(jiti@2.5.1) + '@eslint/compat': 1.4.1(eslint@9.14.0(jiti@2.6.1)) + eslint: 9.14.0(jiti@2.6.1) find-up-simple: 1.0.1 - eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.5.1)): + eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.6.1)): dependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 is-core-module: 2.16.1 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color eslint-parser-plain@0.1.0: {} - eslint-plugin-es-x@7.8.0(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-es-x@7.8.0(eslint@9.14.0(jiti@2.6.1)): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) - '@eslint-community/regexpp': 4.12.1 - eslint: 9.14.0(jiti@2.5.1) - eslint-compat-utils: 0.5.1(eslint@9.14.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 + eslint: 9.14.0(jiti@2.6.1) + eslint-compat-utils: 0.5.1(eslint@9.14.0(jiti@2.6.1)) - eslint-plugin-import-x@4.3.1(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3): + eslint-plugin-import-x@4.3.1(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3): dependencies: - '@typescript-eslint/utils': 8.38.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - debug: 4.4.1 + '@typescript-eslint/utils': 8.46.3(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + debug: 4.4.3 doctrine: 3.0.0 - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - get-tsconfig: 4.10.1 + get-tsconfig: 4.13.0 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 stable-hash: 0.0.4 tslib: 2.8.1 transitivePeerDependencies: - supports-color - typescript - eslint-plugin-n@17.11.1(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-n@17.11.1(eslint@9.14.0(jiti@2.6.1)): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) - enhanced-resolve: 5.18.2 - eslint: 9.14.0(jiti@2.5.1) - eslint-plugin-es-x: 7.8.0(eslint@9.14.0(jiti@2.5.1)) - get-tsconfig: 4.10.1 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) + enhanced-resolve: 5.18.3 + eslint: 9.14.0(jiti@2.6.1) + eslint-plugin-es-x: 7.8.0(eslint@9.14.0(jiti@2.6.1)) + get-tsconfig: 4.13.0 globals: 15.11.0 ignore: 5.3.2 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.5.1)))(eslint@9.14.0(jiti@2.5.1))(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0(jiti@2.6.1)))(eslint@9.14.0(jiti@2.6.1))(prettier@3.3.3): dependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.3 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.14.0(jiti@2.5.1)) + eslint-config-prettier: 9.1.0(eslint@9.14.0(jiti@2.6.1)) - eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-react-hooks@5.0.0(eslint@9.14.0(jiti@2.6.1)): dependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) - eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-react-refresh@0.4.14(eslint@9.14.0(jiti@2.6.1)): dependencies: - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) - eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-react@7.37.2(eslint@9.14.0(jiti@2.6.1)): dependencies: array-includes: 3.1.9 array.prototype.findlast: 1.2.5 @@ -7619,7 +8722,7 @@ snapshots: array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.2.1 - eslint: 9.14.0(jiti@2.5.1) + eslint: 9.14.0(jiti@2.6.1) estraverse: 5.3.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 @@ -7633,24 +8736,24 @@ snapshots: string.prototype.matchall: 4.0.12 string.prototype.repeat: 1.0.0 - eslint-plugin-sort@4.0.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3): + eslint-plugin-sort@4.0.0(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3): dependencies: - '@typescript-eslint/utils': 8.38.0(eslint@9.14.0(jiti@2.5.1))(typescript@5.6.3) - eslint: 9.14.0(jiti@2.5.1) + '@typescript-eslint/utils': 8.46.3(eslint@9.14.0(jiti@2.6.1))(typescript@5.6.3) + eslint: 9.14.0(jiti@2.6.1) isomorphic-resolve: 1.0.0 natural-compare: 1.4.0 transitivePeerDependencies: - supports-color - typescript - eslint-plugin-unicorn@56.0.0(eslint@9.14.0(jiti@2.5.1)): + eslint-plugin-unicorn@56.0.0(eslint@9.14.0(jiti@2.6.1)): dependencies: - '@babel/helper-validator-identifier': 7.27.1 - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) - ci-info: 4.3.0 + '@babel/helper-validator-identifier': 7.28.5 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) + ci-info: 4.3.1 clean-regexp: 1.0.0 - core-js-compat: 3.44.0 - eslint: 9.14.0(jiti@2.5.1) + core-js-compat: 3.46.0 + eslint: 9.14.0(jiti@2.6.1) esquery: 1.6.0 globals: 15.11.0 indent-string: 4.0.0 @@ -7660,7 +8763,7 @@ snapshots: read-pkg-up: 7.0.1 regexp-tree: 0.1.27 regjsparser: 0.10.0 - semver: 7.7.2 + semver: 7.7.3 strip-indent: 3.0.0 eslint-scope@8.4.0: @@ -7672,16 +8775,16 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@9.14.0(jiti@2.5.1): + eslint@9.14.0(jiti@2.6.1): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.14.0(jiti@2.5.1)) - '@eslint-community/regexpp': 4.12.1 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.14.0(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.2 '@eslint/config-array': 0.18.0 '@eslint/core': 0.7.0 '@eslint/eslintrc': 3.3.1 '@eslint/js': 9.14.0 '@eslint/plugin-kit': 0.2.8 - '@humanfs/node': 0.16.6 + '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 '@types/estree': 1.0.8 @@ -7689,7 +8792,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.1 + debug: 4.4.3 escape-string-regexp: 4.0.0 eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 @@ -7710,7 +8813,7 @@ snapshots: optionator: 0.9.4 text-table: 0.2.0 optionalDependencies: - jiti: 2.5.1 + jiti: 2.6.1 transitivePeerDependencies: - supports-color @@ -7732,6 +8835,8 @@ snapshots: estraverse@5.3.0: {} + estree-util-is-identifier-name@3.0.0: {} + estree-walker@2.0.2: {} estree-walker@3.0.3: @@ -7766,10 +8871,10 @@ snapshots: is-plain-obj: 4.1.0 is-stream: 4.0.1 npm-run-path: 5.3.0 - pretty-ms: 9.2.0 + pretty-ms: 9.3.0 signal-exit: 4.1.0 strip-final-newline: 4.0.0 - yoctocolors: 2.1.1 + yoctocolors: 2.1.2 execa@9.5.1: dependencies: @@ -7781,10 +8886,10 @@ snapshots: is-plain-obj: 4.1.0 is-stream: 4.0.1 npm-run-path: 6.0.0 - pretty-ms: 9.2.0 + pretty-ms: 9.3.0 signal-exit: 4.1.0 strip-final-newline: 4.0.0 - yoctocolors: 2.1.1 + yoctocolors: 2.1.2 expand-brackets@2.1.4: dependencies: @@ -7809,6 +8914,8 @@ snapshots: assign-symbols: 1.0.0 is-extendable: 1.0.1 + extend@3.0.2: {} + extglob@2.0.4: dependencies: array-unique: 0.3.2 @@ -7842,7 +8949,7 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.4.6(picomatch@4.0.3): + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -7886,7 +8993,7 @@ snapshots: flatted@3.3.3: {} - follow-redirects@1.15.9: {} + follow-redirects@1.15.11: {} for-each@0.3.5: dependencies: @@ -7921,13 +9028,13 @@ snapshots: fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 - jsonfile: 6.1.0 + jsonfile: 6.2.0 universalify: 2.0.1 - fs-extra@11.3.0: + fs-extra@11.3.2: dependencies: graceful-fs: 4.2.11 - jsonfile: 6.1.0 + jsonfile: 6.2.0 universalify: 2.0.1 fs-minipass@2.1.0: @@ -7950,11 +9057,13 @@ snapshots: functions-have-names@1.2.3: {} + generator-function@2.0.1: {} + gensync@1.0.0-beta.2: {} get-caller-file@2.0.5: {} - get-east-asian-width@1.3.0: {} + get-east-asian-width@1.4.0: {} get-intrinsic@1.3.0: dependencies: @@ -7987,7 +9096,7 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 - get-tsconfig@4.10.1: + get-tsconfig@4.13.0: dependencies: resolve-pkg-maps: 1.0.0 @@ -7998,7 +9107,7 @@ snapshots: citty: 0.1.6 consola: 3.4.2 defu: 6.1.4 - node-fetch-native: 1.6.6 + node-fetch-native: 1.6.7 nypm: 0.5.4 pathe: 2.0.3 tar: 6.2.1 @@ -8024,7 +9133,7 @@ snapshots: dependencies: foreground-child: 3.3.1 jackspeak: 4.1.1 - minimatch: 10.0.3 + minimatch: 10.1.1 minipass: 7.1.2 package-json-from-dist: 1.0.1 path-scurry: 2.0.0 @@ -8055,7 +9164,7 @@ snapshots: gradient-string@3.0.0: dependencies: - chalk: 5.4.1 + chalk: 5.6.2 tinygradient: 1.1.5 graphemer@1.4.0: {} @@ -8064,6 +9173,8 @@ snapshots: dependencies: duplexer: 0.1.2 + hachure-fill@0.5.2: {} + has-ansi@2.0.0: dependencies: ansi-regex: 2.1.1 @@ -8111,55 +9222,166 @@ snapshots: dependencies: function-bind: 1.1.2 - he@1.2.0: {} - - hoist-non-react-statics@3.3.2: + hast-util-from-dom@5.0.1: dependencies: - react-is: 16.13.1 - - hosted-git-info@2.8.9: {} + '@types/hast': 3.0.4 + hastscript: 9.0.1 + web-namespaces: 2.0.1 - html-parse-stringify@3.0.1: + hast-util-from-html-isomorphic@2.0.0: dependencies: - void-elements: 3.1.0 + '@types/hast': 3.0.4 + hast-util-from-dom: 5.0.1 + hast-util-from-html: 2.0.3 + unist-util-remove-position: 5.0.0 - htmlparser2@3.10.1: + hast-util-from-html@2.0.3: dependencies: - domelementtype: 1.3.1 - domhandler: 2.4.2 - domutils: 1.7.0 - entities: 1.1.2 - inherits: 2.0.4 - readable-stream: 3.6.2 - - human-signals@5.0.0: {} - - human-signals@7.0.0: {} - - human-signals@8.0.1: {} + '@types/hast': 3.0.4 + devlop: 1.1.0 + hast-util-from-parse5: 8.0.3 + parse5: 7.3.0 + vfile: 6.0.3 + vfile-message: 4.0.3 - i18next@23.16.4: + hast-util-from-parse5@8.0.3: dependencies: - '@babel/runtime': 7.28.2 + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + devlop: 1.1.0 + hastscript: 9.0.1 + property-information: 7.1.0 + vfile: 6.0.3 + vfile-location: 5.0.3 + web-namespaces: 2.0.1 - iconv-lite@0.6.3: + hast-util-is-element@3.0.0: dependencies: - safer-buffer: 2.1.2 - optional: true - - icss-replace-symbols@1.1.0: {} + '@types/hast': 3.0.4 - icss-utils@5.1.0(postcss@8.5.6): + hast-util-parse-selector@4.0.0: dependencies: - postcss: 8.5.6 + '@types/hast': 3.0.4 - ignore@5.3.2: {} + hast-util-raw@9.1.0: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + '@ungap/structured-clone': 1.3.0 + hast-util-from-parse5: 8.0.3 + hast-util-to-parse5: 8.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + parse5: 7.3.0 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + + hast-util-to-jsx-runtime@2.3.6: + dependencies: + '@types/estree': 1.0.8 + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + hast-util-whitespace: 3.0.0 + mdast-util-mdx-expression: 2.0.1 + mdast-util-mdx-jsx: 3.2.0 + mdast-util-mdxjs-esm: 2.0.1 + property-information: 7.1.0 + space-separated-tokens: 2.0.2 + style-to-js: 1.1.19 + unist-util-position: 5.0.0 + vfile-message: 4.0.3 + transitivePeerDependencies: + - supports-color + + hast-util-to-parse5@8.0.0: + dependencies: + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + + hast-util-to-text@4.0.2: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + hast-util-is-element: 3.0.0 + unist-util-find-after: 5.0.0 + + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.4 + + hastscript@9.0.1: + dependencies: + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 7.1.0 + space-separated-tokens: 2.0.2 + + he@1.2.0: {} + + highlight.js@11.11.1: {} + + hoist-non-react-statics@3.3.2: + dependencies: + react-is: 16.13.1 + + hosted-git-info@2.8.9: {} + + html-parse-stringify@3.0.1: + dependencies: + void-elements: 3.1.0 + + html-url-attributes@3.0.1: {} + + html-void-elements@3.0.0: {} + + htmlparser2@3.10.1: + dependencies: + domelementtype: 1.3.1 + domhandler: 2.4.2 + domutils: 1.7.0 + entities: 1.1.2 + inherits: 2.0.4 + readable-stream: 3.6.2 + + human-signals@5.0.0: {} + + human-signals@7.0.0: {} + + human-signals@8.0.1: {} + + i18next@23.16.4: + dependencies: + '@babel/runtime': 7.28.4 + + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + + icss-replace-symbols@1.1.0: {} + + icss-utils@5.1.0(postcss@8.5.6): + dependencies: + postcss: 8.5.6 + + ignore@5.3.2: {} image-size@0.5.5: {} immediate@3.0.6: {} - immer@10.1.1: {} + immer@10.2.0: {} immutable@4.3.7: {} @@ -8171,7 +9393,7 @@ snapshots: importx@0.4.4: dependencies: bundle-require: 5.1.0(esbuild@0.23.1) - debug: 4.4.1 + debug: 4.4.3 esbuild: 0.23.1 jiti: 2.0.0-beta.3 jiti-v1: jiti@1.21.7 @@ -8186,18 +9408,31 @@ snapshots: inherits@2.0.4: {} + inline-style-parser@0.2.6: {} + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.1.0 + internmap@1.0.1: {} + + internmap@2.0.3: {} + intersection-observer@0.12.2: {} is-accessor-descriptor@1.0.1: dependencies: hasown: 2.0.2 + is-alphabetical@2.0.1: {} + + is-alphanumerical@2.0.1: + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 + is-array-buffer@3.0.5: dependencies: call-bind: 1.0.8 @@ -8254,6 +9489,8 @@ snapshots: call-bound: 1.0.4 has-tostringtag: 1.0.2 + is-decimal@2.0.1: {} + is-descriptor@0.1.7: dependencies: is-accessor-descriptor: 1.0.1 @@ -8282,13 +9519,14 @@ snapshots: is-fullwidth-code-point@4.0.0: {} - is-fullwidth-code-point@5.0.0: + is-fullwidth-code-point@5.1.0: dependencies: - get-east-asian-width: 1.3.0 + get-east-asian-width: 1.4.0 - is-generator-function@1.1.0: + is-generator-function@1.1.2: dependencies: call-bound: 1.0.4 + generator-function: 2.0.1 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 @@ -8297,6 +9535,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-hexadecimal@2.0.1: {} + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -8418,7 +9658,7 @@ snapshots: jiti@2.0.0-beta.3: {} - jiti@2.5.1: {} + jiti@2.6.1: {} js-base64@2.6.4: {} @@ -8456,7 +9696,7 @@ snapshots: jsonc-parser@3.3.1: {} - jsonfile@6.1.0: + jsonfile@6.2.0: dependencies: universalify: 2.0.1 optionalDependencies: @@ -8469,6 +9709,10 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + katex@0.16.25: + dependencies: + commander: 8.3.0 + keepalive-for-react@3.0.2(react-dom@18.3.1(react@18.3.1))(react-router-dom@6.27.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 @@ -8479,6 +9723,8 @@ snapshots: dependencies: json-buffer: 3.0.1 + khroma@2.1.0: {} + kind-of@3.2.2: dependencies: is-buffer: 1.1.6 @@ -8497,7 +9743,19 @@ snapshots: kolorist@1.8.0: {} - less@4.4.0: + langium@3.3.1: + dependencies: + chevrotain: 11.0.3 + chevrotain-allstar: 0.3.1(chevrotain@11.0.3) + vscode-languageserver: 9.0.1 + vscode-languageserver-textdocument: 1.0.12 + vscode-uri: 3.0.8 + + layout-base@1.0.2: {} + + layout-base@2.0.1: {} + + less@4.4.2: dependencies: copy-anything: 2.0.6 parse-node-version: 1.0.1 @@ -8546,7 +9804,7 @@ snapshots: eventemitter3: 5.0.1 log-update: 6.1.0 rfdc: 1.4.1 - wrap-ansi: 9.0.0 + wrap-ansi: 9.0.2 load-tsconfig@0.2.5: {} @@ -8558,19 +9816,19 @@ snapshots: local-pkg@0.5.0: dependencies: - mlly: 1.7.4 + mlly: 1.8.0 pkg-types: 1.3.1 local-pkg@0.5.1: dependencies: - mlly: 1.7.4 + mlly: 1.8.0 pkg-types: 1.3.1 - local-pkg@1.1.1: + local-pkg@1.1.2: dependencies: - mlly: 1.7.4 - pkg-types: 2.2.0 - quansync: 0.2.10 + mlly: 1.8.0 + pkg-types: 2.3.0 + quansync: 0.2.11 localforage@1.10.0: dependencies: @@ -8592,11 +9850,13 @@ snapshots: log-update@6.1.0: dependencies: - ansi-escapes: 7.0.0 + ansi-escapes: 7.2.0 cli-cursor: 5.0.0 - slice-ansi: 7.1.0 - strip-ansi: 7.1.0 - wrap-ansi: 9.0.0 + slice-ansi: 7.1.2 + strip-ansi: 7.1.2 + wrap-ansi: 9.0.2 + + longest-streak@3.1.0: {} loose-envify@1.4.0: dependencies: @@ -8606,30 +9866,36 @@ snapshots: dependencies: tslib: 2.8.1 + lowlight@3.3.0: + dependencies: + '@types/hast': 3.0.4 + devlop: 1.1.0 + highlight.js: 11.11.1 + lru-cache@10.4.3: {} - lru-cache@11.1.0: {} + lru-cache@11.2.2: {} lru-cache@5.1.1: dependencies: yallist: 3.1.1 - lucide-react@0.546.0(react@18.3.1): + lucide-react@0.461.0(react@18.3.1): dependencies: react: 18.3.1 - magic-string@0.30.17: + lucide-react@0.546.0(react@18.3.1): dependencies: - '@jridgewell/sourcemap-codec': 1.5.4 + react: 18.3.1 - magic-string@0.30.19: + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 magicast@0.3.4: dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 source-map-js: 1.2.1 make-dir@2.1.0: @@ -8644,8 +9910,19 @@ snapshots: dependencies: object-visit: 1.0.1 + markdown-table@3.0.4: {} + + marked@15.0.12: {} + math-intrinsics@1.1.0: {} + mdast-util-find-and-replace@3.0.2: + dependencies: + '@types/mdast': 4.0.4 + escape-string-regexp: 5.0.0 + unist-util-is: 6.0.1 + unist-util-visit-parents: 6.0.2 + mdast-util-from-markdown@2.0.2: dependencies: '@types/mdast': 4.0.4 @@ -8663,6 +9940,148 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-gfm-autolink-literal@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-find-and-replace: 3.0.2 + micromark-util-character: 2.1.1 + + mdast-util-gfm-footnote@2.1.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + micromark-util-normalize-identifier: 2.0.1 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-strikethrough@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-table@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + markdown-table: 3.0.4 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-task-list-item@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm@3.1.0: + dependencies: + mdast-util-from-markdown: 2.0.2 + mdast-util-gfm-autolink-literal: 2.0.1 + mdast-util-gfm-footnote: 2.1.0 + mdast-util-gfm-strikethrough: 2.0.0 + mdast-util-gfm-table: 2.0.0 + mdast-util-gfm-task-list-item: 2.0.0 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-math@3.0.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + longest-streak: 3.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + unist-util-remove-position: 5.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx-expression@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx-jsx@3.2.0: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + parse-entities: 4.0.2 + stringify-entities: 4.0.4 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.3 + transitivePeerDependencies: + - supports-color + + mdast-util-mdxjs-esm@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-newline-to-break@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-find-and-replace: 3.0.2 + + mdast-util-phrasing@4.1.0: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.1 + + mdast-util-to-hast@13.2.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.3.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.1 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + + mdast-util-to-markdown@2.1.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + mdast-util-to-string@4.0.0: dependencies: '@types/mdast': 4.0.4 @@ -8681,6 +10100,31 @@ snapshots: merge2@1.4.1: {} + mermaid@11.6.0: + dependencies: + '@braintree/sanitize-url': 7.1.1 + '@iconify/utils': 2.3.0 + '@mermaid-js/parser': 0.4.0 + '@types/d3': 7.4.3 + cytoscape: 3.33.1 + cytoscape-cose-bilkent: 4.1.0(cytoscape@3.33.1) + cytoscape-fcose: 2.2.0(cytoscape@3.33.1) + d3: 7.9.0 + d3-sankey: 0.12.3 + dagre-d3-es: 7.0.11 + dayjs: 1.11.13 + dompurify: 3.3.0 + katex: 0.16.25 + khroma: 2.1.0 + lodash-es: 4.17.21 + marked: 15.0.12 + roughjs: 4.6.6 + stylis: 4.3.6 + ts-dedent: 2.2.0 + uuid: 11.1.0 + transitivePeerDependencies: + - supports-color + micromark-core-commonmark@2.0.3: dependencies: decode-named-character-reference: 1.2.0 @@ -8700,6 +10144,74 @@ snapshots: micromark-util-symbol: 2.0.1 micromark-util-types: 2.0.2 + micromark-extension-gfm-autolink-literal@2.1.0: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-footnote@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-core-commonmark: 2.0.3 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-strikethrough@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-table@2.1.1: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm-tagfilter@2.0.0: + dependencies: + micromark-util-types: 2.0.2 + + micromark-extension-gfm-task-list-item@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-gfm@3.0.0: + dependencies: + micromark-extension-gfm-autolink-literal: 2.1.0 + micromark-extension-gfm-footnote: 2.1.0 + micromark-extension-gfm-strikethrough: 2.1.0 + micromark-extension-gfm-table: 2.1.1 + micromark-extension-gfm-tagfilter: 2.0.0 + micromark-extension-gfm-task-list-item: 2.1.0 + micromark-util-combine-extensions: 2.0.1 + micromark-util-types: 2.0.2 + + micromark-extension-math@3.1.0: + dependencies: + '@types/katex': 0.16.7 + devlop: 1.1.0 + katex: 0.16.25 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + micromark-factory-destination@2.0.1: dependencies: micromark-util-character: 2.1.1 @@ -8795,7 +10307,7 @@ snapshots: micromark@4.0.2: dependencies: '@types/debug': 4.1.12 - debug: 4.4.1 + debug: 4.4.3 decode-named-character-reference: 1.2.0 devlop: 1.1.0 micromark-core-commonmark: 2.0.3 @@ -8857,7 +10369,7 @@ snapshots: min-indent@1.0.1: {} - minimatch@10.0.3: + minimatch@10.1.1: dependencies: '@isaacs/brace-expansion': 5.0.0 @@ -8893,7 +10405,7 @@ snapshots: mkdirp@3.0.1: {} - mlly@1.7.4: + mlly@1.8.0: dependencies: acorn: 8.15.0 pathe: 2.0.3 @@ -8931,7 +10443,7 @@ snapshots: needle@3.3.1: dependencies: iconv-lite: 0.6.3 - sax: 1.4.1 + sax: 1.4.3 optional: true no-case@3.0.4: @@ -8942,14 +10454,14 @@ snapshots: node-addon-api@7.1.1: optional: true - node-fetch-native@1.6.6: {} + node-fetch-native@1.6.7: {} - node-releases@2.0.19: {} + node-releases@2.0.27: {} normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.10 + resolve: 1.22.11 semver: 5.7.2 validate-npm-package-license: 3.0.4 @@ -9034,13 +10546,13 @@ snapshots: ofetch@1.3.4: dependencies: destr: 2.0.5 - node-fetch-native: 1.6.6 + node-fetch-native: 1.6.7 ufo: 1.6.1 ofetch@1.4.1: dependencies: destr: 2.0.5 - node-fetch-native: 1.6.6 + node-fetch-native: 1.6.7 ufo: 1.6.1 ohash@1.1.6: {} @@ -9097,18 +10609,28 @@ snapshots: package-manager-detector@0.2.11: dependencies: - quansync: 0.2.10 + quansync: 0.2.11 - package-manager-detector@1.3.0: {} + package-manager-detector@1.5.0: {} parent-module@1.0.1: dependencies: callsites: 3.1.0 + parse-entities@4.0.2: + dependencies: + '@types/unist': 2.0.11 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.2.0 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.27.1 - error-ex: 1.3.2 + error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -9116,8 +10638,14 @@ snapshots: parse-node-version@1.0.1: {} + parse5@7.3.0: + dependencies: + entities: 6.0.1 + pascalcase@0.1.1: {} + path-data-parser@0.1.0: {} + path-exists@4.0.0: {} path-key@3.1.1: {} @@ -9133,7 +10661,7 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.1.0 + lru-cache: 11.2.2 minipass: 7.1.2 path-type@4.0.0: {} @@ -9160,10 +10688,10 @@ snapshots: pkg-types@1.3.1: dependencies: confbox: 0.1.8 - mlly: 1.7.4 + mlly: 1.8.0 pathe: 2.0.3 - pkg-types@2.2.0: + pkg-types@2.3.0: dependencies: confbox: 0.2.2 exsolve: 1.0.7 @@ -9171,6 +10699,13 @@ snapshots: pluralize@8.0.0: {} + points-on-curve@0.2.0: {} + + points-on-path@0.2.1: + dependencies: + path-data-parser: 0.1.0 + points-on-curve: 0.2.0 + posix-character-classes@0.1.1: {} possible-typed-array-names@1.1.0: {} @@ -9264,7 +10799,7 @@ snapshots: prettier@3.3.3: {} - pretty-ms@9.2.0: + pretty-ms@9.3.0: dependencies: parse-ms: 4.0.0 @@ -9279,6 +10814,10 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 + property-information@6.5.0: {} + + property-information@7.1.0: {} + proxy-from-env@1.1.0: {} prr@1.0.1: @@ -9290,14 +10829,14 @@ snapshots: dependencies: side-channel: 1.1.0 - quansync@0.2.10: {} + quansync@0.2.11: {} query-string@4.3.4: dependencies: object-assign: 4.1.1 strict-uri-encode: 1.1.0 - query-string@9.2.2: + query-string@9.3.1: dependencies: decode-uri-component: 0.4.1 filter-obj: 5.1.0 @@ -9309,7 +10848,7 @@ snapshots: rc-cascader@3.28.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 array-tree-filter: 2.1.0 classnames: 2.5.1 rc-select: 14.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9320,7 +10859,7 @@ snapshots: rc-checkbox@3.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9328,7 +10867,7 @@ snapshots: rc-collapse@3.8.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9337,7 +10876,7 @@ snapshots: rc-dialog@9.6.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9347,7 +10886,7 @@ snapshots: rc-drawer@7.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9357,7 +10896,7 @@ snapshots: rc-dropdown@4.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9366,7 +10905,7 @@ snapshots: rc-field-form@2.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/async-validator': 5.0.4 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9374,7 +10913,7 @@ snapshots: rc-image@7.11.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-dialog: 9.6.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9385,7 +10924,7 @@ snapshots: rc-input-number@9.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/mini-decimal': 1.1.0 classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9395,7 +10934,7 @@ snapshots: rc-input@1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9403,7 +10942,7 @@ snapshots: rc-mentions@2.16.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9415,18 +10954,18 @@ snapshots: rc-menu@9.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-overflow: 1.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-overflow: 1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-motion@2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9434,16 +10973,16 @@ snapshots: rc-notification@5.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-overflow@1.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-overflow@1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9452,7 +10991,7 @@ snapshots: rc-pagination@4.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9460,10 +10999,10 @@ snapshots: rc-picker@4.6.15(dayjs@1.11.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-overflow: 1.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-overflow: 1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9473,7 +11012,7 @@ snapshots: rc-progress@4.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9481,7 +11020,7 @@ snapshots: rc-rate@2.13.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9489,7 +11028,7 @@ snapshots: rc-resize-observer@1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9498,7 +11037,7 @@ snapshots: rc-segmented@2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9507,19 +11046,19 @@ snapshots: rc-select@14.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-overflow: 1.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-overflow: 1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-virtual-list: 3.19.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-virtual-list: 3.19.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-slider@11.1.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-slider@11.1.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9527,7 +11066,7 @@ snapshots: rc-steps@6.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9535,7 +11074,7 @@ snapshots: rc-switch@4.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9543,18 +11082,18 @@ snapshots: rc-table@7.47.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/context': 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-virtual-list: 3.19.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-virtual-list: 3.19.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-tabs@15.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-dropdown: 4.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-menu: 9.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9566,7 +11105,7 @@ snapshots: rc-textarea@1.8.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9576,7 +11115,7 @@ snapshots: rc-tooltip@6.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@rc-component/trigger': 2.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 react: 18.3.1 @@ -9584,7 +11123,7 @@ snapshots: rc-tree-select@5.23.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-select: 14.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tree: 5.9.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9594,17 +11133,17 @@ snapshots: rc-tree@5.9.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-virtual-list: 3.19.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-virtual-list: 3.19.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-upload@4.8.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 @@ -9612,14 +11151,14 @@ snapshots: rc-util@5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-is: 18.3.1 - rc-virtual-list@3.19.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-virtual-list@3.19.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 classnames: 2.5.1 rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-util: 5.44.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9633,7 +11172,7 @@ snapshots: react-beautiful-dnd@13.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 css-box-model: 1.2.1 memoize-one: 5.2.1 raf-schd: 4.0.3 @@ -9658,7 +11197,7 @@ snapshots: react-error-boundary@4.1.2(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 react: 18.3.1 react-fast-compare@3.2.2: {} @@ -9670,7 +11209,7 @@ snapshots: react-i18next@15.1.0(i18next@23.16.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 html-parse-stringify: 3.0.1 i18next: 23.16.4 react: 18.3.1 @@ -9683,9 +11222,27 @@ snapshots: react-is@18.3.1: {} + react-markdown@10.1.0(@types/react@18.3.12)(react@18.3.1): + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/react': 18.3.12 + devlop: 1.1.0 + hast-util-to-jsx-runtime: 2.3.6 + html-url-attributes: 3.0.1 + mdast-util-to-hast: 13.2.0 + react: 18.3.1 + remark-parse: 11.0.0 + remark-rehype: 11.1.2 + unified: 11.0.5 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + transitivePeerDependencies: + - supports-color + react-redux@7.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@types/react-redux': 7.1.34 hoist-non-react-statics: 3.3.2 loose-envify: 1.4.0 @@ -9699,7 +11256,7 @@ snapshots: dependencies: '@types/use-sync-external-store': 0.0.3 react: 18.3.1 - use-sync-external-store: 1.5.0(react@18.3.1) + use-sync-external-store: 1.6.0(react@18.3.1) optionalDependencies: '@types/react': 18.3.12 redux: 5.0.1 @@ -9720,7 +11277,7 @@ snapshots: react-svg@16.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 '@tanem/svg-injector': 10.1.68 '@types/prop-types': 15.7.15 prop-types: 15.8.1 @@ -9770,7 +11327,7 @@ snapshots: redux@4.2.1: dependencies: - '@babel/runtime': 7.28.2 + '@babel/runtime': 7.28.4 redux@5.0.1: {} @@ -9805,6 +11362,79 @@ snapshots: dependencies: jsesc: 0.5.0 + rehype-highlight@7.0.2: + dependencies: + '@types/hast': 3.0.4 + hast-util-to-text: 4.0.2 + lowlight: 3.3.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + + rehype-katex@7.0.1: + dependencies: + '@types/hast': 3.0.4 + '@types/katex': 0.16.7 + hast-util-from-html-isomorphic: 2.0.0 + hast-util-to-text: 4.0.2 + katex: 0.16.25 + unist-util-visit-parents: 6.0.2 + vfile: 6.0.3 + + rehype-raw@7.0.0: + dependencies: + '@types/hast': 3.0.4 + hast-util-raw: 9.1.0 + vfile: 6.0.3 + + remark-breaks@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-newline-to-break: 2.0.0 + unified: 11.0.5 + + remark-gfm@4.0.1: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-gfm: 3.1.0 + micromark-extension-gfm: 3.0.0 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-math@6.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-math: 3.0.0 + micromark-extension-math: 3.1.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-parse@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.2 + micromark-util-types: 2.0.2 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-rehype@11.1.2: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + mdast-util-to-hast: 13.2.0 + unified: 11.0.5 + vfile: 6.0.3 + + remark-stringify@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-to-markdown: 2.1.2 + unified: 11.0.5 + repeat-element@1.1.4: {} repeat-string@1.6.1: {} @@ -9821,7 +11451,7 @@ snapshots: resolve-url@0.2.1: {} - resolve@1.22.10: + resolve@1.22.11: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 @@ -9849,38 +11479,51 @@ snapshots: glob: 11.0.3 package-json-from-dist: 1.0.1 - rollup@4.46.1: + robust-predicates@3.0.2: {} + + rollup@4.52.5: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.46.1 - '@rollup/rollup-android-arm64': 4.46.1 - '@rollup/rollup-darwin-arm64': 4.46.1 - '@rollup/rollup-darwin-x64': 4.46.1 - '@rollup/rollup-freebsd-arm64': 4.46.1 - '@rollup/rollup-freebsd-x64': 4.46.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.46.1 - '@rollup/rollup-linux-arm-musleabihf': 4.46.1 - '@rollup/rollup-linux-arm64-gnu': 4.46.1 - '@rollup/rollup-linux-arm64-musl': 4.46.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.46.1 - '@rollup/rollup-linux-ppc64-gnu': 4.46.1 - '@rollup/rollup-linux-riscv64-gnu': 4.46.1 - '@rollup/rollup-linux-riscv64-musl': 4.46.1 - '@rollup/rollup-linux-s390x-gnu': 4.46.1 - '@rollup/rollup-linux-x64-gnu': 4.46.1 - '@rollup/rollup-linux-x64-musl': 4.46.1 - '@rollup/rollup-win32-arm64-msvc': 4.46.1 - '@rollup/rollup-win32-ia32-msvc': 4.46.1 - '@rollup/rollup-win32-x64-msvc': 4.46.1 + '@rollup/rollup-android-arm-eabi': 4.52.5 + '@rollup/rollup-android-arm64': 4.52.5 + '@rollup/rollup-darwin-arm64': 4.52.5 + '@rollup/rollup-darwin-x64': 4.52.5 + '@rollup/rollup-freebsd-arm64': 4.52.5 + '@rollup/rollup-freebsd-x64': 4.52.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.52.5 + '@rollup/rollup-linux-arm-musleabihf': 4.52.5 + '@rollup/rollup-linux-arm64-gnu': 4.52.5 + '@rollup/rollup-linux-arm64-musl': 4.52.5 + '@rollup/rollup-linux-loong64-gnu': 4.52.5 + '@rollup/rollup-linux-ppc64-gnu': 4.52.5 + '@rollup/rollup-linux-riscv64-gnu': 4.52.5 + '@rollup/rollup-linux-riscv64-musl': 4.52.5 + '@rollup/rollup-linux-s390x-gnu': 4.52.5 + '@rollup/rollup-linux-x64-gnu': 4.52.5 + '@rollup/rollup-linux-x64-musl': 4.52.5 + '@rollup/rollup-openharmony-arm64': 4.52.5 + '@rollup/rollup-win32-arm64-msvc': 4.52.5 + '@rollup/rollup-win32-ia32-msvc': 4.52.5 + '@rollup/rollup-win32-x64-gnu': 4.52.5 + '@rollup/rollup-win32-x64-msvc': 4.52.5 fsevents: 2.3.3 - run-applescript@7.0.0: {} + roughjs@4.6.6: + dependencies: + hachure-fill: 0.5.2 + path-data-parser: 0.1.0 + points-on-curve: 0.2.0 + points-on-path: 0.2.1 + + run-applescript@7.1.0: {} run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 + rw@1.3.3: {} + safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 @@ -9906,8 +11549,7 @@ snapshots: dependencies: ret: 0.1.15 - safer-buffer@2.1.2: - optional: true + safer-buffer@2.1.2: {} sass@1.80.6: dependencies: @@ -9917,7 +11559,7 @@ snapshots: optionalDependencies: '@parcel/watcher': 2.5.1 - sax@1.4.1: + sax@1.4.3: optional: true scheduler@0.23.2: @@ -9940,7 +11582,7 @@ snapshots: semver@7.6.2: {} - semver@7.7.2: {} + semver@7.7.3: {} set-function-length@1.2.2: dependencies: @@ -10027,13 +11669,13 @@ snapshots: slice-ansi@5.0.0: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 is-fullwidth-code-point: 4.0.0 - slice-ansi@7.1.0: + slice-ansi@7.1.2: dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 5.0.0 + ansi-styles: 6.2.3 + is-fullwidth-code-point: 5.1.0 snake-case@3.0.4: dependencies: @@ -10073,31 +11715,27 @@ snapshots: source-map-url: 0.4.1 urix: 0.1.0 - source-map-support@0.5.21: - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - optional: true - source-map-url@0.4.1: {} source-map@0.5.7: {} source-map@0.6.1: {} + space-separated-tokens@2.0.2: {} + spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.21 + spdx-license-ids: 3.0.22 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.21 + spdx-license-ids: 3.0.22 - spdx-license-ids@3.0.21: {} + spdx-license-ids@3.0.22: {} split-on-first@3.0.0: {} @@ -10135,13 +11773,13 @@ snapshots: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 string-width@7.2.0: dependencies: - emoji-regex: 10.4.0 - get-east-asian-width: 1.3.0 - strip-ansi: 7.1.0 + emoji-regex: 10.6.0 + get-east-asian-width: 1.4.0 + strip-ansi: 7.1.2 string.prototype.matchall@4.0.12: dependencies: @@ -10191,6 +11829,11 @@ snapshots: dependencies: safe-buffer: 5.2.1 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + strip-ansi@3.0.1: dependencies: ansi-regex: 2.1.1 @@ -10199,9 +11842,9 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.0: + strip-ansi@7.1.2: dependencies: - ansi-regex: 6.1.0 + ansi-regex: 6.2.2 strip-final-newline@3.0.0: {} @@ -10217,6 +11860,14 @@ snapshots: dependencies: js-tokens: 9.0.1 + style-to-js@1.1.19: + dependencies: + style-to-object: 1.0.12 + + style-to-object@1.0.12: + dependencies: + inline-style-parser: 0.2.6 + stylis@4.3.6: {} supports-color@2.0.0: {} @@ -10266,7 +11917,7 @@ snapshots: '@pkgr/core': 0.1.2 tslib: 2.8.1 - tapable@2.2.2: {} + tapable@2.3.0: {} tar@6.2.1: dependencies: @@ -10277,14 +11928,6 @@ snapshots: mkdirp: 1.0.4 yallist: 4.0.0 - terser@5.44.0: - dependencies: - '@jridgewell/source-map': 0.3.11 - acorn: 8.15.0 - commander: 2.20.3 - source-map-support: 0.5.21 - optional: true - text-table@0.2.0: {} throttle-debounce@5.0.2: {} @@ -10297,11 +11940,11 @@ snapshots: tinyexec@0.3.2: {} - tinyexec@1.0.1: {} + tinyexec@1.0.2: {} - tinyglobby@0.2.14: + tinyglobby@0.2.15: dependencies: - fdir: 6.4.6(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 tinygradient@1.1.5: @@ -10339,6 +11982,10 @@ snapshots: typedarray.prototype.slice: 1.0.5 which-typed-array: 1.1.19 + trim-lines@3.0.1: {} + + trough@2.2.0: {} + ts-api-utils@1.4.3(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -10347,6 +11994,8 @@ snapshots: dependencies: typescript: 5.6.3 + ts-dedent@2.2.0: {} + tslib@2.3.0: {} tslib@2.8.1: {} @@ -10354,7 +12003,7 @@ snapshots: tsx@4.19.2: dependencies: esbuild: 0.23.1 - get-tsconfig: 4.10.1 + get-tsconfig: 4.13.0 optionalDependencies: fsevents: 2.3.3 @@ -10457,16 +12106,26 @@ snapshots: unicorn-magic@0.3.0: {} - unimport@3.14.6(rollup@4.46.1): + unified@11.0.5: dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.46.1) + '@types/unist': 3.0.3 + bail: 2.0.2 + devlop: 1.1.0 + extend: 3.0.2 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 6.0.3 + + unimport@3.14.6(rollup@4.52.5): + dependencies: + '@rollup/pluginutils': 5.3.0(rollup@4.52.5) acorn: 8.15.0 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 fast-glob: 3.3.3 - local-pkg: 1.1.1 - magic-string: 0.30.17 - mlly: 1.7.4 + local-pkg: 1.1.2 + magic-string: 0.30.21 + mlly: 1.8.0 pathe: 2.0.3 picomatch: 4.0.3 pkg-types: 1.3.1 @@ -10483,37 +12142,66 @@ snapshots: is-extendable: 0.1.1 set-value: 2.0.1 + unist-util-find-after@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + + unist-util-is@6.0.1: + dependencies: + '@types/unist': 3.0.3 + + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-remove-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-visit: 5.0.0 + unist-util-stringify-position@4.0.0: dependencies: '@types/unist': 3.0.3 + unist-util-visit-parents@6.0.2: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + + unist-util-visit@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + unist-util-visit-parents: 6.0.2 + universalify@2.0.1: {} - unplugin-auto-import@0.18.3(rollup@4.46.1): + unplugin-auto-import@0.18.3(rollup@4.52.5): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.2.0(rollup@4.46.1) + '@rollup/pluginutils': 5.3.0(rollup@4.52.5) fast-glob: 3.3.3 local-pkg: 0.5.1 - magic-string: 0.30.17 + magic-string: 0.30.21 minimatch: 9.0.5 - unimport: 3.14.6(rollup@4.46.1) + unimport: 3.14.6(rollup@4.52.5) unplugin: 1.16.1 transitivePeerDependencies: - rollup - unplugin-icons@0.20.0(@svgr/core@8.1.0(typescript@5.6.3))(@vue/compiler-sfc@3.5.18): + unplugin-icons@0.20.0(@svgr/core@8.1.0(typescript@5.6.3))(@vue/compiler-sfc@3.5.24): dependencies: '@antfu/install-pkg': 0.4.1 '@antfu/utils': 0.7.10 '@iconify/utils': 2.3.0 - debug: 4.4.1 + debug: 4.4.3 kolorist: 1.8.0 local-pkg: 0.5.1 unplugin: 1.16.1 optionalDependencies: '@svgr/core': 8.1.0(typescript@5.6.3) - '@vue/compiler-sfc': 3.5.18 + '@vue/compiler-sfc': 3.5.24 transitivePeerDependencies: - supports-color @@ -10534,9 +12222,9 @@ snapshots: has-value: 0.3.1 isobject: 3.0.1 - update-browserslist-db@1.1.3(browserslist@4.25.1): + update-browserslist-db@1.1.4(browserslist@4.27.0): dependencies: - browserslist: 4.25.1 + browserslist: 4.27.0 escalade: 3.2.0 picocolors: 1.1.1 @@ -10546,11 +12234,15 @@ snapshots: urix@0.1.0: {} + use-debounce@10.0.4(react@18.3.1): + dependencies: + react: 18.3.1 + use-memo-one@1.1.3(react@18.3.1): dependencies: react: 18.3.1 - use-sync-external-store@1.5.0(react@18.3.1): + use-sync-external-store@1.6.0(react@18.3.1): dependencies: react: 18.3.1 @@ -10558,6 +12250,8 @@ snapshots: util-deprecate@1.0.2: {} + uuid@11.1.0: {} + validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 @@ -10565,68 +12259,101 @@ snapshots: vary@1.1.2: {} - vite-plugin-inspect@0.8.7(rollup@4.46.1)(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)): + vfile-location@5.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile: 6.0.3 + + vfile-message@4.0.3: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.3 + + vite-plugin-inspect@0.8.7(rollup@4.52.5)(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)): dependencies: '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.2.0(rollup@4.46.1) - debug: 4.4.1 + '@rollup/pluginutils': 5.3.0(rollup@4.52.5) + debug: 4.4.3 error-stack-parser-es: 0.1.5 - fs-extra: 11.3.0 + fs-extra: 11.3.2 open: 10.2.0 perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 2.0.4 - vite: 5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0) + vite: 5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6) transitivePeerDependencies: - rollup - supports-color vite-plugin-remove-console@2.2.0: {} - vite-plugin-svg-icons@2.0.1(vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0)): + vite-plugin-svg-icons@2.0.1(vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6)): dependencies: '@types/svgo': 2.6.4 cors: 2.8.5 - debug: 4.4.1 + debug: 4.4.3 etag: 1.8.1 fs-extra: 10.1.0 pathe: 0.2.0 svg-baker: 1.7.0 svgo: 2.8.0 - vite: 5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0) + vite: 5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6) transitivePeerDependencies: - supports-color - vite@5.4.10(@types/node@22.8.6)(less@4.4.0)(sass@1.80.6)(terser@5.44.0): + vite@5.4.10(@types/node@22.8.6)(less@4.4.2)(sass@1.80.6): dependencies: esbuild: 0.21.5 postcss: 8.5.6 - rollup: 4.46.1 + rollup: 4.52.5 optionalDependencies: '@types/node': 22.8.6 fsevents: 2.3.3 - less: 4.4.0 + less: 4.4.2 sass: 1.80.6 - terser: 5.44.0 void-elements@3.1.0: {} + vscode-jsonrpc@8.2.0: {} + + vscode-languageserver-protocol@3.17.5: + dependencies: + vscode-jsonrpc: 8.2.0 + vscode-languageserver-types: 3.17.5 + + vscode-languageserver-textdocument@1.0.12: {} + + vscode-languageserver-types@3.17.5: {} + + vscode-languageserver@9.0.1: + dependencies: + vscode-languageserver-protocol: 3.17.5 + + vscode-uri@3.0.8: {} + vue-flow-layout@0.0.5(typescript@5.6.3): dependencies: - vue: 3.5.18(typescript@5.6.3) + vue: 3.5.24(typescript@5.6.3) transitivePeerDependencies: - typescript - vue@3.5.18(typescript@5.6.3): + vue@3.5.24(typescript@5.6.3): dependencies: - '@vue/compiler-dom': 3.5.18 - '@vue/compiler-sfc': 3.5.18 - '@vue/runtime-dom': 3.5.18 - '@vue/server-renderer': 3.5.18(vue@3.5.18(typescript@5.6.3)) - '@vue/shared': 3.5.18 + '@vue/compiler-dom': 3.5.24 + '@vue/compiler-sfc': 3.5.24 + '@vue/runtime-dom': 3.5.24 + '@vue/server-renderer': 3.5.24(vue@3.5.24(typescript@5.6.3)) + '@vue/shared': 3.5.24 optionalDependencies: typescript: 5.6.3 + web-namespaces@2.0.1: {} + webpack-sources@3.3.3: {} webpack-virtual-modules@0.6.2: {} @@ -10647,7 +12374,7 @@ snapshots: is-async-function: 2.1.1 is-date-object: 1.1.0 is-finalizationregistry: 1.1.1 - is-generator-function: 1.1.0 + is-generator-function: 1.1.2 is-regex: 1.2.1 is-weakref: 1.1.1 isarray: 2.0.5 @@ -10690,15 +12417,15 @@ snapshots: wrap-ansi@8.1.0: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 string-width: 5.1.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 - wrap-ansi@9.0.0: + wrap-ansi@9.0.2: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 string-width: 7.2.0 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 wsl-utils@0.1.0: dependencies: @@ -10726,8 +12453,10 @@ snapshots: yocto-queue@0.1.0: {} - yoctocolors@2.1.1: {} + yoctocolors@2.1.2: {} zrender@5.6.0: dependencies: tslib: 2.3.0 + + zwitch@2.0.4: {} diff --git a/web/src/assets/svg-icon/role.svg b/web/src/assets/svg-icon/role.svg new file mode 100644 index 00000000..9104dafc --- /dev/null +++ b/web/src/assets/svg-icon/role.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/src/assets/svg-icon/share.svg b/web/src/assets/svg-icon/share.svg new file mode 100644 index 00000000..43ba8fa2 --- /dev/null +++ b/web/src/assets/svg-icon/share.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/src/assets/svg-icon/user.svg b/web/src/assets/svg-icon/user.svg new file mode 100644 index 00000000..a4652c37 --- /dev/null +++ b/web/src/assets/svg-icon/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/src/common/src/DropdownList/List.jsx b/web/src/common/src/DropdownList/List.jsx index f3256b81..5884d961 100644 --- a/web/src/common/src/DropdownList/List.jsx +++ b/web/src/common/src/DropdownList/List.jsx @@ -159,7 +159,7 @@ const List = (props) => { const isCheckAll = useMemo(() => { if (!isMultiple) return false; if (isMultiple) { - if (value?.length === 0) { + if (!value || value?.length === 0) { return false; } if ( diff --git a/web/src/common/src/DropdownList/index.jsx b/web/src/common/src/DropdownList/index.jsx index 8e716f87..85e99e43 100644 --- a/web/src/common/src/DropdownList/index.jsx +++ b/web/src/common/src/DropdownList/index.jsx @@ -52,6 +52,7 @@ const DropdownList = (props) => { getPopupContainer = (triggerNode) => triggerNode.parentNode, extraData = [], showListIcon = true, + onDropdownVisibleChange } = props; const [visible, setVisible] = useState(false); @@ -65,6 +66,7 @@ const DropdownList = (props) => { }, [mode, value]); const handleVisible = (visible) => { + onDropdownVisibleChange && onDropdownVisibleChange(visible) setVisible(visible); }; diff --git a/web/src/components/DocumentDrawer/Markdown.jsx b/web/src/components/DocumentDrawer/Markdown.jsx new file mode 100644 index 00000000..621cdfc7 --- /dev/null +++ b/web/src/components/DocumentDrawer/Markdown.jsx @@ -0,0 +1,300 @@ +import React, { useRef, useState, useEffect, useMemo, forwardRef } from "react"; +import clsx from "clsx"; +import ReactMarkdown from "react-markdown"; +import RemarkMath from "remark-math"; +import RemarkBreaks from "remark-breaks"; +import RehypeKatex from "rehype-katex"; +import RemarkGfm from "remark-gfm"; +import RehypeHighlight from "rehype-highlight"; +import RehypeRaw from "rehype-raw"; +import mermaid from "mermaid"; +import { useDebouncedCallback } from "use-debounce"; + +import "./markdown.scss"; +import "./highlight.css"; + +// 8 +function Mermaid(props) { + const ref = useRef(null); + const [hasError, setHasError] = useState(false); + + useEffect(() => { + if (props.code && ref.current) { + mermaid + .run({ + nodes: [ref.current], + suppressErrors: true, + }) + .catch((e) => { + setHasError(true); + console.error("[Mermaid] ", e.message); + }); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [props.code]); + + function viewSvgInNewWindow() { + const svg = ref.current?.querySelector("svg"); + if (!svg) return; + // const text = new XMLSerializer().serializeToString(svg); + // const blob = new Blob([text], { type: "image/svg+xml" }); + // view img + // URL.createObjectURL(blob); + } + + if (hasError) { + return null; + } + + return ( +
viewSvgInNewWindow()} + > + {props.code} +
+ ); +} + +// 7 +const PreCode = forwardRef((props, ref) => { + + const [mermaidCode, setMermaidCode] = useState(""); + // const [htmlCode, setHtmlCode] = useState(""); + // const { height } = useWindowSize(); + // console.log(htmlCode, height); + + const renderArtifacts = useDebouncedCallback(() => { + if (!ref?.current) return; + const mermaidDom = ref.current.querySelector("code.language-mermaid"); + if (mermaidDom) { + setMermaidCode(mermaidDom.innerText); + } + // const htmlDom = ref.current.querySelector("code.language-html"); + // const refText = ref.current.querySelector("code")?.innerText; + // if (htmlDom) { + // setHtmlCode((htmlDom as HTMLElement).innerText); + // } else if (refText?.startsWith(" { + if (ref?.current) { + const codeElements = ref.current.querySelectorAll("code"); + const wrapLanguages = [ + "", + "md", + "markdown", + "text", + "txt", + "plaintext", + "tex", + "latex", + ]; + codeElements.forEach((codeElement) => { + let languageClass = codeElement.className.match(/language-(\w+)/); + let name = languageClass ? languageClass[1] : ""; + if (wrapLanguages.includes(name)) { + codeElement.style.whiteSpace = "pre-wrap"; + } + }); + setTimeout(renderArtifacts, 1); + } + }, [ref?.current]); + + return ( + <> +
+         {
+            if (ref?.current) {
+              //todo copyToClipboard
+            }
+          }}
+        >
+        {props.children}
+      
+ {mermaidCode.length > 0 && ( + + )} + + ); +}) + +// 6 +const CustomCode = forwardRef((props, ref) => { + const enableCodeFold = false; + + const [collapsed, setCollapsed] = useState(true); + const [showToggle, setShowToggle] = useState(false); + + useEffect(() => { + if (ref?.current) { + const codeHeight = ref.current.scrollHeight; + setShowToggle(codeHeight > 400); + ref.current.scrollTop = ref.current.scrollHeight; + } + }, [ref?.current]); + + const toggleCollapsed = () => { + setCollapsed((collapsed) => !collapsed); + }; + const renderShowMoreButton = () => { + if (showToggle && enableCodeFold && collapsed) { + return ( +
+ +
+ ); + } + return null; + }; + return ( + <> + + {props.children} + + + {renderShowMoreButton()} + + ); +}) + +// 5 +function escapeBrackets(text) { + if (!text) return text; + const pattern = + /(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g; + return text?.replace( + pattern, + (match, codeBlock, squareBracket, roundBracket) => { + if (codeBlock) { + return codeBlock; + } else if (squareBracket) { + return `$$${squareBracket}$$`; + } else if (roundBracket) { + return `$${roundBracket}$`; + } + return match; + } + ); +} + +// 4 +function tryWrapHtmlCode(text) { + // try add wrap html code (fixed: html codeblock include 2 newline) + if (!text) return text; + return text + ?.replace( + /([`]*?)(\w*?)([\n\r]*?)()/g, + (match, quoteStart, doctype) => { + return !quoteStart ? "\n```html\n" + doctype : match; + } + ) + ?.replace( + /(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*)([`]*)([\n\r]*?)/g, + (match, bodyEnd, space, htmlEnd, quoteEnd) => { + return !quoteEnd ? bodyEnd + space + htmlEnd + "\n```\n" : match; + } + ); +} + +// 3 +function _MarkDownContent(props) { + const escapedContent = useMemo(() => { + return tryWrapHtmlCode(escapeBrackets(props.content)); + }, [props.content]); + + return ( +

, + a: (aProps) => { + const href = aProps.href || ""; + if (/\.(aac|mp3|opus|wav)$/.test(href)) { + return ( +

+ +
+ ); + } + if (/\.(3gp|3g2|webm|ogv|mpeg|mp4|avi)$/.test(href)) { + return ( + + ); + } + const isInternal = /^\/#/i.test(href); + const target = isInternal ? "_self" : aProps.target ?? "_blank"; + return ; + }, + }} + > + {escapedContent} +
+ ); +} + +// 2 +const MarkdownContent = React.memo(_MarkDownContent); + +// 1 +export default function Markdown(props) { + const mdRef = useRef(null); + + return ( +
+
+ { props.content ? : null} +
+
+ ); +} diff --git a/web/src/components/DocumentDrawer/highlight.css b/web/src/components/DocumentDrawer/highlight.css new file mode 100644 index 00000000..8aee8b6c --- /dev/null +++ b/web/src/components/DocumentDrawer/highlight.css @@ -0,0 +1,115 @@ +.markdown-body { + pre { + padding: 0; + } + + pre, + code { + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + } + + pre code { + display: block; + overflow-x: auto; + padding: 1em; + } + + code { + padding: 3px 5px; + } + + .hljs, + pre { + background: #1a1b26; + color: #cbd2ea; + } + + /*! + Theme: Tokyo-night-Dark + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/ + .hljs-comment, + .hljs-meta { + color: #565f89; + } + + .hljs-deletion, + .hljs-doctag, + .hljs-regexp, + .hljs-selector-attr, + .hljs-selector-class, + .hljs-selector-id, + .hljs-selector-pseudo, + .hljs-tag, + .hljs-template-tag, + .hljs-variable.language_ { + color: #f7768e; + } + + .hljs-link, + .hljs-literal, + .hljs-number, + .hljs-params, + .hljs-template-variable, + .hljs-type, + .hljs-variable { + color: #ff9e64; + } + + .hljs-attribute, + .hljs-built_in { + color: #e0af68; + } + + .hljs-keyword, + .hljs-property, + .hljs-subst, + .hljs-title, + .hljs-title.class_, + .hljs-title.class_.inherited__, + .hljs-title.function_ { + color: #7dcfff; + } + + .hljs-selector-tag { + color: #73daca; + } + + .hljs-addition, + .hljs-bullet, + .hljs-quote, + .hljs-string, + .hljs-symbol { + color: #9ece6a; + } + + .hljs-code, + .hljs-formula, + .hljs-section { + color: #7aa2f7; + } + + .hljs-attr, + .hljs-char.escape_, + .hljs-keyword, + .hljs-name, + .hljs-operator { + color: #bb9af7; + } + + .hljs-punctuation { + color: #c0caf5; + } + + .hljs-emphasis { + font-style: italic; + } + + .hljs-strong { + font-weight: 700; + } +} diff --git a/web/src/components/DocumentDrawer/index.module.less b/web/src/components/DocumentDrawer/index.module.less new file mode 100644 index 00000000..310aeace --- /dev/null +++ b/web/src/components/DocumentDrawer/index.module.less @@ -0,0 +1,16 @@ +.detail { + outline: none; + :global { + .ant-drawer-header { + border: 0; + padding: 12px 24px; + } + .ant-drawer-body { + padding: 12px 0px 254px 0px; + } + .ant-drawer-extra svg { + position: relative; + top: 4px; + } + } +} \ No newline at end of file diff --git a/web/src/components/DocumentDrawer/index.tsx b/web/src/components/DocumentDrawer/index.tsx new file mode 100644 index 00000000..2fbc30ef --- /dev/null +++ b/web/src/components/DocumentDrawer/index.tsx @@ -0,0 +1,112 @@ +import { Button, Descriptions, Drawer, Tag } from "antd"; +import styles from "./index.module.less"; +import Markdown from "./Markdown"; +import { Bot, SquareArrowOutUpRight, Tags, X } from "lucide-react"; + +import dayjs from "dayjs"; +import relativeTime from 'dayjs/plugin/relativeTime'; +import { getDocument } from "@/service/api"; +dayjs.extend(relativeTime); + +export const isWithin7Days = (date) => { + const targetDate = dayjs(date); + const now = dayjs(); + const diffInMs = now.diff(targetDate); + return diffInMs <= 7 * 24 * 60 * 60 * 1000; +} + +export const formatDate = (date) => { + const targetDate = dayjs(date); + return isWithin7Days(date) ? targetDate.fromNow() : targetDate.format('YYYY-MM-DD HH:mm:ss') +} + +export default function DocumentDrawer(props) { + const { getContainer, data = {}, isMobile, open, onClose } = props; + + const { t } = useTranslation(); + + return ( + <> + + )} + rootClassName={styles.detail} + getContainer={getContainer} + > +
+
+ {data.title} +
+
+ { + data.tags?.length > 0 && ( +
+ + {data.tags.map((t, i) => {t})} +
+ ) + } + { + data.thumbnail && ( +
+ +
+ ) + } +
+ +
+
+
+
+ +
+ {/*
+ + +
*/} +
+ + + ); +} diff --git a/web/src/components/DocumentDrawer/markdown.scss b/web/src/components/DocumentDrawer/markdown.scss new file mode 100644 index 00000000..82cf0b88 --- /dev/null +++ b/web/src/components/DocumentDrawer/markdown.scss @@ -0,0 +1,1125 @@ +@mixin light { + color-scheme: light; + --color-prettylights-syntax-comment: #6e7781; + --color-prettylights-syntax-constant: #0550ae; + --color-prettylights-syntax-entity: #8250df; + --color-prettylights-syntax-storage-modifier-import: #24292f; + --color-prettylights-syntax-entity-tag: #116329; + --color-prettylights-syntax-keyword: #cf222e; + --color-prettylights-syntax-string: #0a3069; + --color-prettylights-syntax-variable: #953800; + --color-prettylights-syntax-brackethighlighter-unmatched: #82071e; + --color-prettylights-syntax-invalid-illegal-text: #f6f8fa; + --color-prettylights-syntax-invalid-illegal-bg: #82071e; + --color-prettylights-syntax-carriage-return-text: #f6f8fa; + --color-prettylights-syntax-carriage-return-bg: #cf222e; + --color-prettylights-syntax-string-regexp: #116329; + --color-prettylights-syntax-markup-list: #3b2300; + --color-prettylights-syntax-markup-heading: #0550ae; + --color-prettylights-syntax-markup-italic: #24292f; + --color-prettylights-syntax-markup-bold: #24292f; + --color-prettylights-syntax-markup-deleted-text: #82071e; + --color-prettylights-syntax-markup-deleted-bg: #ffebe9; + --color-prettylights-syntax-markup-inserted-text: #116329; + --color-prettylights-syntax-markup-inserted-bg: #dafbe1; + --color-prettylights-syntax-markup-changed-text: #953800; + --color-prettylights-syntax-markup-changed-bg: #ffd8b5; + --color-prettylights-syntax-markup-ignored-text: #eaeef2; + --color-prettylights-syntax-markup-ignored-bg: #0550ae; + --color-prettylights-syntax-meta-diff-range: #8250df; + --color-prettylights-syntax-brackethighlighter-angle: #57606a; + --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f; + --color-prettylights-syntax-constant-other-reference-link: #0a3069; + --color-fg-default: #24292f; + --color-fg-muted: #57606a; + --color-fg-subtle: #6e7781; + --color-canvas-default: transparent; + --color-canvas-subtle: #f6f8fa; + --color-border-default: #8b949e; + --color-border-muted: hsla(210, 18%, 87%, 1); + --color-neutral-muted: rgba(175, 184, 193, 0.2); + --color-accent-fg: #0969da; + --color-accent-emphasis: #0969da; + --color-attention-subtle: #fff8c5; + --color-danger-fg: #cf222e; +} + +@mixin dark { + color-scheme: dark; + --color-prettylights-syntax-comment: #8b949e; + --color-prettylights-syntax-constant: #79c0ff; + --color-prettylights-syntax-entity: #d2a8ff; + --color-prettylights-syntax-storage-modifier-import: #c9d1d9; + --color-prettylights-syntax-entity-tag: #7ee787; + --color-prettylights-syntax-keyword: #ff7b72; + --color-prettylights-syntax-string: #a5d6ff; + --color-prettylights-syntax-variable: #ffa657; + --color-prettylights-syntax-brackethighlighter-unmatched: #f85149; + --color-prettylights-syntax-invalid-illegal-text: #f0f6fc; + --color-prettylights-syntax-invalid-illegal-bg: #8e1519; + --color-prettylights-syntax-carriage-return-text: #f0f6fc; + --color-prettylights-syntax-carriage-return-bg: #b62324; + --color-prettylights-syntax-string-regexp: #7ee787; + --color-prettylights-syntax-markup-list: #f2cc60; + --color-prettylights-syntax-markup-heading: #1f6feb; + --color-prettylights-syntax-markup-italic: #c9d1d9; + --color-prettylights-syntax-markup-bold: #c9d1d9; + --color-prettylights-syntax-markup-deleted-text: #ffdcd7; + --color-prettylights-syntax-markup-deleted-bg: #67060c; + --color-prettylights-syntax-markup-inserted-text: #aff5b4; + --color-prettylights-syntax-markup-inserted-bg: #033a16; + --color-prettylights-syntax-markup-changed-text: #ffdfb6; + --color-prettylights-syntax-markup-changed-bg: #5a1e02; + --color-prettylights-syntax-markup-ignored-text: #c9d1d9; + --color-prettylights-syntax-markup-ignored-bg: #1158c7; + --color-prettylights-syntax-meta-diff-range: #d2a8ff; + --color-prettylights-syntax-brackethighlighter-angle: #8b949e; + --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58; + --color-prettylights-syntax-constant-other-reference-link: #a5d6ff; + --color-fg-default: #c9d1d9; + --color-fg-muted: #8b949e; + --color-fg-subtle: #6e7681; + --color-canvas-default: transparent; + --color-canvas-subtle: #161b22; + --color-border-default: #30363d; + --color-border-muted: #21262d; + --color-neutral-muted: rgba(110, 118, 129, 0.4); + --color-accent-fg: #58a6ff; + --color-accent-emphasis: #1f6feb; + --color-attention-subtle: rgba(187, 128, 9, 0.15); + --color-danger-fg: #f85149; +} + +.light { + @include light; +} + +.dark { + @include dark; +} + +:root { + @include light; +} + +@media (prefers-color-scheme: dark) { + :root { + @include dark; + } +} + +.coco-chat { + .markdown-body { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + color: var(--color-fg-default); + background-color: var(--color-canvas-default); + font-size: 14px; + line-height: 1.5; + word-wrap: break-word; + + table { + td, + th { + border: 1px solid var(--color-border-muted) !important; + } + } + + ul, + ol { + all: revert !important; + } + } + + .markdown-body .octicon { + display: inline-block; + fill: currentColor; + vertical-align: text-bottom; + } + + .markdown-body h1:hover .anchor .octicon-link:before, + .markdown-body h2:hover .anchor .octicon-link:before, + .markdown-body h3:hover .anchor .octicon-link:before, + .markdown-body h4:hover .anchor .octicon-link:before, + .markdown-body h5:hover .anchor .octicon-link:before, + .markdown-body h6:hover .anchor .octicon-link:before { + width: 16px; + height: 16px; + content: " "; + display: inline-block; + background-color: currentColor; + -webkit-mask-image: url("data:image/svg+xml,"); + mask-image: url("data:image/svg+xml,"); + } + + .markdown-body details, + .markdown-body figcaption, + .markdown-body figure { + display: block; + } + + .markdown-body summary { + display: list-item; + } + + .markdown-body [hidden] { + display: none !important; + } + + .markdown-body a { + background-color: transparent; + color: var(--color-accent-fg); + text-decoration: none; + } + + .markdown-body abbr[title] { + border-bottom: none; + text-decoration: underline dotted; + } + + .markdown-body b, + .markdown-body strong { + font-weight: var(--base-text-weight-semibold, 600); + } + + .markdown-body dfn { + font-style: italic; + } + + .markdown-body h1 { + margin: 0.67em 0; + font-weight: var(--base-text-weight-semibold, 600); + padding-bottom: 0.3em; + font-size: 2em; + border-bottom: 1px solid var(--color-border-muted); + } + + .markdown-body mark { + background-color: var(--color-attention-subtle); + color: var(--color-fg-default); + } + + .markdown-body small { + font-size: 90%; + } + + .markdown-body sub, + .markdown-body sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + .markdown-body sub { + bottom: -0.25em; + } + + .markdown-body sup { + top: -0.5em; + } + + .markdown-body img { + border-style: none; + max-width: 100%; + box-sizing: content-box; + background-color: var(--color-canvas-default); + } + + .markdown-body code, + .markdown-body kbd, + .markdown-body pre, + .markdown-body samp { + font-family: monospace; + font-size: 1em; + } + + .markdown-body figure { + margin: 1em 40px; + } + + .markdown-body hr { + box-sizing: content-box; + overflow: hidden; + background: transparent; + border-bottom: 1px solid var(--color-border-muted); + height: 0.25em; + padding: 0; + margin: 24px 0; + background-color: var(--color-border-default); + } + + .markdown-body input { + font: inherit; + margin: 0; + overflow: visible; + font-family: inherit; + font-size: inherit; + line-height: inherit; + } + + .markdown-body [type="button"], + .markdown-body [type="reset"], + .markdown-body [type="submit"] { + -webkit-appearance: button; + } + + .markdown-body [type="checkbox"], + .markdown-body [type="radio"] { + box-sizing: border-box; + padding: 0; + } + + .markdown-body [type="number"]::-webkit-inner-spin-button, + .markdown-body [type="number"]::-webkit-outer-spin-button { + height: auto; + } + + .markdown-body [type="search"]::-webkit-search-cancel-button, + .markdown-body [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; + } + + .markdown-body ::-webkit-input-placeholder { + color: inherit; + opacity: 0.54; + } + + .markdown-body ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + .markdown-body a:hover { + text-decoration: underline; + } + + .markdown-body ::placeholder { + color: var(--color-fg-subtle); + opacity: 1; + } + + .markdown-body hr::before { + display: table; + content: ""; + } + + .markdown-body hr::after { + display: table; + clear: both; + content: ""; + } + + .markdown-body details summary { + cursor: pointer; + } + + .markdown-body details:not([open]) > *:not(summary) { + display: none !important; + } + + .markdown-body a:focus, + .markdown-body [role="button"]:focus, + .markdown-body input[type="radio"]:focus, + .markdown-body input[type="checkbox"]:focus { + outline: 2px solid var(--color-accent-fg); + outline-offset: -2px; + box-shadow: none; + } + + .markdown-body a:focus:not(:focus-visible), + .markdown-body [role="button"]:focus:not(:focus-visible), + .markdown-body input[type="radio"]:focus:not(:focus-visible), + .markdown-body input[type="checkbox"]:focus:not(:focus-visible) { + outline: solid 1px transparent; + } + + .markdown-body a:focus-visible, + .markdown-body [role="button"]:focus-visible, + .markdown-body input[type="radio"]:focus-visible, + .markdown-body input[type="checkbox"]:focus-visible { + outline: 2px solid var(--color-accent-fg); + outline-offset: -2px; + box-shadow: none; + } + + .markdown-body a:not([class]):focus, + .markdown-body a:not([class]):focus-visible, + .markdown-body input[type="radio"]:focus, + .markdown-body input[type="radio"]:focus-visible, + .markdown-body input[type="checkbox"]:focus, + .markdown-body input[type="checkbox"]:focus-visible { + outline-offset: 0; + } + + .markdown-body kbd { + display: inline-block; + padding: 3px 5px; + font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, + Liberation Mono, monospace; + line-height: 10px; + color: var(--color-fg-default); + vertical-align: middle; + background-color: var(--color-canvas-subtle); + border: solid 1px var(--color-neutral-muted); + border-bottom-color: var(--color-neutral-muted); + border-radius: 6px; + box-shadow: inset 0 -1px 0 var(--color-neutral-muted); + } + + .markdown-body h1, + .markdown-body h2, + .markdown-body h3, + .markdown-body h4, + .markdown-body h5, + .markdown-body h6 { + margin-top: 24px; + margin-bottom: 16px; + font-weight: var(--base-text-weight-semibold, 600); + line-height: 1.25; + } + + .markdown-body h2 { + font-weight: var(--base-text-weight-semibold, 600); + padding-bottom: 0.3em; + font-size: 1.5em; + border-bottom: 1px solid var(--color-border-muted); + } + + .markdown-body h3 { + font-weight: var(--base-text-weight-semibold, 600); + font-size: 1.25em; + } + + .markdown-body h4 { + font-weight: var(--base-text-weight-semibold, 600); + font-size: 1em; + } + + .markdown-body h5 { + font-weight: var(--base-text-weight-semibold, 600); + font-size: 0.875em; + } + + .markdown-body h6 { + font-weight: var(--base-text-weight-semibold, 600); + font-size: 0.85em; + color: var(--color-fg-muted); + } + + .markdown-body p { + margin-top: 0; + margin-bottom: 10px; + } + + .markdown-body blockquote { + margin: 0; + padding: 0 1em; + color: var(--color-fg-muted); + border-left: 0.25em solid var(--color-border-default); + } + + .markdown-body dd { + margin-left: 0; + } + + .markdown-body tt, + .markdown-body code, + .markdown-body samp { + font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, + Liberation Mono, monospace; + font-size: 12px; + } + + .markdown-body pre { + margin-top: 0; + margin-bottom: 0; + font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, + Liberation Mono, monospace; + font-size: 12px; + word-wrap: normal; + } + + .markdown-body .octicon { + display: inline-block; + overflow: visible !important; + vertical-align: text-bottom; + fill: currentColor; + } + + .markdown-body input::-webkit-outer-spin-button, + .markdown-body input::-webkit-inner-spin-button { + margin: 0; + -webkit-appearance: none; + appearance: none; + } + + .markdown-body::before { + display: table; + content: ""; + } + + .markdown-body::after { + display: table; + clear: both; + content: ""; + } + + .markdown-body > *:first-child { + margin-top: 0 !important; + } + + .markdown-body > *:last-child { + margin-bottom: 0 !important; + } + + .markdown-body a:not([href]) { + color: inherit; + text-decoration: none; + } + + .markdown-body .absent { + color: var(--color-danger-fg); + } + + .markdown-body .anchor { + float: left; + padding-right: 4px; + margin-left: -20px; + line-height: 1; + } + + .markdown-body .anchor:focus { + outline: none; + } + + .markdown-body p, + .markdown-body blockquote, + .markdown-body dl, + .markdown-body table, + .markdown-body pre, + .markdown-body details { + margin-top: 0; + margin-bottom: 16px; + } + + .markdown-body blockquote > :first-child { + margin-top: 0; + } + + .markdown-body blockquote > :last-child { + margin-bottom: 0; + } + + .markdown-body h1 .octicon-link, + .markdown-body h2 .octicon-link, + .markdown-body h3 .octicon-link, + .markdown-body h4 .octicon-link, + .markdown-body h5 .octicon-link, + .markdown-body h6 .octicon-link { + color: var(--color-fg-default); + vertical-align: middle; + visibility: hidden; + } + + .markdown-body h1:hover .anchor, + .markdown-body h2:hover .anchor, + .markdown-body h3:hover .anchor, + .markdown-body h4:hover .anchor, + .markdown-body h5:hover .anchor, + .markdown-body h6:hover .anchor { + text-decoration: none; + } + + .markdown-body h1:hover .anchor .octicon-link, + .markdown-body h2:hover .anchor .octicon-link, + .markdown-body h3:hover .anchor .octicon-link, + .markdown-body h4:hover .anchor .octicon-link, + .markdown-body h5:hover .anchor .octicon-link, + .markdown-body h6:hover .anchor .octicon-link { + visibility: visible; + } + + .markdown-body h1 tt, + .markdown-body h1 code, + .markdown-body h2 tt, + .markdown-body h2 code, + .markdown-body h3 tt, + .markdown-body h3 code, + .markdown-body h4 tt, + .markdown-body h4 code, + .markdown-body h5 tt, + .markdown-body h5 code, + .markdown-body h6 tt, + .markdown-body h6 code { + padding: 0 0.2em; + font-size: inherit; + } + + .markdown-body summary h1, + .markdown-body summary h2, + .markdown-body summary h3, + .markdown-body summary h4, + .markdown-body summary h5, + .markdown-body summary h6 { + display: inline-block; + } + + .markdown-body summary h1 .anchor, + .markdown-body summary h2 .anchor, + .markdown-body summary h3 .anchor, + .markdown-body summary h4 .anchor, + .markdown-body summary h5 .anchor, + .markdown-body summary h6 .anchor { + margin-left: -40px; + } + + .markdown-body summary h1, + .markdown-body summary h2 { + padding-bottom: 0; + border-bottom: 0; + } + + .markdown-body ul.no-list, + .markdown-body ol.no-list { + padding: 0; + list-style-type: none; + } + + .markdown-body ol[type="a"] { + list-style-type: lower-alpha; + } + + .markdown-body ol[type="A"] { + list-style-type: upper-alpha; + } + + .markdown-body ol[type="i"] { + list-style-type: lower-roman; + } + + .markdown-body ol[type="I"] { + list-style-type: upper-roman; + } + + .markdown-body ol[type="1"] { + list-style-type: decimal; + } + + .markdown-body div > ol:not([type]) { + list-style-type: decimal; + } + + .markdown-body li > p { + margin-top: 16px; + } + + .markdown-body li + li { + margin-top: 0.25em; + } + + .markdown-body dl { + padding: 0; + } + + .markdown-body dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: var(--base-text-weight-semibold, 600); + } + + .markdown-body dl dd { + padding: 0 16px; + margin-bottom: 16px; + } + + .markdown-body table th { + font-weight: var(--base-text-weight-semibold, 600); + background-color: var(--color-canvas-subtle); + text-align: left; + position: sticky; + top: 0; + z-index: 1; + } + + .markdown-body table th, + .markdown-body table td { + padding: 6px 13px; + border: 1px solid var(--color-border-default); + border-width: 1.5px; + line-height: 1.5; + vertical-align: middle; + white-space: pre-wrap; + } + + .markdown-body p br, + .markdown-body table td br, + .markdown-body table th br { + display: block !important; + content: "" !important; + margin-top: 8px !important; + height: 1px !important; + background-color: transparent !important; + } + + .markdown-body table tr { + background-color: var(--color-canvas-default); + border-top: 1px solid var(--color-border-muted); + transition: background-color 0.2s ease; + } + + .markdown-body table tr:nth-child(2n) { + background-color: var(--color-canvas-subtle); + } + + .markdown-body table tr:hover { + background-color: rgba(175, 184, 193, 0.1); + } + + .markdown-body table img { + background-color: transparent; + } + + .markdown-body img[align="right"] { + padding-left: 20px; + } + + .markdown-body img[align="left"] { + padding-right: 20px; + } + + .markdown-body .emoji { + max-width: none; + vertical-align: text-top; + background-color: transparent; + } + + .markdown-body span.frame { + display: block; + overflow: hidden; + } + + .markdown-body span.frame > span { + display: block; + float: left; + width: auto; + padding: 7px; + margin: 13px 0 0; + overflow: hidden; + border: 1px solid var(--color-border-default); + } + + .markdown-body span.frame span img { + display: block; + float: left; + } + + .markdown-body span.frame span span { + display: block; + padding: 5px 0 0; + clear: both; + color: var(--color-fg-default); + } + + .markdown-body span.align-center { + display: block; + overflow: hidden; + clear: both; + } + + .markdown-body span.align-center > span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: center; + } + + .markdown-body span.align-center span img { + margin: 0 auto; + text-align: center; + } + + .markdown-body span.align-right { + display: block; + overflow: hidden; + clear: both; + } + + .markdown-body span.align-right > span { + display: block; + margin: 13px 0 0; + overflow: hidden; + text-align: right; + } + + .markdown-body span.align-right span img { + margin: 0; + text-align: right; + } + + .markdown-body span.float-left { + display: block; + float: left; + margin-right: 13px; + overflow: hidden; + } + + .markdown-body span.float-left span { + margin: 13px 0 0; + } + + .markdown-body span.float-right { + display: block; + float: right; + margin-left: 13px; + overflow: hidden; + } + + .markdown-body span.float-right > span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: right; + } + + .markdown-body code, + .markdown-body tt { + padding: 0.2em 0.4em; + margin: 0; + font-size: 85%; + white-space: break-spaces; + background-color: var(--color-neutral-muted); + border-radius: 6px; + } + + .markdown-body code br, + .markdown-body tt br { + display: none; + } + + .markdown-body del code { + text-decoration: inherit; + } + + .markdown-body samp { + font-size: 85%; + } + + .markdown-body pre code { + font-size: 100%; + } + + .markdown-body pre > code { + padding: 0; + margin: 0; + word-break: normal; + white-space: pre; + background: transparent; + border: 0; + } + + .markdown-body .highlight { + margin-bottom: 16px; + } + + .markdown-body .highlight pre { + margin-bottom: 0; + word-break: normal; + } + + .markdown-body .highlight pre, + .markdown-body pre { + padding: 16px 16px 8px 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + border-radius: 6px; + direction: ltr; + } + + .markdown-body pre code, + .markdown-body pre tt { + display: inline-block; + max-width: 100%; + padding: 0; + margin: 0; + overflow-x: auto; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; + } + + .markdown-body .csv-data td, + .markdown-body .csv-data th { + padding: 5px; + overflow: hidden; + font-size: 12px; + line-height: 1; + text-align: left; + white-space: nowrap; + } + + .markdown-body .csv-data .blob-num { + padding: 10px 8px 9px; + text-align: right; + background: var(--color-canvas-default); + border: 0; + } + + .markdown-body .csv-data tr { + border-top: 0; + } + + .markdown-body .csv-data th { + font-weight: var(--base-text-weight-semibold, 600); + background: var(--color-canvas-subtle); + border-top: 0; + } + + .markdown-body [data-footnote-ref]::before { + content: "["; + } + + .markdown-body [data-footnote-ref]::after { + content: "]"; + } + + .markdown-body .footnotes { + font-size: 12px; + color: var(--color-fg-muted); + border-top: 1px solid var(--color-border-default); + } + + .markdown-body .footnotes ol { + padding-left: 16px; + } + + .markdown-body .footnotes ol ul { + display: inline-block; + padding-left: 16px; + margin-top: 16px; + } + + .markdown-body .footnotes li { + position: relative; + } + + .markdown-body .footnotes li:target::before { + position: absolute; + top: -8px; + right: -8px; + bottom: -8px; + left: -24px; + pointer-events: none; + content: ""; + border: 2px solid var(--color-accent-emphasis); + border-radius: 6px; + } + + .markdown-body .footnotes li:target { + color: var(--color-fg-default); + } + + .markdown-body .footnotes .data-footnote-backref g-emoji { + font-family: monospace; + } + + .markdown-body .pl-c { + color: var(--color-prettylights-syntax-comment); + } + + .markdown-body .pl-c1, + .markdown-body .pl-s .pl-v { + color: var(--color-prettylights-syntax-constant); + } + + .markdown-body .pl-e, + .markdown-body .pl-en { + color: var(--color-prettylights-syntax-entity); + } + + .markdown-body .pl-smi, + .markdown-body .pl-s .pl-s1 { + color: var(--color-prettylights-syntax-storage-modifier-import); + } + + .markdown-body .pl-ent { + color: var(--color-prettylights-syntax-entity-tag); + } + + .markdown-body .pl-k { + color: var(--color-prettylights-syntax-keyword); + } + + .markdown-body .pl-s, + .markdown-body .pl-pds, + .markdown-body .pl-s .pl-pse .pl-s1, + .markdown-body .pl-sr, + .markdown-body .pl-sr .pl-cce, + .markdown-body .pl-sr .pl-sre, + .markdown-body .pl-sr .pl-sra { + color: var(--color-prettylights-syntax-string); + } + + .markdown-body .pl-v, + .markdown-body .pl-smw { + color: var(--color-prettylights-syntax-variable); + } + + .markdown-body .pl-bu { + color: var(--color-prettylights-syntax-brackethighlighter-unmatched); + } + + .markdown-body .pl-ii { + color: var(--color-prettylights-syntax-invalid-illegal-text); + background-color: var(--color-prettylights-syntax-invalid-illegal-bg); + } + + .markdown-body .pl-c2 { + color: var(--color-prettylights-syntax-carriage-return-text); + background-color: var(--color-prettylights-syntax-carriage-return-bg); + } + + .markdown-body .pl-sr .pl-cce { + font-weight: bold; + color: var(--color-prettylights-syntax-string-regexp); + } + + .markdown-body .pl-ml { + color: var(--color-prettylights-syntax-markup-list); + } + + .markdown-body .pl-mh, + .markdown-body .pl-mh .pl-en, + .markdown-body .pl-ms { + font-weight: bold; + color: var(--color-prettylights-syntax-markup-heading); + } + + .markdown-body .pl-mi { + font-style: italic; + color: var(--color-prettylights-syntax-markup-italic); + } + + .markdown-body .pl-mb { + font-weight: bold; + color: var(--color-prettylights-syntax-markup-bold); + } + + .markdown-body .pl-md { + color: var(--color-prettylights-syntax-markup-deleted-text); + background-color: var(--color-prettylights-syntax-markup-deleted-bg); + } + + .markdown-body .pl-mi1 { + color: var(--color-prettylights-syntax-markup-inserted-text); + background-color: var(--color-prettylights-syntax-markup-inserted-bg); + } + + .markdown-body .pl-mc { + color: var(--color-prettylights-syntax-markup-changed-text); + background-color: var(--color-prettylights-syntax-markup-changed-bg); + } + + .markdown-body .pl-mi2 { + color: var(--color-prettylights-syntax-markup-ignored-text); + background-color: var(--color-prettylights-syntax-markup-ignored-bg); + } + + .markdown-body .pl-mdr { + font-weight: bold; + color: var(--color-prettylights-syntax-meta-diff-range); + } + + .markdown-body .pl-ba { + color: var(--color-prettylights-syntax-brackethighlighter-angle); + } + + .markdown-body .pl-sg { + color: var(--color-prettylights-syntax-sublimelinter-gutter-mark); + } + + .markdown-body .pl-corl { + text-decoration: underline; + color: var(--color-prettylights-syntax-constant-other-reference-link); + } + + .markdown-body g-emoji { + display: inline-block; + min-width: 1ch; + font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 1em; + font-style: normal !important; + font-weight: var(--base-text-weight-normal, 400); + line-height: 1; + vertical-align: -0.075em; + } + + .markdown-body g-emoji img { + width: 1em; + height: 1em; + } + + .markdown-body .task-list-item { + list-style-type: none; + } + + .markdown-body .task-list-item label { + font-weight: var(--base-text-weight-normal, 400); + } + + .markdown-body .task-list-item.enabled label { + cursor: pointer; + } + + .markdown-body .task-list-item + .task-list-item { + margin-top: 4px; + } + + .markdown-body .task-list-item .handle { + display: none; + } + + .markdown-body .task-list-item-checkbox { + margin: 0 0.2em 0.25em -1.4em; + vertical-align: middle; + } + + .markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox { + margin: 0 -1.6em 0.25em 0.2em; + } + + .markdown-body .contains-task-list { + position: relative; + } + + .markdown-body .contains-task-list:hover .task-list-item-convert-container, + .markdown-body + .contains-task-list:focus-within + .task-list-item-convert-container { + display: block; + width: auto; + height: 24px; + overflow: visible; + clip: auto; + } + + .markdown-body ::-webkit-calendar-picker-indicator { + filter: invert(50%); + } + + .markdown-body .mermaid { + border: var(--border-in-light); + margin-bottom: 10px; + border-radius: 4px; + padding: 10px; + background-color: var(--white); + } + + #dmermaid { + display: none; + } +} diff --git a/web/src/components/Resource/AddShares.tsx b/web/src/components/Resource/AddShares.tsx new file mode 100644 index 00000000..ca08f984 --- /dev/null +++ b/web/src/components/Resource/AddShares.tsx @@ -0,0 +1,75 @@ +import { Button, Form, Select, Space } from "antd"; +import PrincipalSelect from "./PrincipalSelect"; + +export default function AddShares(props) { + + const { hasCreate, permissionOptions = [], owner, editor, onCancel, resource, currentShares, onSubmit, setLockOpen } = props; + + const { t } = useTranslation(); + const [form] = Form.useForm(); + const { defaultRequiredRule } = useFormRules(); + + const onFinish = async (values) => { + const { permission, shares = [] } = values; + onSubmit(currentShares.concat(shares.map((item) => { + const share = { + ...(resource || {}), + "principal_type": "user", + "principal_id": item.id, + permission, + } + return share + }))) + } + + const excluded = useMemo(() => { + const data = Array.isArray(currentShares) ? currentShares.map((item) => item.principal_id) : []; + if (owner) { + data.push(owner.id) + } + if (editor) { + data.push(editor.id) + } + return data + }, [owner, editor, currentShares]) + + if (!hasCreate) return null; + + return ( +
+
+ + + + + + + +
)} {createState.step === 2 && ( @@ -328,17 +358,17 @@ export function Component() { )} - { - setRenameState({ + setEditState({ open: false, tokenInfo: {} }); }} onOkClick={() => { - setRenameState({ + setEditState({ open: false, tokenInfo: {} }); @@ -360,16 +390,24 @@ function generateApiTokenName(prefix = 'token') { return `${prefix}_${timestamp}_${randomString}`; } -const RenameComponent = ({ onCancelClick = () => {}, onOkClick = () => {}, open = false, tokenInfo = {} }) => { +const EditComponent = ({ onCancelClick = () => {}, onOkClick = () => {}, open = false, tokenInfo = {} }) => { const { t } = useTranslation(); const [form] = useForm(); const [loading, setLoading] = useState(false); + const userInfo = useAppSelector(selectUserInfo); const onModalOkClick = () => { form.validateFields().then(values => { setLoading(true); - renameToken(tokenInfo.id, values.name) - .then(() => { + updateToken({ + id: tokenInfo.id, + ...values, + permissions: values.permissions?.feature || [] + }) + .then((res) => { + if (res?.data?.result === 'updated') { + window.$message?.success(t("common.updateSuccess")); + } setLoading(false); onOkClick(); }) @@ -378,12 +416,24 @@ const RenameComponent = ({ onCancelClick = () => {}, onOkClick = () => {}, open }); }); }; + + useEffect(() => { + form.setFieldsValue({ + ...tokenInfo, + permissions: { + feature: tokenInfo?.permissions || [] + } + }) + }, [tokenInfo]) + return (
{}, onOkClick = () => {}, open label={{t('page.apitoken.columns.name')}} name="name" > - + + + +
diff --git a/web/src/pages/auth/edit/[id].tsx b/web/src/pages/auth/edit/[id].tsx new file mode 100644 index 00000000..d425aff2 --- /dev/null +++ b/web/src/pages/auth/edit/[id].tsx @@ -0,0 +1,61 @@ +import { useRequest } from '@sa/hooks'; +import { type LoaderFunctionArgs, useLoaderData } from 'react-router-dom'; + +import { EditForm } from '../modules/EditForm'; +import { fetchAuthorizationDetail, updateAuthorization } from '@/service/api/security'; + +export function Component() { + const id = useLoaderData(); + const { t } = useTranslation(); + const nav = useNavigate(); + + const { data, loading, run } = useRequest(fetchAuthorizationDetail, { + manual: true + }); + + const onSubmit = async (params: any, before?: () => void, after?: () => void) => { + if (!data?._source?.id) return; + if (before) before(); + const req = { + id: data._source.id, + ...params, + }; + const res = await updateAuthorization(req); + if (res.data?.result === 'updated') { + window.$message?.success(t('common.updateSuccess')); + nav(`/security?tab=auth`); + } + if (after) after(); + }; + + useEffect(() => { + run(id as string); + }, []); + + return ( +
+ +
+
+
{t(`page.auth.edit.title`)}
+
+
+ +
+ +
+ ); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export async function loader({ params, ...rest }: LoaderFunctionArgs) { + return params.id; +} diff --git a/web/src/pages/auth/modules/EditForm.tsx b/web/src/pages/auth/modules/EditForm.tsx new file mode 100644 index 00000000..1aafd3c5 --- /dev/null +++ b/web/src/pages/auth/modules/EditForm.tsx @@ -0,0 +1,187 @@ +import React, { memo, useEffect, useState } from 'react'; +import { Button, Form, Select, Spin } from 'antd'; +import { useLoading, useRequest } from '@sa/hooks'; + +import { fetchPrincipalSearch } from '@/service/api/security'; + +import DropdownList from '@/common/src/DropdownList'; +import { formatESSearchResult } from '@/service/request/es'; +import { useTranslation } from 'react-i18next'; +import RoleSelect from '@/pages/security/modules/RoleSelect'; + +const { Option } = Select; + +interface EditFormProps { + readonly actionText: string; + readonly loading?: boolean; + readonly onSubmit: (params: any, before?: () => void, after?: () => void) => Promise; + readonly record?: any; +} + +export const EditForm = memo((props: EditFormProps) => { + const { actionText, onSubmit, record } = props; + const { t } = useTranslation(); + const { endLoading, loading, startLoading } = useLoading(); + + + const TYPE_OPTIONS = [ + { key: 'user', label: t('page.auth.labels.user') }, + { key: 'team', label: t('page.auth.labels.team') } + ]; + + const { defaultRequiredRule } = useFormRules(); + const [form] = Form.useForm(); + + const { + data: principalRes, + loading: principalLoading, + run: runPrincipalSearch + } = useRequest(fetchPrincipalSearch, { manual: true }); + + const [principalQueryParams, setPrincipalQueryParams] = useState({ + query: '', + from: 0, + size: 10, + type: TYPE_OPTIONS[0].key + }); + + useEffect(() => { + runPrincipalSearch(principalQueryParams); + }, [principalQueryParams]); + + const principalResult = React.useMemo(() => { + const rs = formatESSearchResult(principalRes); + return { + data: rs.data || [], + total: rs.total || 0 + }; + }, [principalRes]); + + const handleSubmit = async () => { + const params = await form.validateFields(); + const { principal_type, principal, roles } = params + onSubmit({ + principal_type, + principal_id: principal?.id, + display_name: principal?.name, + roles: (roles || []).map((item) => item.name) + }, startLoading, endLoading); + }; + + useEffect(() => { + runPrincipalSearch(principalQueryParams); + }, []); + + useEffect(() => { + if (record && typeof record === 'object') { + form.setFieldsValue({ + ...record, + principal: { + id: record.principal_id, + name: record.display_name + }, + roles: (record.roles || []).map((item) => ({ + name: item + })) + }) + if (record.principal_type) setPrincipalQueryParams((state) => ({...state, type: record.principal_type})) + } else { + form.setFieldsValue({ + principal_type: TYPE_OPTIONS[0].key + }); + } + }, [record]); + + const itemClassNames = '!w-496px'; + + return ( + +
+ + + + + item?.name} + rowKey='id' + pagination={{ + currentPage: principalResult.total + ? Math.floor(principalQueryParams.from / principalQueryParams.size) + 1 + : 0, + total: principalResult.total, + onChange: page => { + setPrincipalQueryParams(params => ({ ...params, from: (page - 1) * params.size })); + } + }} + renderItem={(item: any) => ( +
+ {item.name} + {item.description ? ( + {item.description} + ) : null} +
+ )} + onSearchChange={(query: string) => { + setPrincipalQueryParams(params => ({ ...params, query, from: 0, type: row.type })); + }} + /> +
+ + + + + + +
+
+ ); +}); diff --git a/web/src/pages/auth/new/index.tsx b/web/src/pages/auth/new/index.tsx new file mode 100644 index 00000000..d065ae1b --- /dev/null +++ b/web/src/pages/auth/new/index.tsx @@ -0,0 +1,38 @@ +import { fetchAuthorization } from '@/service/api/security'; + +import { EditForm } from '../modules/EditForm'; + +export function Component() { + const { t } = useTranslation(); + const nav = useNavigate(); + + const onSubmit = async (params: any, before?: () => void, after?: () => void) => { + if (before) before(); + const res = await fetchAuthorization(params); + if (res?.data?.result === 'created') { + window.$message?.success(t('common.addSuccess')); + nav(`/security?tab=auth`); + } + if (after) after(); + }; + + return ( +
+ +
+
+
{t(`page.auth.new.title`)}
+
+
+ +
+ +
+ ); +} diff --git a/web/src/pages/connector/edit/[id].tsx b/web/src/pages/connector/edit/[id].tsx index 53f9550c..c79bd2b4 100644 --- a/web/src/pages/connector/edit/[id].tsx +++ b/web/src/pages/connector/edit/[id].tsx @@ -1,4 +1,4 @@ -import { Button, Form, Input, Select, message,Switch } from 'antd'; +import { Button, Form, Input, Select, message,Switch, Spin } from 'antd'; import type { FormProps } from 'antd'; import InfiniIcon from '@/components/common/icon'; @@ -8,42 +8,19 @@ import { formatESSearchResult } from '@/service/request/es'; import { AssetsIcons } from '../new/assets_icons'; import { IconSelector } from '../new/icon_selector'; -import { useLoaderData } from 'react-router-dom'; +import { useRoute } from '@sa/simple-router'; +import Processor from '../new/processor'; export function Component() { const { t } = useTranslation(); const nav = useNavigate(); - const loaderData = useLoaderData(); - const connectorID = loaderData.id; - const [connector, setConnector] = useState({ - id: connectorID, - }); + const [form] = Form.useForm(); - const [loading, setLoading] = useState(false); - useEffect(() => { - if (!connectorID) return; - setLoading(true); - getConnector(connectorID).then(res => { - if (res.data?.found === true) { - let initialConnector = res.data._source; - initialConnector = { - ...(initialConnector || {}), - assets_icons: initialConnector?.assets?.icons || {}, - ...(initialConnector?.config || { - auth_url: "https://accounts.google.com/o/oauth2/auth", - redirect_url: location.origin + "/connector/google_drive/oauth_redirect", - token_url: "https://oauth2.googleapis.com/token" - }), + const route = useRoute(); + const connectorID = route.params.id - raw_config: initialConnector?.config ? JSON.stringify(initialConnector?.config,null,4) : undefined - - }; - setConnector(initialConnector); - } - }).finally(() => { - setLoading(false); - }); - }, [connectorID]); + const [loading, setLoading] = useState(false); + const [connector, setConnector] = useState({}); const onFinish: FormProps['onFinish'] = values => { const category = typeof values.category === 'string' ? values.category : values.category[0] || ''; @@ -57,9 +34,10 @@ export function Component() { icon: values.icon, name: values.name, path_hierarchy: values.path_hierarchy, - tags: values.tags + tags: values.tags, + processor: values.processor, }; - if (connectorID === 'google_drive') { + if (connector?.processor?.name === 'google_drive') { sValues.config = { auth_url: values.auth_url, client_id: values.client_id, @@ -77,6 +55,32 @@ export function Component() { }); }; const [iconsMeta, setIconsMeta] = useState([]); + + const fetchConnector = async (connectorID) => { + if (!connectorID) return; + setLoading(true) + const res = await getConnector(connectorID); + if (res.data?.found === true && res.data._source) { + const newConnector = { + ...res.data._source, + assets_icons: res.data._source?.assets?.icons || {}, + ...(res.data._source?.config || { + auth_url: "https://accounts.google.com/o/oauth2/auth", + redirect_url: location.origin + `/connector/${res.data._source.id}/oauth_redirect`, + token_url: "https://oauth2.googleapis.com/token" + }), + raw_config: res.data._source?.config ? JSON.stringify(res.data._source?.config,null,4) : undefined + } + setConnector(newConnector) + form.setFieldsValue(newConnector) + } + setLoading(false) + } + + useEffect(() => { + fetchConnector(connectorID) + }, [connectorID]); + useEffect(() => { getConnectorIcons().then(res => { if (res.data?.length > 0) { @@ -102,6 +106,7 @@ export function Component() { console.log('Failed:', errorInfo); }; const { defaultRequiredRule, formRules } = useFormRules(); + return (
{t('page.connector.edit.title')}
+ +
+ + { + if (!value) return Promise.resolve() + if (value.name?.trim().length == 0 ) { + return Promise.reject(new Error('name is required')) + } + return Promise.resolve() + }, + },]} + > + + - {connector.builtin === true ? ( + {connector?.builtin === true ? ( @@ -171,7 +195,7 @@ export function Component() { )} @@ -179,16 +203,16 @@ export function Component() { label={t('page.connector.new.labels.assets_icons')} name="assets_icons" > - {connector.builtin === true ? ( + {connector?.builtin === true ? ( ) : ( )} - {connectorID === 'google_drive' && ( + {connector?.processor?.name === 'google_drive' && ( <> + name="path_hierarchy" + tooltip={t('page.connector.new.tooltip.path_hierarchy', 'Whether to support access documents via path hierarchy manner.')} + valuePropName="checked" + className='w-0 h-0 m-0 overflow-hidden' + > @@ -263,6 +288,7 @@ export function Component() { +
); @@ -301,7 +327,3 @@ const AssetsIconsView = ({ value = {} }) => {
); }; - -export async function loader({ params }: any) { - return params; -} diff --git a/web/src/pages/connector/new/index.tsx b/web/src/pages/connector/new/index.tsx index ad48a7d3..8da8afbb 100644 --- a/web/src/pages/connector/new/index.tsx +++ b/web/src/pages/connector/new/index.tsx @@ -7,6 +7,7 @@ import { formatESSearchResult } from '@/service/request/es'; import { AssetsIcons } from './assets_icons'; import { IconSelector } from './icon_selector'; +import Processor from './processor'; export function Component() { const { t } = useTranslation(); @@ -24,7 +25,8 @@ export function Component() { icon: values.icon, name: values.name, path_hierarchy: values.path_hierarchy, - tags: values.tags + tags: values.tags, + processor: values.processor, }; createConnector(sValues).then(res => { if (res.data?.result === 'created') { @@ -84,6 +86,21 @@ export function Component() { > + { + if (!value) return Promise.resolve() + if (value.name?.trim().length == 0 ) { + return Promise.reject(new Error('name is required')) + } + return Promise.resolve() + }, + },]} + > + + { + + const { t } = useTranslation(); + const [innerValue, setInnerValue] = useState(value || {}); + const handleChange = (key, val) => { + const newValue = { ...innerValue, [key]: val }; + setInnerValue(newValue); + onChange?.(newValue); + }; + + return ( +
+ handleChange('enabled', v)} + checked={innerValue.enabled} + /> +
+
+ {t('page.connector.new.labels.name')} +
+ handleChange('name', e.target.value)} + value={innerValue.name} + /> +
+
+ ); +}; diff --git a/web/src/pages/data-source/detail/[id].tsx b/web/src/pages/data-source/detail/[id].tsx index 8954a09c..e8ec1f34 100644 --- a/web/src/pages/data-source/detail/[id].tsx +++ b/web/src/pages/data-source/detail/[id].tsx @@ -1,392 +1,60 @@ -import Icon, { DownOutlined, EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined } from '@ant-design/icons'; -import type { MenuProps, TableColumnsType, TableProps } from 'antd'; -import { Dropdown, Image, Modal, Switch, Table, message } from 'antd'; -import Search from 'antd/es/input/Search'; -import { type LoaderFunctionArgs, useLoaderData } from 'react-router-dom'; +import { Tabs } from 'antd'; -import FontIcon from '@/components/common/font_icon'; -import InfiniIcon from '@/components/common/icon'; -import { - batchDeleteDocument, - deleteDocument, - fetchDatasourceDetail, - getConnector, - getDatasource, - updateDocument -} from '@/service/api'; -import { formatESSearchResult } from '@/service/request/es'; -import useQueryParams from '@/hooks/common/queryParams'; +import './index.scss'; +import FileManagement from './modules/FileManagement'; import { useRoute } from '@sa/simple-router'; - -interface DataType { - category: string; - disabled: boolean; - icon: string; - id: string; - is_dir: boolean; - searchable: boolean; - subcategory: string; - tags: string[]; - title: string; - type: string; - url: string; -} +import MappingManagement from './modules/MappingManagement'; export function Component() { const route = useRoute(); const datasourceID = route.params.id - const [queryParams, setQueryParams] = useQueryParams(); - + const [searchParams, setSearchParams] = useSearchParams(); const { t } = useTranslation(); - - const [connector, setConnector] = useState({}); - const [datasource, setDatasource] = useState(); - useEffect(() => { - if (!datasourceID) return; - getDatasource(datasourceID).then(res => { - if (res.data?.found === true) { - setDatasource(res.data._source || {}); - } - }); - }, [datasourceID]); - useEffect(() => { - if (!datasource?.connector?.id) return; - getConnector(datasource?.connector?.id).then(res => { - if (res.data?.found === true) { - setConnector(res.data._source || {}); - } - }); - }, [datasource?.connector?.id]); - const onMenuClick = ({ key, record }: any) => { - switch (key) { - case '1': - window?.$modal?.confirm({ - content: 'Are you sure you want to delete this document?', - icon: , - onCancel() {}, - onOk() { - deleteDocument(record.id).then(res => { - if (res.data?.result === 'deleted') { - message.success('deleted success'); - } - // reload data - setQueryParams(old => { - return { - ...old, - t: new Date().valueOf() - }; - }); - }); - } - }); - - break; - } - }; - const [state, setState] = useState({ - selectedRowKeys: [] - }); - // rowSelection object indicates the need for row selection - const rowSelection: TableProps['rowSelection'] = { - getCheckboxProps: (record: DataType) => ({ - // Column configuration not to be checked - name: record.title - }), - onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { - setState((st: any) => { - return { - ...st, - selectedRowKeys - }; - }); - }, - selectedRowKeys: state.selectedRowKeys - }; - const onSearchableChange = (checked: boolean, record: DataType) => { - // update searchable status - record.disabled = !checked; - updateDocument(record.id, record).then(res => { - if (res.data?.result === 'updated') { - message.success('updated success'); - } - // reload data - setQueryParams(old => { - return { - ...old, - t: new Date().valueOf() - }; - }); - }); - }; - const items: MenuProps['items'] = [ - { - key: '1', - label: t('common.delete') - } - ]; - const onBatchMenuClick = useCallback( - ({ key }: any) => { - switch (key) { - case '1': - window?.$modal?.confirm({ - content: 'Are you sure you want to delete theses documents?', - icon: , - onCancel() {}, - onOk() { - if (state.selectedRowKeys?.length === 0) { - message.error('Please select at least one document'); - return; - } - setLoading(true); - batchDeleteDocument(state.selectedRowKeys) - .then(res => { - if (res.data?.result === 'acknowledged') { - setState((st: any) => { - return { - ...st, - selectedRowKeys: [] - }; - }); - message.success('submit success'); - } - // reload data - setTimeout(() => { - setQueryParams(old => { - return { - ...old, - t: new Date().valueOf() - }; - }); - }, 1000); - }) - .finally(() => { - setLoading(false); - }); - } - }); - - break; - } - }, - [state.selectedRowKeys] - ); - const columns: TableColumnsType = useMemo( - () => [ - { - dataIndex: 'title', - render: (text: string, record: DataType) => { - let imgSrc = ''; - if (connector?.assets?.icons) { - imgSrc = connector.assets.icons[record.icon]; - } - const aProps = { - className: "text-blue-500", - rel: "noreferrer", - } - if (record.type === 'folder') { - aProps.onClick = () => { - const categories = (record.categories || []).concat([record.title]) - setQueryParams(old => { - return { - ...old, - path: JSON.stringify(categories), - } - }) - } - } else if (record.url) { - aProps.href = record.url; - aProps.target = "_blank"; - } - return ( - - {imgSrc ? ( - - - - ) : } - { record.url || record.type === 'folder' ? {text} : {text} } - - ); - }, - title: t('page.datasource.columns.name') - }, - { - dataIndex: 'disabled', - render: (text: boolean, record: DataType) => { - return ( - { - onSearchableChange(v, record); - }} - /> - ); - }, - title: t('page.datasource.columns.searchable') - }, - { - fixed: 'right', - render: (_, record) => { - return ( - onMenuClick({ key, record }) }}> - - - ); - }, - title: t('common.operation'), - width: '90px' - } - ], - [connector] - ); + const { hasAuth } = useAuth() - if (!datasourceID) return ; + const permissions = { + viewFile: hasAuth(['coco#datasource/search', 'coco#datasource/read']), + } - const [data, setData] = useState({}); - const [loading, setLoading] = useState(false); + const onChange = (key: string) => { + setSearchParams({ tab: key }); + }; - const [keyword, setKeyword] = useState(); + const items = []; - const fetchData = () => { - setLoading(true); - const { filter = {} } = queryParams || {}; - fetchDatasourceDetail({ - ...queryParams, - filter: { - ...filter, - 'source.id': [datasourceID], - } + if (permissions.viewFile) { + items.push({ + component: FileManagement, + key: 'file', + label: t(`page.datasource.file.title`), }) - .then(data => { - const newData = formatESSearchResult(data.data); - setData(newData); - }) - .finally(() => { - setLoading(false); - }); - }; - - useEffect(fetchData, [queryParams]); + // items.push({ + // component: MappingManagement, + // key: 'mapping', + // label: t(`page.datasource.mapping.title`), + // }) + } - useEffect(() => { - setKeyword(queryParams.query) - }, [queryParams.query]) + const activeKey = useMemo(() => { + return searchParams.get('tab') || items?.[0]?.key + }, []) - const onTableChange = (pagination, filters, sorter, extra: { action; currentDataSource: [] }) => { - setQueryParams(params => { - return { - ...params, - from: (pagination.current - 1) * pagination.pageSize, - size: pagination.pageSize - }; - }); - }; - const onRefreshClick = (query: string) => { - setQueryParams(oldParams => { - return { - ...oldParams, - from: 0, - query, - t: new Date().valueOf() - }; - }); - }; - - const renderTitle = (datasource) => { - let paths - try { - paths = JSON.parse(queryParams?.path); - } catch (error) { - paths = []; - } - if (Array.isArray(paths) && paths.length > 0) { - if (datasource?.name) { - paths.unshift(datasource?.name); - } - return paths.map((item, index) => { - const isLast = index === paths.length - 1; - return ( - - { - isLast ? ( - {item} - ) : ( - { - setQueryParams(old => { - const newParams = Object.assign({}, old); - if (index !== 0) { - const path = paths.slice(1, index + 1); - newParams.path = JSON.stringify(path); - } else { - delete newParams.path; - } - return newParams; - }) - }}>{item} - ) - } - { !isLast && > } - - ); - }); - } - return datasource?.name; - } + const activeItem = useMemo(() => { + return items.find((item) => item.key === activeKey); + }, [activeKey]) return ( -
- -
-
-
{renderTitle(datasource)}
-
-
-
- setKeyword(e.target.value)} - addonBefore={} - className="max-w-500px" - enterButton={t('common.refresh')} - onSearch={onRefreshClick} - /> -
- } - menu={{ items, onClick: onBatchMenuClick }} - type="primary" - > - {t('common.operation')} - -
-
- - columns={columns} - dataSource={data.data || []} - loading={loading} - rowKey="id" - rowSelection={{ ...rowSelection }} - size="middle" - pagination={{ - showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`, - pageSize: queryParams.size, - current: Math.floor(queryParams.from / queryParams.size) + 1, - total: data.total?.value || data?.total, - showSizeChanger: true, - }} - onChange={onTableChange} - /> -
- -
+ + +
+ { activeItem?.component ? : null} +
+
); } diff --git a/web/src/pages/data-source/detail/index.scss b/web/src/pages/data-source/detail/index.scss new file mode 100644 index 00000000..b57b4418 --- /dev/null +++ b/web/src/pages/data-source/detail/index.scss @@ -0,0 +1,68 @@ +.settings-tabs { + .ant-tabs-nav { + margin-bottom: 0px; + height: 40px; + } + .ant-tabs-ink-bar { + height: 4px !important; + } + .ant-tabs-nav-wrap { + padding-left: 16px; + padding-right: 16px; + } + .ant-tabs-tab { + padding-left: 8px; + padding-right: 8px; + } + .ant-tabs-tab:not(:first-child) { + margin-left: 38px; + } + .ant-tabs-content { + display: none; + min-height: calc(100vh - 176px); + height: auto; + padding: 0px 24px; + } +} + +.settings-tabs-content { + min-height: calc(100vh - 176px); + height: auto; + padding: 12px 16px; + display: flex; + flex-direction: column; +} + +.settings-tabs-content > div { + flex: 1; + width: 100%; +} + +.settings-form { + & > .ant-form-item > .ant-row { + & > .ant-form-item-label { + width: 160px; + } + & > .ant-form-item-control { + max-width: 520px; + } + } + .deepseek-icon > div > div { + font-size: 32px; + padding-top: 3px; + margin-right: -8px; + } + .sub-form-item { + .ant-form-item-label > label { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); + } + } +} + +.settings-form-help { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); +} \ No newline at end of file diff --git a/web/src/pages/data-source/detail/modules/FileManagement.tsx b/web/src/pages/data-source/detail/modules/FileManagement.tsx new file mode 100644 index 00000000..50e067f0 --- /dev/null +++ b/web/src/pages/data-source/detail/modules/FileManagement.tsx @@ -0,0 +1,544 @@ +import { DownOutlined, EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined } from '@ant-design/icons'; +import type { MenuProps, TableColumnsType, TableProps } from 'antd'; +import { Avatar, Dropdown, Switch, Table, message } from 'antd'; +import Search from 'antd/es/input/Search'; + +import FontIcon from '@/components/common/font_icon'; +import InfiniIcon from '@/components/common/icon'; +import { + batchDeleteDocument, + deleteDocument, + fetchDatasourceDetail, + getConnector, + getDatasource, + updateDocument +} from '@/service/api'; +import { formatESSearchResult } from '@/service/request/es'; +import useQueryParams from '@/hooks/common/queryParams'; + +interface DataType { + category: string; + disabled: boolean; + icon: string; + id: string; + is_dir: boolean; + searchable: boolean; + subcategory: string; + tags: string[]; + title: string; + type: string; + url: string; +} + +const FileManagement = props => { + const datasourceID = props.id; + const [queryParams, setQueryParams] = useQueryParams(); + + const responsive = useResponsive(); + const { t } = useTranslation(); + + const { addSharesToData, isEditorOwner, hasEdit, isResourceShare } = useResource(); + + const { hasAuth } = useAuth(); + + const permissions = { + readDatasource: hasAuth('coco#datasource/read'), + readConnector: hasAuth('coco#connector/read'), + update: hasAuth('coco#document/update'), + delete: hasAuth('coco#document/delete') + }; + + const [connector, setConnector] = useState({}); + const [datasource, setDatasource] = useState(); + const [selectedRecord, setSelectedRecord] = useState(); + + useEffect(() => { + if (!datasourceID) return; + if (permissions.readDatasource) { + getDatasource(datasourceID).then(res => { + if (res.data?.found === true) { + setDatasource(res.data._source || {}); + } + }); + } + }, [datasourceID]); + useEffect(() => { + if (!datasource?.connector?.id) return; + if (permissions.readConnector) { + getConnector(datasource?.connector?.id).then(res => { + if (res.data?.found === true) { + setConnector(res.data._source || {}); + } + }); + } + }, [datasource?.connector?.id]); + const onMenuClick = ({ key, record }: any) => { + switch (key) { + case '1': + window?.$modal?.confirm({ + content: 'Are you sure you want to delete this document?', + icon: , + onCancel() {}, + onOk() { + deleteDocument(record.id).then(res => { + if (res.data?.result === 'deleted') { + message.success('deleted success'); + } + // reload data + setQueryParams(old => { + return { + ...old, + t: new Date().valueOf() + }; + }); + }); + } + }); + + break; + } + }; + const [state, setState] = useState({ + selectedRowKeys: [] + }); + // rowSelection object indicates the need for row selection + const rowSelection: TableProps['rowSelection'] = { + getCheckboxProps: (record: DataType) => ({ + // Column configuration not to be checked + name: record.title, + disabled: !(isEditorOwner(record) && permissions.delete) + }), + onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { + setState((st: any) => { + return { + ...st, + selectedRowKeys + }; + }); + }, + selectedRowKeys: state.selectedRowKeys + }; + const onSearchableChange = (checked: boolean, record: DataType) => { + // update searchable status + record.disabled = !checked; + updateDocument(record.id, record).then(res => { + if (res.data?.result === 'updated') { + message.success('updated success'); + } + // reload data + setQueryParams(old => { + return { + ...old, + t: new Date().valueOf() + }; + }); + }); + }; + const items: MenuProps['items'] = [ + { + key: '1', + label: t('common.delete') + } + ]; + const onBatchMenuClick = useCallback( + ({ key }: any) => { + switch (key) { + case '1': + window?.$modal?.confirm({ + content: 'Are you sure you want to delete theses documents?', + icon: , + onCancel() {}, + onOk() { + if (state.selectedRowKeys?.length === 0) { + message.error('Please select at least one document'); + return; + } + setLoading(true); + batchDeleteDocument(state.selectedRowKeys) + .then(res => { + if (res.data?.result === 'acknowledged') { + setState((st: any) => { + return { + ...st, + selectedRowKeys: [] + }; + }); + message.success('submit success'); + } + // reload data + setTimeout(() => { + setQueryParams(old => { + return { + ...old, + t: new Date().valueOf() + }; + }); + }, 1000); + }) + .finally(() => { + setLoading(false); + }); + } + }); + + break; + } + }, + [state.selectedRowKeys] + ); + + const columns: TableColumnsType = [ + { + dataIndex: 'title', + render: (text: string, record: DataType) => { + const isShare = isResourceShare(record); + + let imgSrc = ''; + if (connector?.assets?.icons) { + imgSrc = connector.assets.icons[record.icon]; + } + const aProps = { + className: 'text-blue-500', + rel: 'noreferrer' + }; + + const pathHierarchy = connector?.path_hierarchy && record.type === 'folder'; + + if (pathHierarchy) { + aProps.onClick = () => { + const categories = (record.categories || []).concat([record.title]); + setQueryParams(old => { + return { + ...old, + from: 0, + size: 10, + path: JSON.stringify(categories), + view: isEditorOwner(record) ? 'auto' : 'list' + }; + }); + }; + } else { + aProps.onClick = () => { + setSelectedRecord(record) + } + } + + let shareIcon; + + if (isShare) { + shareIcon = ( +
+ +
+ ); + } + + if (connector?.path_hierarchy && queryParams.view === 'list') { + return ( + + + {imgSrc ? ( + + + + ) : ( + + )} + {text} + {shareIcon} + + + {record.categories?.length > 0 ? `/${record.categories.join('/')}` : '/'} + + + ); + } + + return ( + + {imgSrc ? ( + + + + ) : ( + + )} + {text} + {shareIcon} + + ); + }, + title: t('page.datasource.columns.name') + }, + { + dataIndex: 'categories', + title: t('page.datasource.labels.categories'), + hidden: connector?.path_hierarchy && queryParams.view === 'list', + render: (value) => { + return Array.isArray(value) ? `/${value.join('/')}` : '/' + } + }, + { + dataIndex: 'owner', + title: t('page.datasource.labels.owner'), + render: (value, record) => { + if (!value) return '-'; + return ( +
+ + + +
+ ); + } + }, + { + dataIndex: 'shares', + title: t('page.datasource.labels.shares'), + render: (value, record) => { + return ( + 0 ? `/${record.categories.join('/')}/` : '/', + resource_full_path: + (record.categories?.length > 0 ? `/${record.categories.join('/')}/` : '/') + record.title, + resource_is_folder: record?.type === 'folder' + }} + onSuccess={() => fetchData(queryParams, datasourceID)} + /> + ); + } + }, + // { + // dataIndex: 'updated', + // title: t('page.datasource.labels.updated') + // }, + // { + // dataIndex: 'size', + // title: t('page.datasource.labels.size') + // }, + // { + // dataIndex: 'disabled', + // render: (text: boolean, record: DataType) => { + // return ( + // { + // onSearchableChange(v, record); + // }} + // /> + // ); + // }, + // title: t('page.datasource.columns.searchable') + // }, + { + fixed: 'right', + hidden: !permissions.delete, + render: (_, record) => { + if (!isEditorOwner(record)) return null; + return ( + onMenuClick({ key, record }) }}> + + + ); + }, + title: t('common.operation'), + width: '90px' + } + ].filter(item => Boolean(item)); + + const [data, setData] = useState({}); + const [loading, setLoading] = useState(false); + + const [keyword, setKeyword] = useState(); + + const fetchData = async (queryParams, datasourceID) => { + if (!datasourceID) return; + setLoading(true); + const { filter = {} } = queryParams || {}; + const res = await fetchDatasourceDetail({ + ...queryParams, + filter: { + ...filter, + 'source.id': [datasourceID] + } + }); + if (res?.data) { + const newData = formatESSearchResult(res.data); + if (newData.data.length > 0) { + const resources = newData.data.map(item => ({ + resource_id: item.id, + resource_type: 'document', + resource_category_type: 'datasource', + resource_category_id: datasourceID, + resource_parent_path: item.categories?.length > 0 ? `/${item.categories.join('/')}/` : '/' + })); + const dataWithShares = await addSharesToData(newData.data, resources); + if (dataWithShares) { + newData.data = dataWithShares; + } + } + setData(newData); + } + setLoading(false); + }; + + useEffect(() => { + fetchData(queryParams, datasourceID); + }, [queryParams, datasourceID]); + + useEffect(() => { + setKeyword(queryParams.query); + }, [queryParams.query]); + + const onTableChange = (pagination, filters, sorter, extra: { action; currentDataSource: [] }) => { + setQueryParams(params => { + return { + ...params, + from: (pagination.current - 1) * pagination.pageSize, + size: pagination.pageSize + }; + }); + }; + const onRefreshClick = (query: string) => { + setQueryParams(oldParams => { + return { + ...oldParams, + from: query === oldParams.query ? oldParams.from : 0, + query, + t: new Date().valueOf() + }; + }); + }; + + const renderTitle = datasource => { + let paths; + try { + paths = JSON.parse(queryParams?.path); + } catch (error) { + paths = []; + } + if (Array.isArray(paths) && paths.length > 0) { + if (datasource?.name) { + paths.unshift(datasource?.name); + } + return paths.map((item, index) => { + const isLast = index === paths.length - 1; + return ( + + {isLast ? ( + {item} + ) : ( + { + setQueryParams(old => { + const newParams = { ...old }; + if (index !== 0) { + const path = paths.slice(1, index + 1); + newParams.path = JSON.stringify(path); + } else { + delete newParams.path; + } + return { + ...newParams, + from: 0, + size: 10 + }; + }); + }} + > + {item} + + )} + {!isLast && >} + + ); + }); + } + return datasource?.name; + }; + + if (!datasourceID) return ; + + return ( + +
+
+
{renderTitle(datasource)}
+
+
+ } + className='max-w-500px' + enterButton={t('common.refresh')} + value={keyword} + onChange={e => setKeyword(e.target.value)} + onSearch={onRefreshClick} + /> + {permissions.delete && ( +
+ } + menu={{ items, onClick: onBatchMenuClick }} + type='primary' + > + {t('common.operation')} + +
+ )} +
+ + columns={columns} + dataSource={data.data || []} + loading={loading} + rowKey='id' + rowSelection={{ ...rowSelection }} + size='middle' + pagination={{ + showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size, + current: Math.floor(queryParams.from / queryParams.size) + 1, + total: data.total?.value || data?.total, + showSizeChanger: true + }} + onChange={onTableChange} + /> + setSelectedRecord(undefined)} + isMobile={!responsive.sm} + /> + + ); +}; + +export default FileManagement; diff --git a/web/src/pages/data-source/detail/modules/MappingManagement.tsx b/web/src/pages/data-source/detail/modules/MappingManagement.tsx new file mode 100644 index 00000000..df63af4e --- /dev/null +++ b/web/src/pages/data-source/detail/modules/MappingManagement.tsx @@ -0,0 +1,152 @@ +import { FilterOutlined } from '@ant-design/icons'; +import { useLoading } from '@sa/hooks'; +import { Button, Input, Space, Switch, Table } from 'antd'; + +import { formatESSearchResult } from '@/service/request/es'; +import useQueryParams from '@/hooks/common/queryParams'; +import { fetchRoles } from '@/service/api/security'; +import PrincipalSelect from '@/components/Resource/PrincipalSelect'; + +const MappingManagement = (props) => { + const [queryParams, setQueryParams] = useQueryParams(); + const { t } = useTranslation(); + + const { hasAuth } = useAuth() + + const permissions = { + update: hasAuth('coco#datasource/update'), + } + + const [editRow, setEditRow] = useState() + + const [data, setData] = useState({ + data: [], + total: 0 + }); + const { endLoading, loading, startLoading } = useLoading(); + const [keyword, setKeyword] = useState(); + + const fetchData = async (params) => { + startLoading(); + const res = await fetchRoles(params); + const newData = formatESSearchResult(res.data); + setData(newData); + endLoading(); + }; + + const handleTableChange = pagination => { + setQueryParams(params => { + return { + ...params, + from: (pagination.current - 1) * pagination.pageSize, + size: pagination.pageSize + }; + }); + }; + + const onRefreshClick = (query: string) => { + setQueryParams(oldParams => { + return { + ...oldParams, + from: 0, + query, + t: new Date().valueOf() + }; + }); + }; + + const columns = [ + { + dataIndex: 'name', + title: t('page.datasource.labels.externalAccount') + }, + { + dataIndex: 'coco', + title: t('page.datasource.labels.cocoAccount'), + render: (value, record) => { + return editRow?.id === record.id ? ( + + ) : value + } + }, + { + dataIndex: 'mapping_status', + title: t('page.datasource.labels.mappingStatus'), + render: (value: boolean)=>{ + return value ? t('page.datasource.labels.mapped') : t('page.datasource.labels.unmapped') + } + }, + { + dataIndex: 'enabled', + title: t('page.datasource.labels.enabled'), + width: 80, + render: (value: boolean)=>{ + return {}} /> + } + }, + { + fixed: 'right', + hidden: !permissions.update, + render: (_, record) => { + return editRow?.id === record.id ? ( + + + + + ) : ( + + ) + }, + title: t('common.operation'), + width: '90px' + } + ]; + // rowSelection object indicates the need for row selection + const rowSelection = { + getCheckboxProps: record => ({ + name: record.name + }), + onChange: (selectedRowKeys: React.Key[], selectedRows) => {} + }; + + useEffect(() => { + fetchData(queryParams); + }, [queryParams]); + + useEffect(() => { + setKeyword(queryParams.query) + }, [queryParams.query]) + + return ( + +
+ } + className="max-w-500px" + enterButton={t('common.refresh')} + onSearch={onRefreshClick} + value={keyword} + onChange={(e) => setKeyword(e.target.value)} + /> +
+ `${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size, + current: Math.floor(queryParams.from / queryParams.size) + 1, + total: data.total?.value || data?.total, + showSizeChanger: true, + }} + onChange={handleTableChange} + /> + + ); +} + +export default MappingManagement \ No newline at end of file diff --git a/web/src/pages/data-source/edit/[id].tsx b/web/src/pages/data-source/edit/[id].tsx index a385890a..c721ef73 100644 --- a/web/src/pages/data-source/edit/[id].tsx +++ b/web/src/pages/data-source/edit/[id].tsx @@ -1,5 +1,5 @@ import type { FormProps } from 'antd'; -import { Button, Form, Input, Spin, Switch, message } from 'antd'; +import { Button, Form, Input, Spin, Switch, Typography, message } from 'antd'; import { useForm } from 'antd/es/form/Form'; import { useEffect, useState } from 'react'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -50,6 +50,15 @@ export function Component() { }); const [form] = useForm(); + const [webhookEnabled, setWebhookEnabled] = useState(false) + const webhookUrl = useMemo(() => { + return datasourceID ? `${window.location.origin}/webhooks/${datasourceID}` : '' + }, [datasourceID]) + + useEffect(() => { + setWebhookEnabled(datasource?.webhook?.enabled) + }, [datasource?.webhook?.enabled]) + useEffect(() => { if (!datasourceID) return; // eslint-disable-next-line complexity @@ -97,7 +106,8 @@ export function Component() { interval: datasource?.sync?.interval || '1h' }, raw_config: datasource?.connector?.config? JSON.stringify(datasource?.connector?.config,null,4) : undefined, - urls: datasource?.connector?.config?.urls || [''] + urls: datasource?.connector?.config?.urls || [''], + enrichment_pipeline: datasource?.enrichment_pipeline ? JSON.stringify(datasource?.enrichment_pipeline, null,2) : '' }); } }); @@ -235,6 +245,14 @@ export function Component() { break; } } + if(values.enrichment_pipeline) { + try { + values.enrichment_pipeline = JSON.parse(values.enrichment_pipeline); + }catch (e) { + message.error("invalid enrichment pipeline JSON format"); + return; + } + } const sValues = { connector: { config: { @@ -253,7 +271,9 @@ export function Component() { strategy: values.sync_config?.strategy || 'interval', interval: values.sync_config?.interval || '1h' }, - type: 'connector' + type: 'connector', + webhook: values.webhook, + enrichment_pipeline: values.enrichment_pipeline || null }; updateDatasource(datasourceID, sValues).then(res => { if (res.data?.result === 'updated') { @@ -424,6 +444,30 @@ export function Component() { type="connector" /> + + setWebhookEnabled(checked)}/> + + { + webhookEnabled && ( + + {webhookUrl} + + ) + } + + + {!isCustom ? ( <> @@ -499,6 +543,14 @@ export function Component() { )} + {/* + + */} + , boolean>; - -interface TableParams { - filters?: Parameters>[1]; - pagination?: TablePaginationConfig; - sortField?: SorterResult['field']; - sortOrder?: SorterResult['order']; -} - const TYPES = { google_drive: { icon: GoogleDriveSVG, @@ -46,19 +37,23 @@ export function Component() { const { t } = useTranslation(); + const { addSharesToData, isEditorOwner, hasEdit, hasView, isResourceShare } = useResource(); + const resourceType = 'datasource'; + const resourceCategoryType = 'connector'; + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('coco#datasource/read'), + readConnector: hasAuth('coco#connector/read'), + create: hasAuth('coco#datasource/create'), + update: hasAuth('coco#datasource/update'), + delete: hasAuth('coco#datasource/delete') + }; + const { scrollConfig, tableWrapperRef } = useTableScroll(); const nav = useNavigate(); - const items: MenuProps['items'] = [ - { - key: '2', - label: t('common.edit') - }, - { - key: '1', - label: t('common.delete') - } - ]; const onMenuClick = ({ key, record }: any) => { switch (key) { @@ -114,8 +109,6 @@ export function Component() { enabled: value }; - console.log('Updating sync config:', updatedSync); // Debug log - updateDatasource(record.id, { ...record, sync: updatedSync @@ -123,7 +116,6 @@ export function Component() { .then(res => { if (res.data?.result === 'updated') { message.success(t('common.updateSuccess')); - console.log('Sync update response:', res.data); // Debug log } // reload data setQueryParams(old => { @@ -167,35 +159,102 @@ export function Component() { const columns: TableColumnsType = [ { dataIndex: 'name', - minWidth: 200, + minWidth: 150, + ellipsis: true, render: (value: string, record: Datasource) => { let iconSrc = record.icon; if (!iconSrc && data.connectors) { iconSrc = data.connectors[record.connector.id]?.icon; } - if (!iconSrc) return value; - return ( - - nav(`/data-source/detail/${record.id}`, { - state: { connector_id: record.connector?.id || '', datasource_name: record.name } - }) - } - > - - + - - {value} - + + ); + } + + return ( + ); }, title: t('page.datasource.columns.name') }, + { + dataIndex: 'owner', + title: t('page.datasource.labels.owner'), + render: (value, record) => { + if (!value) return '-'; + return ( +
+ + + +
+ ); + } + }, + { + dataIndex: 'shares', + title: t('page.datasource.labels.shares'), + render: (value, record) => { + if (!value) return '-'; + const connector = data.connectors?.[record.connector?.id] + if (connector?.path_hierarchy) return '-' + return ( + fetchData()} + /> + ); + } + }, { minWidth: 100, render: (text: string, record: Datasource) => { @@ -205,13 +264,36 @@ export function Component() { }, title: t('page.datasource.columns.type') }, + // { + // dataIndex: ['sync', 'enabled'], + // title: t('page.datasource.labels.permission_sync'), + // render: (value: number) => { + // return value ? t('page.datasource.labels.isEnabled') : '-' + // }, + // }, + // { + // dataIndex: 'strategy', + // title: t('page.datasource.columns.sync_policy'), + // }, + { + dataIndex: 'updated', + title: t('page.datasource.labels.updated'), + render: (value: number) => { + return value ? new Date(value).toISOString() : ''; + } + }, + // { + // dataIndex: 'sync_status', + // title: t('page.datasource.columns.sync_status'), + // }, { dataIndex: ['sync', 'enabled'], render: (value: boolean, record: Datasource) => { return ( onSyncEnabledChange(v, record)} /> ); @@ -224,7 +306,8 @@ export function Component() { render: (value: boolean, record: Datasource) => { return ( onEnabledChange(v, record)} /> @@ -235,7 +318,22 @@ export function Component() { }, { fixed: 'right', + hidden: !permissions.update && !permissions.delete, render: (_, record) => { + const items: MenuProps['items'] = []; + if (permissions.read && permissions.update && hasEdit(record)) { + items.push({ + key: '2', + label: t('common.edit') + }); + } + if (permissions.delete && isEditorOwner(record)) { + items.push({ + key: '1', + label: t('common.delete') + }); + } + if (items.length === 0) return null; return ( onMenuClick({ key, record }) }}> @@ -245,7 +343,7 @@ export function Component() { title: t('common.operation'), width: '90px' } - ]; + ].filter(item => Boolean(item)); // rowSelection object indicates the need for row selection const rowSelection: TableProps['rowSelection'] = { getCheckboxProps: (record: Datasource) => ({ @@ -264,49 +362,50 @@ export function Component() { const [keyword, setKeyword] = useState(); - const fetchData = () => { + const fetchData = async () => { setLoading(true); - fetchDataSourceList(queryParams).then(({ data }) => { - const newData = formatESSearchResult(data); + const res = await fetchDataSourceList(queryParams); + if (res?.data) { + const newData = formatESSearchResult(res?.data); + if (newData.data.length > 0) { + const resources = newData.data.map(item => ({ + resource_id: item.id, + resource_type: resourceType, + resource_category_type: resourceCategoryType, + resource_category_id: item.connector?.id + })); + const dataWithShares = await addSharesToData(newData.data, resources); + if (dataWithShares) { + newData.data = dataWithShares; + } + const connectorRes = await getConnectorByIDs(newData.data.filter((item) => !!item.connector?.id).map(item => item.connector.id)); + if (connectorRes.data) { + const newConnectors = formatESSearchResult(connectorRes.data); + const connectors: any = {}; + newConnectors.data.map(item => { + connectors[item.id] = item; + }); + newData.connectors = connectors; + } + } setData((oldData: any) => { return { ...oldData, ...(newData || initialData) }; }); - setLoading(false); - }); + } + setLoading(false); }; - useEffect(fetchData, [queryParams]); + useEffect(() => { + fetchData(); + }, [queryParams]); useEffect(() => { setKeyword(queryParams.query); }, [queryParams.query]); - const fetchConnectors = async (ids: string[]) => { - const res = await getConnectorByIDs(ids); - if (res.data) { - const newData = formatESSearchResult(res.data); - const connectors: any = {}; - newData.data.map(item => { - connectors[item.id] = item; - }); - setData(data => { - return { - ...data, - connectors - }; - }); - } - }; - useEffect(() => { - if (data.data?.length > 0) { - const ids = data.data.map(item => item.connector.id); - fetchConnectors(ids); - } - }, [data.data]); - const handleTableChange: TableProps['onChange'] = (pagination, filters, sorter) => { setQueryParams(params => { return { @@ -320,7 +419,7 @@ export function Component() { setQueryParams(oldParams => { return { ...oldParams, - from: 0, + from: query === oldParams.query ? oldParams.from : 0, query, t: new Date().valueOf() }; @@ -333,41 +432,39 @@ export function Component() { -
+
} - className="max-w-500px" + className='max-w-500px' enterButton={t('common.refresh')} value={keyword} onChange={e => setKeyword(e.target.value)} onSearch={onRefreshClick} /> - + {permissions.create && ( + + )}
columns={columns} dataSource={data.data} loading={loading} - rowKey="id" + rowKey='id' rowSelection={{ ...rowSelection }} - size="middle" + size='middle' pagination={{ current: Math.floor(queryParams.from / queryParams.size) + 1, - pageSize: queryParams.size, - showSizeChanger: true, - showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`, - total: data.total?.value || data?.total + total: data.total?.value || data?.total, + showSizeChanger: true }} onChange={handleTableChange} /> diff --git a/web/src/pages/data-source/new-first/index.tsx b/web/src/pages/data-source/new-first/index.tsx index 20e79175..6d644a9a 100644 --- a/web/src/pages/data-source/new-first/index.tsx +++ b/web/src/pages/data-source/new-first/index.tsx @@ -50,10 +50,13 @@ export function Component() { }, [queryParams.query]); const onSearchClick = (query: string) => { - setQueryParams({ - ...queryParams, - query, - t: new Date().getTime() + setQueryParams(oldParams => { + return { + ...oldParams, + from: query === oldParams.query ? oldParams.from: 0, + query, + t: new Date().valueOf() + }; }); }; const onPageChange = (page: number, pageSize: number) => { diff --git a/web/src/pages/data-source/new/index.tsx b/web/src/pages/data-source/new/index.tsx index d06531b8..19f4b312 100644 --- a/web/src/pages/data-source/new/index.tsx +++ b/web/src/pages/data-source/new/index.tsx @@ -203,6 +203,14 @@ export function Component() { // eslint-disable-next-line complexity const onFinish: FormProps['onFinish'] = values => { let config: any = {}; + if(values.enrichment_pipeline){ + try { + values.enrichment_pipeline = JSON.parse(values.enrichment_pipeline); + }catch (e) { + message.error("invalid enrichment pipeline JSON format"); + return + } + } // eslint-disable-next-line default-case switch (type) { case Types.Yuque: @@ -309,7 +317,9 @@ export function Component() { strategy: values.sync_config.strategy, interval: values.sync_config.interval }, - type: 'connector' + type: 'connector', + webhook: values.webhook, + enrichment_pipeline: values.enrichment_pipeline }; createDatasource(sValues).then(res => { if (res.data?.result === 'created') { @@ -448,6 +458,19 @@ export function Component() { type="connector" /> + + + + + + {type === Types.Yuque && } {type === Types.Notion && } {type === Types.HugoSite && } diff --git a/web/src/pages/guide/modules/Guide.tsx b/web/src/pages/guide/modules/Guide.tsx index e67abe0a..05571f45 100644 --- a/web/src/pages/guide/modules/Guide.tsx +++ b/web/src/pages/guide/modules/Guide.tsx @@ -16,20 +16,22 @@ const Guide = memo(() => { const handleSubmit = async (isPass?: boolean) => { if (step === 0) { const params = await form.validateFields(); + const { confirm_password, ...rest } = params setStep(1); - setEditValue(params); + setEditValue(rest); } else if (step === 1) { let body; if (isPass) { body = editValue; } else { const params = await form.validateFields(); + const { confirm_password, ...rest } = params if(typeof params.llm.reasoning === "undefined") { params.llm.reasoning = params.llm.type === "deepseek"; } body = { ...(editValue || {}), - ...params + ...rest }; } startLoading(); diff --git a/web/src/pages/guide/modules/UserForm.tsx b/web/src/pages/guide/modules/UserForm.tsx index c13c9ff2..de698589 100644 --- a/web/src/pages/guide/modules/UserForm.tsx +++ b/web/src/pages/guide/modules/UserForm.tsx @@ -39,6 +39,24 @@ const UserForm = memo(({ form, onSubmit }: { form: FormInstance; onSubmit: () => > + { + const password = await form.getFieldValue('password'); + if (value && password !== value) { + throw new Error(t('form.pwdConfirm.invalid')); + } + }, + } + ]} + > + + , key: 'llm', - link: '/model-provider/list' + link: '/model-provider/list', + permissions: ['coco#model_provider/search'] }, { icon: , key: 'dataSource', - link: '/data-source' + link: '/data-source', + permissions: ['coco#datasource/search'] }, { icon: , key: 'aiAssistant', - link: '/ai-assistant' + link: '/ai-assistant', + permissions: ['coco#assistant/search'] } ]; @@ -29,6 +32,11 @@ export function Component() { const userInfo = useAppSelector(selectUserInfo); const routerPush = useRouterPush(); const { t } = useTranslation(); + const { hasAuth } = useAuth(); + const permissions = { + update: hasAuth('coco#system/update'), + } + const domRef = useRef(null); const [form] = Form.useForm(); const { endLoading, loading, startLoading } = useLoading(); @@ -123,23 +131,27 @@ export function Component() { )} {data?.name ? data?.name : {t('page.home.server.title', { user: userInfo?.name })}}
- + { + permissions.update && ( + + ) + }
{t('page.home.server.address')}
@@ -168,7 +180,7 @@ export function Component() {
{data?.endpoint}
)} { - !managed && ( + permissions.update && !managed && (
- + { + !item.permissions || hasAuth(item.permissions) ? ( + + ) : null + } ))} diff --git a/web/src/pages/integration/edit/[id].tsx b/web/src/pages/integration/edit/[id].tsx index 3d0634df..1d184fbd 100644 --- a/web/src/pages/integration/edit/[id].tsx +++ b/web/src/pages/integration/edit/[id].tsx @@ -1,11 +1,12 @@ import { useRequest } from '@sa/hooks'; -import { Col, Row } from 'antd'; +import { Col, Row, Spin } from 'antd'; import { type LoaderFunctionArgs, useLoaderData } from 'react-router-dom'; import { fetchIntegration, updateIntegration } from '@/service/api/integration'; -import { EditForm } from '../modules/EditForm'; +import { EditForm, isFullscreen } from '../modules/EditForm'; import { InsertCode } from '../modules/InsertCode'; +import { capitalize } from 'lodash'; export function Component() { const id = useLoaderData(); @@ -30,6 +31,11 @@ export function Component() { run(id); }, []); + const type = useMemo(() => { + if (!data?._source?.type) return '' + return isFullscreen(data?._source?.type) ? 'fullscreen' : 'searchbox' + }, [data?._source]) + return (
-
{t(`page.integration.form.title.edit`)}
+
{type ? `${t(`common.edit`)} ${capitalize(type)}` : t(`page.integration.form.title.edit`)}
- -
- - - - { - data && ( - : type ? ( + + + - ) - } - - + + + { + data && ( + + ) + } + + + ) : null + } ); diff --git a/web/src/pages/integration/list/index.scss b/web/src/pages/integration/list/index.scss new file mode 100644 index 00000000..b57b4418 --- /dev/null +++ b/web/src/pages/integration/list/index.scss @@ -0,0 +1,68 @@ +.settings-tabs { + .ant-tabs-nav { + margin-bottom: 0px; + height: 40px; + } + .ant-tabs-ink-bar { + height: 4px !important; + } + .ant-tabs-nav-wrap { + padding-left: 16px; + padding-right: 16px; + } + .ant-tabs-tab { + padding-left: 8px; + padding-right: 8px; + } + .ant-tabs-tab:not(:first-child) { + margin-left: 38px; + } + .ant-tabs-content { + display: none; + min-height: calc(100vh - 176px); + height: auto; + padding: 0px 24px; + } +} + +.settings-tabs-content { + min-height: calc(100vh - 176px); + height: auto; + padding: 12px 16px; + display: flex; + flex-direction: column; +} + +.settings-tabs-content > div { + flex: 1; + width: 100%; +} + +.settings-form { + & > .ant-form-item > .ant-row { + & > .ant-form-item-label { + width: 160px; + } + & > .ant-form-item-control { + max-width: 520px; + } + } + .deepseek-icon > div > div { + font-size: 32px; + padding-top: 3px; + margin-right: -8px; + } + .sub-form-item { + .ant-form-item-label > label { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); + } + } +} + +.settings-form-help { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); +} \ No newline at end of file diff --git a/web/src/pages/integration/list/index.tsx b/web/src/pages/integration/list/index.tsx index f22bcc0c..478a3f11 100644 --- a/web/src/pages/integration/list/index.tsx +++ b/web/src/pages/integration/list/index.tsx @@ -1,17 +1,34 @@ import { EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from '@ant-design/icons'; import { useLoading } from '@sa/hooks'; -import { Button, Dropdown, Input, Modal, Switch, Table, message } from 'antd'; +import { useSearchParams } from 'react-router-dom'; +import { Avatar, Button, Dropdown, Input, Switch, Table, Tabs, message } from 'antd'; -import { deleteIntegration, fetchIntegrations, updateIntegration, renewAPIToken } from '@/service/api/integration'; +import { deleteIntegration, fetchIntegrations, updateIntegration } from '@/service/api/integration'; import { formatESSearchResult } from '@/service/request/es'; import useQueryParams from '@/hooks/common/queryParams'; import { isFullscreen } from '../modules/EditForm'; import SvgIcon from '@/components/stateless/custom/SvgIcon'; +import './index.scss'; + +export const SEARCHBOX_TYPES = ['embedded', 'floating', 'all'] +export const FULLSCREEN_TYPES = ['page', 'modal'] export function Component() { const [queryParams, setQueryParams] = useQueryParams(); const { t } = useTranslation(); + const { addSharesToData, isEditorOwner, hasEdit, isResourceShare } = useResource(); + const resourceType = 'integration'; + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('coco#integration/read'), + create: hasAuth('coco#integration/create'), + update: hasAuth('coco#integration/update'), + delete: hasAuth('coco#integration/delete') + }; + const { tableWrapperRef } = useTableScroll(); const nav = useNavigate(); @@ -23,11 +40,40 @@ export function Component() { const { endLoading, loading, startLoading } = useLoading(); const [keyword, setKeyword] = useState(); - const fetchData = async (params) => { + // 用于判断 Webhooks 类型 + const isWebhook = (type?: string) => ['webhook', 'webhooks'].includes(String(type || '').toLowerCase()); + + const fetchData = async params => { startLoading(); - const res = await fetchIntegrations(params); - const newData = formatESSearchResult(res.data); - setData(newData); + const { tab, ...rest } = params + let filter + if (tab === 'fullscreen') { + filter = { + type: FULLSCREEN_TYPES + } + } else { + filter = { + type: SEARCHBOX_TYPES + } + } + const res = await fetchIntegrations({ + ...rest, + filter + }); + if (res?.data) { + const newData = formatESSearchResult(res.data); + if (newData.data.length > 0) { + const resources = newData.data.map(item => ({ + resource_id: item.id, + resource_type: resourceType + })); + const dataWithShares = await addSharesToData(newData.data, resources); + if (dataWithShares) { + newData.data = dataWithShares; + } + } + setData(newData); + } endLoading(); }; @@ -76,18 +122,83 @@ export function Component() { const columns = [ { dataIndex: 'name', - render: (value) => ( -
- - {value} -
- ), + minWidth: 150, + ellipsis: true, + render: (value, record) => { + const isShare = isResourceShare(record); + + let shareIcon; + + if (isShare) { + shareIcon = ( +
+ +
+ ); + } + + return ( +
+ + {value} + {shareIcon} +
+ ); + }, title: t('page.integration.columns.name') }, + { + dataIndex: 'owner', + title: t('page.datasource.labels.owner'), + render: (value, record) => { + if (!value) return '-'; + return ( +
+ + + +
+ ); + } + }, + { + dataIndex: 'shares', + title: t('page.datasource.labels.shares'), + render: (value, record) => { + if (!value) return '-'; + return ( + fetchData(queryParams)} + /> + ); + } + }, { dataIndex: 'type', render: value => { - return isFullscreen(value) ? t('page.integration.form.labels.type_fullscreen') : t('page.integration.form.labels.type_searchbox') + // Webhooks 优先匹配 + if (isWebhook(value)) { + return t('page.integration.tabs.webhooks'); + } + return t(`page.integration.form.labels.mode_${value}`) }, title: t('page.integration.columns.type') }, @@ -98,11 +209,13 @@ export function Component() { { dataIndex: 'datasource', render: (value, record) => { - if(record.datasource?.length){ + if (record.datasource?.length) { return record.datasource?.includes('*') ? '*' : value?.length || 0; } - if(record.enabled_module?.search?.datasource?.length){ - return record.enabled_module?.search?.datasource?.includes('*') ? '*' : record.enabled_module.search.datasource?.length || 0; + if (record.enabled_module?.search?.datasource?.length) { + return record.enabled_module?.search?.datasource?.includes('*') + ? '*' + : record.enabled_module.search.datasource?.length || 0; } return 0; }, @@ -114,7 +227,8 @@ export function Component() { return ( { window?.$modal?.confirm({ content: t(`page.integration.update.${checked ? 'enable' : 'disable'}_confirm`, { name: record.name }), @@ -130,32 +244,26 @@ export function Component() { }, title: t('page.integration.columns.enabled') }, - { - dataIndex: 'token_expire_in', - render: (value: number, record:any) => { - return value ? new Date(value * 1000).toISOString() : ''; - }, - title: t('page.integration.columns.token_expire_in') - }, { fixed: 'right', + hidden: !permissions.update && !permissions.delete, render: (_, record) => { - const items = [ - { + const items: MenuProps['items'] = []; + if (permissions.read && permissions.update && hasEdit(record)) { + items.push({ key: 'edit', label: t('common.edit') - }, - { + }); + } + if (permissions.delete && isEditorOwner(record)) { + items.push({ key: 'delete', label: t('common.delete') - }, - { - key: 'renew_token', - label: t('common.renew_token') - } - ]; - + }); + } + if (items.length === 0) return null; const onMenuClick = ({ key, record }: any) => { + // eslint-disable-next-line default-case switch (key) { case 'edit': nav(`/integration/edit/${record.id}`, { state: record }); @@ -170,16 +278,6 @@ export function Component() { title: t('common.tip') }); break; - case 'renew_token': - startLoading(); - renewAPIToken(record.id).then(res => { - if (res.data?.result === 'acknowledged') { - message.success(t('common.updateSuccess')); - } - }).finally(() => { - endLoading(); - }); - break; } }; return ( @@ -197,7 +295,7 @@ export function Component() { getCheckboxProps: record => ({ name: record.name }), - onChange: (selectedRowKeys: React.Key[], selectedRows) => {} + onChange: (selectedRowKeys: React.Key[], selectedRows) => { } }; useEffect(() => { @@ -205,50 +303,96 @@ export function Component() { }, [queryParams]); useEffect(() => { - setKeyword(queryParams.query) - }, [queryParams.query]) + setKeyword(queryParams.query); + }, [queryParams.query]); + + // 新增:Tabs 状态(与 settings 页面一致) + const [searchParams, setSearchParams] = useSearchParams(); + const items = [ + { + key: 'searchbox', + label: t('page.integration.form.labels.type_searchbox') + }, + { + key: 'fullscreen', + label: t('page.integration.form.labels.type_fullscreen') + } + // { + // key: 'webhooks', + // label: t('page.integration.tabs.webhooks'), + // } + ]; + const activeKey = useMemo(() => { + return searchParams.get('tab') || items[0].key; + }, [searchParams]); + const onTabChange = (key: string) => { + setSearchParams({ tab: key }); + }; + + // 新增:按当前 tab 过滤数据源 + const filteredData = useMemo(() => { + const list = data?.data || []; + if (activeKey === 'fullscreen') { + return { ...data, data: list.filter((item: any) => isFullscreen(item?.type)) }; + } + if (activeKey === 'searchbox') { + return { ...data, data: list.filter((item: any) => !isFullscreen(item?.type)) }; + } + if (activeKey === 'webhooks') { + return { ...data, data: list.filter((item: any) => isWebhook(item?.type)) }; + } + return data; + }, [data, activeKey]); return ( - - -
- } - className="max-w-500px" - enterButton={t('common.refresh')} - onSearch={onRefreshClick} - value={keyword} - onChange={(e) => setKeyword(e.target.value)} + + +
+ +
+ } + className='max-w-500px' + enterButton={t('common.refresh')} + value={keyword} + onChange={e => setKeyword(e.target.value)} + onSearch={onRefreshClick} + /> + {permissions.create && ( + + )} +
+
`${range[0]}-${range[1]} of ${total} items`, + total: data.total?.value || data?.total + }} + onChange={handleTableChange} /> - - -
`${range[0]}-${range[1]} of ${total} items`, - pageSize: queryParams.size, - current: Math.floor(queryParams.from / queryParams.size) + 1, - total: data.total?.value || data?.total, - showSizeChanger: true, - }} - onChange={handleTableChange} - /> - - + + + ); -} \ No newline at end of file +} diff --git a/web/src/pages/integration/modules/EditForm.tsx b/web/src/pages/integration/modules/EditForm.tsx index 0d514f74..1cf1c7e1 100644 --- a/web/src/pages/integration/modules/EditForm.tsx +++ b/web/src/pages/integration/modules/EditForm.tsx @@ -1,24 +1,36 @@ -import { SearchBoxForm } from "./SearchBoxForm"; -import { FullscreenForm } from "./FullscreenForm"; -import { Button, Form, Input, Radio, Select, Spin, Switch } from "antd"; -import { useRequest, useLoading } from '@sa/hooks'; -import { fetchDataSourceList } from "@/service/api"; +import { SearchBoxForm } from './SearchBoxForm'; +import { FullscreenForm } from './FullscreenForm'; +import { Button, Form, Input, Radio, Select, Spin, Switch } from 'antd'; +import { useLoading, useRequest } from '@sa/hooks'; +import { fetchDataSourceList } from '@/service/api'; import './EditForm.css'; -import { generateRandomString } from "@/utils/common"; +import { generateRandomString } from '@/utils/common'; +import { FULLSCREEN_TYPES, SEARCHBOX_TYPES } from '../list'; +import { getLocale, getLocaleOptions } from '@/store/slice/app'; export function isFullscreen(type) { - return ['page', 'modal', 'fullscreen'].includes(type) + return ['page', 'modal', 'fullscreen'].includes(type); } export const EditForm = memo(props => { - const { actionText, record, onSubmit } = props; - const [type, setType] = useState('searchbox'); + const { defaultType, actionText, record, onSubmit } = props; + const [type, setType] = useState(); const [form] = Form.useForm(); const { t } = useTranslation(); const { defaultRequiredRule } = useFormRules(); const { endLoading, loading, startLoading } = useLoading(); - const [assistants, setAssistants] = useState([]) - const [enabledList, setEnabledList] = useState({}) + const [assistants, setAssistants] = useState([]); + const [enabledList, setEnabledList] = useState({}); + const [guestEnabled, setGuestEnabled] = useState(false); + + const locale = useAppSelector(getLocale); + const localeOptions = useAppSelector(getLocaleOptions); + + const { hasAuth } = useAuth(); + + const permissions = { + fetchDataSources: hasAuth('coco#datasource/search') + }; const [startPagelogos, setStartPagelogos] = useState({ lightLoading: false, @@ -26,8 +38,8 @@ export const EditForm = memo(props => { light: undefined, darkLoading: false, darkList: [], - dark: undefined, - }) + dark: undefined + }); const [searchLogos, setSearchLogos] = useState({ lightLoading: false, @@ -35,16 +47,16 @@ export const EditForm = memo(props => { light: undefined, lightMobileLoading: false, lightMobileList: [], - 'light_mobile': undefined, - }) + light_mobile: undefined + }); const [aiOverviewLogo, setAIOverviewLogo] = useState({ lightLoading: false, lightList: [], - light: undefined, - }) + light: undefined + }); - const [widgetsLogo, setWidgetsLogo] = useState([]) + const [widgetsLogo, setWidgetsLogo] = useState([]); const { data: result, @@ -55,11 +67,19 @@ export const EditForm = memo(props => { }); useEffect(() => { - run({ - from: 0, - size: 10000 - }); - }, []); + if (defaultType) { + setType(defaultType) + } + }, [defaultType]) + + useEffect(() => { + if (permissions.fetchDataSources) { + run({ + from: 0, + size: 10000 + }); + } + }, [permissions.fetchDataSources]); const dataSource = useMemo(() => { return result?.hits?.hits?.map(item => ({ ...item._source })) || []; @@ -67,262 +87,321 @@ export const EditForm = memo(props => { const handleSubmit = async () => { const params = await form.validateFields(); - const { searchbox_mode, fullscreen_mode, cors = {}, enabled_module = {}, start_page = {}, payload = {} } = params; - const { search = {}, ai_chat = {} } = enabled_module - const { datasource = [] } = search - const { assistants = [] } = ai_chat - const { ai_overview = {}, ai_widgets = {} } = payload - onSubmit(type === 'fullscreen' ? { - ...params, - enabled_module: { - search: { - ...search, - enabled: true, - datasource: datasource?.includes('*') ? ['*'] : datasource, - } - }, - payload: { - ...payload, - ai_overview: { - ...ai_overview, - assistant: ai_overview?.assistant?.id, - logo: { - "light": aiOverviewLogo?.light, + const { searchbox_mode, fullscreen_mode, cors = {}, enabled_module = {}, start_page = {}, payload = {}, guest = {} } = params; + const { search = {}, ai_chat = {} } = enabled_module; + const { datasource = [] } = search; + const { assistants = [] } = ai_chat; + const { ai_overview = {}, ai_widgets = {} } = payload; + const formatGuest = { + ...guest, + run_as: guest.enabled && guest.run_as?.id ? guest.run_as?.id : undefined + } + onSubmit( + type === 'fullscreen' + ? { + ...params, + guest: formatGuest, + enabled_module: { + search: { + ...search, + enabled: true, + datasource: datasource?.includes('*') ? ['*'] : datasource } }, - ai_widgets: { - ...ai_widgets, - widgets: ai_widgets.widgets? ai_widgets.widgets.map((item, index) => ({ - ...item, - assistant: item.assistant?.id, + payload: { + ...payload, + ai_overview: { + ...ai_overview, + assistant: ai_overview?.assistant?.id, logo: { - "light": widgetsLogo[index]?.light + light: aiOverviewLogo?.light } - })) : [] - }, - "logo": { - "light": searchLogos?.light, - "light_mobile": searchLogos?.light_mobile + }, + ai_widgets: { + ...ai_widgets, + widgets: ai_widgets.widgets + ? ai_widgets.widgets.map((item, index) => ({ + ...item, + assistant: item.assistant?.id, + logo: { + light: widgetsLogo[index]?.light + } + })) + : [] + }, + logo: { + light: searchLogos?.light, + light_mobile: searchLogos?.light_mobile + } }, - }, - cors: { - ...cors, - allowed_origins: cors.allowed_origins?.trim() ? cors.allowed_origins.trim().split(',') : [] - }, - type: fullscreen_mode - } : { - ...params, - enabled_module: { - ...enabled_module, - search: { - ...search, - datasource: datasource?.includes('*') ? ['*'] : datasource + cors: { + ...cors, + allowed_origins: cors.allowed_origins?.trim() ? cors.allowed_origins.trim().split(',') : [] }, - ai_chat: { - ...ai_chat, - assistants: assistants.map((item) => item.id), - start_page_config: { - ...start_page, - "display_assistants": start_page?.display_assistants?.map((item) => item.id), - "logo": { - "light": startPagelogos.light, - "dark": startPagelogos.dark - }, + type: fullscreen_mode + } + : { + ...params, + guest: formatGuest, + enabled_module: { + ...enabled_module, + search: { + ...search, + datasource: datasource?.includes('*') ? ['*'] : datasource + }, + ai_chat: { + ...ai_chat, + assistants: assistants.map(item => item.id), + start_page_config: { + ...start_page, + display_assistants: start_page?.display_assistants?.map(item => item.id), + logo: { + light: startPagelogos.light, + dark: startPagelogos.dark + } + } } - } - }, - cors: { - ...cors, - allowed_origins: cors.allowed_origins?.trim() ? cors.allowed_origins.trim().split(',') : [] + }, + cors: { + ...cors, + allowed_origins: cors.allowed_origins?.trim() ? cors.allowed_origins.trim().split(',') : [] + }, + type: searchbox_mode }, - type: searchbox_mode - }, startLoading, endLoading ); }; - const initValue = (record) => { - setType(isFullscreen(record?.type) ? 'fullscreen': 'searchbox') - if (isFullscreen(record?.type)) { - if (record) { - setSearchLogos((state) => ({ ...state, ...(record.payload?.logo || {}) })) - setAIOverviewLogo((state) => ({ ...state, ...(record.payload?.ai_overview?.logo || {}) })) - setWidgetsLogo(record.payload?.ai_widgets?.widgets ? record.payload?.ai_widgets?.widgets.map((item) => item.logo) : []) - } - const initValue = record - ? { - ...record, - enabled_module: { - ...(record.enabled_module || {}), - search: record.enabled_module?.search ? { - ...(record.enabled_module?.search || {}), - enabled: true, - datasource: record.enabled_module?.search?.datasource?.includes('*') ? ['*'] : record.enabled_module?.search?.datasource - } : { - enabled: true, - datasource: ['*'], - placeholder: 'Search whatever you want...' - } + const initValue = (record, type, locale) => { + setGuestEnabled(!!record.guest?.enabled) + const commonValues = { + cors: { + ...(record.cors || {}), + allowed_origins: record.cors?.allowed_origins ? record.cors?.allowed_origins.join(',') : '' + }, + guest: { + ...(record.guest || {}), + run_as: record.guest?.enabled && record.guest?.run_as ? { id: record.guest?.run_as } : undefined + }, + appearance: { + ...(record.appearance || {}), + theme: record.appearance?.theme || 'auto', + language: record.appearance?.language || locale + }, + } + if (type === 'fullscreen') { + setSearchLogos(state => ({ ...state, ...(record.payload?.logo || {}) })); + setAIOverviewLogo(state => ({ ...state, ...(record.payload?.ai_overview?.logo || {}) })); + setWidgetsLogo( + record.payload?.ai_widgets?.widgets ? record.payload?.ai_widgets?.widgets.map(item => item.logo) : [] + ); + const initValue = { + ...record, + ...commonValues, + enabled_module: { + ...(record.enabled_module || {}), + search: record.enabled_module?.search + ? { + ...(record.enabled_module?.search || {}), + enabled: true, + datasource: record.enabled_module?.search?.datasource?.includes('*') + ? ['*'] + : record.enabled_module?.search?.datasource + } + : { + enabled: true, + datasource: ['*'], + placeholder: 'Search whatever you want...' + } + }, + payload: { + ...(record.payload || {}), + ai_overview: record.payload?.ai_overview + ? { + ...record.payload?.ai_overview, + assistant: { id: record.payload?.ai_overview.assistant } + } + : { + enabled: true, + title: 'AI Overview', + height: 200, + output: 'markdown' }, - payload: { - ...(record.payload || {}), - ai_overview: record.payload?.ai_overview ? { - ...record.payload?.ai_overview, - assistant: { id: record.payload?.ai_overview.assistant } - } : { - enabled: true, - title: 'AI Overview', - height: 200, - output: 'markdown' - }, - ai_widgets: record.payload?.ai_widgets ? { - ...record.payload.ai_widgets, - widgets: record.payload?.ai_widgets.widgets ? record.payload?.ai_widgets.widgets.map((item) => ({ + ai_widgets: record.payload?.ai_widgets + ? { + ...record.payload.ai_widgets, + widgets: record.payload?.ai_widgets.widgets + ? record.payload?.ai_widgets.widgets.map(item => ({ ...item, assistant: { id: item.assistant } - })) : [] - } : { - enabled: true, - widgets: [] - } - }, - cors: { - ...(record.cors || {}), - allowed_origins: record.cors?.allowed_origins ? record.cors?.allowed_origins.join(',') : '' - }, - type: 'fullscreen', - fullscreen_mode: ['page', 'modal'].includes(record?.type) ? record?.type : 'page' - } - : { - access_control: { - authentication: true, - chat_history: true - }, - appearance: { - theme: 'auto' - }, - cors: { - allowed_origins: '*', - enabled: true - }, - enabled_module: { - search: { - enabled: true, - datasource: ['*'], - placeholder: 'Search whatever you want...' - } - }, - payload: { - ai_overview: { - enabled: true, - title: 'AI Overview', - height: 200 - }, - ai_widgets: { - enabled: true, - widgets: [] - } - }, - name: `widget-${generateRandomString(8)}`, - enabled: true, - type: 'fullscreen', - fullscreen_mode: 'page' - } + })) + : [] + } + : { + enabled: true, + widgets: [] + } + }, + type: 'fullscreen', + fullscreen_mode: FULLSCREEN_TYPES.includes(record?.type) ? record?.type : FULLSCREEN_TYPES[0], + }; setEnabledList({ search: true, ai_overview: initValue.payload?.ai_overview?.enabled, ai_widgets: initValue.payload?.ai_widgets?.enabled - }) + }); form.setFieldsValue(initValue); } else { - if (record) { - setStartPagelogos((state) => ({ ...state, ...(record.enabled_module?.ai_chat?.start_page_config?.logo || {}) })) - setAssistants(record?.enabled_module?.ai_chat?.assistants ? record?.enabled_module?.ai_chat?.assistants.map((item) => ({ - id: item - })) : []) - } - const initValue = record - ? { - ...record, - enabled_module: { - ...(record.enabled_module || {}), - search: record.enabled_module?.search ? { - ...(record.enabled_module?.search || {}), - datasource: record.enabled_module?.search?.datasource?.includes('*') ? ['*'] : record.enabled_module?.search?.datasource - } : { - enabled: true, - datasource: ['*'], - placeholder: 'Search whatever you want...' - }, - ai_chat: record.enabled_module?.ai_chat ? { - ...(record.enabled_module?.ai_chat || {}), - assistants: record.enabled_module?.ai_chat?.assistants ? record.enabled_module?.ai_chat?.assistants.map((item) => ({ - id: item - })) : [] - } : { - enabled: true, - placeholder: 'Ask whatever you want...' - } - }, - cors: { - ...(record.cors || {}), - allowed_origins: record.cors?.allowed_origins ? record.cors?.allowed_origins.join(',') : '' - }, - start_page: { - ...(record.enabled_module?.ai_chat?.start_page_config || {}), - display_assistants: record.enabled_module?.ai_chat?.start_page_config?.display_assistants ? record.enabled_module?.ai_chat?.start_page_config?.display_assistants.map((item) => ({ - id: item - })) : [] - }, - type: 'searchbox', - searchbox_mode: ['embedded', 'floating', 'all'].includes(record?.type) ? record?.type : 'embedded' - } - : { - access_control: { - authentication: true, - chat_history: true - }, - appearance: { - theme: 'auto' - }, - cors: { - allowed_origins: '*', - enabled: true - }, - enabled_module: { - ai_chat: { - enabled: true, - placeholder: 'Ask whatever you want...' - }, - features: ['search_active', 'think_active'], - search: { - enabled: true, - datasource: ['*'], - placeholder: 'Search whatever you want...' - } - }, - hotkey: 'ctrl+/', - name: `widget-${generateRandomString(8)}`, - enabled: true, - options: { - embedded_placeholder: 'Search...', - floating_placeholder: 'Ask AI' + setStartPagelogos(state => ({ ...state, ...(record.enabled_module?.ai_chat?.start_page_config?.logo || {}) })); + setAssistants( + record?.enabled_module?.ai_chat?.assistants + ? record?.enabled_module?.ai_chat?.assistants.map(item => ({ + id: item + })) + : [] + ); + const initValue = { + ...record, + ...commonValues, + enabled_module: { + ...(record.enabled_module || {}), + search: record.enabled_module?.search + ? { + ...(record.enabled_module?.search || {}), + datasource: record.enabled_module?.search?.datasource?.includes('*') + ? ['*'] + : record.enabled_module?.search?.datasource + } + : { + enabled: true, + datasource: ['*'], + placeholder: 'Search whatever you want...' }, - type: 'searchbox', - searchbox_mode: 'embedded' - }; + ai_chat: record.enabled_module?.ai_chat + ? { + ...(record.enabled_module?.ai_chat || {}), + assistants: record.enabled_module?.ai_chat?.assistants + ? record.enabled_module?.ai_chat?.assistants.map(item => ({ + id: item + })) + : [] + } + : { + enabled: true, + placeholder: 'Ask whatever you want...' + } + }, + start_page: { + ...(record.enabled_module?.ai_chat?.start_page_config || {}), + display_assistants: record.enabled_module?.ai_chat?.start_page_config?.display_assistants + ? record.enabled_module?.ai_chat?.start_page_config?.display_assistants.map(item => ({ + id: item + })) + : [] + }, + type: 'searchbox', + searchbox_mode: SEARCHBOX_TYPES.includes(record?.type) ? record?.type : SEARCHBOX_TYPES[0], + } setEnabledList({ search: initValue.enabled_module?.search?.enabled, - ai_chat: initValue.enabled_module?.ai_chat?.enabled, - }) + ai_chat: initValue.enabled_module?.ai_chat?.enabled + }); form.setFieldsValue(initValue); } - } + }; useEffect(() => { - initValue(record) - }, [record]) + if (record) { + initValue(record, type, locale); + } else { + if (type === 'fullscreen') { + const initValue = { + access_control: { + authentication: true, + chat_history: true + }, + appearance: { + theme: 'auto', + language: locale + }, + cors: { + allowed_origins: '*', + enabled: true + }, + enabled_module: { + search: { + enabled: true, + datasource: ['*'], + placeholder: 'Search whatever you want...' + } + }, + payload: { + ai_overview: { + enabled: true, + title: 'AI Overview', + height: 200 + }, + ai_widgets: { + enabled: true, + widgets: [] + } + }, + name: `widget-${generateRandomString(8)}`, + enabled: true, + type: 'fullscreen', + fullscreen_mode: 'page' + } + setEnabledList({ + search: true, + ai_overview: initValue.payload?.ai_overview?.enabled, + ai_widgets: initValue.payload?.ai_widgets?.enabled + }); + form.setFieldsValue(initValue); + } else { + const initValue = { + access_control: { + authentication: true, + chat_history: true + }, + appearance: { + theme: 'auto', + language: locale + }, + cors: { + allowed_origins: '*', + enabled: true + }, + enabled_module: { + ai_chat: { + enabled: true, + placeholder: 'Ask whatever you want...' + }, + features: ['search_active', 'think_active'], + search: { + enabled: true, + datasource: ['*'], + placeholder: 'Search whatever you want...' + } + }, + hotkey: 'ctrl+/', + name: `widget-${generateRandomString(8)}`, + enabled: true, + options: { + embedded_placeholder: 'Search...', + floating_placeholder: 'Ask AI' + }, + type: 'searchbox', + searchbox_mode: 'embedded' + }; + setEnabledList({ + search: initValue.enabled_module?.search?.enabled, + ai_chat: initValue.enabled_module?.ai_chat?.enabled + }); + form.setFieldsValue(initValue); + } + } + }, [record, type, locale]); const itemClassNames = '!w-496px'; @@ -331,8 +410,8 @@ export const EditForm = memo(props => { { > - + - { - const type = e.target.value - setType(type) + onChange={e => { + const type = e.target.value; + setType(type); if (type === 'fullscreen' && !enabledList?.search) { - setEnabledList((state) => ({ ...state, search: true })) + setEnabledList(state => ({ ...state, search: true })); } }} /> - - { - ( - type === 'searchbox' ? ( - - ) : ( - - ) - ) - } + */} + {type === 'searchbox' ? ( + + ) : ( + + )} - + setGuestEnabled(checked)}/> + { + guestEnabled && ( + <> +
{t('page.integration.form.hints.tourist_mode')}
+ + + + + ) + }
-
- {t('page.integration.form.labels.theme')} -
+
{t('page.integration.form.labels.theme')}
({ value: item.key, label: item.label }))} + /> +
- + -
- {t('page.integration.form.labels.allow_origin')} -
+
{t('page.integration.form.labels.allow_origin')}
{ - + + {permissions.create && ( + + )} columns={columns} dataSource={data.data} loading={loading} - rowKey="id" + rowKey='id' rowSelection={{ ...rowSelection }} - size="middle" + size='middle' pagination={{ - current: Math.floor(queryParams.from / queryParams.size) + 1, - pageSize: queryParams.size, - showSizeChanger: true, showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`, - total: data.total?.value || data?.total + pageSize: queryParams.size, + current: Math.floor(queryParams.from / queryParams.size) + 1, + total: data.total?.value || data?.total, + showSizeChanger: true }} onChange={handleTableChange} /> diff --git a/web/src/pages/model-provider/list/index.tsx b/web/src/pages/model-provider/list/index.tsx index 1ac90f2c..f0d2e628 100644 --- a/web/src/pages/model-provider/list/index.tsx +++ b/web/src/pages/model-provider/list/index.tsx @@ -1,12 +1,12 @@ -import Icon, { +import { + EllipsisOutlined, ExclamationCircleOutlined, ExportOutlined, FilterOutlined, PlusOutlined, SettingOutlined } from '@ant-design/icons'; -import type { MenuProps } from 'antd'; -import { Button, Dropdown, Form, Image, Input, List, Modal, Spin, Switch, Tag, message } from 'antd'; +import { Avatar, Button, Dropdown, Form, Input, List, Modal, Spin, Switch, Table, message } from 'antd'; import Search from 'antd/es/input/Search'; import type { IntegratedStoreModalRef } from '@/components/common/IntegratedStoreModal'; @@ -16,46 +16,86 @@ import { deleteModelProvider, searchModelPovider, updateModelProvider } from '@/ import { formatESSearchResult } from '@/service/request/es'; export function Component() { + const type = 'table'; + const [queryParams, setQueryParams] = useQueryParams({ - size: 12, + size: type === 'table' ? 10 : 12, sort: [ ['enabled', 'desc'], ['created', 'desc'] ] }); + + const { addSharesToData, isEditorOwner, hasEdit, isResourceShare } = useResource(); + const resourceType = 'llm-provider'; + const { t } = useTranslation(); const nav = useNavigate(); const [data, setData] = useState({ - data: [], - total: 0 + total: 0, + data: [] }); const [loading, setLoading] = useState(false); const [keyword, setKeyword] = useState(); - const fetchData = () => { + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('coco#model_provider/read'), + create: hasAuth('coco#model_provider/create'), + update: hasAuth('coco#model_provider/update'), + delete: hasAuth('coco#model_provider/delete') + }; + + const fetchData = async queryParams => { setLoading(true); - searchModelPovider(queryParams) - .then(data => { - const newData = formatESSearchResult(data.data); - setData(newData); - }) - .finally(() => { - setLoading(false); - }); + const res = await searchModelPovider(queryParams); + if (res?.data) { + const newData = formatESSearchResult(res?.data); + if (newData.data.length > 0) { + const resources = newData.data.map(item => ({ + resource_id: item.id, + resource_type: resourceType + })); + const dataWithShares = await addSharesToData(newData.data, resources); + if (dataWithShares) { + newData.data = dataWithShares; + } + } + setData(newData); + } + setLoading(false); }; - useEffect(fetchData, [queryParams]); + + useEffect(() => { + fetchData(queryParams); + }, [queryParams]); useEffect(() => { setKeyword(queryParams.query); }, [queryParams.query]); const onSearchClick = (query: string) => { - setQueryParams({ - ...queryParams, - query, - t: new Date().valueOf() + setQueryParams(oldParams => { + return { + ...oldParams, + from: query === oldParams.query ? oldParams.from : 0, + query, + t: new Date().valueOf() + }; + }); + }; + + const handleTableChange = pagination => { + setQueryParams(params => { + return { + ...params, + from: (pagination.current - 1) * pagination.pageSize, + size: pagination.pageSize + }; }); }; + const onPageChange = (page: number, pageSize: number) => { setQueryParams((oldParams: any) => { return { @@ -65,21 +105,28 @@ export function Component() { }; }); }; - const getMenuItems = useCallback((record: any): MenuProps['items'] => { - const items: MenuProps['items'] = [ - { - key: '1', - label: t('common.edit') - } - ]; - if (record.builtin !== true) { + const getMenuItems = (record: any) => { + const items = []; + if (permissions.read && permissions.update && hasEdit(record)) { items.push({ - key: '2', - label: t('common.delete') + label: t('common.edit'), + key: '1' + }); + } + if (permissions.update && hasEdit(record)) { + items.push({ + label: 'API-key', + key: '3' + }); + } + if (permissions.delete && record.builtin !== true && isEditorOwner(record)) { + items.push({ + label: t('common.delete'), + key: '2' }); } return items; - }, []); + }; const onMenuClick = ({ key, record }: any) => { switch (key) { @@ -100,14 +147,16 @@ export function Component() { }; }); }); - }, - title: t('common.tip') + } }); break; case '1': nav(`/model-provider/edit/${record.id}`); break; + case '3': + onAPIKeyClick(record); + break; } }; const onItemEnableChange = (record: any, checked: boolean) => { @@ -146,7 +195,7 @@ export function Component() { const [open, setOpen] = useState(false); const onOkClick = () => { setOpen(false); - fetchData(); + fetchData(queryParams); }; const onCancelClick = () => { setOpen(false); @@ -157,110 +206,281 @@ export function Component() { setOpen(true); }; + const columns = [ + { + dataIndex: 'name', + minWidth: 150, + ellipsis: true, + render: (value, record) => { + const isShare = isResourceShare(record); + + let shareIcon; + + if (isShare) { + shareIcon = ( +
+ +
+ ); + } + + return ( +
+ {record.icon && ( + + + + )} + {permissions.read && permissions.update && hasEdit(record) ? ( + nav(`/model-provider/edit/${record.id}`)} + > + {value} + + ) : ( + {value} + )} + {record.builtin === true && ( +
+

+ {t('page.modelprovider.labels.builtin')} +

+
+ )} + {shareIcon} +
+ ); + }, + title: t('page.integration.columns.name') + }, + { + dataIndex: 'owner', + title: t('page.datasource.labels.owner'), + width: 200, + render: (value, record) => { + if (!value) return '-'; + return ( +
+ + + +
+ ); + } + }, + { + dataIndex: 'shares', + title: t('page.datasource.labels.shares'), + width: 150, + render: (value, record) => { + if (!value) return '-'; + return ( + fetchData(queryParams)} + /> + ); + } + }, + { + title: t('page.assistant.labels.description'), + minWidth: 200, + dataIndex: 'description', + render: (value, record) => { + return {value}; + }, + ellipsis: true + }, + { + dataIndex: 'enabled', + title: t('page.assistant.labels.enabled'), + width: 80, + render: (value, record) => { + return ( + onItemEnableChange(record, v)} + /> + ); + } + }, + { + title: t('common.operation'), + fixed: 'right', + width: '90px', + hidden: !permissions.update && !permissions.delete, + render: (_, record) => { + const items = getMenuItems(record); + if (items.length === 0) return null; + return ( + onMenuClick({ key, record }) }}> + + + ); + } + } + ]; + // rowSelection object indicates the need for row selection + const rowSelection = { + getCheckboxProps: record => ({ + name: record.name + }), + onChange: (selectedRowKeys: React.Key[], selectedRows) => {} + }; + const integratedStoreModalRef = useRef(null); return ( -
+
} - className="max-w-500px" + className='max-w-500px' enterButton={t('common.refresh')} value={keyword} onChange={e => setKeyword(e.target.value)} onSearch={onSearchClick} /> - + {permissions.create && ( + + )}
- `${range[0]}-${range[1]} of ${total} items`, - total: data.total?.value || data?.total - }} - renderItem={provider => ( - -
-
-
-
- - `${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size, + current: Math.floor(queryParams.from / queryParams.size) + 1, + total: data.total?.value || data?.total, + showSizeChanger: true + }} + onChange={handleTableChange} + /> + ) : ( + `${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size, + current: Math.floor(queryParams.from / queryParams.size) + 1, + total: data.total?.value || data?.total, + showSizeChanger: true, + pageSizeOptions: [12, 24, 48, 96] + }} + renderItem={provider => { + const operations = getMenuItems(provider); + return ( + +
+
+
+
+ + + + {permissions.read && permissions.update && hasEdit(provider) ? ( + nav(`/model-provider/edit/${provider.id}`)} + > + {provider.name} + + ) : ( + {provider.name} + )} +
+ {provider.builtin === true && ( +
+

+ {t('page.modelprovider.labels.builtin')} +

+
+ )} +
+
+ onItemEnableChange(provider, v)} /> - - nav(`/model-provider/edit/${provider.id}`)} - > - {provider.name} - -
- {provider.builtin === true && ( -
-

- {t('page.modelprovider.labels.builtin')} -

- )} -
-
- onItemEnableChange(provider, v)} - /> -
-
-
{provider.description}
-
-
-
{ - onAPIKeyClick(provider); - }} - > - API-key
-
- onMenuClick({ key, record: provider }) - }} - > - - +
{provider.description}
+
+
+ {permissions.update && hasEdit(provider) && ( +
{ + onAPIKeyClick(provider); + }} + > + API-key +
+ )} + {operations?.length > 0 && ( +
+ onMenuClick({ key, record: provider }) }} + > + + +
+ )} +
-
-
-
- )} - /> + + ); + }} + /> + )} {}, onOkClick = () => {}, open = false, record = {} }) => { +const APIKeyComponent = ({ record = {}, onOkClick = () => {}, open = false, onCancelClick = () => {} }) => { const { t } = useTranslation(); const [form] = Form.useForm(); useEffect(() => { @@ -346,23 +566,23 @@ const APIKeyComponent = ({ onCancelClick = () => {}, onOkClick = () => {}, open >
{t('page.modelprovider.labels.api_key')}} - name="api_key" + label={{t('page.modelprovider.labels.api_key')}} + name='api_key' > {apiHref && (
+ + + + ); +}); diff --git a/web/src/pages/role/modules/Permissions.module.less b/web/src/pages/role/modules/Permissions.module.less new file mode 100644 index 00000000..3dc287d1 --- /dev/null +++ b/web/src/pages/role/modules/Permissions.module.less @@ -0,0 +1,42 @@ +.permissions { + + :global { + .ant-collapse-header { + padding-right: 18px !important; + } + + .ant-collapse-content-box { + padding: 0px 10px 0px 36px !important; + } + + .ant-table th { + background: transparent !important; + } + + .ant-table th, .ant-table td { + margin-left: 0 !important; + } + + .ant-table th::before { + display: none; + } + + .ant-table-tbody tr:last-child td { + border: 0 !important; + } + } + + .count { + margin-right: 20px; + } + + .operations { + :global { + .ant-checkbox-wrapper { + margin-left: 0 !important; + margin-right: 8px !important; + line-height: 34px !important; + } + } + } +} \ No newline at end of file diff --git a/web/src/pages/role/modules/Permissions.tsx b/web/src/pages/role/modules/Permissions.tsx new file mode 100644 index 00000000..6d3fc408 --- /dev/null +++ b/web/src/pages/role/modules/Permissions.tsx @@ -0,0 +1,290 @@ +import { Checkbox, Collapse, Spin, Table } from 'antd'; +import type { Key } from 'react'; +import { useEffect, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { fetchPermissions } from '@/service/api/security'; + +import styles from './Permissions.module.less'; + +interface PermissionsProps { + readonly value?: { feature?: string[] }; + readonly onChange?: (value: { feature?: string[] }) => void; + readonly filters?: { feature?: string[] }; +} + +type FeatureItem = { + id: string; + category: string; + resource: string; + action: string; +}; + +export default function Permissions(props: PermissionsProps) { + const { value = {}, onChange, filters } = props; + const { feature: filterFeatures } = filters || {}; + const { feature = [] } = value; + const [loading, setLoading] = useState(false); + const [features, setFeatures] = useState([]); + const { t } = useTranslation(); + + // eslint-disable-next-line @typescript-eslint/no-shadow + const handleCheckAll = (checked: boolean, operations: any[], feature: string[]) => { + const newFeature = [...feature]; + if (checked) { + operations.forEach((o: { id: any }) => { + const index = newFeature.indexOf(o.id); + if (index === -1) { + newFeature.push(o.id); + } + }); + } else { + operations.forEach((o: { id: any }) => { + const index = newFeature.indexOf(o.id); + if (index !== -1) { + newFeature.splice(index, 1); + } + }); + } + if (onChange) { + onChange({ + ...value, + feature: newFeature + }); + } + }; + + // eslint-disable-next-line @typescript-eslint/no-shadow + const handleCheck = (checked: boolean, item: { id: any }, feature: string[]) => { + const newFeature = [...feature]; + const index = newFeature.indexOf(item.id); + if (checked) { + if (index === -1) { + newFeature.push(item.id); + } + } else if (index !== -1) { + newFeature.splice(index, 1); + } + if (onChange) { + onChange({ + ...value, + feature: newFeature + }); + } + }; + + const getFeatures = async () => { + try { + setLoading(true); + + const res: any = await fetchPermissions(); + if (Array.isArray(res.data)) { + setFeatures(res.data); + + // eslint-disable-next-line prettier/prettier + const filteredFeatures = feature.filter(item => + res.data.some((r: { id: string }) => r.id === item) + ); + + if (onChange) { + onChange({ + ...value, + feature: filteredFeatures + }); + } + } else { + setFeatures([]); + } + } catch (error) { + console.error(error); + setFeatures([]); + } finally { + setLoading(false); + } + }; + + // eslint-disable-next-line @typescript-eslint/no-shadow + const buildTreeData = (features: FeatureItem[], filters?: string[]) => { + const treeData: Array<{ key: string; data: Array<{ object: string; operations: FeatureItem[] }> }> = []; + features + .filter(item => { + if (!item.category) return false; + if (Array.isArray(filters) && filters.length > 0) { + return filters.includes(item.id); + } + return true; + }) + .forEach(item => { + // 新格式按 category → resource 分组 + const root = item.category; + const subRoot = item.resource; + // eslint-disable-next-line @typescript-eslint/no-shadow + const index = treeData.findIndex(t => t.key === root); + if (index === -1) { + treeData.push({ + key: root, + data: [ + { + object: subRoot, + operations: [item] + } + ] + }); + } else { + // eslint-disable-next-line @typescript-eslint/no-shadow + const subIndex = treeData[index].data.findIndex(t => t.object === subRoot); + if (subIndex === -1) { + treeData[index].data.push({ + object: subRoot, + operations: [item] + }); + } else { + treeData[index].data[subIndex].operations.push(item); + } + } + }); + return treeData; + }; + + // eslint-disable-next-line @typescript-eslint/no-shadow + const renderCount = (item: { key?: string; data: any }, feature: string | any[]) => { + let total = 0; + let checked = 0; + const operations: any[] = []; + item.data?.forEach((d: { operations: any[]; children: any[] }) => { + d.operations?.forEach((o: { id: any }) => { + // eslint-disable-next-line no-plusplus + total++; + operations.push(o); + if (feature.includes(o.id)) { + // eslint-disable-next-line no-plusplus + checked++; + } + }); + d.children?.forEach((c: { operations: any[] }) => { + c.operations?.forEach((o: { id: any }) => { + // eslint-disable-next-line no-plusplus + total++; + operations.push(o); + if (feature.includes(o.id)) { + // eslint-disable-next-line no-plusplus + checked++; + } + }); + }); + }); + return ( + <> + {`${checked}/${total}`} + 0 && checked !== total} + onChange={e => handleCheckAll(e.target.checked, operations, feature as string[])} + onClick={e => { + e.stopPropagation(); + }} + /> + + ); + }; + + useEffect(() => { + getFeatures(); + }, []); + + const treeData = useMemo(() => { + return buildTreeData(features, filterFeatures); + }, [features, filterFeatures]); + + const items = useMemo(() => { + return treeData.map(item => { + const featureComponent = ( +
{ + // 显示 resource 的文案 + return t(`permission.${text}`); + } + }, + { + key: 'operations', + dataIndex: 'operations', + title: t('common.operation'), + className: styles.operations, + render: ops => { + // 每个 operation 是一个 { id, category, resource, action } + return ops?.map((op: { id: Key | null | undefined }) => { + const label = t(`permission.${op.id}`); + return ( + handleCheck(e.target.checked, op, feature)} + > + {label} + + ); + }); + } + }, + { + key: 'checkAll', + dataIndex: 'checkAll', + title: '', + width: 16, + render: (_text, record) => { + let total = 0; + let checked = 0; + const operations = record.operations || []; + operations.forEach(o => { + // eslint-disable-next-line no-plusplus + total++; + if (feature.includes(o.id)) { + // eslint-disable-next-line no-plusplus + checked++; + } + }); + return ( + 0 && checked !== total} + onChange={e => handleCheckAll(e.target.checked, operations, feature)} + /> + ); + } + } + ]} + /> + ); + return { + key: item.key, + label:
{t(`page.role.labels.${item.key}`)}
, + extra: renderCount(item, feature), + children: featureComponent + }; + }); + }, [treeData, feature, t]); + + // 早退放在所有 Hook 之后 + if (loading) { + return ; + } + + return ( + + ); +} diff --git a/web/src/pages/role/new/index.tsx b/web/src/pages/role/new/index.tsx new file mode 100644 index 00000000..d8d56338 --- /dev/null +++ b/web/src/pages/role/new/index.tsx @@ -0,0 +1,44 @@ +import { createRole } from '@/service/api/security'; + +import { EditForm } from '../modules/EditForm'; + +export function Component() { + const { t } = useTranslation(); + const nav = useNavigate(); + + const onSubmit = async (params: any, before?: () => void, after?: () => void) => { + if (before) before(); + const data = { + ...params, + grants: { + permissions: params.permission.feature + } + }; + const res = await createRole(data); + if (res?.data?.result === 'created') { + window.$message?.success(t('common.addSuccess')); + nav(`/security?tab=role`); + } + if (after) after(); + }; + + return ( +
+ +
+
+
{t(`page.role.new.title`)}
+
+
+ +
+ +
+ ); +} diff --git a/web/src/pages/security/index.scss b/web/src/pages/security/index.scss new file mode 100644 index 00000000..b57b4418 --- /dev/null +++ b/web/src/pages/security/index.scss @@ -0,0 +1,68 @@ +.settings-tabs { + .ant-tabs-nav { + margin-bottom: 0px; + height: 40px; + } + .ant-tabs-ink-bar { + height: 4px !important; + } + .ant-tabs-nav-wrap { + padding-left: 16px; + padding-right: 16px; + } + .ant-tabs-tab { + padding-left: 8px; + padding-right: 8px; + } + .ant-tabs-tab:not(:first-child) { + margin-left: 38px; + } + .ant-tabs-content { + display: none; + min-height: calc(100vh - 176px); + height: auto; + padding: 0px 24px; + } +} + +.settings-tabs-content { + min-height: calc(100vh - 176px); + height: auto; + padding: 12px 16px; + display: flex; + flex-direction: column; +} + +.settings-tabs-content > div { + flex: 1; + width: 100%; +} + +.settings-form { + & > .ant-form-item > .ant-row { + & > .ant-form-item-label { + width: 160px; + } + & > .ant-form-item-control { + max-width: 520px; + } + } + .deepseek-icon > div > div { + font-size: 32px; + padding-top: 3px; + margin-right: -8px; + } + .sub-form-item { + .ant-form-item-label > label { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); + } + } +} + +.settings-form-help { + color: var(--ant-color-text-description); + font-size: var(--ant-font-size); + line-height: var(--ant-line-height); +} \ No newline at end of file diff --git a/web/src/pages/security/index.tsx b/web/src/pages/security/index.tsx new file mode 100644 index 00000000..f860c1e4 --- /dev/null +++ b/web/src/pages/security/index.tsx @@ -0,0 +1,75 @@ +import { Tabs } from "antd"; + +import Auth from "./modules/Auth"; +import Role from "./modules/Role"; + +import "./index.scss"; +import User from "./modules/User"; +import { getProviderInfo } from "@/store/slice/server"; + +export function Component() { + const [searchParams, setSearchParams] = useSearchParams(); + const { t } = useTranslation(); + + const { hasAuth } = useAuth(); + + const permissions = { + viewAuth: hasAuth("generic#security:authorization/search"), + viewUser: hasAuth("generic#security:user/search"), + viewRole: hasAuth("generic#security:role/search"), + }; + + const providerInfo = useAppSelector(getProviderInfo); + + const onChange = (key: string) => { + setSearchParams({ tab: key }); + }; + + const items: any[] = []; + + if (permissions.viewAuth && providerInfo?.managed) { + items.push({ + component: Auth, + key: "auth", + label: t(`page.auth.title`), + }); + } + + if (permissions.viewUser && !providerInfo?.managed) { + items.push({ + component: User, + key: "user", + label: t(`page.user.title`), + }); + } + + if (permissions.viewRole) { + items.push({ + component: Role, + key: "role", + label: t(`page.role.title`), + }); + } + + const activeKey = useMemo(() => { + return searchParams.get("tab") || items?.[0]?.key; + }, []); + + const activeItem = useMemo(() => { + return items.find((item) => item.key === activeKey); + }, [activeKey]); + + return ( + + +
+ {activeItem?.component ? : null} +
+
+ ); +} diff --git a/web/src/pages/security/modules/Auth.tsx b/web/src/pages/security/modules/Auth.tsx new file mode 100644 index 00000000..0edfe064 --- /dev/null +++ b/web/src/pages/security/modules/Auth.tsx @@ -0,0 +1,222 @@ +import { EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from '@ant-design/icons'; +import { useLoading } from '@sa/hooks'; +import { Button, Dropdown, Input, Table, Tag, Typography, message } from 'antd'; +import dayjs from 'dayjs'; +import type { TableColumnsType, TableProps } from 'antd'; + +import useQueryParams from '@/hooks/common/queryParams'; +import { deleteAuthorization, fetchAuthorizationSearch } from '@/service/api/security'; +import { formatESSearchResult } from '@/service/request/es'; + +const Auth = () => { + const [queryParams, setQueryParams] = useQueryParams(); + const { t } = useTranslation(); + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('generic#security:authorization/read'), + create: hasAuth('generic#security:authorization/create'), + delete: hasAuth('generic#security:authorization/delete'), + update: hasAuth('generic#security:authorization/update') + }; + + const nav = useNavigate(); + + const [data, setData] = useState<{ + data: any[]; + total: number | { value: number }; + }>({ + data: [], + total: 0 + }); + const { endLoading, loading, startLoading } = useLoading(); + const [keyword, setKeyword] = useState(''); + + const fetchData = async (params: any) => { + startLoading(); + const res = await fetchAuthorizationSearch(params); + const newData = formatESSearchResult(res.data); + setData(newData); + endLoading(); + }; + + const handleTableChange: TableProps['onChange'] = pagination => { + setQueryParams((params: any) => { + const pageSize = pagination?.pageSize ?? params.size ?? 10; + const current = pagination?.current ?? Math.floor((params.from ?? 0) / pageSize) + 1; + return { + ...params, + from: (current - 1) * pageSize, + size: pageSize + }; + }); + }; + + const onRefreshClick = (query: string) => { + const q = (query || '').trim(); + setQueryParams((oldParams: any) => { + return { + ...oldParams, + from: 0, + query: q, + t: new Date().valueOf() + }; + }); + }; + + const handleDelete = useCallback( + async (id: string) => { + startLoading(); + const res = await deleteAuthorization(id); + if (res.data?.result === 'deleted') { + message.success(t('common.deleteSuccess')); + } + fetchData(queryParams); + endLoading(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [queryParams, t] + ); + + const columns: TableColumnsType = [ + { + dataIndex: 'display_name', + title: t('page.auth.labels.auth'), + render: (value, record) => { + return ( + nav(`/auth/edit/${record.id}`, {state:record})}> + {value} + + ) + } + }, + { + dataIndex: 'roles', + title: t('page.auth.labels.roles'), + render: (value) => { + if (!Array.isArray(value)) return '-' + return value.map((tag, index) => { + return {tag}; + }); + } + }, + { + dataIndex: 'created', + title: t('page.auth.labels.created'), + render: (value: string) => { + const d = dayjs(value); + return d.isValid() ? d.format('YYYY-MM-DD HH:mm:ss') : value; + } + }, + { + fixed: 'right', + hidden: !permissions.update && !permissions.delete, + render: (_, record) => { + const items = []; + if (permissions.read && permissions.update) { + items.push({ + key: 'edit', + label: t('common.edit') + }); + } + if (permissions.delete) { + items.push({ + key: 'delete', + label: t('common.delete') + }); + } + if (items.length === 0) return null; + const onMenuClick = ({ key, record }: any) => { + switch (key) { + case 'edit': + nav(`/auth/edit/${record.id}`, { state: record }); + break; + case 'delete': + window?.$modal?.confirm({ + content: t('page.auth.delete.confirm', { name: record.display_name }), + icon: , + onOk() { + handleDelete(record.id); + }, + title: t('common.tip') + }); + break; + default: + break; + } + }; + return ( + onMenuClick({ key, record }) + }} + > + + + ); + }, + title: t('common.operation'), + width: '90px' + } + ]; + + const rowSelection: TableProps['rowSelection'] = { + getCheckboxProps: record => ({ + name: record.name + }), + onChange: (_selectedRowKeys: React.Key[], _selectedRows) => {} + }; + + useEffect(() => { + fetchData(queryParams); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [queryParams]); + + useEffect(() => { + setKeyword((queryParams as any).query || ''); + }, [queryParams.query]); + + return ( + +
+ } + className='max-w-500px' + enterButton={t('common.refresh')} + value={keyword} + onChange={e => setKeyword(e.target.value)} + onSearch={onRefreshClick} + /> + {permissions.create && ( + + )} +
+
`${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size ?? 10, + current: Math.floor((queryParams.from ?? 0) / (queryParams.size ?? 10)) + 1, + total: typeof data.total === 'object' ? (data.total?.value ?? 0) : (data.total ?? 0), + showSizeChanger: true + }} + onChange={handleTableChange} + /> + + ); +}; + +export default Auth; diff --git a/web/src/pages/security/modules/Role.tsx b/web/src/pages/security/modules/Role.tsx new file mode 100644 index 00000000..ad7c283f --- /dev/null +++ b/web/src/pages/security/modules/Role.tsx @@ -0,0 +1,223 @@ +import { EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from '@ant-design/icons'; +import { useLoading } from '@sa/hooks'; +import { Button, Dropdown, Input, Table, message } from 'antd'; +import dayjs from 'dayjs'; +import type { TableColumnsType, TableProps } from 'antd'; + +import useQueryParams from '@/hooks/common/queryParams'; +import { deleteRole, fetchRoles } from '@/service/api/security'; +import { formatESSearchResult } from '@/service/request/es'; + +const Role = () => { + const [queryParams, setQueryParams] = useQueryParams(); + const { t } = useTranslation(); + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('generic#security:role/read'), + create: hasAuth('generic#security:role/create'), + delete: hasAuth('generic#security:role/delete'), + update: hasAuth('generic#security:role/update') + }; + + const nav = useNavigate(); + + const [data, setData] = useState<{ + data: any[]; + total: number | { value: number }; + }>({ + data: [], + total: 0 + }); + const { endLoading, loading, startLoading } = useLoading(); + const [keyword, setKeyword] = useState(''); + + const fetchData = async (params: any) => { + startLoading(); + const res = await fetchRoles(params); + const newData = formatESSearchResult(res.data); + setData(newData); + endLoading(); + }; + + const handleTableChange: TableProps['onChange'] = pagination => { + setQueryParams((params: any) => { + const pageSize = pagination?.pageSize ?? params.size ?? 10; + const current = pagination?.current ?? Math.floor((params.from ?? 0) / pageSize) + 1; + return { + ...params, + from: (current - 1) * pageSize, + size: pageSize + }; + }); + }; + + const onRefreshClick = (query: string) => { + const q = (query || '').trim(); + setQueryParams((oldParams: any) => { + return { + ...oldParams, + from: 0, + query: q, + t: new Date().valueOf() + }; + }); + }; + + const handleDelete = useCallback( + async (id: string) => { + startLoading(); + const res = await deleteRole(id); + if (res.data?.result === 'deleted') { + message.success(t('common.deleteSuccess')); + } + fetchData(queryParams); + endLoading(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [queryParams, t] + ); + + const columns: TableColumnsType = [ + { + dataIndex: 'name', + title: t('page.role.labels.name'), + minWidth: 150, + ellipsis: true, + render: (value, record) => { + return ( +
+ + {value} +
+ ); + } + }, + { + dataIndex: 'description', + title: t('page.role.labels.description') + }, + { + dataIndex: 'created', + title: t('page.role.labels.created'), + render: (value: string) => { + const d = dayjs(value); + return d.isValid() ? d.format('YYYY-MM-DD HH:mm:ss') : value; + } + }, + { + fixed: 'right', + hidden: !permissions.update && !permissions.delete, + render: (_, record) => { + const items = []; + if (permissions.read && permissions.update) { + items.push({ + key: 'edit', + label: t('common.edit') + }); + } + if (permissions.delete) { + items.push({ + key: 'delete', + label: t('common.delete') + }); + } + if (items.length === 0) return null; + // eslint-disable-next-line @typescript-eslint/no-shadow + const onMenuClick = ({ key, record }: any) => { + switch (key) { + case 'edit': + nav(`/role/edit/${record.id}`, { state: record }); + break; + case 'delete': + window?.$modal?.confirm({ + content: t('page.role.delete.confirm', { name: record.name }), + icon: , + onOk() { + handleDelete(record.id); + }, + title: t('common.tip') + }); + break; + default: + break; + } + }; + return ( + onMenuClick({ key, record }) + }} + > + + + ); + }, + title: t('common.operation'), + width: '90px' + } + ]; + + const rowSelection: TableProps['rowSelection'] = { + getCheckboxProps: record => ({ + name: record.name + }), + onChange: (_selectedRowKeys: React.Key[], _selectedRows) => {} + }; + + useEffect(() => { + fetchData(queryParams); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [queryParams]); + + useEffect(() => { + setKeyword((queryParams as any).query || ''); + }, [queryParams.query]); + + return ( + +
+ } + className='max-w-500px' + enterButton={t('common.refresh')} + value={keyword} + onChange={e => setKeyword(e.target.value)} + onSearch={onRefreshClick} + /> + {permissions.create && ( + + )} +
+
`${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size ?? 10, + current: Math.floor((queryParams.from ?? 0) / (queryParams.size ?? 10)) + 1, + total: typeof data.total === 'object' ? (data.total?.value ?? 0) : (data.total ?? 0), + showSizeChanger: true + }} + onChange={handleTableChange} + /> + + ); +}; + +export default Role; diff --git a/web/src/pages/security/modules/RoleSelect.tsx b/web/src/pages/security/modules/RoleSelect.tsx new file mode 100644 index 00000000..1fc89f9c --- /dev/null +++ b/web/src/pages/security/modules/RoleSelect.tsx @@ -0,0 +1,71 @@ +import DropdownList from '@/common/src/DropdownList'; +import { fetchRoles } from '@/service/api/security'; +import { formatESSearchResult } from '@/service/request/es'; +import { useRequest } from '@sa/hooks'; + +const RoleSelect = (props) => { + const { + value, + onChange, + className, + mode, + width = '100%', + allowClear, + placeholder, + } = props; + + const { hasAuth } = useAuth(); + + const permissions = { + search: hasAuth('generic#security:role/search') + } + + const { data, loading, run } = useRequest(fetchRoles, { manual: true }); + + const [queryParams, setQueryParams] = useState({ + query: '', + from: 0, + size: 10, + sort: 'created:desc' + }); + + useEffect(() => { + if (permissions.search) { + run(queryParams); + } + }, [queryParams, permissions.search]); + + const result = useMemo(() => { + return formatESSearchResult(data); + }, [data]); + + return ( + onChange && onChange(item)} + className={className} + mode={mode} + loading={loading} + width={width} + allowClear={allowClear} + data={result.data} + placeholder={placeholder} + renderItem={(item: any) => {item.name}} + renderLabel={(item: any) => item?.name} + rowKey='name' + pagination={{ + currentPage: result.total ? Math.floor(queryParams.from / queryParams.size) + 1 : 0, + total: result.total, + onChange: page => { + setQueryParams(params => ({ ...params, from: (page - 1) * params.size })); + } + }} + onSearchChange={(query: string) => { + setQueryParams(params => ({ ...params, query, from: 0 })); + }} + /> + ) + +} + +export default RoleSelect \ No newline at end of file diff --git a/web/src/pages/security/modules/User.tsx b/web/src/pages/security/modules/User.tsx new file mode 100644 index 00000000..ab883e6c --- /dev/null +++ b/web/src/pages/security/modules/User.tsx @@ -0,0 +1,233 @@ +import { EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from '@ant-design/icons'; +import { useLoading } from '@sa/hooks'; +import { Button, Dropdown, Input, Table, Tag, message } from 'antd'; +import dayjs from 'dayjs'; +import type { TableColumnsType, TableProps } from 'antd'; + +import useQueryParams from '@/hooks/common/queryParams'; +import { deleteUser, fetchUsers } from '@/service/api/security'; +import { formatESSearchResult } from '@/service/request/es'; + +const User = () => { + const [queryParams, setQueryParams] = useQueryParams(); + const { t } = useTranslation(); + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('generic#security:user/read'), + create: hasAuth('generic#security:user/create'), + delete: hasAuth('generic#security:user/delete'), + update: hasAuth('generic#security:user/update') + }; + + const nav = useNavigate(); + + const [data, setData] = useState<{ + data: any[]; + total: number | { value: number }; + }>({ + data: [], + total: 0 + }); + const { endLoading, loading, startLoading } = useLoading(); + const [keyword, setKeyword] = useState(''); + + const fetchData = async (params: any) => { + startLoading(); + const res = await fetchUsers(params); + const newData = formatESSearchResult(res.data); + setData(newData); + endLoading(); + }; + + const handleTableChange: TableProps['onChange'] = pagination => { + setQueryParams((params: any) => { + const pageSize = pagination?.pageSize ?? params.size ?? 10; + const current = pagination?.current ?? Math.floor((params.from ?? 0) / pageSize) + 1; + return { + ...params, + from: (current - 1) * pageSize, + size: pageSize + }; + }); + }; + + const onRefreshClick = (query: string) => { + const q = (query || '').trim(); + setQueryParams((oldParams: any) => { + return { + ...oldParams, + from: 0, + query: q, + t: new Date().valueOf() + }; + }); + }; + + const handleDelete = useCallback( + async (id: string) => { + startLoading(); + const res = await deleteUser(id); + if (res.data?.result === 'deleted') { + message.success(t('common.deleteSuccess')); + } + fetchData(queryParams); + endLoading(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [queryParams, t] + ); + + const columns: TableColumnsType = [ + { + dataIndex: 'name', + title: t('page.user.labels.name'), + minWidth: 150, + ellipsis: true, + render: (value, record) => { + return ( +
+ + {value} +
+ ); + } + }, + { + dataIndex: 'email', + title: t('page.user.labels.email') + }, + { + dataIndex: 'roles', + title: t('page.user.labels.roles'), + render: (value) => { + if (!Array.isArray(value)) return '-' + return value.map((tag, index) => { + return {tag}; + }); + } + }, + { + dataIndex: 'created', + title: t('page.user.labels.created'), + render: (value: string) => { + const d = dayjs(value); + return d.isValid() ? d.format('YYYY-MM-DD HH:mm:ss') : value; + } + }, + { + fixed: 'right', + hidden: !permissions.update && !permissions.delete, + render: (_, record) => { + const items = []; + if (permissions.read && permissions.update) { + items.push({ + key: 'edit', + label: t('common.edit') + }); + } + if (permissions.delete) { + items.push({ + key: 'delete', + label: t('common.delete') + }); + } + if (items.length === 0) return null; + // eslint-disable-next-line @typescript-eslint/no-shadow + const onMenuClick = ({ key, record }: any) => { + switch (key) { + case 'edit': + nav(`/user/edit/${record.id}`, { state: record }); + break; + case 'delete': + window?.$modal?.confirm({ + content: t('page.user.delete.confirm', { name: record.name }), + icon: , + onOk() { + handleDelete(record.id); + }, + title: t('common.tip') + }); + break; + default: + break; + } + }; + return ( + onMenuClick({ key, record }) + }} + > + + + ); + }, + title: t('common.operation'), + width: '90px' + } + ]; + + const rowSelection: TableProps['rowSelection'] = { + getCheckboxProps: record => ({ + name: record.name + }), + onChange: (_selectedRowKeys: React.Key[], _selectedRows) => {} + }; + + useEffect(() => { + fetchData(queryParams); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [queryParams]); + + useEffect(() => { + setKeyword((queryParams as any).query || ''); + }, [queryParams.query]); + + return ( + +
+ } + className='max-w-500px' + enterButton={t('common.refresh')} + value={keyword} + onChange={e => setKeyword(e.target.value)} + onSearch={onRefreshClick} + /> + {permissions.create && ( + + )} +
+
`${range[0]}-${range[1]} of ${total} items`, + pageSize: queryParams.size ?? 10, + current: Math.floor((queryParams.from ?? 0) / (queryParams.size ?? 10)) + 1, + total: typeof data.total === 'object' ? (data.total?.value ?? 0) : (data.total ?? 0), + showSizeChanger: true + }} + onChange={handleTableChange} + /> + + ); +}; + +export default User; diff --git a/web/src/pages/settings/index.tsx b/web/src/pages/settings/index.tsx index f9a35524..eacc5f5d 100644 --- a/web/src/pages/settings/index.tsx +++ b/web/src/pages/settings/index.tsx @@ -9,31 +9,43 @@ export function Component() { const [searchParams, setSearchParams] = useSearchParams(); const { t } = useTranslation(); + const { hasAuth } = useAuth() + + const permissions = { + viewConnector: hasAuth('coco#connector/search'), + viewSystemSettings: hasAuth('coco#system/read'), + } + const onChange = (key: string) => { setSearchParams({ tab: key }); }; - const items = [ - { + const items = []; + + if (permissions.viewConnector) { + items.push({ component: ConnectorSettings, key: 'connector', - label: t(`page.settings.connector.title`) - }, - { + label: t(`page.settings.connector.title`), + }) + } + + if (permissions.viewSystemSettings) { + items.push({ component: AppSettings, key: 'app_settings', - label: t(`page.settings.app_settings.title`) - }, - { + label: t(`page.settings.app_settings.title`), + }) + items.push({ component: SearchSettings, key: 'search_settings', - label: t(`page.settings.search_settings.title`) - } - ]; + label: t(`page.settings.search_settings.title`), + }) + } const activeKey = useMemo(() => { - return searchParams.get('tab') || items[0].key; - }, []); + return searchParams.get('tab') || items?.[0]?.key + }, []) const activeItem = useMemo(() => { return items.find(item => item.key === activeKey); diff --git a/web/src/pages/settings/modules/AppSettings.tsx b/web/src/pages/settings/modules/AppSettings.tsx index 00573e4e..74e29fb0 100644 --- a/web/src/pages/settings/modules/AppSettings.tsx +++ b/web/src/pages/settings/modules/AppSettings.tsx @@ -9,6 +9,12 @@ const AppSettings = memo(() => { const [form] = Form.useForm(); const { t } = useTranslation(); + const { hasAuth } = useAuth() + + const permissions = { + update: hasAuth('coco#system/update'), + } + const { endLoading, loading, startLoading } = useLoading(); const [logo, setLogo] = useState({ lightLoading: false, @@ -91,14 +97,18 @@ const AppSettings = memo(() => { {t('page.settings.app_settings.chat_settings.title')} - - - + { + permissions.update && ( + + + + ) + } diff --git a/web/src/pages/settings/modules/Connector.tsx b/web/src/pages/settings/modules/Connector.tsx index 662d1a8f..13092bbc 100644 --- a/web/src/pages/settings/modules/Connector.tsx +++ b/web/src/pages/settings/modules/Connector.tsx @@ -1,4 +1,4 @@ -import { Button, Dropdown, Form, Image, Input, Modal, Spin, Table, Tag, message } from 'antd'; +import { Avatar, Button, Dropdown, Table, Tag, message } from 'antd'; import '../index.scss'; import type { MenuProps, TableColumnsType } from 'antd'; @@ -10,15 +10,10 @@ import { GoogleDriveSVG, HugoSVG, NotionSVG, YuqueSVG } from '@/components/icons import useQueryParams from '@/hooks/common/queryParams'; import { deleteConnector, searchConnector } from '@/service/api/connector'; -import Icon, { - EllipsisOutlined, - ExclamationCircleOutlined, - FilterOutlined, - PlusOutlined, - createFromIconfontCN -} from '@ant-design/icons'; +import Icon, { EllipsisOutlined, ExclamationCircleOutlined, FilterOutlined, PlusOutlined } from '@ant-design/icons'; import { formatESSearchResult } from '@/service/request/es'; +import { Api } from '@/types/api'; type Connector = Api.Datasource.Connector; @@ -28,16 +23,17 @@ const ConnectorSettings = memo(() => { const { t } = useTranslation(); const nav = useNavigate(); - const items: MenuProps['items'] = [ - { - key: '1', - label: t('common.edit') - }, - { - key: '2', - label: t('common.delete') - } - ]; + const { addSharesToData, isEditorOwner, hasEdit, isResourceShare } = useResource(); + const resourceType = 'connector'; + + const { hasAuth } = useAuth(); + + const permissions = { + read: hasAuth('coco#connector/read'), + create: hasAuth('coco#connector/create'), + update: hasAuth('coco#connector/update'), + delete: hasAuth('coco#connector/delete') + }; const onMenuClick = ({ key, record }: any) => { switch (key) { @@ -72,10 +68,26 @@ const ConnectorSettings = memo(() => { const columns: TableColumnsType = [ { dataIndex: 'name', - minWidth: 100, + minWidth: 150, + ellipsis: true, render: (name, record) => { + const isShare = isResourceShare(record); + + let shareIcon; + + if (isShare) { + shareIcon = ( +
+ +
+ ); + } + let svgIcon = null; - switch (record.id) { + switch (record.processor?.name) { case 'google_drive': svgIcon = GoogleDriveSVG; break; @@ -90,24 +102,63 @@ const ConnectorSettings = memo(() => { break; } return ( -
- - {svgIcon ? ( - - ) : ( +
+ + {record.icon ? ( + ) : ( + )} - {name} + {name} + {shareIcon}
); }, title: t('page.connector.columns.name') }, + { + dataIndex: 'owner', + title: t('page.datasource.labels.owner'), + render: (value, record) => { + if (!value) return '-'; + return ( +
+ + + +
+ ); + } + }, + { + dataIndex: 'shares', + title: t('page.datasource.labels.shares'), + render: (value, record) => { + if (!value) return '-'; + return ( + fetchData(queryParams)} + /> + ); + } + }, { dataIndex: 'category', minWidth: 200, @@ -115,9 +166,9 @@ const ConnectorSettings = memo(() => { }, { dataIndex: 'description', - ellipsis: true, minWidth: 100, - title: t('page.connector.columns.description') + title: t('page.connector.columns.description'), + ellipsis: true }, { dataIndex: 'tags', @@ -131,7 +182,22 @@ const ConnectorSettings = memo(() => { }, { fixed: 'right', + hidden: !permissions.update && !permissions.delete, render: (_, record) => { + const items: MenuProps['items'] = []; + if (permissions.read && permissions.update && hasEdit(record)) { + items.push({ + key: '1', + label: t('common.edit') + }); + } + if (permissions.delete && isEditorOwner(record)) { + items.push({ + key: '2', + label: t('common.delete') + }); + } + if (items.length === 0) return null; return ( onMenuClick({ key, record }) }}> @@ -148,16 +214,29 @@ const ConnectorSettings = memo(() => { const [keyword, setKeyword] = useState(); - const fetchData = () => { + const fetchData = async queryParams => { setLoading(true); - searchConnector(queryParams).then(({ data }: { data: any }) => { - const newData = formatESSearchResult(data); + const res = await searchConnector(queryParams); + if (res?.data) { + const newData = formatESSearchResult(res?.data); + if (newData.data.length > 0) { + const resources = newData.data.map(item => ({ + resource_id: item.id, + resource_type: resourceType + })); + const dataWithShares = await addSharesToData(newData.data, resources); + if (dataWithShares) { + newData.data = dataWithShares; + } + } setData(newData); - setLoading(false); - }); + } + setLoading(false); }; - useEffect(fetchData, [queryParams]); + useEffect(() => { + fetchData(queryParams); + }, [queryParams]); useEffect(() => { setKeyword(queryParams.query); @@ -171,18 +250,19 @@ const ConnectorSettings = memo(() => { setQueryParams(params => { return { ...params, - from: (pagination.current - 1) * pagination.pageSize, - size: pagination.pageSize + size: pagination.pageSize, + from: (pagination.current - 1) * pagination.pageSize }; }); }; const onSearchClick = (query: string) => { - setQueryParams(old => { + setQueryParams(oldParams => { return { - ...old, + ...oldParams, + from: query === oldParams.query ? oldParams.from : 0, query, - t: new Date().getTime() + t: new Date().valueOf() }; }); }; @@ -191,33 +271,33 @@ const ConnectorSettings = memo(() => { return ( -
+
} - className="max-w-500px" + className='max-w-500px' enterButton={t('common.refresh')} value={keyword} onChange={e => setKeyword(e.target.value)} onSearch={onSearchClick} /> - - - + > + {t('common.add')} + + )}
columns={columns} dataSource={data.data} loading={loading} - rowKey="id" - size="middle" + rowKey='id' + size='middle' pagination={{ current: Math.floor(queryParams.from / queryParams.size) + 1, pageSize: queryParams.size, @@ -227,6 +307,7 @@ const ConnectorSettings = memo(() => { }} onChange={handleTableChange} /> + ); }); diff --git a/web/src/pages/settings/modules/SearchSettings.tsx b/web/src/pages/settings/modules/SearchSettings.tsx index f87f18ba..0b939db7 100644 --- a/web/src/pages/settings/modules/SearchSettings.tsx +++ b/web/src/pages/settings/modules/SearchSettings.tsx @@ -9,6 +9,12 @@ const SearchSettings = memo(() => { const [form] = Form.useForm(); const { t } = useTranslation(); + const { hasAuth } = useAuth() + + const permissions = { + update: hasAuth('coco#system/update'), + } + const { endLoading, loading, startLoading } = useLoading(); const dispatch = useAppDispatch(); @@ -84,14 +90,18 @@ const SearchSettings = memo(() => { - - - + { + permissions.update && ( + + + + ) + } diff --git a/web/src/pages/user/edit/[id].tsx b/web/src/pages/user/edit/[id].tsx new file mode 100644 index 00000000..263e0d48 --- /dev/null +++ b/web/src/pages/user/edit/[id].tsx @@ -0,0 +1,61 @@ +import { useRequest } from '@sa/hooks'; +import { type LoaderFunctionArgs, useLoaderData } from 'react-router-dom'; + +import { EditForm } from '../modules/EditForm'; +import { fetchUser, updateUser } from '@/service/api/security'; + +export function Component() { + const id = useLoaderData(); + const { t } = useTranslation(); + const nav = useNavigate(); + + const { data, loading, run } = useRequest(fetchUser, { + manual: true + }); + + const onSubmit = async (params: any, before?: () => void, after?: () => void) => { + if (!data?._source?.id) return; + if (before) before(); + const req = { + id: data._source.id, + ...params, + }; + const res = await updateUser(req); + if (res.data?.result === 'updated') { + window.$message?.success(t('common.updateSuccess')); + nav(`/security?tab=user`); + } + if (after) after(); + }; + + useEffect(() => { + run(id as string); + }, []); + + return ( +
+ +
+
+
{t(`page.user.edit.title`)}
+
+
+ +
+ +
+ ); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export async function loader({ params, ...rest }: LoaderFunctionArgs) { + return params.id; +} diff --git a/web/src/pages/user/modules/EditForm.tsx b/web/src/pages/user/modules/EditForm.tsx new file mode 100644 index 00000000..528ba696 --- /dev/null +++ b/web/src/pages/user/modules/EditForm.tsx @@ -0,0 +1,118 @@ +import RoleSelect from '@/pages/security/modules/RoleSelect'; +import { useLoading } from '@sa/hooks'; +import { Button, Form, Input, Spin } from 'antd'; + +interface EditFormProps { + actionText: string; + loading?: boolean; + onSubmit: (params: any, before?: () => void, after?: () => void) => Promise; + record?: any; +} + +export const EditForm = memo((props: EditFormProps) => { + const { actionText, onSubmit, record } = props; + const [form] = Form.useForm(); + const { t } = useTranslation(); + const { defaultRequiredRule, formRules, patternRules } = useFormRules(); + const { endLoading, loading, startLoading } = useLoading(); + + const handleSubmit = async () => { + const params = await form.validateFields(); + const { roles, confirm_password, ...rest } = params; + onSubmit({ + ...rest, + roles: (roles || []).map((item) => item.name) + }, startLoading, endLoading); + }; + + useEffect(() => { + if (record && typeof record === 'object') { + const { password, roles, ...rest } = record; + form.setFieldsValue({ + ...rest, + roles: roles.map((item) => ({ name: item })) + }); + } + }, [record]); + + const itemClassNames = '!w-496px'; + + return ( + +
+ + + + + + + { + record && ( + <> + + + + { + const password = await form.getFieldValue('password'); + if (password && password !== value) { + throw new Error(t('form.pwdConfirm.invalid')); + } + }, + } + ]} + > + + + + ) + } + + + + + + + +
+ ); +}); diff --git a/web/src/pages/user/new/index.tsx b/web/src/pages/user/new/index.tsx new file mode 100644 index 00000000..54ea29c6 --- /dev/null +++ b/web/src/pages/user/new/index.tsx @@ -0,0 +1,62 @@ +import { createUser } from '@/service/api/security'; + +import { EditForm } from '../modules/EditForm'; +import { Modal } from 'antd'; + +import copy from 'copy-to-clipboard'; + +export function Component() { + const { t } = useTranslation(); + const nav = useNavigate(); + + const onSubmit = async (params: any, before?: () => void, after?: () => void) => { + if (before) before(); + const res = await createUser(params); + if (res?.data?.password) { + Modal.success({ + title: t('common.addSuccess'), + width: 530, + content: ( +
+
+ {t('page.user.new.copyPassword')} +
+
+ {res?.data?.password} +
+
+ ), + cancelButtonProps: { style: { display: 'none'} }, + okText: t('common.copy'), + onOk: () => { + const isCopy = copy(res?.data?.password); + if (isCopy) { + window.$message?.success(t('common.copySuccess')); + nav(`/security?tab=user`); + } + } + }); + } + if (after) after(); + }; + + return ( +
+ +
+
+
{t(`page.user.new.title`)}
+
+
+ +
+ +
+ ); +} diff --git a/web/src/pages/webhook/edit/[id].tsx b/web/src/pages/webhook/edit/[id].tsx new file mode 100644 index 00000000..a391a235 --- /dev/null +++ b/web/src/pages/webhook/edit/[id].tsx @@ -0,0 +1,42 @@ +import { useRequest } from '@sa/hooks'; +import { type LoaderFunctionArgs, useLoaderData } from 'react-router-dom'; +import { fetchWebhook, updateWebhook } from '@/service/api/webhook'; +import { WebhookForm } from '../modules/WebhookForm'; + +export function Component() { + const id = useLoaderData(); + const { t } = useTranslation(); + + const { data, loading, run } = useRequest(fetchWebhook, { manual: true }); + + const onSubmit = async (params, before, after) => { + if (!data?._source?.id) return; + if (before) before(); + const res = await updateWebhook({ id: data._source.id, ...params }); + if (res.data?.result === 'updated') { + window.$message?.success(t('common.updateSuccess')); + run(data._source.id); + } + if (after) after(); + }; + + useEffect(() => { + run(id); + }, []); + + return ( +
+ +
+
+
{t('page.webhook.form.title.edit')}
+
+ + +
+ ); +} + +export async function loader({ params }: LoaderFunctionArgs) { + return params.id; +} \ No newline at end of file diff --git a/web/src/pages/webhook/modules/WebhookForm.tsx b/web/src/pages/webhook/modules/WebhookForm.tsx new file mode 100644 index 00000000..add3eb25 --- /dev/null +++ b/web/src/pages/webhook/modules/WebhookForm.tsx @@ -0,0 +1,204 @@ +import { Button, Form, Input, Select, Switch, Checkbox, Space } from 'antd'; +import { useLoading } from '@sa/hooks'; +import AIAssistantSelect from '@/pages/ai-assistant/modules/AIAssistantSelect'; +import DataSourceSelect from '@/pages/data-source/modules/DataSourceSelect'; + +export const WebhookForm = (props: { + actionText: string; + loading?: boolean; + record?: any; + onSubmit: (params: any, before?: () => void, after?: () => void) => Promise; +}) => { + const { actionText, loading, record, onSubmit } = props; + const { t } = useTranslation(); + const [form] = Form.useForm(); + const { endLoading, startLoading } = useLoading(); + + useEffect(() => { + if (record) { + form.setFieldsValue(record); + } else { + form.setFieldsValue({ + content_type: 'application/json', + ssl_verify: true, + triggers: { + ai_assistant: { enabled: true, reply_completed: true }, + datasource: { enabled: false, file_parse_completed: false, sync_completed: false }, + model_provider: { enabled: false } + } + }); + } + }, [record]); + + const handleSubmit = async () => { + const params = await form.validateFields(); + await onSubmit( + { + ...params + }, + startLoading, + endLoading + ); + }; + + return ( +
+
+ + + + + + + + + + + + + + + + + + + + + + + + prev?.triggers?.ai_assistant?.enabled !== next?.triggers?.ai_assistant?.enabled} + > + {({ getFieldValue }) => { + const enabled = getFieldValue(['triggers','ai_assistant','enabled']); + return enabled ? ( + + + + + + {t('page.webhook.labels.reply_completed')} + + + ) : null; + }} + + + + + + + + + + prev?.triggers?.datasource?.enabled !== next?.triggers?.datasource?.enabled} + > + {({ getFieldValue }) => { + const enabled = getFieldValue(['triggers','datasource','enabled']); + return enabled ? ( + + + + + + {t('page.webhook.labels.file_parse_completed')} + + + {t('page.webhook.labels.sync_completed')} + + + ) : null; + }} + + + + + + + + + + + + + + + + + + + +
+ ); +}; \ No newline at end of file diff --git a/web/src/pages/webhook/new/index.tsx b/web/src/pages/webhook/new/index.tsx new file mode 100644 index 00000000..b9b2991e --- /dev/null +++ b/web/src/pages/webhook/new/index.tsx @@ -0,0 +1,32 @@ +import { createWebhook } from '@/service/api/webhook'; +import { WebhookForm } from '../modules/WebhookForm'; + +export function Component() { + const { t } = useTranslation(); + const nav = useNavigate(); + + const onSubmit = async (params, before, after) => { + if (before) before(); + const res = await createWebhook({ + ...params, + enabled: true + }); + if (res?.data?.result === 'created') { + window.$message?.success(t('common.addSuccess')); + res?.data?._id && nav(`/webhook/edit/${res.data._id}`); + } + if (after) after(); + }; + + return ( +
+ +
+
+
{t('page.webhook.form.title.new')}
+
+ + +
+ ); +} \ No newline at end of file diff --git a/web/src/router/elegant/imports.ts b/web/src/router/elegant/imports.ts index b248713f..43b6249b 100644 --- a/web/src/router/elegant/imports.ts +++ b/web/src/router/elegant/imports.ts @@ -21,10 +21,11 @@ export const pages: Record import("@/pages/_builtin/404/index.tsx"), 500: () => import("@/pages/_builtin/500/index.tsx"), "ai-assistant_edit": () => import("@/pages/ai-assistant/edit/[id].tsx"), - "ai-assistant": () => import("@/pages/ai-assistant/index.tsx"), "ai-assistant_list": () => import("@/pages/ai-assistant/list/index.tsx"), "ai-assistant_new": () => import("@/pages/ai-assistant/new/index.tsx"), "api-token_list": () => import("@/pages/api-token/list/index.tsx"), + auth_edit: () => import("@/pages/auth/edit/[id].tsx"), + auth_new: () => import("@/pages/auth/new/index.tsx"), connector_edit: () => import("@/pages/connector/edit/[id].tsx"), connector_new: () => import("@/pages/connector/new/index.tsx"), "data-source_detail": () => import("@/pages/data-source/detail/[id].tsx"), @@ -44,6 +45,13 @@ export const pages: Record import("@/pages/model-provider/edit/[id].tsx"), "model-provider_list": () => import("@/pages/model-provider/list/index.tsx"), "model-provider_new": () => import("@/pages/model-provider/new/index.tsx"), + role_edit: () => import("@/pages/role/edit/[id].tsx"), + role_new: () => import("@/pages/role/new/index.tsx"), search: () => import("@/pages/search/index.tsx"), + security: () => import("@/pages/security/index.tsx"), settings: () => import("@/pages/settings/index.tsx"), + user_edit: () => import("@/pages/user/edit/[id].tsx"), + user_new: () => import("@/pages/user/new/index.tsx"), + webhook_edit: () => import("@/pages/webhook/edit/[id].tsx"), + webhook_new: () => import("@/pages/webhook/new/index.tsx"), }; diff --git a/web/src/router/elegant/routes.ts b/web/src/router/elegant/routes.ts index a5bef3ce..76003f7c 100644 --- a/web/src/router/elegant/routes.ts +++ b/web/src/router/elegant/routes.ts @@ -47,7 +47,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.ai-assistant', title: 'ai-assistant', icon: 'mdi:robot-outline', - order: 2 + order: 2, + permissions: ['coco#assistant/search'] }, children: [ { @@ -58,7 +59,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.ai-assistant_edit', title: 'ai-assistant_edit', hideInMenu: true, - activeMenu: 'ai-assistant' + activeMenu: 'ai-assistant', + permissions: ['coco#assistant/read', 'coco#assistant/update'] } }, { @@ -69,7 +71,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.ai-assistant_list', title: 'ai-assistant_list', hideInMenu: true, - activeMenu: 'ai-assistant' + activeMenu: 'ai-assistant', + permissions: ['coco#assistant/search'] } }, { @@ -80,7 +83,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.ai-assistant_new', title: 'ai-assistant_new', hideInMenu: true, - activeMenu: 'ai-assistant' + activeMenu: 'ai-assistant', + permissions: ['coco#assistant/create'] } } ] @@ -93,7 +97,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.api-token', title: 'api-token', order: 4, - localIcon: 'security' + localIcon: 'security', + permissions: ['generic#security:authorization/search'] }, children: [ { @@ -104,7 +109,41 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.api-token_list', title: 'api-token_list', hideInMenu: true, - activeMenu: 'api-token' + activeMenu: 'api-token', + permissions: ['generic#security:authorization/search'] + } + } + ] + }, + { + name: 'auth', + path: '/auth', + component: 'layout.base', + meta: { + i18nKey: 'route.auth', + title: 'auth', + hideInMenu: true, + activeMenu: 'security' + }, + children: [ + { + name: 'auth_edit', + path: 'edit/:id', + component: 'view.auth_edit', + meta: { + i18nKey: 'route.auth_edit', + title: 'auth_edit', + permissions: ['generic#security:authorization/read', 'generic#security:authorization/update'] + } + }, + { + name: 'auth_new', + path: 'new', + component: 'view.auth_new', + meta: { + i18nKey: 'route.auth_new', + title: 'auth_new', + permissions: ['generic#security:authorization/create'] } } ] @@ -126,7 +165,10 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.connector_edit', meta: { i18nKey: 'route.connector_edit', - title: 'connector_edit' + title: 'connector_edit', + hideInMenu: true, + activeMenu: 'settings', + permissions: ['coco#connector/read', 'coco#connector/update'] } }, { @@ -137,7 +179,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.connector_new', title: 'connector_new', hideInMenu: true, - activeMenu: 'settings' + activeMenu: 'settings', + permissions: ['coco#connector/create'] } } ] @@ -151,7 +194,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source', title: 'data-source', icon: 'mdi:folder-open-outline', - order: 3 + order: 3, + permissions: ['coco#datasource/search'] }, children: [ { @@ -162,7 +206,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source_detail', title: 'data-source_detail', hideInMenu: true, - activeMenu: 'data-source' + activeMenu: 'data-source', + permissions: ['coco#datasource/search', 'coco#datasource/read'] } }, { @@ -173,7 +218,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source_edit', title: 'data-source_edit', hideInMenu: true, - activeMenu: 'data-source' + activeMenu: 'data-source', + permissions: ['coco#datasource/read', 'coco#datasource/update'] } }, { @@ -184,7 +230,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source_list', title: 'data-source_list', hideInMenu: true, - activeMenu: 'data-source' + activeMenu: 'data-source', + permissions: ['coco#datasource/search'] } }, { @@ -195,7 +242,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source_new', title: 'data-source_new', hideInMenu: true, - activeMenu: 'data-source' + activeMenu: 'data-source', + permissions: ['coco#datasource/create'] } }, { @@ -206,7 +254,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.data-source_new-first', title: 'data-source_new-first', hideInMenu: true, - activeMenu: 'data-source' + activeMenu: 'data-source', + permissions: ['coco#datasource/create'] } } ] @@ -242,7 +291,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.integration', title: 'integration', icon: 'mdi:puzzle-outline', - order: 5 + order: 5, + permissions: ['coco#integration/search'] }, children: [ { @@ -253,7 +303,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.integration_edit', title: 'integration_edit', hideInMenu: true, - activeMenu: 'integration' + activeMenu: 'integration', + permissions: ['coco#integration/read', 'coco#integration/update'] } }, { @@ -264,7 +315,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.integration_list', title: 'integration_list', hideInMenu: true, - activeMenu: 'integration' + activeMenu: 'integration', + permissions: ['coco#integration/search'] } }, { @@ -275,7 +327,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.integration_new', title: 'integration_new', hideInMenu: true, - activeMenu: 'integration' + activeMenu: 'integration', + permissions: ['coco#integration/create'] } } ] @@ -299,7 +352,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.mcp-server', title: 'mcp-server', order: 2, - localIcon: 'mcp' + localIcon: 'mcp', + permissions: ['coco#mcp_server/search'] }, redirect: 'list', children: [ @@ -311,7 +365,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.mcp-server_edit', title: 'mcp-server_edit', hideInMenu: true, - activeMenu: 'mcp-server' + activeMenu: 'mcp-server', + permissions: ['coco#mcp_server/read', 'coco#mcp_server/update'] } }, { @@ -322,7 +377,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.mcp-server_list', title: 'mcp-server_list', hideInMenu: true, - activeMenu: 'mcp-server' + activeMenu: 'mcp-server', + permissions: ['coco#mcp_server/search'] } }, { @@ -333,7 +389,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.mcp-server_new', title: 'mcp-server_new', hideInMenu: true, - activeMenu: 'mcp-server' + activeMenu: 'mcp-server', + permissions: ['coco#mcp_server/create'] } } ] @@ -347,7 +404,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.model-provider', title: 'model-provider', order: 2, - localIcon: 'model-provider' + localIcon: 'model-provider', + permissions: ['coco#model_provider/search'] }, children: [ { @@ -358,7 +416,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.model-provider_edit', title: 'model-provider_edit', hideInMenu: true, - activeMenu: 'model-provider' + activeMenu: 'model-provider', + permissions: ['coco#model_provider/read', 'coco#model_provider/update'] } }, { @@ -369,7 +428,8 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.model-provider_list', title: 'model-provider_list', hideInMenu: true, - activeMenu: 'model-provider' + activeMenu: 'model-provider', + permissions: ['coco#model_provider/search'] } }, { @@ -380,7 +440,41 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.model-provider_new', title: 'model-provider_new', hideInMenu: true, - activeMenu: 'model-provider' + activeMenu: 'model-provider', + permissions: ['coco#model_provider/create'] + } + } + ] + }, + { + name: 'role', + path: '/role', + component: 'layout.base', + meta: { + i18nKey: 'route.role', + title: 'role', + hideInMenu: true, + activeMenu: 'security' + }, + children: [ + { + name: 'role_edit', + path: 'edit/:id', + component: 'view.role_edit', + meta: { + i18nKey: 'route.role_edit', + title: 'role_edit', + permissions: ['generic#security:role/read', 'generic#security:role/update'] + } + }, + { + name: 'role_new', + path: 'new', + component: 'view.role_new', + meta: { + i18nKey: 'route.role_new', + title: 'role_new', + permissions: ['generic#security:role/create'] } } ] @@ -396,6 +490,23 @@ export const generatedRoutes: GeneratedRoute[] = [ hideInMenu: true } }, + { + name: 'security', + path: '/security', + component: 'layout.base$view.security', + meta: { + i18nKey: 'route.security', + title: 'security', + localIcon: 'user', + order: 10, + permissions: [ + 'generic#security:authorization/search', + 'generic#security:user/search', + 'generic#security:role/search' + ], + permissionLogic: 'or' + } + }, { name: 'settings', path: '/settings', @@ -404,7 +515,78 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.settings', title: 'settings', icon: 'mdi:settings-outline', - order: 10 + order: 11, + permissions: ['coco#system/read', 'coco#connector/search'], + permissionLogic: 'or' } + }, + { + name: 'user', + path: '/user', + component: 'layout.base', + meta: { + i18nKey: 'route.user', + title: 'user', + hideInMenu: true, + activeMenu: 'security' + }, + children: [ + { + name: 'user_edit', + path: 'edit/:id', + component: 'view.user_edit', + meta: { + i18nKey: 'route.user_edit', + title: 'user_edit', + permissions: ['generic#security:user/read', 'generic#security:user/update'] + } + }, + { + name: 'user_new', + path: 'new', + component: 'view.user_new', + meta: { + i18nKey: 'route.user_new', + title: 'user_new', + permissions: ['generic#security:user/create'] + } + } + ] + }, + { + name: 'webhook', + path: '/webhook', + component: 'layout.base', + meta: { + i18nKey: 'route.webhook', + title: 'webhook', + order: 5, + localIcon: 'link', + hideInMenu: true + }, + children: [ + { + name: 'webhook_edit', + path: 'edit/:id', + component: 'view.webhook_edit', + meta: { + i18nKey: 'route.webhook_edit', + title: 'webhook_edit', + hideInMenu: true, + activeMenu: 'webhook' + } + }, + { + name: 'webhook_new', + path: 'new', + component: 'view.webhook_new', + meta: { + i18nKey: 'route.webhook_new', + title: 'webhook_new', + hideInMenu: true, + activeMenu: 'webhook' + } + } + ] } ]; diff --git a/web/src/router/elegant/transform.ts b/web/src/router/elegant/transform.ts index ffe2c369..43290f3c 100644 --- a/web/src/router/elegant/transform.ts +++ b/web/src/router/elegant/transform.ts @@ -222,6 +222,9 @@ const routeMap: RouteMap = { "ai-assistant_new": "new", "api-token": "/api-token", "api-token_list": "list", + "auth": "/auth", + "auth_edit": "edit/:id", + "auth_new": "new", "connector": "/connector", "connector_edit": "edit/:id", "connector_new": "new", @@ -246,8 +249,18 @@ const routeMap: RouteMap = { "model-provider_edit": "edit/:id", "model-provider_list": "list", "model-provider_new": "new", + "role": "/role", + "role_edit": "edit/:id", + "role_new": "new", "search": "/search", - "settings": "/settings" + "security": "/security", + "settings": "/settings", + "user": "/user", + "user_edit": "edit/:id", + "user_new": "new", + "webhook": "/webhook", + "webhook_edit": "edit/:id", + "webhook_new": "new" }; /** diff --git a/web/src/router/guard/index.ts b/web/src/router/guard/index.ts index 8be7757f..9f02f746 100644 --- a/web/src/router/guard/index.ts +++ b/web/src/router/guard/index.ts @@ -24,7 +24,7 @@ function shouldRedirectLogin(path: string) { } export const init: Init = async currentFullPath => { - + const result = await fetchServer(); await store.dispatch(setProviderInfo(result.data)); @@ -118,13 +118,17 @@ export const createRouteGuard: BeforeEach = (to, _, blockerOrJump) => { const loginRoute: RouteKey = 'login'; const noAuthorizationRoute: RouteKey = '403'; - const isLogin = Boolean(localStg.get('userInfo')); + const userInfo = selectUserInfo(store.getState()); + + const isLogin = Boolean(userInfo); const needLogin = !to.meta.constant; - const routeRoles = to.meta.roles || []; - const hasRole = selectUserInfo(store.getState())?.roles?.some(role => routeRoles.includes(role)); + const routePermissions = to.meta.permissions || [] + const shouldAllPermissions = to.meta?.permissionLogic !== 'or' + + const hasPermissions = shouldAllPermissions ? routePermissions.every((p) => userInfo?.permissions?.includes(p)) : routePermissions.some((p) => userInfo?.permissions?.includes(p)) - const hasAuth = store.dispatch(isStaticSuper()) || !routeRoles.length || hasRole; + const hasAuth = store.dispatch(isStaticSuper()) || !routePermissions.length || hasPermissions; const routeSwitches: CommonType.StrategicPattern[] = [ // if it is login route when logged in, then switch to the root page diff --git a/web/src/service/api/api-token.ts b/web/src/service/api/api-token.ts index ae1a363f..37719aa9 100644 --- a/web/src/service/api/api-token.ts +++ b/web/src/service/api/api-token.ts @@ -12,11 +12,9 @@ export function getTokens(params?: any) { } /** create API Token */ -export function createToken(name: string) { +export function createToken(data) { return request({ - data: { - name - }, + data, method: 'post', url: '/auth/access_token' }); @@ -30,13 +28,12 @@ export function deleteToken(tokenID: string) { }); } -/** rename API Token */ -export function renameToken(tokenID: string, name: string) { +/** update API Token */ +export function updateToken(data) { + const { id, ...rest } = data return request({ - data: { - name - }, - method: 'post', - url: `/auth/access_token/${tokenID}/_rename` + data: rest, + method: 'put', + url: `/auth/access_token/${id}` }); } diff --git a/web/src/service/api/auth.ts b/web/src/service/api/auth.ts index fce25aea..b21167aa 100644 --- a/web/src/service/api/auth.ts +++ b/web/src/service/api/auth.ts @@ -5,11 +5,9 @@ import { request } from '../request'; * * @param password Password */ -export function fetchLogin(password: string) { +export function fetchLogin(data: any) { return request({ - data: { - password - }, + data, method: 'post', url: '/account/login' }); diff --git a/web/src/service/api/connector.ts b/web/src/service/api/connector.ts index d95cd7bf..f194b647 100644 --- a/web/src/service/api/connector.ts +++ b/web/src/service/api/connector.ts @@ -51,7 +51,7 @@ export function getConnectorByIDs(connectorIDs: string[]) { return request({ method: 'get', params: { - _source_includes: ['id', 'name', 'icon'].join(','), + _source_includes: ['id', 'name', 'icon', 'path_hierarchy'].join(','), size: connectorIDs.length }, url: `/connector/_search?${formatSearchFilter({ id: connectorIDs })}` diff --git a/web/src/service/api/data-source.ts b/web/src/service/api/data-source.ts index bf3d6628..444c7201 100644 --- a/web/src/service/api/data-source.ts +++ b/web/src/service/api/data-source.ts @@ -57,6 +57,13 @@ export function getDatasource(dataourceID: string) { }); } +export function getDocument(documentID: string) { + return request({ + method: 'get', + url: `/document/${documentID}` + }); +} + export function deleteDocument(documentID: string) { return request({ method: 'delete', diff --git a/web/src/service/api/entity.ts b/web/src/service/api/entity.ts new file mode 100644 index 00000000..5e99a692 --- /dev/null +++ b/web/src/service/api/entity.ts @@ -0,0 +1,18 @@ +import { request } from '../request'; + +export function fetchBatchEntityLabels(data: any) { + return request({ + method: 'post', + url: `/entity/label/_batch_get`, + data + }); +} + +export function fetchEntityCard(params: any) { + const { type, id } = params + + return request({ + method: 'post', + url: `/entity/card/${type}/${id}` + }); +} \ No newline at end of file diff --git a/web/src/service/api/security.ts b/web/src/service/api/security.ts new file mode 100644 index 00000000..bc63f652 --- /dev/null +++ b/web/src/service/api/security.ts @@ -0,0 +1,144 @@ +import { request } from '../request'; +import { formatSearchFilter } from '../request/es'; + +export function fetchRoles(params: any) { + const { filter = {}, ...rest } = params || {}; + return request({ + method: 'get', + params: rest, + url: `/security/role/_search?${formatSearchFilter(filter)}` + }); +} + +export function fetchRole(id: string) { + return request({ + method: 'get', + url: `/security/role/${id}` + }); +} + +export function createRole(data: any) { + return request({ + data, + method: 'post', + url: '/security/role/' + }); +} + +export function updateRole(data: any) { + const { id, ...rest } = data; + return request({ + data: rest, + method: 'put', + url: `/security/role/${id}` + }); +} + +export function deleteRole(id: string) { + return request({ + method: 'delete', + url: `/security/role/${id}` + }); +} + +export function fetchPermissions() { + return request({ + method: 'get', + url: `/security/permission/` + }); +} + +// POST /security/authorization/ +export function fetchAuthorization(data: any) { + return request({ + data, + method: 'post', + url: '/security/authorization/' + }); +} + +// GET /security/authorization/_search +export function fetchAuthorizationSearch(params: any) { + const { filter = {}, ...rest } = params || {}; + return request({ + method: 'get', + params: rest, + url: `/security/authorization/_search?${formatSearchFilter(filter)}` + }); +} + +// PUT /security/authorization/:id +export function updateAuthorization(data: any) { + const { id, ...rest } = data; + return request({ + data: rest, + method: 'put', + url: `/security/authorization/${id}` + }); +} + +// DELETE /security/authorization/:id +export function deleteAuthorization(id: string) { + return request({ + method: 'delete', + url: `/security/authorization/${id}` + }); +} + +// GET /security/authorization/:id +export function fetchAuthorizationDetail(id: string) { + return request({ + method: 'get', + url: `/security/authorization/${id}` + }); +} + +// GET /security/principal/_search?from=0&size=10&type=user type=user/team +export function fetchPrincipalSearch(params: any) { + const { filter = {}, ...rest } = params || {}; + return request({ + method: 'get', + params: rest, + url: `/security/principal/_search?${formatSearchFilter(filter)}` + }); +} + +export function fetchUsers(params: any) { + const { filter = {}, ...rest } = params || {}; + return request({ + method: 'get', + params: rest, + url: `/security/user/_search?${formatSearchFilter(filter)}` + }); +} + +export function fetchUser(id: string) { + return request({ + method: 'get', + url: `/security/user/${id}` + }); +} + +export function createUser(data: any) { + return request({ + data, + method: 'post', + url: '/security/user/' + }); +} + +export function updateUser(data: any) { + const { id, ...rest } = data; + return request({ + data: rest, + method: 'put', + url: `/security/user/${id}` + }); +} + +export function deleteUser(id: string) { + return request({ + method: 'delete', + url: `/security/user/${id}` + }); +} diff --git a/web/src/service/api/share.ts b/web/src/service/api/share.ts new file mode 100644 index 00000000..7b05ca82 --- /dev/null +++ b/web/src/service/api/share.ts @@ -0,0 +1,65 @@ +import { request } from '../request'; +import { formatSearchFilter } from '../request/es'; + +export function fetchShares(params: any) { + const { type, id } = params + + return request({ + method: 'get', + url: `/resources/${type}/${id}/shares` + }); +} + +export function fetchBatchShares(data: any) { + return request({ + method: 'post', + url: `/resources/shares/_batch_get`, + data + }); +} + +export function fetchCurrentUserPermission(params: any) { + const { type, id } = params + + return request({ + method: 'get', + url: `/resources/${type}/${id}/access` + }); +} + +export function addShares(data: any) { + return request({ + method: 'post', + url: `/resources/shares/_batch_set`, + data: data + }); +} + +export function updateShares(data: any) { + const { type, id, ...rest } = data + + return request({ + method: 'post', + url: `/resources/${type}/${id}/share`, + data: rest + }); +} + +export function deleteShares(data: any) { + const { type, id, fileID, ...rest } = data + + return request({ + method: 'delete', + url: `/resources/${type}/${id}/share/${fileID}`, + data: rest + }); +} + +export function fetchPrincipals(params) { + const { filter = {}, ...rest } = params || {} + return request({ + method: 'get', + params: rest, + url: `/security/principal/_search?${formatSearchFilter(filter)}` + }) +} \ No newline at end of file diff --git a/web/src/service/api/webhook.ts b/web/src/service/api/webhook.ts new file mode 100644 index 00000000..c4622792 --- /dev/null +++ b/web/src/service/api/webhook.ts @@ -0,0 +1,49 @@ +import { request } from '../request'; +import { formatSearchFilter } from '../request/es'; + +export function fetchWebhooks(params) { + const { filter = {}, ...rest } = params || {}; + return request({ + method: 'get', + params: rest, + url: `/webhook/_search?${formatSearchFilter(filter)}` + }); +} + +export function fetchWebhook(id: string) { + return request({ + method: 'get', + url: `/webhook/${id}` + }); +} + +export function createWebhook(data) { + return request({ + data, + method: 'post', + url: '/webhook/' + }); +} + +export function updateWebhook(data) { + const { id, ...rest } = data; + return request({ + data: rest, + method: 'put', + url: `/webhook/${id}` + }); +} + +export function deleteWebhook(id: string) { + return request({ + method: 'delete', + url: `/webhook/${id}` + }); +} + +export function testWebhook(id: string) { + return request({ + method: 'post', + url: `/webhook/${id}/_test` + }); +} \ No newline at end of file diff --git a/web/src/service/request/error.ts b/web/src/service/request/error.ts index ce65cd9f..02d48082 100644 --- a/web/src/service/request/error.ts +++ b/web/src/service/request/error.ts @@ -121,5 +121,6 @@ export function handleError( return; } - showErrorMsg(request.state, message); + const reason = error.response?.data?.error?.reason ? `, ${error.response?.data?.error?.reason}.` : '' + showErrorMsg(request.state, `${message}${reason}`, ); } diff --git a/web/src/store/slice/auth/index.ts b/web/src/store/slice/auth/index.ts index ccaed38c..95483052 100644 --- a/web/src/store/slice/auth/index.ts +++ b/web/src/store/slice/auth/index.ts @@ -1,38 +1,37 @@ -import { createSelector } from '@reduxjs/toolkit'; +import { createSelector } from "@reduxjs/toolkit"; -import { fetchGetUserInfo, fetchLogin } from '@/service/api'; -import { localStg } from '@/utils/storage'; +import { fetchGetUserInfo, fetchLogin } from "@/service/api"; +import { localStg } from "@/utils/storage"; -import type { AppThunk } from '../..'; -import { createAppSlice } from '../../createAppSlice'; -import { resetRouteStore } from '../route'; -import { cacheTabs } from '../tab'; +import type { AppThunk } from "../.."; +import { createAppSlice } from "../../createAppSlice"; +import { resetRouteStore } from "../route"; +import { cacheTabs } from "../tab"; -import { clearAuthStorage, getToken, getUserInfo } from './shared'; +import { clearAuthStorage, getToken, getUserInfo } from "./shared"; const initialState = { token: getToken(), - userInfo: getUserInfo() + userInfo: getUserInfo(), }; export const authSlice = createAppSlice({ initialState, - name: 'auth', - reducers: create => ({ + name: "auth", + reducers: (create) => ({ login: create.asyncThunk( - async ({ password }: { password: string; userName: string }) => { - const { data, error } = await fetchLogin(password); + async (params: { password: string; email: string }) => { + const { data, error } = await fetchLogin(params); // 1. stored in the localStorage, the later requests need it in headers if (!error) { - - const { data: info, error: userInfoError } = await fetchGetUserInfo(); + const { data: userInfo, error: userInfoError } = await fetchGetUserInfo(); if (!userInfoError) { // 2. store user info - localStg.set('userInfo', info); + localStg.set("userInfo", userInfo); return { token: data.access_token, - userInfo: info + userInfo: userInfo, }; } } @@ -46,18 +45,18 @@ export const authSlice = createAppSlice({ state.token = payload.token; state.userInfo = payload.userInfo; } - } - } + }, + }, ), resetAuth: create.reducer(() => ({ token: getToken(), - userInfo: getUserInfo() - })) + userInfo: getUserInfo(), + })), }), selectors: { - selectToken: auth => auth.token, - selectUserInfo: auth => auth.userInfo - } + selectToken: (auth) => auth.token, + selectUserInfo: (auth) => auth.userInfo, + }, }); export const { selectToken, selectUserInfo } = authSlice.selectors; export const { login, resetAuth } = authSlice.actions; @@ -66,7 +65,7 @@ export const { login, resetAuth } = authSlice.actions; export const getUerName = (): AppThunk => (_, getState) => { const pass = selectToken(getState()); - return pass ? selectUserInfo(getState())?.name : ''; + return pass ? selectUserInfo(getState())?.name : ""; }; /** is super role in static route */ @@ -75,12 +74,13 @@ export const isStaticSuper = (): AppThunk => (_, getState) => { const { roles = [] } = selectUserInfo(getState()) || {}; const { VITE_AUTH_ROUTE_MODE, VITE_STATIC_SUPER_ROLE } = import.meta.env; - // return VITE_AUTH_ROUTE_MODE === 'static' && roles.includes(VITE_STATIC_SUPER_ROLE); - return VITE_AUTH_ROUTE_MODE === 'static'; + return ( + VITE_AUTH_ROUTE_MODE === "static" && roles.includes(VITE_STATIC_SUPER_ROLE) + ); }; /** Reset auth store */ -export const resetStore = (): AppThunk => dispatch => { +export const resetStore = (): AppThunk => (dispatch) => { clearAuthStorage(); dispatch(resetAuth()); @@ -91,4 +91,6 @@ export const resetStore = (): AppThunk => dispatch => { }; /** Is login */ -export const getIsLogin = createSelector([selectUserInfo], userInfo => Boolean(userInfo)); +export const getIsLogin = createSelector([selectUserInfo], (userInfo) => + Boolean(userInfo), +); diff --git a/web/src/store/slice/route/index.ts b/web/src/store/slice/route/index.ts index 5c484637..5620cc22 100644 --- a/web/src/store/slice/route/index.ts +++ b/web/src/store/slice/route/index.ts @@ -12,7 +12,7 @@ import { initHomeTab } from '@/store/slice/tab'; import type { AppThunk } from '../..'; import { createAppSlice } from '../../createAppSlice'; -import { filterAuthRoutesByRoles, getCacheRouteNames, sortRoutesByOrder } from './shared'; +import { filterAuthRoutesByPermissions, getCacheRouteNames, sortRoutesByOrder } from './shared'; interface InitialStateType { authRoutes: ElegantConstRoute[]; @@ -196,8 +196,8 @@ const initStaticAuthRoute = (): AppThunk => (dispatch, getState) => { if (dispatch(isStaticSuper())) { dispatch(setAuthRoutes(staticAuthRoutes)); } else { - const userInfo = selectUserInfo(getState()); - const filteredAuthRoutes = filterAuthRoutesByRoles(staticAuthRoutes, userInfo.roles); + const userInfo = selectUserInfo(getState()) || {}; + const filteredAuthRoutes = filterAuthRoutesByPermissions(staticAuthRoutes, userInfo.permissions); dispatch(setAuthRoutes(filteredAuthRoutes)); } diff --git a/web/src/store/slice/route/shared.ts b/web/src/store/slice/route/shared.ts index dda1f2a6..ff20acba 100644 --- a/web/src/store/slice/route/shared.ts +++ b/web/src/store/slice/route/shared.ts @@ -34,6 +34,39 @@ function filterAuthRouteByRoles(route: ElegantConstRoute, roles: string[]) { return hasPermission || isEmptyRoles ? [filterRoute] : []; } +/** + * Filter auth routes by roles + * + * @param routes Auth routes + * @param permissions Permissions + */ +export function filterAuthRoutesByPermissions(routes: ElegantConstRoute[], permissions: string[]) { + return routes.flatMap(route => filterAuthRouteByPermissions(route, permissions)); +} + +/** + * Filter auth route by roles + * + * @param route Auth route + * @param permissions Permissions + */ +function filterAuthRouteByPermissions(route: ElegantConstRoute, permissions: string[] = []) { + const routePermissions = (route.meta && route.meta.permissions) || []; + const shouldAll = route.meta?.permissionLogic !== 'or' + + const isEmptyPermissions = !routePermissions.length; + + const hasPermission = shouldAll ? routePermissions.every(p => permissions.includes(p)) : routePermissions.some(p => permissions.includes(p)); + + const filterRoute = { ...route }; + + if (filterRoute.children?.length) { + filterRoute.children = filterRoute.children.flatMap(item => filterAuthRouteByPermissions(item, permissions)); + } + + return hasPermission || isEmptyPermissions ? [filterRoute] : []; +} + /** * sort route by order * diff --git a/web/src/types/app.d.ts b/web/src/types/app.d.ts index 4839014c..8420ed1d 100644 --- a/web/src/types/app.d.ts +++ b/web/src/types/app.d.ts @@ -366,8 +366,10 @@ declare namespace App { endpoint: FormMsg; phone: FormMsg; pwd: FormMsg; + pwdConfirm: FormMsg; required: string; userName: FormMsg; + noSpecial: FormMsg; }; icon: { collapse: string; diff --git a/web/src/types/auto-imports.d.ts b/web/src/types/auto-imports.d.ts index db669cbf..335f86fa 100644 --- a/web/src/types/auto-imports.d.ts +++ b/web/src/types/auto-imports.d.ts @@ -6,12 +6,24 @@ // biome-ignore lint: disable export {} declare global { + const AButton: typeof import('antd')['Button'] const ACard: typeof import('antd')['Card'] + const ACheckbox: typeof import('antd')['Checkbox'] + const AColorPicker: typeof import('antd')['ColorPicker'] const AConfigProvider: typeof import('antd')['ConfigProvider'] + const ADivider: typeof import('antd')['Divider'] + const ADrawer: typeof import('antd')['Drawer'] + const AFlex: typeof import('antd')['Flex'] const AGPL: typeof import('../components/License/AGPL.jsx')['default'] + const AInput: typeof import('antd')['Input'] const AMenu: typeof import('antd')['Menu'] + const ASpace: typeof import('antd')['Space'] + const ASwitch: typeof import('antd')['Switch'] + const ATooltip: typeof import('antd')['Tooltip'] const AWatermark: typeof import('antd')['Watermark'] + const AddShares: typeof import('../components/Resource/AddShares')['default'] const AppProvider: typeof import('../components/stateful/AppProvider')['default'] + const AvatarLabel: typeof import('../components/Resource/AvatarLabel')['default'] const BetterScroll: typeof import('../components/stateless/custom/BetterScroll')['default'] const BeyondHiding: typeof import('../components/stateless/custom/BeyondHiding')['default'] const BucketSVG: typeof import('../components/icons/index.jsx')['BucketSVG'] @@ -21,7 +33,9 @@ declare global { const DarkModeContainer: typeof import('../components/stateless/common/DarkModeContainer')['default'] const DarkSystemLogo: typeof import('../components/stateless/common/DarkSystemLogo')['default'] const DataSync: typeof import('../components/datasource/data_sync/index.jsx')['DataSync'] + const DocumentDrawer: typeof import('../components/DocumentDrawer/index')['default'] const DragContent: typeof import('../components/advanced/DragContent')['default'] + const EditShares: typeof import('../components/Resource/EditShares')['default'] const ExceptionBase: typeof import('../components/stateless/common/ExceptionBase')['default'] const FullScreen: typeof import('../components/stateless/common/FullScreen')['default'] const GlobalLoading: typeof import('../components/stateless/common/GlobalLoading')['default'] @@ -41,6 +55,7 @@ declare global { const ListContainer: typeof import('../components/stateless/common/ListContainer')['default'] const LocalFsSVG: typeof import('../components/icons/index.jsx')['LocalFsSVG'] const LookForward: typeof import('../components/stateless/custom/LookForward')['default'] + const Markdown: typeof import('../components/DocumentDrawer/Markdown.jsx')['default'] const MenuToggler: typeof import('../components/stateful/MenuToggler')['default'] const MultiFilePathInput: typeof import('../components/datasource/type/file_paths.jsx')['MultiFilePathInput'] const MultiURLInput: typeof import('../components/datasource/type/urls.jsx')['MultiURLInput'] @@ -50,11 +65,15 @@ declare global { const NotionSVG: typeof import('../components/icons/index.jsx')['NotionSVG'] const OAuthValidationPresets: typeof import('../components/oauth_connect')['OAuthValidationPresets'] const Outlet: typeof import('react-router-dom')['Outlet'] + const PERMISSION_MAPPING: typeof import('../components/Resource/Shares')['PERMISSION_MAPPING'] const PinToggler: typeof import('../components/stateless/common/PinToggler')['default'] + const PrincipalSelect: typeof import('../components/Resource/PrincipalSelect')['default'] const ReloadButton: typeof import('../components/stateless/common/ReloadButton')['default'] + const ResultDetail: typeof import('../components/DocumentDrawer/index.jsx')['ResultDetail'] const Route: typeof import('react-router-dom')['Route'] const Routes: typeof import('react-router-dom')['Routes'] const SearchSVG: typeof import('../components/icons/index.jsx')['SearchSVG'] + const Shares: typeof import('../components/Resource/Shares')['default'] const SoybeanAvatar: typeof import('../components/stateful/SoybeanAvatar')['default'] const SvgIcon: typeof import('../components/stateless/custom/SvgIcon')['default'] const SystemLogo: typeof import('../components/stateless/common/SystemLogo')['default'] @@ -70,10 +89,12 @@ declare global { const bucket: typeof import('../components/icons/bucket.jsx')['default'] const createRef: typeof import('react')['createRef'] const fontIcon: typeof import('../components/common/font_icon.jsx')['default'] + const formatDate: typeof import('../components/DocumentDrawer/index')['formatDate'] const forwardRef: typeof import('react')['forwardRef'] const googleDrive: typeof import('../components/icons/google_drive.jsx')['default'] const hugo: typeof import('../components/icons/hugo.jsx')['default'] const icon: typeof import('../components/common/icon.jsx')['default'] + const isWithin7Days: typeof import('../components/DocumentDrawer/index')['isWithin7Days'] const lazy: typeof import('react')['lazy'] const localFs: typeof import('../components/icons/local_fs.jsx')['default'] const memo: typeof import('react')['memo'] @@ -169,6 +190,7 @@ declare global { const useRequest: typeof import('ahooks')['useRequest'] const useResetState: typeof import('ahooks')['useResetState'] const useResolvedPath: typeof import('react-router-dom')['useResolvedPath'] + const useResource: typeof import('../components/Resource/hooks/useResource')['default'] const useResponsive: typeof import('ahooks')['useResponsive'] const useRouterPush: typeof import('../hooks/common/routerPush')['useRouterPush'] const useRoutes: typeof import('react-router-dom')['useRoutes'] diff --git a/web/src/types/elegant-router.d.ts b/web/src/types/elegant-router.d.ts index a5d00609..652c054a 100644 --- a/web/src/types/elegant-router.d.ts +++ b/web/src/types/elegant-router.d.ts @@ -41,6 +41,9 @@ declare module "@elegant-router/types" { "ai-assistant_new": "new"; "api-token": "/api-token"; "api-token_list": "list"; + "auth": "/auth"; + "auth_edit": "edit/:id"; + "auth_new": "new"; "connector": "/connector"; "connector_edit": "edit/:id"; "connector_new": "new"; @@ -65,8 +68,18 @@ declare module "@elegant-router/types" { "model-provider_edit": "edit/:id"; "model-provider_list": "list"; "model-provider_new": "new"; + "role": "/role"; + "role_edit": "edit/:id"; + "role_new": "new"; "search": "/search"; + "security": "/security"; "settings": "/settings"; + "user": "/user"; + "user_edit": "edit/:id"; + "user_new": "new"; + "webhook": "/webhook"; + "webhook_edit": "edit/:id"; + "webhook_new": "new"; }; /** @@ -116,6 +129,7 @@ declare module "@elegant-router/types" { | "500" | "ai-assistant" | "api-token" + | "auth" | "connector" | "data-source" | "guide" @@ -124,8 +138,12 @@ declare module "@elegant-router/types" { | "login" | "mcp-server" | "model-provider" + | "role" | "search" + | "security" | "settings" + | "user" + | "webhook" >; /** @@ -149,10 +167,11 @@ declare module "@elegant-router/types" { | "404" | "500" | "ai-assistant_edit" - | "ai-assistant" | "ai-assistant_list" | "ai-assistant_new" | "api-token_list" + | "auth_edit" + | "auth_new" | "connector_edit" | "connector_new" | "data-source_detail" @@ -172,8 +191,15 @@ declare module "@elegant-router/types" { | "model-provider_edit" | "model-provider_list" | "model-provider_new" + | "role_edit" + | "role_new" | "search" + | "security" | "settings" + | "user_edit" + | "user_new" + | "webhook_edit" + | "webhook_new" >; /** diff --git a/web/src/types/global.d.ts b/web/src/types/global.d.ts index 39a9be14..0a367a06 100644 --- a/web/src/types/global.d.ts +++ b/web/src/types/global.d.ts @@ -7,6 +7,31 @@ interface Window { $notification?: import('antd/es/notification/interface').NotificationInstance; /** NProgress instance */ NProgress?: import('nprogress').NProgress; + + /** WuJie global props */ + // 是否存在无界 + __POWERED_BY_WUJIE__?: boolean; + // 子应用公共加载路径 + __WUJIE_PUBLIC_PATH__: string; + // 原生的querySelector + __WUJIE_RAW_DOCUMENT_QUERY_SELECTOR__: typeof Document.prototype.querySelector; + // 原生的querySelectorAll + __WUJIE_RAW_DOCUMENT_QUERY_SELECTOR_ALL__: typeof Document.prototype.querySelectorAll; + // 原生的window对象 + __WUJIE_RAW_WINDOW__: Window; + // 子应用沙盒实例 + __WUJIE: any; + // 子应用mount函数 + __WUJIE_MOUNT: () => void; + // 子应用unmount函数 + __WUJIE_UNMOUNT: () => void | Promise; + // 注入对象 + $wujie: { + bus: any; + shadowRoot?: ShadowRoot; + props?: { [key: string]: any }; + location?: Object; + }; } interface ImportMeta { diff --git a/web/src/types/router.d.ts b/web/src/types/router.d.ts index 512835c6..6cd0f279 100644 --- a/web/src/types/router.d.ts +++ b/web/src/types/router.d.ts @@ -62,6 +62,7 @@ declare module '@ohh-889/react-auto-route' { * It only works when the route mode is "static", if the route mode is "dynamic", it will be ignored */ roles?: string[]; + permissions?: string[]; /** * Title of the route * diff --git a/web/widgets/fullscreen/src/Fullscreen.jsx b/web/widgets/fullscreen/src/Fullscreen.jsx index be409d4a..6550c8f2 100644 --- a/web/widgets/fullscreen/src/Fullscreen.jsx +++ b/web/widgets/fullscreen/src/Fullscreen.jsx @@ -6,17 +6,16 @@ import FullscreenModal from './FullscreenModal'; import './ui-search/index.css'; export default (props) => { - const { shadow, id, token, server, enableQueryParams = true } = props; + const { shadow, id, server, enableQueryParams = true } = props; const [settings, setSettings] = useState() const { payload = {}, enabled_module = {} } = settings || {} - async function fetchSettings(server, id, token) { - if (!server || !id || !token) return; + async function fetchSettings(server, id) { + if (!server || !id) return; fetch(`${server}/integration/${id}`, { headers: { 'APP-INTEGRATION-ID': id, - 'X-API-TOKEN': token, 'Content-Type': 'application/json', }, method: 'GET', @@ -39,7 +38,6 @@ export default (props) => { method: 'POST', headers: { 'APP-INTEGRATION-ID': id, - 'X-API-TOKEN': token, }, credentials: 'include', body: shouldAgg ? JSON.stringify({ @@ -84,7 +82,6 @@ export default (props) => { const response = await fetch(`${server}/assistant/${assistantID}/_ask`, { headers: { 'APP-INTEGRATION-ID': id, - 'X-API-TOKEN': token, }, method: 'POST', credentials: 'include', @@ -134,8 +131,8 @@ export default (props) => { } useEffect(() => { - fetchSettings(server, id, token); - }, [server, id, token]); + fetchSettings(server, id); + }, [server, id]); const componentProps = { ...props, diff --git a/web/widgets/fullscreen/src/ui-search/index.js b/web/widgets/fullscreen/src/ui-search/index.js index 17259a54..c92b8695 100644 --- a/web/widgets/fullscreen/src/ui-search/index.js +++ b/web/widgets/fullscreen/src/ui-search/index.js @@ -3,35 +3,35 @@ import*as e from"react";import t,{useContext as n,isValidElement as r,version as Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=[];return t.Children.forEach(e,function(e){(null!=e||n.keepEmpty)&&(Array.isArray(e)?r=r.concat(on(e)):an(e)&&e.props?r=r.concat(on(e.props.children,n)):r.push(e))}),r}function sn(e){return e instanceof HTMLElement||e instanceof SVGElement}function ln(e){var n,r=function(e){return e&&"object"===N(e)&&sn(e.nativeElement)?e.nativeElement:sn(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=x.findDOMNode)||void 0===n?void 0:n.call(x,e):null)}var cn,un={exports:{}},hn={},dn=Symbol.for("react.element"),pn=Symbol.for("react.portal"),fn=Symbol.for("react.fragment"),gn=Symbol.for("react.strict_mode"),mn=Symbol.for("react.profiler"),yn=Symbol.for("react.provider"),vn=Symbol.for("react.context"),bn=Symbol.for("react.server_context"),xn=Symbol.for("react.forward_ref"),wn=Symbol.for("react.suspense"),En=Symbol.for("react.suspense_list"),kn=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),_n=Symbol.for("react.offscreen");function Cn(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case dn:switch(e=e.type){case fn:case mn:case gn:case wn:case En:return e;default:switch(e=e&&e.$$typeof){case bn:case vn:case xn:case Tn:case kn:case yn:return e;default:return t}}case pn:return t}}}cn=Symbol.for("react.module.reference"),hn.ContextConsumer=vn,hn.ContextProvider=yn,hn.Element=dn,hn.ForwardRef=xn,hn.Fragment=fn,hn.Lazy=Tn,hn.Memo=kn,hn.Portal=pn,hn.Profiler=mn,hn.StrictMode=gn,hn.Suspense=wn,hn.SuspenseList=En,hn.isAsyncMode=function(){return!1},hn.isConcurrentMode=function(){return!1},hn.isContextConsumer=function(e){return Cn(e)===vn},hn.isContextProvider=function(e){return Cn(e)===yn},hn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===dn},hn.isForwardRef=function(e){return Cn(e)===xn},hn.isFragment=function(e){return Cn(e)===fn},hn.isLazy=function(e){return Cn(e)===Tn},hn.isMemo=function(e){return Cn(e)===kn},hn.isPortal=function(e){return Cn(e)===pn},hn.isProfiler=function(e){return Cn(e)===mn},hn.isStrictMode=function(e){return Cn(e)===gn},hn.isSuspense=function(e){return Cn(e)===wn},hn.isSuspenseList=function(e){return Cn(e)===En},hn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===fn||e===mn||e===gn||e===wn||e===En||e===_n||"object"==typeof e&&null!==e&&(e.$$typeof===Tn||e.$$typeof===kn||e.$$typeof===yn||e.$$typeof===vn||e.$$typeof===xn||e.$$typeof===cn||void 0!==e.getModuleId)},hn.typeOf=Cn,un.exports=hn;var Sn=un.exports,An=Number(i.split(".")[0]),Nn=function(e,t){"function"==typeof e?e(t):"object"===N(e)&&e&&"current"in e&&(e.current=t)},In=function(){for(var e=arguments.length,t=new Array(e),n=0;n=19)return!0;var r=Sn.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===Sn.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===Sn.ForwardRef)};function Mn(e){return r(e)&&!an(e)}var Rn=function(e){if(e&&Mn(e)){var t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null},Dn=e.createContext(null);var Pn=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){$n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),jn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){$n&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;zn.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Un=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),tr="undefined"!=typeof WeakMap?new WeakMap:new Pn,nr=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Hn.getInstance(),r=new er(t,n,this);tr.set(this,r)};["observe","unobserve","disconnect"].forEach(function(e){nr.prototype[e]=function(){var t;return(t=tr.get(this))[e].apply(t,arguments)}});var rr=void 0!==Bn.ResizeObserver?Bn.ResizeObserver:nr,ir=new Map;var ar=new rr(function(e){e.forEach(function(e){var t,n=e.target;null===(t=ir.get(n))||void 0===t||t.forEach(function(e){return e(n)})})});var or=function(){ye(n,e.Component);var t=xe(n);function n(){return re(this,n),t.apply(this,arguments)}return ae(n,[{key:"render",value:function(){return this.props.children}}]),n}();function sr(t,n){var r=t.children,i=t.disabled,a=e.useRef(null),o=e.useRef(null),s=e.useContext(Dn),l="function"==typeof r,c=l?r(a):r,u=e.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=!l&&e.isValidElement(c)&&Ln(c),d=h?Rn(c):null,p=On(d,a),f=function(){var e;return ln(a.current)||(a.current&&"object"===N(a.current)?ln(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||ln(o.current)};e.useImperativeHandle(n,function(){return f()});var g=e.useRef(t);g.current=t;var m=e.useCallback(function(e){var t=g.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),a=i.width,o=i.height,l=e.offsetWidth,c=e.offsetHeight,h=Math.floor(a),d=Math.floor(o);if(u.current.width!==h||u.current.height!==d||u.current.offsetWidth!==l||u.current.offsetHeight!==c){var p={width:h,height:d,offsetWidth:l,offsetHeight:c};u.current=p;var f=l===Math.round(a)?a:l,m=c===Math.round(o)?o:c,y=D(D({},p),{},{offsetWidth:f,offsetHeight:m});null==s||s(y,e,r),n&&Promise.resolve().then(function(){n(y,e)})}},[]);return e.useEffect(function(){var e=f();return e&&!i&&function(e,t){ir.has(e)||(ir.set(e,new Set),ar.observe(e)),ir.get(e).add(t)}(e,m),function(){return function(e,t){ir.has(e)&&(ir.get(e).delete(t),ir.get(e).size||(ar.unobserve(e),ir.delete(e)))}(e,m)}},[a.current,i]),e.createElement(or,{ref:o},h?e.cloneElement(c,{ref:p}):c)}var lr=e.forwardRef(sr);function cr(t,n){var r=t.children;return("function"==typeof r?[r]:on(r)).map(function(r,i){var a=(null==r?void 0:r.key)||"".concat("rc-observer-key","-").concat(i);return e.createElement(lr,Xe({},t,{key:a,ref:0===i?n:void 0}),r)})}var ur=e.forwardRef(cr);ur.Collection=function(t){var n=t.children,r=t.onBatchResize,i=e.useRef(0),a=e.useRef([]),o=e.useContext(Dn),s=e.useCallback(function(e,t,n){i.current+=1;var s=i.current;a.current.push({size:e,element:t,data:n}),Promise.resolve().then(function(){s===i.current&&(null==r||r(a.current),a.current=[])}),null==o||o(e,t,n)},[r,o]);return e.createElement(Dn.Provider,{value:s},n)};var hr=function(e){return+setTimeout(e,16)},dr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(hr=function(e){return window.requestAnimationFrame(e)},dr=function(e){return window.cancelAnimationFrame(e)});var pr=0,fr=new Map;function gr(e){fr.delete(e)}var mr=function(e){var t=pr+=1;return function n(r){if(0===r)gr(t),e();else{var i=hr(function(){n(r-1)});fr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};mr.cancel=function(e){var t=fr.get(e);return gr(e),dr(t)};var yr=a({});function vr(e){return T(e)||L(e)||C(e)||S()}function br(e,t){for(var n=e,r=0;r3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!br(e,t.slice(0,-1))?e:xr(e,t,n,r)}function Er(e){return Array.isArray(e)?[]:{}}var kr="undefined"==typeof Reflect?Object.keys:Reflect.ownKeys;function Tr(){for(var e=arguments.length,t=new Array(e),n=0;n{const e=()=>{};return e.deprecated=_r,e};var Ar=a(void 0),Nr={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},Ir=D(D({},{yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const Or={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},Lr={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},Ir),timePickerLocale:Object.assign({},Or)},Mr="${label} is not a valid ${type}",Rr={locale:"en",Pagination:Nr,DatePicker:Lr,TimePicker:Or,Calendar:Lr,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:Mr,method:Mr,array:Mr,object:Mr,number:Mr,date:Mr,boolean:Mr,integer:Mr,float:Mr,regexp:Mr,email:Mr,url:Mr,hex:Mr},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let Dr=Object.assign({},Rr.Modal),Pr=[];const $r=()=>Pr.reduce((e,t)=>Object.assign(Object.assign({},e),t),Rr.Modal);function Br(){return Dr}const Fr=a(void 0),zr=(t,n)=>{const r=e.useContext(Fr),i=e.useMemo(()=>{var e;const i=n||Rr[t],a=null!==(e=null==r?void 0:r[t])&&void 0!==e?e:{};return Object.assign(Object.assign({},"function"==typeof i?i():i),a||{})},[t,n,r]);return[i,e.useMemo(()=>{const e=null==r?void 0:r.locale;return(null==r?void 0:r.exist)&&!e?Rr.locale:e},[r])]},jr=t=>{const{locale:n={},children:r,_ANT_MARK__:i}=t;e.useEffect(()=>{const e=function(e){if(e){const t=Object.assign({},e);return Pr.push(t),Dr=$r(),()=>{Pr=Pr.filter(e=>e!==t),Dr=$r()}}Dr=Object.assign({},Rr.Modal)}(null==n?void 0:n.Modal);return e},[n]);const a=e.useMemo(()=>Object.assign(Object.assign({},n),{exist:!0}),[n]);return e.createElement(Fr.Provider,{value:a},r)},Hr={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Ur=Object.assign(Object.assign({},Hr),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),Gr=Math.round;function qr(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||"",e);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const Wr=(e,t,n)=>0===n?e:e/100;function Vr(e,t){const n=t||255;return e>n?n:e<0?0:e}class Yr{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if(O(this,"isValid",!0),O(this,"r",0),O(this,"g",0),O(this,"b",0),O(this,"a",1),O(this,"_h",void 0),O(this,"_s",void 0),O(this,"_l",void 0),O(this,"_v",void 0),O(this,"_max",void 0),O(this,"_min",void 0),O(this,"_brightness",void 0),e)if("string"==typeof e){const n=e.trim();function r(e){return n.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(n)?this.fromHexString(n):r("rgb")?this.fromRgbString(n):r("hsl")?this.fromHslString(n):(r("hsv")||r("hsb"))&&this.fromHsvString(n)}else if(e instanceof Yr)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=Vr(e.r),this.g=Vr(e.g),this.b=Vr(e.b),this.a="number"==typeof e.a?Vr(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else{if(!t("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e));this.fromHsv(e)}else;}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return.2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if(void 0===this._h){const e=this.getMax()-this.getMin();this._h=0===e?0:Gr(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:Gr(i("r")),g:Gr(i("g")),b:Gr(i("b")),a:Gr(100*i("a"))/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>Gr((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;const n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;const r=(this.b||0).toString(16);if(e+=2===r.length?r:"0"+r,"number"==typeof this.a&&this.a>=0&&this.a<1){const t=Gr(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=Gr(100*this.getSaturation()),n=Gr(100*this.getLightness());return 1!==this.a?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=Vr(t,n),r}_c(e){return new this.constructor(e)}getMax(){return void 0===this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return void 0===this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a="number"==typeof r?r:1,t<=0){const e=Gr(255*n);this.r=e,this.g=e,this.b=e}let i=0,a=0,o=0;const s=e/60,l=(1-Math.abs(2*n-1))*t,c=l*(1-Math.abs(s%2-1));s>=0&&s<1?(i=l,a=c):s>=1&&s<2?(i=c,a=l):s>=2&&s<3?(a=l,o=c):s>=3&&s<4?(a=c,o=l):s>=4&&s<5?(i=c,o=l):s>=5&&s<6&&(i=l,o=c);const u=n-l/2;this.r=Gr(255*(i+u)),this.g=Gr(255*(a+u)),this.b=Gr(255*(o+u))}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a="number"==typeof r?r:1;const i=Gr(255*n);if(this.r=i,this.g=i,this.b=i,t<=0)return;const a=e/60,o=Math.floor(a),s=a-o,l=Gr(n*(1-t)*255),c=Gr(n*(1-t*s)*255),u=Gr(n*(1-t*(1-s))*255);switch(o){case 0:this.g=u,this.b=l;break;case 1:this.r=c,this.b=l;break;case 2:this.r=l,this.b=u;break;case 3:this.r=l,this.g=c;break;case 4:this.r=u,this.g=l;break;default:this.g=l,this.b=c}}fromHsvString(e){const t=qr(e,Wr);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=qr(e,Wr);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=qr(e,(e,t)=>t.includes("%")?Gr(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}var Xr=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function Kr(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function Qr(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(100*r)/100);var r}function Zr(e,t,n){var r;return r=n?e.v+.05*t:e.v-.15*t,r=Math.max(0,Math.min(1,r)),Math.round(100*r)/100}function Jr(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=new Yr(e),i=r.toHsv(),a=5;a>0;a-=1){var o=new Yr({h:Kr(i,a,!0),s:Qr(i,a,!0),v:Zr(i,a,!0)});n.push(o)}n.push(r);for(var s=1;s<=4;s+=1){var l=new Yr({h:Kr(i,s),s:Qr(i,s),v:Zr(i,s)});n.push(l)}return"dark"===t.theme?Xr.map(function(e){var r=e.index,i=e.amount;return new Yr(t.backgroundColor||"#141414").mix(n[r],i).toHexString()}):n.map(function(e){return e.toHexString()})}var ei={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},ti=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];ti.primary=ti[5];var ni=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];ni.primary=ni[5];var ri=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];ri.primary=ri[5];var ii=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];ii.primary=ii[5];var ai=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];ai.primary=ai[5];var oi=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];oi.primary=oi[5];var si=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];si.primary=si[5];var li=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];li.primary=li[5];var ci=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];ci.primary=ci[5];var ui=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];ui.primary=ui[5];var hi=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];hi.primary=hi[5];var di=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];di.primary=di[5];var pi=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];pi.primary=pi[5];var fi={red:ti,volcano:ni,orange:ri,gold:ii,yellow:ai,lime:oi,green:si,cyan:li,blue:ci,geekblue:ui,purple:hi,magenta:di,grey:pi};function gi(e){return(e+8)/e}const mi=e=>{const t=function(e){const t=Array.from({length:10}).map((t,n)=>{const r=n-1,i=e*Math.pow(Math.E,r/5),a=n>1?Math.floor(i):Math.ceil(i);return 2*Math.floor(a/2)});return t[1]=e,t.map(e=>({size:e,lineHeight:gi(e)}))}(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),i=n[1],a=n[0],o=n[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*i),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};const yi=(e,t)=>new Yr(e).setA(t).toRgbString(),vi=(e,t)=>new Yr(e).darken(t).toHexString(),bi=e=>{const t=Jr(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},xi=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:yi(r,.88),colorTextSecondary:yi(r,.65),colorTextTertiary:yi(r,.45),colorTextQuaternary:yi(r,.25),colorFill:yi(r,.15),colorFillSecondary:yi(r,.06),colorFillTertiary:yi(r,.04),colorFillQuaternary:yi(r,.02),colorBgSolid:yi(r,1),colorBgSolidHover:yi(r,.75),colorBgSolidActive:yi(r,.95),colorBgLayout:vi(n,4),colorBgContainer:vi(n,0),colorBgElevated:vi(n,0),colorBgSpotlight:yi(r,.85),colorBgBlur:"transparent",colorBorder:vi(n,15),colorBorderSecondary:vi(n,6)}};const wi=_e(function(e){ei.pink=ei.magenta,fi.pink=fi.magenta;const t=Object.keys(Hr).map(t=>{const n=e[t]===ei[t]?fi[t]:Jr(e[t]);return Array.from({length:10},()=>1).reduce((e,r,i)=>(e[`${t}-${i+1}`]=n[i],e[`${t}${i+1}`]=n[i],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:o,colorPrimary:s,colorBgBase:l,colorTextBase:c}=e,u=t(s),h=t(r),d=t(i),p=t(a),f=t(o),g=n(l,c),m=t(e.colorLink||e.colorInfo),y=new Yr(p[1]).mix(new Yr(p[3]),50).toHexString();return Object.assign(Object.assign({},g),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:y,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:d[1],colorWarningBgHover:d[2],colorWarningBorder:d[3],colorWarningBorderHover:d[4],colorWarningHover:d[4],colorWarning:d[6],colorWarningActive:d[7],colorWarningTextHover:d[8],colorWarningText:d[9],colorWarningTextActive:d[10],colorInfoBg:f[1],colorInfoBgHover:f[2],colorInfoBorder:f[3],colorInfoBorderHover:f[4],colorInfoHover:f[4],colorInfo:f[6],colorInfoActive:f[7],colorInfoTextHover:f[8],colorInfoText:f[9],colorInfoTextActive:f[10],colorLinkHover:m[4],colorLink:m[6],colorLinkActive:m[7],colorBgMask:new Yr("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:bi,generateNeutralColorPalettes:xi})),mi(e.fontSize)),function(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),(e=>{const{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}})(e)),function(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+2*t).toFixed(1)}s`,motionDurationSlow:`${(n+3*t).toFixed(1)}s`,lineWidthBold:i+1},(e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}})(r))}(e))}),Ei={token:Ur,override:{override:Ur},hashed:!0},ki=t.createContext(Ei),Ti="ant",_i="anticon",Ci=["outlined","borderless","filled","underlined"],Si=e.createContext({getPrefixCls:(e,t)=>t||(e?`${Ti}-${e}`:Ti),iconPrefixCls:_i}),{Consumer:Ai}=Si,Ni={};function Ii(t){const n=e.useContext(Si),{getPrefixCls:r,direction:i,getPopupContainer:a}=n,o=n[t];return Object.assign(Object.assign({classNames:Ni,styles:Ni},o),{getPrefixCls:r,direction:i,getPopupContainer:a})}const Oi=`-ant-${Date.now()}-${Math.random()}`;function Li(e,t){const n=function(e,t){const n={},r=(e,t)=>{let n=e.clone();return n=(null==t?void 0:t(n))||n,n.toRgbString()},i=(e,t)=>{const i=new Yr(e),a=Jr(i.toRgbString());n[`${t}-color`]=r(i),n[`${t}-color-disabled`]=a[1],n[`${t}-color-hover`]=a[4],n[`${t}-color-active`]=a[6],n[`${t}-color-outline`]=i.clone().setA(.2).toRgbString(),n[`${t}-color-deprecated-bg`]=a[0],n[`${t}-color-deprecated-border`]=a[2]};if(t.primaryColor){i(t.primaryColor,"primary");const e=new Yr(t.primaryColor),a=Jr(e.toRgbString());a.forEach((e,t)=>{n[`primary-${t+1}`]=e}),n["primary-color-deprecated-l-35"]=r(e,e=>e.lighten(35)),n["primary-color-deprecated-l-20"]=r(e,e=>e.lighten(20)),n["primary-color-deprecated-t-20"]=r(e,e=>e.tint(20)),n["primary-color-deprecated-t-50"]=r(e,e=>e.tint(50)),n["primary-color-deprecated-f-12"]=r(e,e=>e.setA(.12*e.a));const o=new Yr(a[0]);n["primary-color-active-deprecated-f-30"]=r(o,e=>e.setA(.3*e.a)),n["primary-color-active-deprecated-d-02"]=r(o,e=>e.darken(2))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),`\n :root {\n ${Object.keys(n).map(t=>`--${e}-${t}: ${n[t]};`).join("\n")}\n }\n `.trim()}(e,t);$()&&Y(n,`${Oi}-dynamic-theme`)}const Mi=e.createContext(!1),Ri=({children:t,disabled:n})=>{const r=e.useContext(Mi);return e.createElement(Mi.Provider,{value:null!=n?n:r},t)},Di=e.createContext(void 0),Pi=({children:t,size:n})=>{const r=e.useContext(Di);return e.createElement(Di.Provider,{value:n||r},t)};var $i=ae(function e(){re(this,e)}),Bi="CALC_UNIT",Fi=new RegExp(Bi,"g");function zi(e){return"number"==typeof e?"".concat(e).concat(Bi):e}var ji=function(){ye(t,$i);var e=xe(t);function t(n,r){var i;re(this,t),O(ge(i=e.call(this)),"result",""),O(ge(i),"unitlessCssVar",void 0),O(ge(i),"lowPriority",void 0);var a=N(n);return i.unitlessCssVar=r,n instanceof t?i.result="(".concat(n.result,")"):"number"===a?i.result=zi(n):"string"===a&&(i.result=n),i}return ae(t,[{key:"add",value:function(e){return e instanceof t?this.result="".concat(this.result," + ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," + ").concat(zi(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof t?this.result="".concat(this.result," - ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," - ").concat(zi(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," * ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," / ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){var t=this,n=(e||{}).unit,r=!0;return"boolean"==typeof n?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(Fi,r?"px":""),void 0!==this.lowPriority?"calc(".concat(this.result,")"):this.result}}]),t}(),Hi=function(){ye(t,$i);var e=xe(t);function t(n){var r;return re(this,t),O(ge(r=e.call(this)),"result",0),n instanceof t?r.result=n.result:"number"==typeof n&&(r.result=n),r}return ae(t,[{key:"add",value:function(e){return e instanceof t?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof t?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof t?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof t?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),t}(),Ui=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function Gi(t){var n=e.useRef();n.current=t;var r=e.useCallback(function(){for(var e,t=arguments.length,r=new Array(t),i=0;i1e4){var t=Date.now();this.lastAccessBeat.forEach(function(n,r){t-n>6e5&&(e.map.delete(r),e.lastAccessBeat.delete(r))}),this.accessBeat=0}}}]),e}(),na=new ta;var ra=function(){return{}};const ia=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];function aa(e){return e>=0&&e<=255}function oa(e,t){const{r:n,g:r,b:i,a:a}=new Yr(e).toRgb();if(a<1)return e;const{r:o,g:s,b:l}=new Yr(t).toRgb();for(let e=.01;e<=1;e+=.01){const t=Math.round((n-o*(1-e))/e),a=Math.round((r-s*(1-e))/e),c=Math.round((i-l*(1-e))/e);if(aa(t)&&aa(a)&&aa(c))return new Yr({r:t,g:a,b:c,a:Math.round(100*e)/100}).toRgbString()}return new Yr({r:n,g:r,b:i,a:1}).toRgbString()}var sa=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{delete r[e]});const i=Object.assign(Object.assign({},n),r),a=1200,o=1600;if(!1===i.motion){const e="0s";i.motionDurationFast=e,i.motionDurationMid=e,i.motionDurationSlow=e}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:oa(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:oa(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:oa(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:3*i.lineWidth,lineWidth:i.lineWidth,controlOutlineWidth:2*i.lineWidth,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:oa(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:a,screenXLMin:a,screenXLMax:1599,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`\n 0 1px 2px -2px ${new Yr("rgba(0, 0, 0, 0.16)").toRgbString()},\n 0 3px 6px 0 ${new Yr("rgba(0, 0, 0, 0.12)").toRgbString()},\n 0 5px 12px 4px ${new Yr("rgba(0, 0, 0, 0.09)").toRgbString()}\n `,boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var ca=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const r=n.getDerivativeToken(e),{override:i}=t,a=ca(t,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=la(o),a&&Object.entries(a).forEach(([e,t])=>{const{theme:n}=t,r=ca(t,["theme"]);let i=r;n&&(i=pa(Object.assign(Object.assign({},o),r),{override:r},n)),o[e]=i}),o};function fa(){const{token:e,hashed:n,theme:r,override:i,cssVar:a}=t.useContext(ki),o=`5.27.4-${n||""}`,s=r||wi,[l,c,u]=Ye(s,[Ur,e],{salt:o,override:i,getComputedToken:pa,formatToken:la,cssVar:a&&{prefix:a.prefix,key:a.key,unitless:ua,ignore:ha,preserve:da}});return[s,u,n?c:"",l,a]}const ga={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ma=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),ya=(e,t)=>({outline:`${Le(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:null!=t?t:1,transition:"outline-offset 0s, outline 0s"}),va=(e,t)=>({"&:focus-visible":ya(e,t)}),ba=e=>({[`.${e}`]:Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{[`.${e} .${e}-icon`]:{display:"block"}})}),xa=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},va(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}}),{genStyleHooks:wa,genComponentStyleHook:Ea,genSubStyleComponent:ka}=function(e){var r=e.useCSP,i=void 0===r?ra:r,a=e.useToken,o=e.usePrefix,s=e.getResetStyles,l=e.getCommonStyle,c=e.getCompUnitless;function u(n,r,c){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=Array.isArray(n)?n:[n,n],d=A(h,1)[0],p=h.join("-"),f=e.layer||{name:"antd"};return function(e){var n,h,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,m=a(),y=m.theme,v=m.realToken,b=m.hashId,x=m.token,w=m.cssVar,E=o(),k=E.rootPrefixCls,T=E.iconPrefixCls,_=i(),C=w?"css":"js",S=(n=function(){var e=new Set;return w&&Object.keys(u.unitless||{}).forEach(function(t){e.add(Re(t,w.prefix)),e.add(Re(t,Ui(d,w.prefix)))}),function(e,t){var n="css"===e?ji:Hi;return function(e){return new n(e,t)}}(C,e)},h=[C,d,null==w?void 0:w.prefix],t.useMemo(function(){var e=na.get(h);if(e)return e;var t=n();return na.set(h,t),t},h)),A=function(e){return"js"===e?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:e,n=A(f(e,t),2)[1],r=A(g(t),2);return[r[0],n,r[1]]}},genSubStyleComponent:function(e,t,n){var r=u(e,t,n,D({resetStyle:!1,order:-998},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));return function(e){var t=e.prefixCls,n=e.rootCls;return r(t,void 0===n?t:n),null}},genComponentStyleHook:u}}({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=n(Si);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,i]=fa();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:e}=n(Si);return null!=e?e:{}},getResetStyles:(e,t)=>{var n;const r=(e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}))(e);return[r,{"&":r},ba(null!==(n=null==t?void 0:t.prefix.iconPrefixCls)&&void 0!==n?n:_i)]},getCommonStyle:(e,t,n,r)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=n?`.${n}`:i,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let s={};return!1!==r&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},getCompUnitless:()=>ua});function Ta(e,t){return ia.reduce((n,r)=>{const i=e[`${r}1`],a=e[`${r}3`],o=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}const _a=Object.assign({},e),{useId:Ca}=_a,Sa=void 0===Ca?()=>"":Ca;var Aa=["children"],Na=e.createContext({});function Ia(t){var n=t.children,r=X(t,Aa);return e.createElement(Na.Provider,{value:r},n)}var Oa=function(){ye(n,e.Component);var t=xe(n);function n(){return re(this,n),t.apply(this,arguments)}return ae(n,[{key:"render",value:function(){return this.props.children}}]),n}();var La="none",Ma="appear",Ra="enter",Da="leave",Pa="none",$a="prepare",Ba="start",Fa="active",za="end",ja="prepared";function Ha(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Ua=function(e,t){var n={animationend:Ha("Animation","AnimationEnd"),transitionend:Ha("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}($(),"undefined"!=typeof window?window:{}),Ga={};if($()){var qa=document.createElement("div");Ga=qa.style}var Wa={};function Va(e){if(Wa[e])return Wa[e];var t=Ua[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:2;n();var a=mr(function(){i<=1?r({isCanceled:function(){return a!==t.current}}):e(r,i-1)});t.current=a},n]}(),l=A(s,2),c=l[0],u=l[1];var h=n?no:to;return eo(function(){if(a!==Pa&&a!==za){var e=h.indexOf(a),t=h[e+1],n=r(a);n===ro?o(t,!0):t&&c(function(e){function r(){e.isCanceled()||o(t,!0)}!0===n?r():Promise.resolve(n).then(r)})}},[t,a]),e.useEffect(function(){return function(){u()}},[]),[function(){o($a,!0)},a]};function oo(t,n,r,i){var a,s,c,u,h=i.motionEnter,d=void 0===h||h,p=i.motionAppear,f=void 0===p||p,g=i.motionLeave,m=void 0===g||g,y=i.motionDeadline,v=i.motionLeaveImmediately,b=i.onAppearPrepare,x=i.onEnterPrepare,w=i.onLeavePrepare,E=i.onAppearStart,k=i.onEnterStart,T=i.onLeaveStart,_=i.onAppearActive,C=i.onEnterActive,S=i.onLeaveActive,N=i.onAppearEnd,I=i.onEnterEnd,L=i.onLeaveEnd,M=i.onVisibleChanged,R=A(qi(),2),P=R[0],$=R[1],B=(a=La,s=e.useReducer(function(e){return e+1},0),c=A(s,2)[1],u=e.useRef(a),[Gi(function(){return u.current}),Gi(function(e){u.current="function"==typeof e?e(u.current):e,c()})]),F=A(B,2),z=F[0],j=F[1],H=A(qi(null),2),U=H[0],G=H[1],q=z(),W=o(!1),V=o(null);function Y(){return r()}var X=o(!1);function K(){j(La),G(null,!0)}var Q=Gi(function(e){var t=z();if(t!==La){var n=Y();if(!e||e.deadline||e.target===n){var r,i=X.current;t===Ma&&i?r=null==N?void 0:N(n,e):t===Ra&&i?r=null==I?void 0:I(n,e):t===Da&&i&&(r=null==L?void 0:L(n,e)),i&&!1!==r&&K()}}}),Z=function(t){var n=o();function r(e){e&&(e.removeEventListener(Za,t),e.removeEventListener(Qa,t))}return e.useEffect(function(){return function(){r(n.current)}},[]),[function(e){n.current&&n.current!==e&&r(n.current),e&&e!==n.current&&(e.addEventListener(Za,t),e.addEventListener(Qa,t),n.current=e)},r]}(Q),J=A(Z,1)[0],ee=function(e){switch(e){case Ma:return O(O(O({},$a,b),Ba,E),Fa,_);case Ra:return O(O(O({},$a,x),Ba,k),Fa,C);case Da:return O(O(O({},$a,w),Ba,T),Fa,S);default:return{}}},te=e.useMemo(function(){return ee(q)},[q]),ne=A(ao(q,!t,function(e){if(e===$a){var t=te[$a];return t?t(Y()):ro}var n;ie in te&&G((null===(n=te[ie])||void 0===n?void 0:n.call(te,Y(),null))||null);return ie===Fa&&q!==La&&(J(Y()),y>0&&(clearTimeout(V.current),V.current=setTimeout(function(){Q({deadline:!0})},y))),ie===ja&&K(),true}),2),re=ne[0],ie=ne[1],ae=io(ie);X.current=ae;var oe=o(null);eo(function(){if(!W.current||oe.current!==n){$(n);var e,r=W.current;W.current=!0,!r&&n&&f&&(e=Ma),r&&n&&d&&(e=Ra),(r&&!n&&m||!r&&v&&!n&&m)&&(e=Da);var i=ee(e);e&&(t||i[$a])?(j(e),re()):j(La),oe.current=n}},[n]),l(function(){(q===Ma&&!f||q===Ra&&!d||q===Da&&!m)&&j(La)},[f,d,m]),l(function(){return function(){W.current=!1,clearTimeout(V.current)}},[]);var se=e.useRef(!1);l(function(){P&&(se.current=!0),void 0!==P&&q===La&&((se.current||P)&&(null==M||M(P)),se.current=!0)},[P,q]);var le=U;return te[$a]&&ie===Ba&&(le=D({transition:"none"},le)),[q,ie,le,null!=P?P:n]}var so=function(t){var n=t;"object"===N(t)&&(n=t.transitionSupport);var r=e.forwardRef(function(t,r){var i=t.visible,a=void 0===i||i,s=t.removeOnLeave,l=void 0===s||s,c=t.forceRender,u=t.children,h=t.motionName,d=t.leavedClassName,p=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(Na).motion),g=o(),m=o();var y=A(oo(f,a,function(){try{return g.current instanceof HTMLElement?g.current:ln(m.current)}catch(e){return null}},t),4),v=y[0],b=y[1],x=y[2],w=y[3],E=e.useRef(w);w&&(E.current=!0);var k,T=e.useCallback(function(e){g.current=e,Nn(r,e)},[r]),_=D(D({},p),{},{visible:a});if(u)if(v===La)k=w?u(D({},_),T):!l&&E.current&&d?u(D(D({},_),{},{className:d}),T):c||!l&&!d?u(D(D({},_),{},{style:{display:"none"}}),T):null;else{var C;b===$a?C="prepare":io(b)?C="active":b===Ba&&(C="start");var S=Ja(h,"".concat(v,"-").concat(C));k=u(D(D({},_),{},{className:en(Ja(h,v),O(O({},S,S&&C),h,"string"==typeof h)),style:x}),T)}else k=null;e.isValidElement(k)&&Ln(k)&&(Rn(k)||(k=e.cloneElement(k,{ref:T})));return e.createElement(Oa,{ref:m},k)});return r.displayName="CSSMotion",r}(Ka),lo="add",co="keep",uo="remove",ho="removed";function po(e){var t;return D(D({},t=e&&"object"===N(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function fo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(po)}var go=["component","children","onVisibleChanged","onAllRemoved"],mo=["status"],yo=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:so,r=function(){ye(r,e.Component);var t=xe(r);function r(){var e;re(this,r);for(var n=arguments.length,i=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,a=fo(e),o=fo(t);a.forEach(function(e){for(var t=!1,a=r;a1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==uo})).forEach(function(t){t.key===e&&(t.status=co)})}),n}(r,i);return{keyEntities:a.filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==ho||e.status!==uo})}}}]),r}();O(r,"defaultProps",{component:"div"})}(Ka);const vo=e.createContext(!0);function bo(t){const n=e.useContext(vo),{children:r}=t,[,i]=fa(),{motion:a}=i,o=e.useRef(!1);return o.current||(o.current=n!==a),o.current?e.createElement(vo.Provider,{value:a},e.createElement(Ia,{motion:a},r)):r}var xo=()=>null,wo=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{children:n,csp:r,autoInsertSpaceInButton:i,alert:a,anchor:o,form:s,locale:l,componentSize:c,direction:u,space:h,splitter:d,virtual:p,dropdownMatchSelectWidth:f,popupMatchSelectWidth:g,popupOverflow:m,legacyLocale:y,parentContext:v,iconPrefixCls:b,theme:x,componentDisabled:w,segmented:E,statistic:k,spin:T,calendar:_,carousel:C,cascader:S,collapse:A,typography:N,checkbox:I,descriptions:O,divider:L,drawer:M,skeleton:R,steps:D,image:P,layout:$,list:B,mentions:F,modal:z,progress:j,result:H,slider:U,breadcrumb:G,menu:q,pagination:W,input:V,textArea:Y,empty:X,badge:Q,radio:Z,rate:J,switch:ee,transfer:te,avatar:re,message:ie,tag:ae,table:oe,card:se,tabs:le,timeline:ce,timePicker:ue,upload:he,notification:de,tree:fe,colorPicker:ge,datePicker:me,rangePicker:ye,flex:ve,wave:be,dropdown:xe,warning:we,tour:Ee,tooltip:ke,popover:Te,popconfirm:Ce,floatButton:Se,floatButtonGroup:Ae,variant:Ne,inputNumber:Ie,treeSelect:Oe}=t,Le=e.useCallback((e,n)=>{const{prefixCls:r}=t;if(n)return n;const i=r||v.getPrefixCls("");return e?`${i}-${e}`:i},[v.getPrefixCls,t.prefixCls]),Me=b||v.iconPrefixCls||_i,Re=r||v.csp;((e,t)=>{const[n,r]=fa();Vt({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},()=>ba(e))})(Me,Re);const De=function(e,t,n){var r;Sr();const i=e||{},a=!1!==i.inherit&&t?t:Object.assign(Object.assign({},Ei),{hashed:null!==(r=null==t?void 0:t.hashed)&&void 0!==r?r:Ei.hashed,cssVar:null==t?void 0:t.cssVar}),o=Sa();return K(()=>{var r,s;if(!e)return t;const l=Object.assign({},a.components);Object.keys(e.components||{}).forEach(t=>{l[t]=Object.assign(Object.assign({},l[t]),e.components[t])});const c=`css-var-${o.replace(/:/g,"")}`,u=(null!==(r=i.cssVar)&&void 0!==r?r:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==n?void 0:n.prefixCls},"object"==typeof a.cssVar?a.cssVar:{}),"object"==typeof i.cssVar?i.cssVar:{}),{key:"object"==typeof i.cssVar&&(null===(s=i.cssVar)||void 0===s?void 0:s.key)||c});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:l,cssVar:u})},[i,a],(e,t)=>e.some((e,n)=>!ne(e,t[n],!0)))}(x,v.theme,{prefixCls:Le("")}),Pe={csp:Re,autoInsertSpaceInButton:i,alert:a,anchor:o,locale:l||y,direction:u,space:h,splitter:d,virtual:p,popupMatchSelectWidth:null!=g?g:f,popupOverflow:m,getPrefixCls:Le,iconPrefixCls:Me,theme:De,segmented:E,statistic:k,spin:T,calendar:_,carousel:C,cascader:S,collapse:A,typography:N,checkbox:I,descriptions:O,divider:L,drawer:M,skeleton:R,steps:D,image:P,input:V,textArea:Y,layout:$,list:B,mentions:F,modal:z,progress:j,result:H,slider:U,breadcrumb:G,menu:q,pagination:W,empty:X,badge:Q,radio:Z,rate:J,switch:ee,transfer:te,avatar:re,message:ie,tag:ae,table:oe,card:se,tabs:le,timeline:ce,timePicker:ue,upload:he,notification:de,tree:fe,colorPicker:ge,datePicker:me,rangePicker:ye,flex:ve,wave:be,dropdown:xe,warning:we,tour:Ee,tooltip:ke,popover:Te,popconfirm:Ce,floatButton:Se,floatButtonGroup:Ae,variant:Ne,inputNumber:Ie,treeSelect:Oe},$e=Object.assign({},v);Object.keys(Pe).forEach(e=>{void 0!==Pe[e]&&($e[e]=Pe[e])}),Eo.forEach(e=>{const n=t[e];n&&($e[e]=n)}),void 0!==i&&($e.button=Object.assign({autoInsertSpace:i},$e.button));const Be=K(()=>$e,$e,(e,t)=>{const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),{layer:Fe}=e.useContext(pe),ze=e.useMemo(()=>({prefixCls:Me,csp:Re,layer:Fe?"antd":void 0}),[Me,Re,Fe]);let je=e.createElement(e.Fragment,null,e.createElement(xo,{dropdownMatchSelectWidth:f}),n);const He=e.useMemo(()=>{var e,t,n,r;return Tr((null===(e=Rr.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=Be.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=Be.form)||void 0===r?void 0:r.validateMessages)||{},(null==s?void 0:s.validateMessages)||{})},[Be,null==s?void 0:s.validateMessages]);Object.keys(He).length>0&&(je=e.createElement(Ar.Provider,{value:He},je)),l&&(je=e.createElement(jr,{locale:l,_ANT_MARK__:"internalMark"},je)),je=e.createElement(yr.Provider,{value:ze},je),c&&(je=e.createElement(Pi,{size:c},je)),je=e.createElement(bo,null,je);const Ue=e.useMemo(()=>{const e=De||{},{algorithm:t,token:n,components:r,cssVar:i}=e,a=wo(e,["algorithm","token","components","cssVar"]),o=t&&(!Array.isArray(t)||t.length>0)?_e(t):wi,s={};Object.entries(r||{}).forEach(([e,t])=>{const n=Object.assign({},t);"algorithm"in n&&(!0===n.algorithm?n.theme=o:(Array.isArray(n.algorithm)||"function"==typeof n.algorithm)&&(n.theme=_e(n.algorithm)),delete n.algorithm),s[e]=n});const l=Object.assign(Object.assign({},Ur),n);return Object.assign(Object.assign({},a),{theme:o,token:l,components:s,override:Object.assign({override:l},s),cssVar:i})},[De]);return x&&(je=e.createElement(ki.Provider,{value:Ue},je)),Be.warning&&(je=e.createElement(Cr.Provider,{value:Be.warning},je)),void 0!==w&&(je=e.createElement(Ri,{disabled:w},je)),e.createElement(Si.Provider,{value:Be},je)},Io=t=>{const n=e.useContext(Si),r=e.useContext(Fr);return e.createElement(No,Object.assign({parentContext:n,legacyLocale:r},t))};Io.ConfigContext=Si,Io.SizeContext=Di,Io.config=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:i}=e;void 0!==t&&(ko=t),void 0!==n&&(To=n),"holderRender"in e&&(Co=i),r&&(!function(e){return Object.keys(e).some(e=>e.endsWith("Color"))}(r)?_o=r:Li(So(),r))},Io.useConfig=function(){return{componentDisabled:n(Mi),componentSize:n(Di)}},Object.defineProperty(Io,"SizeContext",{get:()=>Di});var Oo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function Lo(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function Mo(e){return function(e){return Lo(e)instanceof ShadowRoot}(e)?Lo(e):null}function Ro(e){return"object"===N(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===N(e.icon)||"function"==typeof e.icon)}function Do(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r,i=e[n];if("class"===n)t.className=i,delete t.class;else delete t[n],t[(r=n,r.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=i;return t},{})}function Po(e,n,r){return r?t.createElement(e.tag,D(D({key:n},Do(e.attrs)),r),(e.children||[]).map(function(t,r){return Po(t,"".concat(n,"-").concat(e.tag,"-").concat(r))})):t.createElement(e.tag,D({key:n},Do(e.attrs)),(e.children||[]).map(function(t,r){return Po(t,"".concat(n,"-").concat(e.tag,"-").concat(r))}))}function $o(e){return Jr(e)[0]}function Bo(e){return e?Array.isArray(e)?e:[e]:[]}var Fo=["icon","className","onClick","style","primaryColor","secondaryColor"],zo={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var jo=function(t){var r,i,a,o,s,c,u=t.icon,h=t.className,d=t.onClick,p=t.style,f=t.primaryColor,g=t.secondaryColor,m=X(t,Fo),y=e.useRef(),v=zo;if(f&&(v={primaryColor:f,secondaryColor:g||$o(f)}),r=y,i=n(yr),a=i.csp,o=i.prefixCls,s=i.layer,c="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",o&&(c=c.replace(/anticon/g,o)),s&&(c="@layer ".concat(s," {\n").concat(c,"\n}")),l(function(){var e=Mo(r.current);Y(c,"@ant-design-icons",{prepend:!s,csp:a,attachTo:e})},[]),function(e,t){te(e,"[@ant-design/icons] ".concat(t))}(Ro(u),"icon should be icon definiton, but got ".concat(u)),!Ro(u))return null;var b=u;return b&&"function"==typeof b.icon&&(b=D(D({},b),{},{icon:b.icon(v.primaryColor,v.secondaryColor)})),Po(b.icon,"svg-".concat(b.name),D(D({className:h,onClick:d,style:p,"data-icon":b.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},m),{},{ref:y}))};function Ho(e){var t=A(Bo(e),2),n=t[0],r=t[1];return jo.setTwoToneColors({primaryColor:n,secondaryColor:r})}jo.displayName="IconReact",jo.getTwoToneColors=function(){return D({},zo)},jo.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;zo.primaryColor=t,zo.secondaryColor=n||$o(t),zo.calculated=!!n};var Uo=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Ho(ci.primary);var Go=e.forwardRef(function(t,n){var r=t.className,i=t.icon,a=t.spin,o=t.rotate,s=t.tabIndex,l=t.onClick,c=t.twoToneColor,u=X(t,Uo),h=e.useContext(yr),d=h.prefixCls,p=void 0===d?"anticon":d,f=h.rootClassName,g=en(f,p,O(O({},"".concat(p,"-").concat(i.name),!!i.name),"".concat(p,"-spin"),!!a||"loading"===i.name),r),m=s;void 0===m&&l&&(m=-1);var y=o?{msTransform:"rotate(".concat(o,"deg)"),transform:"rotate(".concat(o,"deg)")}:void 0,v=A(Bo(c),2),b=v[0],x=v[1];return e.createElement("span",Xe({role:"img","aria-label":i.name},u,{ref:n,tabIndex:m,onClick:l,className:g}),e.createElement(jo,{icon:i,primaryColor:b,secondaryColor:x,style:y}))});Go.displayName="AntdIcon",Go.getTwoToneColor=function(){var e=jo.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},Go.setTwoToneColor=Ho;var qo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Oo}))},Wo=e.forwardRef(qo),Vo={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},Yo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Vo}))},Xo=e.forwardRef(Yo),Ko={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Qo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Ko}))},Zo=e.forwardRef(Qo),Jo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},es=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Jo}))},ts=e.forwardRef(es),ns={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},rs=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ns}))},is=e.forwardRef(rs),as="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/); -/**![check-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0xOTMuNSAzMDEuN2wtMjEwLjYgMjkyYTMxLjggMzEuOCAwIDAxLTUxLjcgMEwzMTguNSA0ODQuOWMtMy44LTUuMyAwLTEyLjcgNi41LTEyLjdoNDYuOWMxMC4yIDAgMTkuOSA0LjkgMjUuOSAxMy4zbDcxLjIgOTguOCAxNTcuMi0yMThjNi04LjMgMTUuNi0xMy4zIDI1LjktMTMuM0g2OTljNi41IDAgMTAuMyA3LjQgNi41IDEyLjd6IiAvPjwvc3ZnPg==) */function os(e,t){return 0===e.indexOf(t)}function ss(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:D({},n);var r={};return Object.keys(e).forEach(function(n){(t.aria&&("role"===n||os(n,"aria-"))||t.data&&os(n,"data-")||t.attr&&as.includes(n))&&(r[n]=e[n])}),r}function ls(e){return e&&t.isValidElement(e)&&e.type===t.Fragment}const cs=(e,n,r)=>t.isValidElement(e)?t.cloneElement(e,"function"==typeof r?r(e.props||{}):r):n;function us(e,t){return cs(e,e,t)}const hs=e=>{const[,,,,t]=fa();return t?`${e}-css-var`:""};var ds={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},ps={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fs=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ps}))},gs=e.forwardRef(fs);const ms=t.createContext(void 0),ys=100,vs={Modal:ys,Drawer:ys,Popover:ys,Popconfirm:ys,Tooltip:ys,Tour:ys,FloatButton:ys},bs={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};const xs=(e,n)=>{const[,r]=fa(),i=t.useContext(ms),a=function(e){return e in vs}(e);let o;if(void 0!==n)o=[n,n];else{let t=null!=i?i:0;t+=a?(i?0:r.zIndexPopupBase)+vs[e]:bs[e],o=[void 0===i?n:t,t]}return o};function ws(e,t){this.v=e,this.k=t}function Es(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Es=function(e,t,n,r){function a(t,n){Es(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},Es(e,t,n,r)}function ks(){ +*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=[];return t.Children.forEach(e,function(e){(null!=e||n.keepEmpty)&&(Array.isArray(e)?r=r.concat(on(e)):an(e)&&e.props?r=r.concat(on(e.props.children,n)):r.push(e))}),r}function sn(e){return e instanceof HTMLElement||e instanceof SVGElement}function ln(e){var n,r=function(e){return e&&"object"===N(e)&&sn(e.nativeElement)?e.nativeElement:sn(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=x.findDOMNode)||void 0===n?void 0:n.call(x,e):null)}var cn,un={exports:{}},hn={},dn=Symbol.for("react.element"),pn=Symbol.for("react.portal"),fn=Symbol.for("react.fragment"),gn=Symbol.for("react.strict_mode"),mn=Symbol.for("react.profiler"),yn=Symbol.for("react.provider"),vn=Symbol.for("react.context"),bn=Symbol.for("react.server_context"),xn=Symbol.for("react.forward_ref"),wn=Symbol.for("react.suspense"),En=Symbol.for("react.suspense_list"),kn=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),_n=Symbol.for("react.offscreen");function Cn(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case dn:switch(e=e.type){case fn:case mn:case gn:case wn:case En:return e;default:switch(e=e&&e.$$typeof){case bn:case vn:case xn:case Tn:case kn:case yn:return e;default:return t}}case pn:return t}}}cn=Symbol.for("react.module.reference"),hn.ContextConsumer=vn,hn.ContextProvider=yn,hn.Element=dn,hn.ForwardRef=xn,hn.Fragment=fn,hn.Lazy=Tn,hn.Memo=kn,hn.Portal=pn,hn.Profiler=mn,hn.StrictMode=gn,hn.Suspense=wn,hn.SuspenseList=En,hn.isAsyncMode=function(){return!1},hn.isConcurrentMode=function(){return!1},hn.isContextConsumer=function(e){return Cn(e)===vn},hn.isContextProvider=function(e){return Cn(e)===yn},hn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===dn},hn.isForwardRef=function(e){return Cn(e)===xn},hn.isFragment=function(e){return Cn(e)===fn},hn.isLazy=function(e){return Cn(e)===Tn},hn.isMemo=function(e){return Cn(e)===kn},hn.isPortal=function(e){return Cn(e)===pn},hn.isProfiler=function(e){return Cn(e)===mn},hn.isStrictMode=function(e){return Cn(e)===gn},hn.isSuspense=function(e){return Cn(e)===wn},hn.isSuspenseList=function(e){return Cn(e)===En},hn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===fn||e===mn||e===gn||e===wn||e===En||e===_n||"object"==typeof e&&null!==e&&(e.$$typeof===Tn||e.$$typeof===kn||e.$$typeof===yn||e.$$typeof===vn||e.$$typeof===xn||e.$$typeof===cn||void 0!==e.getModuleId)},hn.typeOf=Cn,un.exports=hn;var Sn=un.exports,An=Number(i.split(".")[0]),Nn=function(e,t){"function"==typeof e?e(t):"object"===N(e)&&e&&"current"in e&&(e.current=t)},In=function(){for(var e=arguments.length,t=new Array(e),n=0;n=19)return!0;var r=Sn.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===Sn.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===Sn.ForwardRef)};function Mn(e){return r(e)&&!an(e)}var Rn=function(e){if(e&&Mn(e)){var t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null},Dn=e.createContext(null);var Pn=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){$n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),jn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){$n&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;zn.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Un=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),tr="undefined"!=typeof WeakMap?new WeakMap:new Pn,nr=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Hn.getInstance(),r=new er(t,n,this);tr.set(this,r)};["observe","unobserve","disconnect"].forEach(function(e){nr.prototype[e]=function(){var t;return(t=tr.get(this))[e].apply(t,arguments)}});var rr=void 0!==Bn.ResizeObserver?Bn.ResizeObserver:nr,ir=new Map;var ar=new rr(function(e){e.forEach(function(e){var t,n=e.target;null===(t=ir.get(n))||void 0===t||t.forEach(function(e){return e(n)})})});var or=function(){ye(n,e.Component);var t=xe(n);function n(){return re(this,n),t.apply(this,arguments)}return ae(n,[{key:"render",value:function(){return this.props.children}}]),n}();function sr(t,n){var r=t.children,i=t.disabled,a=e.useRef(null),o=e.useRef(null),s=e.useContext(Dn),l="function"==typeof r,c=l?r(a):r,u=e.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=!l&&e.isValidElement(c)&&Ln(c),d=h?Rn(c):null,p=On(d,a),f=function(){var e;return ln(a.current)||(a.current&&"object"===N(a.current)?ln(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||ln(o.current)};e.useImperativeHandle(n,function(){return f()});var g=e.useRef(t);g.current=t;var m=e.useCallback(function(e){var t=g.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),a=i.width,o=i.height,l=e.offsetWidth,c=e.offsetHeight,h=Math.floor(a),d=Math.floor(o);if(u.current.width!==h||u.current.height!==d||u.current.offsetWidth!==l||u.current.offsetHeight!==c){var p={width:h,height:d,offsetWidth:l,offsetHeight:c};u.current=p;var f=l===Math.round(a)?a:l,m=c===Math.round(o)?o:c,y=D(D({},p),{},{offsetWidth:f,offsetHeight:m});null==s||s(y,e,r),n&&Promise.resolve().then(function(){n(y,e)})}},[]);return e.useEffect(function(){var e=f();return e&&!i&&function(e,t){ir.has(e)||(ir.set(e,new Set),ar.observe(e)),ir.get(e).add(t)}(e,m),function(){return function(e,t){ir.has(e)&&(ir.get(e).delete(t),ir.get(e).size||(ar.unobserve(e),ir.delete(e)))}(e,m)}},[a.current,i]),e.createElement(or,{ref:o},h?e.cloneElement(c,{ref:p}):c)}var lr=e.forwardRef(sr);function cr(t,n){var r=t.children;return("function"==typeof r?[r]:on(r)).map(function(r,i){var a=(null==r?void 0:r.key)||"".concat("rc-observer-key","-").concat(i);return e.createElement(lr,Xe({},t,{key:a,ref:0===i?n:void 0}),r)})}var ur=e.forwardRef(cr);ur.Collection=function(t){var n=t.children,r=t.onBatchResize,i=e.useRef(0),a=e.useRef([]),o=e.useContext(Dn),s=e.useCallback(function(e,t,n){i.current+=1;var s=i.current;a.current.push({size:e,element:t,data:n}),Promise.resolve().then(function(){s===i.current&&(null==r||r(a.current),a.current=[])}),null==o||o(e,t,n)},[r,o]);return e.createElement(Dn.Provider,{value:s},n)};var hr=function(e){return+setTimeout(e,16)},dr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(hr=function(e){return window.requestAnimationFrame(e)},dr=function(e){return window.cancelAnimationFrame(e)});var pr=0,fr=new Map;function gr(e){fr.delete(e)}var mr=function(e){var t=pr+=1;return function n(r){if(0===r)gr(t),e();else{var i=hr(function(){n(r-1)});fr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};mr.cancel=function(e){var t=fr.get(e);return gr(e),dr(t)};var yr=a({});function vr(e){return T(e)||L(e)||C(e)||S()}function br(e,t){for(var n=e,r=0;r3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!br(e,t.slice(0,-1))?e:xr(e,t,n,r)}function Er(e){return Array.isArray(e)?[]:{}}var kr="undefined"==typeof Reflect?Object.keys:Reflect.ownKeys;function Tr(){for(var e=arguments.length,t=new Array(e),n=0;n{const e=()=>{};return e.deprecated=_r,e};var Ar=a(void 0),Nr={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},Ir=D(D({},{yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const Or={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},Lr={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},Ir),timePickerLocale:Object.assign({},Or)},Mr="${label} is not a valid ${type}",Rr={locale:"en",Pagination:Nr,DatePicker:Lr,TimePicker:Or,Calendar:Lr,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:Mr,method:Mr,array:Mr,object:Mr,number:Mr,date:Mr,boolean:Mr,integer:Mr,float:Mr,regexp:Mr,email:Mr,url:Mr,hex:Mr},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let Dr=Object.assign({},Rr.Modal),Pr=[];const $r=()=>Pr.reduce((e,t)=>Object.assign(Object.assign({},e),t),Rr.Modal);function Br(){return Dr}const Fr=a(void 0),zr=(t,n)=>{const r=e.useContext(Fr),i=e.useMemo(()=>{var e;const i=n||Rr[t],a=null!==(e=null==r?void 0:r[t])&&void 0!==e?e:{};return Object.assign(Object.assign({},"function"==typeof i?i():i),a||{})},[t,n,r]);return[i,e.useMemo(()=>{const e=null==r?void 0:r.locale;return(null==r?void 0:r.exist)&&!e?Rr.locale:e},[r])]},jr=t=>{const{locale:n={},children:r,_ANT_MARK__:i}=t;e.useEffect(()=>{const e=function(e){if(e){const t=Object.assign({},e);return Pr.push(t),Dr=$r(),()=>{Pr=Pr.filter(e=>e!==t),Dr=$r()}}Dr=Object.assign({},Rr.Modal)}(null==n?void 0:n.Modal);return e},[n]);const a=e.useMemo(()=>Object.assign(Object.assign({},n),{exist:!0}),[n]);return e.createElement(Fr.Provider,{value:a},r)},Hr={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Ur=Object.assign(Object.assign({},Hr),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),Gr=Math.round;function qr(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||"",e);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const Wr=(e,t,n)=>0===n?e:e/100;function Vr(e,t){const n=t||255;return e>n?n:e<0?0:e}class Yr{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if(O(this,"isValid",!0),O(this,"r",0),O(this,"g",0),O(this,"b",0),O(this,"a",1),O(this,"_h",void 0),O(this,"_s",void 0),O(this,"_l",void 0),O(this,"_v",void 0),O(this,"_max",void 0),O(this,"_min",void 0),O(this,"_brightness",void 0),e)if("string"==typeof e){const n=e.trim();function r(e){return n.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(n)?this.fromHexString(n):r("rgb")?this.fromRgbString(n):r("hsl")?this.fromHslString(n):(r("hsv")||r("hsb"))&&this.fromHsvString(n)}else if(e instanceof Yr)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=Vr(e.r),this.g=Vr(e.g),this.b=Vr(e.b),this.a="number"==typeof e.a?Vr(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else{if(!t("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e));this.fromHsv(e)}else;}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return.2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if(void 0===this._h){const e=this.getMax()-this.getMin();this._h=0===e?0:Gr(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:Gr(i("r")),g:Gr(i("g")),b:Gr(i("b")),a:Gr(100*i("a"))/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>Gr((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;const n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;const r=(this.b||0).toString(16);if(e+=2===r.length?r:"0"+r,"number"==typeof this.a&&this.a>=0&&this.a<1){const t=Gr(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=Gr(100*this.getSaturation()),n=Gr(100*this.getLightness());return 1!==this.a?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=Vr(t,n),r}_c(e){return new this.constructor(e)}getMax(){return void 0===this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return void 0===this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a="number"==typeof r?r:1,t<=0){const e=Gr(255*n);this.r=e,this.g=e,this.b=e}let i=0,a=0,o=0;const s=e/60,l=(1-Math.abs(2*n-1))*t,c=l*(1-Math.abs(s%2-1));s>=0&&s<1?(i=l,a=c):s>=1&&s<2?(i=c,a=l):s>=2&&s<3?(a=l,o=c):s>=3&&s<4?(a=c,o=l):s>=4&&s<5?(i=c,o=l):s>=5&&s<6&&(i=l,o=c);const u=n-l/2;this.r=Gr(255*(i+u)),this.g=Gr(255*(a+u)),this.b=Gr(255*(o+u))}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a="number"==typeof r?r:1;const i=Gr(255*n);if(this.r=i,this.g=i,this.b=i,t<=0)return;const a=e/60,o=Math.floor(a),s=a-o,l=Gr(n*(1-t)*255),c=Gr(n*(1-t*s)*255),u=Gr(n*(1-t*(1-s))*255);switch(o){case 0:this.g=u,this.b=l;break;case 1:this.r=c,this.b=l;break;case 2:this.r=l,this.b=u;break;case 3:this.r=l,this.g=c;break;case 4:this.r=u,this.g=l;break;default:this.g=l,this.b=c}}fromHsvString(e){const t=qr(e,Wr);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=qr(e,Wr);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=qr(e,(e,t)=>t.includes("%")?Gr(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}var Xr=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function Kr(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function Qr(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(100*r)/100);var r}function Zr(e,t,n){var r;return r=n?e.v+.05*t:e.v-.15*t,r=Math.max(0,Math.min(1,r)),Math.round(100*r)/100}function Jr(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=new Yr(e),i=r.toHsv(),a=5;a>0;a-=1){var o=new Yr({h:Kr(i,a,!0),s:Qr(i,a,!0),v:Zr(i,a,!0)});n.push(o)}n.push(r);for(var s=1;s<=4;s+=1){var l=new Yr({h:Kr(i,s),s:Qr(i,s),v:Zr(i,s)});n.push(l)}return"dark"===t.theme?Xr.map(function(e){var r=e.index,i=e.amount;return new Yr(t.backgroundColor||"#141414").mix(n[r],i).toHexString()}):n.map(function(e){return e.toHexString()})}var ei={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},ti=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];ti.primary=ti[5];var ni=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];ni.primary=ni[5];var ri=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];ri.primary=ri[5];var ii=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];ii.primary=ii[5];var ai=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];ai.primary=ai[5];var oi=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];oi.primary=oi[5];var si=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];si.primary=si[5];var li=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];li.primary=li[5];var ci=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];ci.primary=ci[5];var ui=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];ui.primary=ui[5];var hi=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];hi.primary=hi[5];var di=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];di.primary=di[5];var pi=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];pi.primary=pi[5];var fi={red:ti,volcano:ni,orange:ri,gold:ii,yellow:ai,lime:oi,green:si,cyan:li,blue:ci,geekblue:ui,purple:hi,magenta:di,grey:pi};function gi(e){return(e+8)/e}const mi=e=>{const t=function(e){const t=Array.from({length:10}).map((t,n)=>{const r=n-1,i=e*Math.pow(Math.E,r/5),a=n>1?Math.floor(i):Math.ceil(i);return 2*Math.floor(a/2)});return t[1]=e,t.map(e=>({size:e,lineHeight:gi(e)}))}(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),i=n[1],a=n[0],o=n[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*i),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};const yi=(e,t)=>new Yr(e).setA(t).toRgbString(),vi=(e,t)=>new Yr(e).darken(t).toHexString(),bi=e=>{const t=Jr(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},xi=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:yi(r,.88),colorTextSecondary:yi(r,.65),colorTextTertiary:yi(r,.45),colorTextQuaternary:yi(r,.25),colorFill:yi(r,.15),colorFillSecondary:yi(r,.06),colorFillTertiary:yi(r,.04),colorFillQuaternary:yi(r,.02),colorBgSolid:yi(r,1),colorBgSolidHover:yi(r,.75),colorBgSolidActive:yi(r,.95),colorBgLayout:vi(n,4),colorBgContainer:vi(n,0),colorBgElevated:vi(n,0),colorBgSpotlight:yi(r,.85),colorBgBlur:"transparent",colorBorder:vi(n,15),colorBorderSecondary:vi(n,6)}};const wi=_e(function(e){ei.pink=ei.magenta,fi.pink=fi.magenta;const t=Object.keys(Hr).map(t=>{const n=e[t]===ei[t]?fi[t]:Jr(e[t]);return Array.from({length:10},()=>1).reduce((e,r,i)=>(e[`${t}-${i+1}`]=n[i],e[`${t}${i+1}`]=n[i],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:o,colorPrimary:s,colorBgBase:l,colorTextBase:c}=e,u=t(s),h=t(r),d=t(i),p=t(a),f=t(o),g=n(l,c),m=t(e.colorLink||e.colorInfo),y=new Yr(p[1]).mix(new Yr(p[3]),50).toHexString();return Object.assign(Object.assign({},g),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:y,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:d[1],colorWarningBgHover:d[2],colorWarningBorder:d[3],colorWarningBorderHover:d[4],colorWarningHover:d[4],colorWarning:d[6],colorWarningActive:d[7],colorWarningTextHover:d[8],colorWarningText:d[9],colorWarningTextActive:d[10],colorInfoBg:f[1],colorInfoBgHover:f[2],colorInfoBorder:f[3],colorInfoBorderHover:f[4],colorInfoHover:f[4],colorInfo:f[6],colorInfoActive:f[7],colorInfoTextHover:f[8],colorInfoText:f[9],colorInfoTextActive:f[10],colorLinkHover:m[4],colorLink:m[6],colorLinkActive:m[7],colorBgMask:new Yr("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:bi,generateNeutralColorPalettes:xi})),mi(e.fontSize)),function(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),(e=>{const{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}})(e)),function(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+2*t).toFixed(1)}s`,motionDurationSlow:`${(n+3*t).toFixed(1)}s`,lineWidthBold:i+1},(e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}})(r))}(e))}),Ei={token:Ur,override:{override:Ur},hashed:!0},ki=t.createContext(Ei),Ti="ant",_i="anticon",Ci=["outlined","borderless","filled","underlined"],Si=e.createContext({getPrefixCls:(e,t)=>t||(e?`${Ti}-${e}`:Ti),iconPrefixCls:_i}),{Consumer:Ai}=Si,Ni={};function Ii(t){const n=e.useContext(Si),{getPrefixCls:r,direction:i,getPopupContainer:a}=n,o=n[t];return Object.assign(Object.assign({classNames:Ni,styles:Ni},o),{getPrefixCls:r,direction:i,getPopupContainer:a})}const Oi=`-ant-${Date.now()}-${Math.random()}`;function Li(e,t){const n=function(e,t){const n={},r=(e,t)=>{let n=e.clone();return n=(null==t?void 0:t(n))||n,n.toRgbString()},i=(e,t)=>{const i=new Yr(e),a=Jr(i.toRgbString());n[`${t}-color`]=r(i),n[`${t}-color-disabled`]=a[1],n[`${t}-color-hover`]=a[4],n[`${t}-color-active`]=a[6],n[`${t}-color-outline`]=i.clone().setA(.2).toRgbString(),n[`${t}-color-deprecated-bg`]=a[0],n[`${t}-color-deprecated-border`]=a[2]};if(t.primaryColor){i(t.primaryColor,"primary");const e=new Yr(t.primaryColor),a=Jr(e.toRgbString());a.forEach((e,t)=>{n[`primary-${t+1}`]=e}),n["primary-color-deprecated-l-35"]=r(e,e=>e.lighten(35)),n["primary-color-deprecated-l-20"]=r(e,e=>e.lighten(20)),n["primary-color-deprecated-t-20"]=r(e,e=>e.tint(20)),n["primary-color-deprecated-t-50"]=r(e,e=>e.tint(50)),n["primary-color-deprecated-f-12"]=r(e,e=>e.setA(.12*e.a));const o=new Yr(a[0]);n["primary-color-active-deprecated-f-30"]=r(o,e=>e.setA(.3*e.a)),n["primary-color-active-deprecated-d-02"]=r(o,e=>e.darken(2))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),`\n :root {\n ${Object.keys(n).map(t=>`--${e}-${t}: ${n[t]};`).join("\n")}\n }\n `.trim()}(e,t);$()&&Y(n,`${Oi}-dynamic-theme`)}const Mi=e.createContext(!1),Ri=({children:t,disabled:n})=>{const r=e.useContext(Mi);return e.createElement(Mi.Provider,{value:null!=n?n:r},t)},Di=e.createContext(void 0),Pi=({children:t,size:n})=>{const r=e.useContext(Di);return e.createElement(Di.Provider,{value:n||r},t)};var $i=ae(function e(){re(this,e)}),Bi="CALC_UNIT",Fi=new RegExp(Bi,"g");function zi(e){return"number"==typeof e?"".concat(e).concat(Bi):e}var ji=function(){ye(t,$i);var e=xe(t);function t(n,r){var i;re(this,t),O(ge(i=e.call(this)),"result",""),O(ge(i),"unitlessCssVar",void 0),O(ge(i),"lowPriority",void 0);var a=N(n);return i.unitlessCssVar=r,n instanceof t?i.result="(".concat(n.result,")"):"number"===a?i.result=zi(n):"string"===a&&(i.result=n),i}return ae(t,[{key:"add",value:function(e){return e instanceof t?this.result="".concat(this.result," + ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," + ").concat(zi(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof t?this.result="".concat(this.result," - ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," - ").concat(zi(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," * ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," / ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){var t=this,n=(e||{}).unit,r=!0;return"boolean"==typeof n?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(Fi,r?"px":""),void 0!==this.lowPriority?"calc(".concat(this.result,")"):this.result}}]),t}(),Hi=function(){ye(t,$i);var e=xe(t);function t(n){var r;return re(this,t),O(ge(r=e.call(this)),"result",0),n instanceof t?r.result=n.result:"number"==typeof n&&(r.result=n),r}return ae(t,[{key:"add",value:function(e){return e instanceof t?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof t?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof t?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof t?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),t}(),Ui=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function Gi(t){var n=e.useRef();n.current=t;var r=e.useCallback(function(){for(var e,t=arguments.length,r=new Array(t),i=0;i1e4){var t=Date.now();this.lastAccessBeat.forEach(function(n,r){t-n>6e5&&(e.map.delete(r),e.lastAccessBeat.delete(r))}),this.accessBeat=0}}}]),e}(),na=new ta;var ra=function(){return{}};const ia=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];function aa(e){return e>=0&&e<=255}function oa(e,t){const{r:n,g:r,b:i,a:a}=new Yr(e).toRgb();if(a<1)return e;const{r:o,g:s,b:l}=new Yr(t).toRgb();for(let e=.01;e<=1;e+=.01){const t=Math.round((n-o*(1-e))/e),a=Math.round((r-s*(1-e))/e),c=Math.round((i-l*(1-e))/e);if(aa(t)&&aa(a)&&aa(c))return new Yr({r:t,g:a,b:c,a:Math.round(100*e)/100}).toRgbString()}return new Yr({r:n,g:r,b:i,a:1}).toRgbString()}var sa=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{delete r[e]});const i=Object.assign(Object.assign({},n),r),a=1200,o=1600;if(!1===i.motion){const e="0s";i.motionDurationFast=e,i.motionDurationMid=e,i.motionDurationSlow=e}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:oa(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:oa(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:oa(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:3*i.lineWidth,lineWidth:i.lineWidth,controlOutlineWidth:2*i.lineWidth,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:oa(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:a,screenXLMin:a,screenXLMax:1599,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`\n 0 1px 2px -2px ${new Yr("rgba(0, 0, 0, 0.16)").toRgbString()},\n 0 3px 6px 0 ${new Yr("rgba(0, 0, 0, 0.12)").toRgbString()},\n 0 5px 12px 4px ${new Yr("rgba(0, 0, 0, 0.09)").toRgbString()}\n `,boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var ca=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const r=n.getDerivativeToken(e),{override:i}=t,a=ca(t,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=la(o),a&&Object.entries(a).forEach(([e,t])=>{const{theme:n}=t,r=ca(t,["theme"]);let i=r;n&&(i=pa(Object.assign(Object.assign({},o),r),{override:r},n)),o[e]=i}),o};function fa(){const{token:e,hashed:n,theme:r,override:i,cssVar:a}=t.useContext(ki),o=`5.28.0-${n||""}`,s=r||wi,[l,c,u]=Ye(s,[Ur,e],{salt:o,override:i,getComputedToken:pa,formatToken:la,cssVar:a&&{prefix:a.prefix,key:a.key,unitless:ua,ignore:ha,preserve:da}});return[s,u,n?c:"",l,a]}const ga={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ma=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),ya=(e,t)=>({outline:`${Le(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:null!=t?t:1,transition:"outline-offset 0s, outline 0s"}),va=(e,t)=>({"&:focus-visible":ya(e,t)}),ba=e=>({[`.${e}`]:Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{[`.${e} .${e}-icon`]:{display:"block"}})}),xa=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},va(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}}),{genStyleHooks:wa,genComponentStyleHook:Ea,genSubStyleComponent:ka}=function(e){var r=e.useCSP,i=void 0===r?ra:r,a=e.useToken,o=e.usePrefix,s=e.getResetStyles,l=e.getCommonStyle,c=e.getCompUnitless;function u(n,r,c){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=Array.isArray(n)?n:[n,n],d=A(h,1)[0],p=h.join("-"),f=e.layer||{name:"antd"};return function(e){var n,h,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,m=a(),y=m.theme,v=m.realToken,b=m.hashId,x=m.token,w=m.cssVar,E=o(),k=E.rootPrefixCls,T=E.iconPrefixCls,_=i(),C=w?"css":"js",S=(n=function(){var e=new Set;return w&&Object.keys(u.unitless||{}).forEach(function(t){e.add(Re(t,w.prefix)),e.add(Re(t,Ui(d,w.prefix)))}),function(e,t){var n="css"===e?ji:Hi;return function(e){return new n(e,t)}}(C,e)},h=[C,d,null==w?void 0:w.prefix],t.useMemo(function(){var e=na.get(h);if(e)return e;var t=n();return na.set(h,t),t},h)),A=function(e){return"js"===e?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:e,n=A(f(e,t),2)[1],r=A(g(t),2);return[r[0],n,r[1]]}},genSubStyleComponent:function(e,t,n){var r=u(e,t,n,D({resetStyle:!1,order:-998},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));return function(e){var t=e.prefixCls,n=e.rootCls;return r(t,void 0===n?t:n),null}},genComponentStyleHook:u}}({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=n(Si);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,i]=fa();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:e}=n(Si);return null!=e?e:{}},getResetStyles:(e,t)=>{var n;const r=(e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}))(e);return[r,{"&":r},ba(null!==(n=null==t?void 0:t.prefix.iconPrefixCls)&&void 0!==n?n:_i)]},getCommonStyle:(e,t,n,r)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=n?`.${n}`:i,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let s={};return!1!==r&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},getCompUnitless:()=>ua});function Ta(e,t){return ia.reduce((n,r)=>{const i=e[`${r}1`],a=e[`${r}3`],o=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}const _a=Object.assign({},e),{useId:Ca}=_a,Sa=void 0===Ca?()=>"":Ca;var Aa=["children"],Na=e.createContext({});function Ia(t){var n=t.children,r=X(t,Aa);return e.createElement(Na.Provider,{value:r},n)}var Oa=function(){ye(n,e.Component);var t=xe(n);function n(){return re(this,n),t.apply(this,arguments)}return ae(n,[{key:"render",value:function(){return this.props.children}}]),n}();var La="none",Ma="appear",Ra="enter",Da="leave",Pa="none",$a="prepare",Ba="start",Fa="active",za="end",ja="prepared";function Ha(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Ua=function(e,t){var n={animationend:Ha("Animation","AnimationEnd"),transitionend:Ha("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}($(),"undefined"!=typeof window?window:{}),Ga={};if($()){var qa=document.createElement("div");Ga=qa.style}var Wa={};function Va(e){if(Wa[e])return Wa[e];var t=Ua[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:2;n();var a=mr(function(){i<=1?r({isCanceled:function(){return a!==t.current}}):e(r,i-1)});t.current=a},n]}(),l=A(s,2),c=l[0],u=l[1];var h=n?no:to;return eo(function(){if(a!==Pa&&a!==za){var e=h.indexOf(a),t=h[e+1],n=r(a);n===ro?o(t,!0):t&&c(function(e){function r(){e.isCanceled()||o(t,!0)}!0===n?r():Promise.resolve(n).then(r)})}},[t,a]),e.useEffect(function(){return function(){u()}},[]),[function(){o($a,!0)},a]};function oo(t,n,r,i){var a,s,c,u,h=i.motionEnter,d=void 0===h||h,p=i.motionAppear,f=void 0===p||p,g=i.motionLeave,m=void 0===g||g,y=i.motionDeadline,v=i.motionLeaveImmediately,b=i.onAppearPrepare,x=i.onEnterPrepare,w=i.onLeavePrepare,E=i.onAppearStart,k=i.onEnterStart,T=i.onLeaveStart,_=i.onAppearActive,C=i.onEnterActive,S=i.onLeaveActive,N=i.onAppearEnd,I=i.onEnterEnd,L=i.onLeaveEnd,M=i.onVisibleChanged,R=A(qi(),2),P=R[0],$=R[1],B=(a=La,s=e.useReducer(function(e){return e+1},0),c=A(s,2)[1],u=e.useRef(a),[Gi(function(){return u.current}),Gi(function(e){u.current="function"==typeof e?e(u.current):e,c()})]),F=A(B,2),z=F[0],j=F[1],H=A(qi(null),2),U=H[0],G=H[1],q=z(),W=o(!1),V=o(null);function Y(){return r()}var X=o(!1);function K(){j(La),G(null,!0)}var Q=Gi(function(e){var t=z();if(t!==La){var n=Y();if(!e||e.deadline||e.target===n){var r,i=X.current;t===Ma&&i?r=null==N?void 0:N(n,e):t===Ra&&i?r=null==I?void 0:I(n,e):t===Da&&i&&(r=null==L?void 0:L(n,e)),i&&!1!==r&&K()}}}),Z=function(t){var n=o();function r(e){e&&(e.removeEventListener(Za,t),e.removeEventListener(Qa,t))}return e.useEffect(function(){return function(){r(n.current)}},[]),[function(e){n.current&&n.current!==e&&r(n.current),e&&e!==n.current&&(e.addEventListener(Za,t),e.addEventListener(Qa,t),n.current=e)},r]}(Q),J=A(Z,1)[0],ee=function(e){switch(e){case Ma:return O(O(O({},$a,b),Ba,E),Fa,_);case Ra:return O(O(O({},$a,x),Ba,k),Fa,C);case Da:return O(O(O({},$a,w),Ba,T),Fa,S);default:return{}}},te=e.useMemo(function(){return ee(q)},[q]),ne=A(ao(q,!t,function(e){if(e===$a){var t=te[$a];return t?t(Y()):ro}var n;ie in te&&G((null===(n=te[ie])||void 0===n?void 0:n.call(te,Y(),null))||null);return ie===Fa&&q!==La&&(J(Y()),y>0&&(clearTimeout(V.current),V.current=setTimeout(function(){Q({deadline:!0})},y))),ie===ja&&K(),true}),2),re=ne[0],ie=ne[1],ae=io(ie);X.current=ae;var oe=o(null);eo(function(){if(!W.current||oe.current!==n){$(n);var e,r=W.current;W.current=!0,!r&&n&&f&&(e=Ma),r&&n&&d&&(e=Ra),(r&&!n&&m||!r&&v&&!n&&m)&&(e=Da);var i=ee(e);e&&(t||i[$a])?(j(e),re()):j(La),oe.current=n}},[n]),l(function(){(q===Ma&&!f||q===Ra&&!d||q===Da&&!m)&&j(La)},[f,d,m]),l(function(){return function(){W.current=!1,clearTimeout(V.current)}},[]);var se=e.useRef(!1);l(function(){P&&(se.current=!0),void 0!==P&&q===La&&((se.current||P)&&(null==M||M(P)),se.current=!0)},[P,q]);var le=U;return te[$a]&&ie===Ba&&(le=D({transition:"none"},le)),[q,ie,le,null!=P?P:n]}var so=function(t){var n=t;"object"===N(t)&&(n=t.transitionSupport);var r=e.forwardRef(function(t,r){var i=t.visible,a=void 0===i||i,s=t.removeOnLeave,l=void 0===s||s,c=t.forceRender,u=t.children,h=t.motionName,d=t.leavedClassName,p=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(Na).motion),g=o(),m=o();var y=A(oo(f,a,function(){try{return g.current instanceof HTMLElement?g.current:ln(m.current)}catch(e){return null}},t),4),v=y[0],b=y[1],x=y[2],w=y[3],E=e.useRef(w);w&&(E.current=!0);var k,T=e.useCallback(function(e){g.current=e,Nn(r,e)},[r]),_=D(D({},p),{},{visible:a});if(u)if(v===La)k=w?u(D({},_),T):!l&&E.current&&d?u(D(D({},_),{},{className:d}),T):c||!l&&!d?u(D(D({},_),{},{style:{display:"none"}}),T):null;else{var C;b===$a?C="prepare":io(b)?C="active":b===Ba&&(C="start");var S=Ja(h,"".concat(v,"-").concat(C));k=u(D(D({},_),{},{className:en(Ja(h,v),O(O({},S,S&&C),h,"string"==typeof h)),style:x}),T)}else k=null;e.isValidElement(k)&&Ln(k)&&(Rn(k)||(k=e.cloneElement(k,{ref:T})));return e.createElement(Oa,{ref:m},k)});return r.displayName="CSSMotion",r}(Ka),lo="add",co="keep",uo="remove",ho="removed";function po(e){var t;return D(D({},t=e&&"object"===N(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function fo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(po)}var go=["component","children","onVisibleChanged","onAllRemoved"],mo=["status"],yo=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:so,r=function(){ye(r,e.Component);var t=xe(r);function r(){var e;re(this,r);for(var n=arguments.length,i=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,a=fo(e),o=fo(t);a.forEach(function(e){for(var t=!1,a=r;a1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==uo})).forEach(function(t){t.key===e&&(t.status=co)})}),n}(r,i);return{keyEntities:a.filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==ho||e.status!==uo})}}}]),r}();O(r,"defaultProps",{component:"div"})}(Ka);const vo=e.createContext(!0);function bo(t){const n=e.useContext(vo),{children:r}=t,[,i]=fa(),{motion:a}=i,o=e.useRef(!1);return o.current||(o.current=n!==a),o.current?e.createElement(vo.Provider,{value:a},e.createElement(Ia,{motion:a},r)):r}var xo=()=>null,wo=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{children:n,csp:r,autoInsertSpaceInButton:i,alert:a,anchor:o,form:s,locale:l,componentSize:c,direction:u,space:h,splitter:d,virtual:p,dropdownMatchSelectWidth:f,popupMatchSelectWidth:g,popupOverflow:m,legacyLocale:y,parentContext:v,iconPrefixCls:b,theme:x,componentDisabled:w,segmented:E,statistic:k,spin:T,calendar:_,carousel:C,cascader:S,collapse:A,typography:N,checkbox:I,descriptions:O,divider:L,drawer:M,skeleton:R,steps:D,image:P,layout:$,list:B,mentions:F,modal:z,progress:j,result:H,slider:U,breadcrumb:G,menu:q,pagination:W,input:V,textArea:Y,empty:X,badge:Q,radio:Z,rate:J,switch:ee,transfer:te,avatar:re,message:ie,tag:ae,table:oe,card:se,tabs:le,timeline:ce,timePicker:ue,upload:he,notification:de,tree:fe,colorPicker:ge,datePicker:me,rangePicker:ye,flex:ve,wave:be,dropdown:xe,warning:we,tour:Ee,tooltip:ke,popover:Te,popconfirm:Ce,floatButton:Se,floatButtonGroup:Ae,variant:Ne,inputNumber:Ie,treeSelect:Oe}=t,Le=e.useCallback((e,n)=>{const{prefixCls:r}=t;if(n)return n;const i=r||v.getPrefixCls("");return e?`${i}-${e}`:i},[v.getPrefixCls,t.prefixCls]),Me=b||v.iconPrefixCls||_i,Re=r||v.csp;((e,t)=>{const[n,r]=fa();Vt({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},()=>ba(e))})(Me,Re);const De=function(e,t,n){var r;Sr();const i=e||{},a=!1!==i.inherit&&t?t:Object.assign(Object.assign({},Ei),{hashed:null!==(r=null==t?void 0:t.hashed)&&void 0!==r?r:Ei.hashed,cssVar:null==t?void 0:t.cssVar}),o=Sa();return K(()=>{var r,s;if(!e)return t;const l=Object.assign({},a.components);Object.keys(e.components||{}).forEach(t=>{l[t]=Object.assign(Object.assign({},l[t]),e.components[t])});const c=`css-var-${o.replace(/:/g,"")}`,u=(null!==(r=i.cssVar)&&void 0!==r?r:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==n?void 0:n.prefixCls},"object"==typeof a.cssVar?a.cssVar:{}),"object"==typeof i.cssVar?i.cssVar:{}),{key:"object"==typeof i.cssVar&&(null===(s=i.cssVar)||void 0===s?void 0:s.key)||c});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:l,cssVar:u})},[i,a],(e,t)=>e.some((e,n)=>!ne(e,t[n],!0)))}(x,v.theme,{prefixCls:Le("")}),Pe={csp:Re,autoInsertSpaceInButton:i,alert:a,anchor:o,locale:l||y,direction:u,space:h,splitter:d,virtual:p,popupMatchSelectWidth:null!=g?g:f,popupOverflow:m,getPrefixCls:Le,iconPrefixCls:Me,theme:De,segmented:E,statistic:k,spin:T,calendar:_,carousel:C,cascader:S,collapse:A,typography:N,checkbox:I,descriptions:O,divider:L,drawer:M,skeleton:R,steps:D,image:P,input:V,textArea:Y,layout:$,list:B,mentions:F,modal:z,progress:j,result:H,slider:U,breadcrumb:G,menu:q,pagination:W,empty:X,badge:Q,radio:Z,rate:J,switch:ee,transfer:te,avatar:re,message:ie,tag:ae,table:oe,card:se,tabs:le,timeline:ce,timePicker:ue,upload:he,notification:de,tree:fe,colorPicker:ge,datePicker:me,rangePicker:ye,flex:ve,wave:be,dropdown:xe,warning:we,tour:Ee,tooltip:ke,popover:Te,popconfirm:Ce,floatButton:Se,floatButtonGroup:Ae,variant:Ne,inputNumber:Ie,treeSelect:Oe},$e=Object.assign({},v);Object.keys(Pe).forEach(e=>{void 0!==Pe[e]&&($e[e]=Pe[e])}),Eo.forEach(e=>{const n=t[e];n&&($e[e]=n)}),void 0!==i&&($e.button=Object.assign({autoInsertSpace:i},$e.button));const Be=K(()=>$e,$e,(e,t)=>{const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),{layer:Fe}=e.useContext(pe),ze=e.useMemo(()=>({prefixCls:Me,csp:Re,layer:Fe?"antd":void 0}),[Me,Re,Fe]);let je=e.createElement(e.Fragment,null,e.createElement(xo,{dropdownMatchSelectWidth:f}),n);const He=e.useMemo(()=>{var e,t,n,r;return Tr((null===(e=Rr.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=Be.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=Be.form)||void 0===r?void 0:r.validateMessages)||{},(null==s?void 0:s.validateMessages)||{})},[Be,null==s?void 0:s.validateMessages]);Object.keys(He).length>0&&(je=e.createElement(Ar.Provider,{value:He},je)),l&&(je=e.createElement(jr,{locale:l,_ANT_MARK__:"internalMark"},je)),je=e.createElement(yr.Provider,{value:ze},je),c&&(je=e.createElement(Pi,{size:c},je)),je=e.createElement(bo,null,je);const Ue=e.useMemo(()=>{const e=De||{},{algorithm:t,token:n,components:r,cssVar:i}=e,a=wo(e,["algorithm","token","components","cssVar"]),o=t&&(!Array.isArray(t)||t.length>0)?_e(t):wi,s={};Object.entries(r||{}).forEach(([e,t])=>{const n=Object.assign({},t);"algorithm"in n&&(!0===n.algorithm?n.theme=o:(Array.isArray(n.algorithm)||"function"==typeof n.algorithm)&&(n.theme=_e(n.algorithm)),delete n.algorithm),s[e]=n});const l=Object.assign(Object.assign({},Ur),n);return Object.assign(Object.assign({},a),{theme:o,token:l,components:s,override:Object.assign({override:l},s),cssVar:i})},[De]);return x&&(je=e.createElement(ki.Provider,{value:Ue},je)),Be.warning&&(je=e.createElement(Cr.Provider,{value:Be.warning},je)),void 0!==w&&(je=e.createElement(Ri,{disabled:w},je)),e.createElement(Si.Provider,{value:Be},je)},Io=t=>{const n=e.useContext(Si),r=e.useContext(Fr);return e.createElement(No,Object.assign({parentContext:n,legacyLocale:r},t))};Io.ConfigContext=Si,Io.SizeContext=Di,Io.config=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:i}=e;void 0!==t&&(ko=t),void 0!==n&&(To=n),"holderRender"in e&&(Co=i),r&&(!function(e){return Object.keys(e).some(e=>e.endsWith("Color"))}(r)?_o=r:Li(So(),r))},Io.useConfig=function(){return{componentDisabled:n(Mi),componentSize:n(Di)}},Object.defineProperty(Io,"SizeContext",{get:()=>Di});var Oo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function Lo(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function Mo(e){return function(e){return Lo(e)instanceof ShadowRoot}(e)?Lo(e):null}function Ro(e){return"object"===N(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===N(e.icon)||"function"==typeof e.icon)}function Do(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r,i=e[n];if("class"===n)t.className=i,delete t.class;else delete t[n],t[(r=n,r.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=i;return t},{})}function Po(e,n,r){return r?t.createElement(e.tag,D(D({key:n},Do(e.attrs)),r),(e.children||[]).map(function(t,r){return Po(t,"".concat(n,"-").concat(e.tag,"-").concat(r))})):t.createElement(e.tag,D({key:n},Do(e.attrs)),(e.children||[]).map(function(t,r){return Po(t,"".concat(n,"-").concat(e.tag,"-").concat(r))}))}function $o(e){return Jr(e)[0]}function Bo(e){return e?Array.isArray(e)?e:[e]:[]}var Fo=["icon","className","onClick","style","primaryColor","secondaryColor"],zo={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var jo=function(t){var r,i,a,o,s,c,u=t.icon,h=t.className,d=t.onClick,p=t.style,f=t.primaryColor,g=t.secondaryColor,m=X(t,Fo),y=e.useRef(),v=zo;if(f&&(v={primaryColor:f,secondaryColor:g||$o(f)}),r=y,i=n(yr),a=i.csp,o=i.prefixCls,s=i.layer,c="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",o&&(c=c.replace(/anticon/g,o)),s&&(c="@layer ".concat(s," {\n").concat(c,"\n}")),l(function(){var e=Mo(r.current);Y(c,"@ant-design-icons",{prepend:!s,csp:a,attachTo:e})},[]),function(e,t){te(e,"[@ant-design/icons] ".concat(t))}(Ro(u),"icon should be icon definiton, but got ".concat(u)),!Ro(u))return null;var b=u;return b&&"function"==typeof b.icon&&(b=D(D({},b),{},{icon:b.icon(v.primaryColor,v.secondaryColor)})),Po(b.icon,"svg-".concat(b.name),D(D({className:h,onClick:d,style:p,"data-icon":b.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},m),{},{ref:y}))};function Ho(e){var t=A(Bo(e),2),n=t[0],r=t[1];return jo.setTwoToneColors({primaryColor:n,secondaryColor:r})}jo.displayName="IconReact",jo.getTwoToneColors=function(){return D({},zo)},jo.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;zo.primaryColor=t,zo.secondaryColor=n||$o(t),zo.calculated=!!n};var Uo=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Ho(ci.primary);var Go=e.forwardRef(function(t,n){var r=t.className,i=t.icon,a=t.spin,o=t.rotate,s=t.tabIndex,l=t.onClick,c=t.twoToneColor,u=X(t,Uo),h=e.useContext(yr),d=h.prefixCls,p=void 0===d?"anticon":d,f=h.rootClassName,g=en(f,p,O(O({},"".concat(p,"-").concat(i.name),!!i.name),"".concat(p,"-spin"),!!a||"loading"===i.name),r),m=s;void 0===m&&l&&(m=-1);var y=o?{msTransform:"rotate(".concat(o,"deg)"),transform:"rotate(".concat(o,"deg)")}:void 0,v=A(Bo(c),2),b=v[0],x=v[1];return e.createElement("span",Xe({role:"img","aria-label":i.name},u,{ref:n,tabIndex:m,onClick:l,className:g}),e.createElement(jo,{icon:i,primaryColor:b,secondaryColor:x,style:y}))});Go.displayName="AntdIcon",Go.getTwoToneColor=function(){var e=jo.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},Go.setTwoToneColor=Ho;var qo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Oo}))},Wo=e.forwardRef(qo),Vo={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},Yo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Vo}))},Xo=e.forwardRef(Yo),Ko={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Qo=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Ko}))},Zo=e.forwardRef(Qo),Jo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},es=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Jo}))},ts=e.forwardRef(es),ns={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},rs=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ns}))},is=e.forwardRef(rs),as="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/); +/**![check-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0xOTMuNSAzMDEuN2wtMjEwLjYgMjkyYTMxLjggMzEuOCAwIDAxLTUxLjcgMEwzMTguNSA0ODQuOWMtMy44LTUuMyAwLTEyLjcgNi41LTEyLjdoNDYuOWMxMC4yIDAgMTkuOSA0LjkgMjUuOSAxMy4zbDcxLjIgOTguOCAxNTcuMi0yMThjNi04LjMgMTUuNi0xMy4zIDI1LjktMTMuM0g2OTljNi41IDAgMTAuMyA3LjQgNi41IDEyLjd6IiAvPjwvc3ZnPg==) */function os(e,t){return 0===e.indexOf(t)}function ss(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:D({},n);var r={};return Object.keys(e).forEach(function(n){(t.aria&&("role"===n||os(n,"aria-"))||t.data&&os(n,"data-")||t.attr&&as.includes(n))&&(r[n]=e[n])}),r}function ls(e){return e&&t.isValidElement(e)&&e.type===t.Fragment}const cs=(e,n,r)=>t.isValidElement(e)?t.cloneElement(e,"function"==typeof r?r(e.props||{}):r):n;function us(e,t){return cs(e,e,t)}const hs=e=>{const[,,,,t]=fa();return t?`${e}-css-var`:""};var ds={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},ps={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fs=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ps}))},gs=e.forwardRef(fs);function ms(...e){const t={};return e.forEach(e=>{e&&Object.keys(e).forEach(n=>{void 0!==e[n]&&(t[n]=e[n])})}),t}function ys(e){if(!e)return;const{closable:t,closeIcon:n}=e;return{closable:t,closeIcon:n}}function vs(e){const{closable:n,closeIcon:r}=e||{};return t.useMemo(()=>{if(!n&&(!1===n||!1===r||null===r))return!1;if(void 0===n&&void 0===r)return null;let e={closeIcon:"boolean"!=typeof r&&null!==r?r:void 0};return n&&"object"==typeof n&&(e=Object.assign(Object.assign({},e),n)),e},[n,r])}const bs={},xs=(e,n,r=bs)=>{const i=vs(e),a=vs(n),[o]=zr("global",Rr.global),s="boolean"!=typeof i&&!!(null==i?void 0:i.disabled),l=t.useMemo(()=>Object.assign({closeIcon:t.createElement(Zo,null)},r),[r]),c=t.useMemo(()=>!1!==i&&(i?ms(l,a,i):!1!==a&&(a?ms(l,a):!!l.closable&&l)),[i,a,l]);return t.useMemo(()=>{var e,n;if(!1===c)return[!1,null,s,{}];const{closeIconRender:r}=l,{closeIcon:i}=c;let a=i;const u=ss(c,!0);return null!=a&&(r&&(a=r(i)),a=t.isValidElement(a)?t.cloneElement(a,Object.assign(Object.assign(Object.assign({},a.props),{"aria-label":null!==(n=null===(e=a.props)||void 0===e?void 0:e["aria-label"])&&void 0!==n?n:o.close}),u)):t.createElement("span",Object.assign({"aria-label":o.close},u),a)),[!0,a,s,u]},[s,o.close,c,l])},ws=t.createContext(void 0),Es=100,ks={Modal:Es,Drawer:Es,Popover:Es,Popconfirm:Es,Tooltip:Es,Tour:Es,FloatButton:Es},Ts={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};const _s=(e,n)=>{const[,r]=fa(),i=t.useContext(ws),a=function(e){return e in ks}(e);let o;if(void 0!==n)o=[n,n];else{let t=null!=i?i:0;t+=a?(i?0:r.zIndexPopupBase)+ks[e]:Ts[e],o=[void 0===i?n:t,t]}return o};function Cs(e,t){this.v=e,this.k=t}function Ss(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Ss=function(e,t,n,r){function a(t,n){Ss(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},Ss(e,t,n,r)}function As(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ -var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Es(c,"_invoke",function(n,r,i){var a,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,l=e,d.n=n,o}};function p(n,r){for(s=n,l=r,t=0;!h&&c&&!i&&t3?(i=f===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&pr||r>f)&&(a[4]=n,a[5]=r,d.n=f,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==o)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,a),!0),c}var o={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Es(t={},r,function(){return this}),t),h=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Es(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,Es(h,"constructor",c),Es(c,"constructor",l),l.displayName="GeneratorFunction",Es(c,i,"GeneratorFunction"),Es(h),Es(h,i,"Generator"),Es(h,r,function(){return this}),Es(h,"toString",function(){return"[object Generator]"}),(ks=function(){return{w:a,m:d}})()}function Ts(e,t){function n(r,i,a,o){try{var s=e[r](i),l=s.value;return l instanceof ws?t.resolve(l.v).then(function(e){n("next",e,a,o)},function(e){n("throw",e,a,o)}):t.resolve(l).then(function(e){s.value=e,a(s)},function(e){return n("throw",e,a,o)})}catch(e){o(e)}}var r;this.next||(Es(Ts.prototype),Es(Ts.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Es(this,"_invoke",function(e,i,a){function o(){return new t(function(t,r){n(e,a,t,r)})}return r=r?r.then(o,o):o()},!0)}function _s(e,t,n,r,i){return new Ts(ks().w(e,t,n,r),i||Promise)}function Cs(e,t,n,r,i){var a=_s(e,t,n,r,i);return a.next().then(function(e){return e.done?e.value:a.next()})}function Ss(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function As(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(N(e)+" is not iterable")}function Ns(){var e=ks(),t=e.m(Ns),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var i={throw:1,return:2,break:3,continue:3};function a(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,i[e],t)},delegateYield:function(e,i,a){return t.resultName=i,n(r.d,As(e),a)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(Ns=function(){return{wrap:function(t,n,r,i){return e.w(a(t),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new ws(e,t)},AsyncIterator:Ts,async:function(e,t,n,i,o){return(r(t)?_s:Cs)(a(e),t,n,i,o)},keys:Ss,values:As}})()}function Is(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Os(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Is(a,r,i,o,s,"next",e)}function s(e){Is(a,r,i,o,s,"throw",e)}o(void 0)})}}var Ls,Ms=D({},b),Rs=Ms.version,Ds=Ms.render,Ps=Ms.unmountComponentAtNode;try{Number((Rs||"").split(".")[0])>=18&&(Ls=Ms.createRoot)}catch(y7){}function $s(e){var t=Ms.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===N(t)&&(t.usingClientEntryPoint=e)}var Bs="__rc_react_root__";function Fs(e,t){Ls?function(e,t){$s(!0);var n=t[Bs]||Ls(t);$s(!1),n.render(e),t[Bs]=n}(e,t):function(e,t){null==Ds||Ds(e,t)}(e,t)}function zs(e){return js.apply(this,arguments)}function js(){return(js=Os(Ns().mark(function e(t){return Ns().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[Bs])||void 0===e||e.unmount(),delete t[Bs]}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Hs(e){Ps(e)}function Us(){return(Us=Os(Ns().mark(function e(t){return Ns().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Ls){e.next=2;break}return e.abrupt("return",zs(t));case 2:Hs(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}let Gs=(e,t)=>(Fs(e,t),()=>function(e){return Us.apply(this,arguments)}(t));function qs(e){return Gs}const Ws=(e,t,n)=>void 0!==n?n:`${e}-${t}`;function Vs(e,t){var n=Object.assign({},e);return Array.isArray(t)&&t.forEach(function(e){delete n[e]}),n}var Ys=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),a=i.width,o=i.height;if(a||o)return!0}}return!1};var Xs=Ea("Wave",e=>{const{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`,`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")}}}}});const Ks=`${Ti}-wave-target`;function Qs(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e&&"canvastext"!==e}function Zs(e){return Number.isNaN(e)?0:e}const Js=t=>{const{className:n,target:r,component:i,registerUnmount:a}=t,o=e.useRef(null),s=e.useRef(null);e.useEffect(()=>{s.current=a()},[]);const[l,c]=e.useState(null),[u,h]=e.useState([]),[d,p]=e.useState(0),[f,g]=e.useState(0),[m,y]=e.useState(0),[v,b]=e.useState(0),[x,w]=e.useState(!1),E={left:d,top:f,width:m,height:v,borderRadius:u.map(e=>`${e}px`).join(" ")};function k(){const e=getComputedStyle(r);c(function(e){var t;const{borderTopColor:n,borderColor:r,backgroundColor:i}=getComputedStyle(e);return null!==(t=[n,r,i].find(Qs))&&void 0!==t?t:null}(r));const t="static"===e.position,{borderLeftWidth:n,borderTopWidth:i}=e;p(t?r.offsetLeft:Zs(-parseFloat(n))),g(t?r.offsetTop:Zs(-parseFloat(i))),y(r.offsetWidth),b(r.offsetHeight);const{borderTopLeftRadius:a,borderTopRightRadius:o,borderBottomLeftRadius:s,borderBottomRightRadius:l}=e;h([a,o,l,s].map(e=>Zs(parseFloat(e))))}if(l&&(E["--wave-color"]=l),e.useEffect(()=>{if(r){const e=mr(()=>{k(),w(!0)});let t;return"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(k),t.observe(r)),()=>{mr.cancel(e),null==t||t.disconnect()}}},[]),!x)return null;const T=("Checkbox"===i||"Radio"===i)&&(null==r?void 0:r.classList.contains(Ks));return e.createElement(so,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n,r;if(t.deadline||"opacity"===t.propertyName){const e=null===(n=o.current)||void 0===n?void 0:n.parentElement;null===(r=s.current)||void 0===r||r.call(s).then(()=>{null==e||e.remove()})}return!1}},({className:t},r)=>e.createElement("div",{ref:In(o,r),className:en(n,t,{"wave-quick":T}),style:E}))},el=(t,n)=>{var r;const{component:i}=n;if("Checkbox"===i&&!(null===(r=t.querySelector("input"))||void 0===r?void 0:r.checked))return;const a=document.createElement("div");a.style.position="absolute",a.style.left="0px",a.style.top="0px",null==t||t.insertBefore(a,null==t?void 0:t.firstChild);const o=qs();let s=null;s=o(e.createElement(Js,Object.assign({},n,{target:t,registerUnmount:function(){return s}})),a)},tl=(t,n,r)=>{const{wave:i}=e.useContext(Si),[,a,o]=fa(),s=Gi(e=>{const s=t.current;if((null==i?void 0:i.disabled)||!s)return;const l=s.querySelector(`.${Ks}`)||s,{showEffect:c}=i||{};(c||el)(l,{className:n,token:a,component:r,event:e,hashId:o})}),l=e.useRef(null);return e=>{mr.cancel(l.current),l.current=mr(()=>{s(e)})}},nl=e=>{const{children:r,disabled:i,component:a}=e,{getPrefixCls:s}=n(Si),l=o(null),c=s("wave"),[,u]=Xs(c),h=tl(l,en(c,u),a);if(t.useEffect(()=>{const e=l.current;if(!e||e.nodeType!==window.Node.ELEMENT_NODE||i)return;const t=t=>{!Ys(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")&&!e.className.includes("disabled:")||"true"===e.getAttribute("aria-disabled")||e.className.includes("-leave")||h(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[i]),!t.isValidElement(r))return null!=r?r:null;return us(r,{ref:Ln(r)?In(Rn(r),l):l})},rl=e=>{const n=t.useContext(Di);return t.useMemo(()=>e?"string"==typeof e?null!=e?e:n:"function"==typeof e?e(n):n:n,[e,n])};window&&window.__rest;const il=e.createContext(null),al=(t,n)=>{const r=e.useContext(il),i=e.useMemo(()=>{if(!r)return"";const{compactDirection:e,isFirstItem:i,isLastItem:a}=r,o="vertical"===e?"-vertical-":"-";return en(`${t}-compact${o}item`,{[`${t}-compact${o}first-item`]:i,[`${t}-compact${o}last-item`]:a,[`${t}-compact${o}item-rtl`]:"rtl"===n})},[t,n,r]);return{compactSize:null==r?void 0:r.compactSize,compactDirection:null==r?void 0:r.compactDirection,compactItemClassnames:i}},ol=t=>{const{children:n}=t;return e.createElement(il.Provider,{value:null},n)};var sl=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const t=typeof e,n="string"===t||"number"===t;if(r&&n){const t=i.length-1,n=i[t];i[t]=`${n}${e}`}else i.push(e);r=n}),t.Children.map(i,e=>function(e,n){if(null==e)return;const r=n?" ":"";return"string"!=typeof e&&"number"!=typeof e&&dl(e.type)&&ul(e.props.children)?us(e,{children:e.props.children.split("").join(r)}):dl(e)?ul(e)?t.createElement("span",null,e.split("").join(r)):t.createElement("span",null,e):ls(e)?t.createElement("span",null,e):e}(e,n))}["default","primary","danger"].concat(M(ia));const gl=u((e,n)=>{const{className:r,style:i,children:a,prefixCls:o}=e,s=en(`${o}-icon`,r);return t.createElement("span",{ref:n,className:s,style:i},a)}),ml=u((e,n)=>{const{prefixCls:r,className:i,style:a,iconClassName:o}=e,s=en(`${r}-loading-icon`,i);return t.createElement(gl,{prefixCls:r,className:s,style:a,ref:n},t.createElement(gs,{className:o}))}),yl=()=>({width:0,opacity:0,transform:"scale(0)"}),vl=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"}),bl=e=>{const{prefixCls:n,loading:r,existIcon:i,className:a,style:o,mount:s}=e,l=!!r;return i?t.createElement(ml,{prefixCls:n,className:a,style:o}):t.createElement(so,{visible:l,motionName:`${n}-loading-icon-motion`,motionAppear:!s,motionEnter:!s,motionLeave:!s,removeOnLeave:!0,onAppearStart:yl,onAppearActive:vl,onEnterStart:yl,onEnterActive:vl,onLeaveStart:vl,onLeaveActive:yl},({className:e,style:r},i)=>{const s=Object.assign(Object.assign({},o),r);return t.createElement(ml,{prefixCls:n,className:en(a,e),style:s,ref:i})})},xl=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),wl=e=>{const{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},xl(`${t}-primary`,i),xl(`${t}-danger`,a)]}};var El=["b"],kl=["v"],Tl=function(e){return Math.round(Number(e||0))},_l=function(){ye(t,Yr);var e=xe(t);function t(n){return re(this,t),e.call(this,function(e){if(e instanceof Yr)return e;if(e&&"object"===N(e)&&"h"in e&&"b"in e){var t=e,n=t.b;return D(D({},X(t,El)),{},{v:n})}return"string"==typeof e&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e}(n))}return ae(t,[{key:"toHsbString",value:function(){var e=this.toHsb(),t=Tl(100*e.s),n=Tl(100*e.b),r=Tl(e.h),i=e.a,a="hsb(".concat(r,", ").concat(t,"%, ").concat(n,"%)"),o="hsba(".concat(r,", ").concat(t,"%, ").concat(n,"%, ").concat(i.toFixed(0===i?0:2),")");return 1===i?a:o}},{key:"toHsb",value:function(){var e=this.toHsv(),t=e.v;return D(D({},X(e,kl)),{},{b:t,a:this.a})}}]),t}();!function(e){e instanceof _l||new _l(e)}("#1677ff");let Cl=function(){return ae(function e(t){var n;if(re(this,e),this.cleared=!1,t instanceof e)return this.metaColor=t.metaColor.clone(),this.colors=null===(n=t.colors)||void 0===n?void 0:n.map(t=>({color:new e(t.color),percent:t.percent})),void(this.cleared=t.cleared);const r=Array.isArray(t);r&&t.length?(this.colors=t.map(({color:t,percent:n})=>({color:new e(t),percent:n})),this.metaColor=new _l(this.colors[0].color.metaColor)):this.metaColor=new _l(r?"":t),(!t||r&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)},[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return((e,t)=>e?((e,t)=>(null==e?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"")(e,t):"")(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:e}=this;if(e){return`linear-gradient(90deg, ${e.map(e=>`${e.color.toRgbString()} ${e.percent}%`).join(", ")})`}return this.metaColor.toRgbString()}},{key:"equals",value:function(e){return!(!e||this.isGradient()!==e.isGradient())&&(this.isGradient()?this.colors.length===e.colors.length&&this.colors.every((t,n)=>{const r=e.colors[n];return t.percent===r.percent&&t.color.equals(r.color)}):this.toHexString()===e.toHexString())}}])}();var Sl={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},Al=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Sl}))},Nl=e.forwardRef(Al);const Il=e=>({animationDuration:e,animationFillMode:"both"}),Ol=e=>({animationDuration:e,animationFillMode:"both"}),Ll=(e,t,n,r,i=!1)=>{const a=i?"&":"";return{[`\n ${a}${e}-enter,\n ${a}${e}-appear\n `]:Object.assign(Object.assign({},Il(r)),{animationPlayState:"paused"}),[`${a}${e}-leave`]:Object.assign(Object.assign({},Ol(r)),{animationPlayState:"paused"}),[`\n ${a}${e}-enter${e}-enter-active,\n ${a}${e}-appear${e}-appear-active\n `]:{animationName:t,animationPlayState:"running"},[`${a}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},Ml=new Xt("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Rl=new Xt("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Dl=(e,t=!1)=>{const{antCls:n}=e,r=`${n}-fade`,i=t?"&":"";return[Ll(r,Ml,Rl,e.motionDurationMid,t),{[`\n ${i}${r}-enter,\n ${i}${r}-appear\n `]:{opacity:0,animationTimingFunction:"linear"},[`${i}${r}-leave`]:{animationTimingFunction:"linear"}}]},Pl=new Xt("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),$l=new Xt("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),Bl=new Xt("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Fl=new Xt("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),zl=new Xt("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),jl=new Xt("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Hl={"move-up":{inKeyframes:new Xt("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new Xt("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:Pl,outKeyframes:$l},"move-left":{inKeyframes:Bl,outKeyframes:Fl},"move-right":{inKeyframes:zl,outKeyframes:jl}},Ul=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Hl[t];return[Ll(r,i,a,e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},Gl=new Xt("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ql=new Xt("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Wl=new Xt("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Vl=new Xt("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Yl=new Xt("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Xl=new Xt("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Kl=new Xt("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Ql=new Xt("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),Zl={"slide-up":{inKeyframes:Gl,outKeyframes:ql},"slide-down":{inKeyframes:Wl,outKeyframes:Vl},"slide-left":{inKeyframes:Yl,outKeyframes:Xl},"slide-right":{inKeyframes:Kl,outKeyframes:Ql}},Jl=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Zl[t];return[Ll(r,i,a,e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},ec=new Xt("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),tc=new Xt("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),nc=new Xt("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),rc=new Xt("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),ic=new Xt("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),ac=new Xt("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),oc={zoom:{inKeyframes:ec,outKeyframes:tc},"zoom-big":{inKeyframes:nc,outKeyframes:rc},"zoom-big-fast":{inKeyframes:nc,outKeyframes:rc},"zoom-left":{inKeyframes:new Xt("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),outKeyframes:new Xt("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}})},"zoom-right":{inKeyframes:new Xt("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),outKeyframes:new Xt("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}})},"zoom-up":{inKeyframes:ic,outKeyframes:ac},"zoom-down":{inKeyframes:new Xt("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),outKeyframes:new Xt("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}})}},sc=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=oc[t];return[Ll(r,i,a,"zoom-big-fast"===t?e.motionDurationFast:e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},lc=e=>{const{paddingInline:t,onlyIconSize:n}=e;return Qi(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},cc=e=>{var t,n,r,i,a,o;const s=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,c=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(i=e.contentLineHeight)&&void 0!==i?i:gi(s),h=null!==(a=e.contentLineHeightSM)&&void 0!==a?a:gi(l),d=null!==(o=e.contentLineHeightLG)&&void 0!==o?o:gi(c),p=((e,t)=>{const{r:n,g:r,b:i,a:a}=e.toRgb(),o=new _l(e.toRgbString()).onBackground(t).toHsv();return a<=.5?o.v>.5:.299*n+.587*r+.114*i>192})(new Cl(e.colorBgSolid),"#fff")?"#000":"#fff",f=ia.reduce((t,n)=>Object.assign(Object.assign({},t),{[`${n}ShadowColor`]:`0 ${Le(e.controlOutlineWidth)} 0 ${oa(e[`${n}1`],e.colorBgContainer)}`}),{});return Object.assign(Object.assign({},f),{fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:p,contentFontSize:s,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:h,contentLineHeightLG:d,paddingBlock:Math.max((e.controlHeight-s*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*h)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-c*d)/2-e.lineWidth,0)})},uc=e=>{const{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:s,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},[`${t}-icon > svg`]:{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}},"> a":{color:"currentColor"},"&:not(:disabled)":va(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:"none"}},[`&${t}-loading`]:{opacity:i,cursor:"default"},[`${t}-loading-icon`]:{transition:["width","opacity","margin"].map(e=>`${e} ${a} ${o}`).join(",")},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(s).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(s).mul(-1).equal()}}}}}},hc=(e,t,n)=>({[`&:not(:disabled):not(${e}-disabled)`]:{"&:hover":t,"&:active":n}}),dc=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),pc=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),fc=(e,t,n,r,i,a,o,s)=>({[`&${e}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},hc(e,Object.assign({background:t},o),Object.assign({background:t},s))),{"&:disabled":{cursor:"not-allowed",color:i||void 0,borderColor:a||void 0}})}),gc=e=>({[`&:disabled, &${e.componentCls}-disabled`]:Object.assign({},pc(e))}),mc=e=>({[`&:disabled, &${e.componentCls}-disabled`]:{cursor:"not-allowed",color:e.colorTextDisabled}}),yc=(e,t,n,r)=>{const i=r&&["link","text"].includes(r)?mc:gc;return Object.assign(Object.assign({},i(e)),hc(e.componentCls,t,n))},vc=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-solid`]:Object.assign({color:t,background:n},yc(e,r,i))}),bc=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]:Object.assign({borderColor:t,background:n},yc(e,r,i))}),xc=e=>({[`&${e.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),wc=(e,t,n,r)=>({[`&${e.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:t},yc(e,n,r))}),Ec=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-${n}`]:Object.assign({color:t,boxShadow:"none"},yc(e,r,i,n))}),kc=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},vc(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),xc(e)),wc(e,e.colorFillTertiary,{color:e.defaultColor,background:e.colorFillSecondary},{color:e.defaultColor,background:e.colorFill})),fc(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),Ec(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),Tc=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},bc(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),xc(e)),wc(e,e.colorPrimaryBg,{color:e.colorPrimary,background:e.colorPrimaryBgHover},{color:e.colorPrimary,background:e.colorPrimaryBorder})),Ec(e,e.colorPrimaryText,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),Ec(e,e.colorPrimaryText,"link",{color:e.colorPrimaryTextHover,background:e.linkHoverBg},{color:e.colorPrimaryTextActive})),fc(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),_c=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},vc(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),bc(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),xc(e)),wc(e,e.colorErrorBg,{color:e.colorError,background:e.colorErrorBgFilledHover},{color:e.colorError,background:e.colorErrorBgActive})),Ec(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),Ec(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),fc(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),Cc=e=>Object.assign(Object.assign({},Ec(e,e.colorLink,"link",{color:e.colorLinkHover},{color:e.colorLinkActive})),fc(e.componentCls,e.ghostBg,e.colorInfo,e.colorInfo,e.colorTextDisabled,e.colorBorder,{color:e.colorInfoHover,borderColor:e.colorInfoHover},{color:e.colorInfoActive,borderColor:e.colorInfoActive})),Sc=e=>{const{componentCls:t}=e;return Object.assign({[`${t}-color-default`]:kc(e),[`${t}-color-primary`]:Tc(e),[`${t}-color-dangerous`]:_c(e),[`${t}-color-link`]:Cc(e)},(e=>{const{componentCls:t}=e;return ia.reduce((n,r)=>{const i=e[`${r}6`],a=e[`${r}1`],o=e[`${r}5`],s=e[`${r}2`],l=e[`${r}3`],c=e[`${r}7`];return Object.assign(Object.assign({},n),{[`&${t}-color-${r}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:i,boxShadow:e[`${r}ShadowColor`]},vc(e,e.colorTextLightSolid,i,{background:o},{background:c})),bc(e,i,e.colorBgContainer,{color:o,borderColor:o,background:e.colorBgContainer},{color:c,borderColor:c,background:e.colorBgContainer})),xc(e)),wc(e,a,{color:i,background:s},{color:i,background:l})),Ec(e,i,"link",{color:o},{color:c})),Ec(e,i,"text",{color:o,background:a},{color:c,background:l}))})},{})})(e))},Ac=e=>Object.assign(Object.assign(Object.assign(Object.assign({},bc(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),Ec(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),vc(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),Ec(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),Nc=(e,t="")=>{const{componentCls:n,controlHeight:r,fontSize:i,borderRadius:a,buttonPaddingHorizontal:o,iconCls:s,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=e;return[{[t]:{fontSize:i,height:r,padding:`${Le(l)} ${Le(o)}`,borderRadius:a,[`&${n}-icon-only`]:{width:r,[s]:{fontSize:c}}}},{[`${n}${n}-circle${t}`]:dc(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},Ic=e=>{const t=Qi(e,{fontSize:e.contentFontSize});return Nc(t,e.componentCls)},Oc=e=>{const t=Qi(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM});return Nc(t,`${e.componentCls}-sm`)},Lc=e=>{const t=Qi(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG});return Nc(t,`${e.componentCls}-lg`)},Mc=e=>{const{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:"100%"}}}};var Rc=wa("Button",e=>{const t=lc(e);return[uc(t),Ic(t),Oc(t),Lc(t),Mc(t),Sc(t),Ac(t),wl(t)]},cc,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function Dc(e,t,n,r){const{focusElCls:i,focus:a,borderElCls:o}=n,s=o?"> *":"",l=["hover",a?"focus":null,"active"].filter(Boolean).map(e=>`&:${e} ${s}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${r}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},i?{[`&${i}`]:{zIndex:3}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function Pc(e,t,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function $c(e,t={focus:!0}){const{componentCls:n}=e,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},Dc(e,r,t,n)),Pc(n,r,t))}}function Bc(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}}}function Fc(e){const t=`${e.componentCls}-compact-vertical`;return{[t]:Object.assign(Object.assign({},Bc(e,t,e.componentCls)),(n=e.componentCls,r=t,{[`&-item:not(${r}-first-item):not(${r}-last-item)`]:{borderRadius:0},[`&-item${r}-first-item:not(${r}-last-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${r}-last-item:not(${r}-first-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))};var n,r}const zc=e=>{const{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:i}=e,a=i(r).mul(-1).equal(),o=e=>{const i=`${t}-compact${e?"-vertical":""}-item${t}-primary:not([disabled])`;return{[`${i} + ${i}::before`]:{position:"absolute",top:e?a:0,insetInlineStart:e?0:a,backgroundColor:n,content:'""',width:e?"100%":r,height:e?r:"100%"}}};return Object.assign(Object.assign({},o()),o(!0))};var jc=ka(["Button","compact"],e=>{const t=lc(e);return[$c(t),Fc(t),zc(t)]},cc),Hc=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i,a;const{loading:s=!1,prefixCls:c,color:u,variant:f,type:g,danger:m=!1,shape:y,size:v,styles:b,disabled:x,className:w,rootClassName:E,children:k,icon:T,iconPosition:_="start",ghost:C=!1,block:S=!1,htmlType:A="button",classNames:N,style:I={},autoInsertSpace:O,autoFocus:L}=e,M=Hc(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),R=g||"default",{button:D}=t.useContext(Si),P=y||(null==D?void 0:D.shape)||"default",[$,B]=h(()=>{if(u&&f)return[u,f];if(g||m){const e=Uc[R]||[];return m?["danger",e[1]]:e}return(null==D?void 0:D.color)&&(null==D?void 0:D.variant)?[D.color,D.variant]:["default","outlined"]},[g,u,f,m,null==D?void 0:D.variant,null==D?void 0:D.color]),F="danger"===$?"dangerous":$,{getPrefixCls:z,direction:j,autoInsertSpace:H,className:U,style:G,classNames:q,styles:W}=Ii("button"),V=null===(i=null!=O?O:H)||void 0===i||i,Y=z("btn",c),[X,K,Q]=Rc(Y),Z=n(Mi),J=null!=x?x:Z,ee=n(ll),te=h(()=>function(e){if("object"==typeof e&&e){let t=null==e?void 0:e.delay;return t=Number.isNaN(t)||"number"!=typeof t?0:t,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}(s),[s]),[ne,re]=d(te.loading),[ie,ae]=d(!1),oe=o(null),se=On(r,oe),le=1===p.count(k)&&!T&&!pl(B),ce=o(!0);t.useEffect(()=>(ce.current=!1,()=>{ce.current=!0}),[]),Be(()=>{let e=null;return te.delay>0?e=setTimeout(()=>{e=null,re(!0)},te.delay):re(te.loading),function(){e&&(clearTimeout(e),e=null)}},[te.delay,te.loading]),l(()=>{if(!oe.current||!V)return;const e=oe.current.textContent||"";le&&ul(e)?ie||ae(!0):ie&&ae(!1)}),l(()=>{L&&oe.current&&oe.current.focus()},[]);const ue=t.useCallback(t=>{var n;ne||J?t.preventDefault():null===(n=e.onClick)||void 0===n||n.call(e,t)},[e.onClick,ne,J]),{compactSize:he,compactItemClassnames:de}=al(Y,j),pe={large:"lg",small:"sm",middle:void 0},fe=rl(e=>{var t,n;return null!==(n=null!==(t=null!=v?v:he)&&void 0!==t?t:ee)&&void 0!==n?n:e}),ge=fe&&null!==(a=pe[fe])&&void 0!==a?a:"",me=ne?"loading":T,ye=Vs(M,["navigate"]),ve=en(Y,K,Q,{[`${Y}-${P}`]:"default"!==P&&P,[`${Y}-${R}`]:R,[`${Y}-dangerous`]:m,[`${Y}-color-${F}`]:F,[`${Y}-variant-${B}`]:B,[`${Y}-${ge}`]:ge,[`${Y}-icon-only`]:!k&&0!==k&&!!me,[`${Y}-background-ghost`]:C&&!pl(B),[`${Y}-loading`]:ne,[`${Y}-two-chinese-chars`]:ie&&V&&!ne,[`${Y}-block`]:S,[`${Y}-rtl`]:"rtl"===j,[`${Y}-icon-end`]:"end"===_},de,w,E,U),be=Object.assign(Object.assign({},G),I),xe=en(null==N?void 0:N.icon,q.icon),we=Object.assign(Object.assign({},(null==b?void 0:b.icon)||{}),W.icon||{}),Ee=T&&!ne?t.createElement(gl,{prefixCls:Y,className:xe,style:we},T):s&&"object"==typeof s&&s.icon?t.createElement(gl,{prefixCls:Y,className:xe,style:we},s.icon):t.createElement(bl,{existIcon:!!T,prefixCls:Y,loading:ne,mount:ce.current}),ke=k||0===k?fl(k,le&&V):null;if(void 0!==ye.href)return X(t.createElement("a",Object.assign({},ye,{className:en(ve,{[`${Y}-disabled`]:J}),href:J?void 0:ye.href,style:be,onClick:ue,ref:se,tabIndex:J?-1:0,"aria-disabled":J}),Ee,ke));let Te=t.createElement("button",Object.assign({},M,{type:A,className:ve,style:be,onClick:ue,disabled:J,ref:se}),Ee,ke,de&&t.createElement(jc,{prefixCls:Y}));return pl(B)||(Te=t.createElement(nl,{component:"Button",disabled:ne},Te)),X(Te)}),qc=Gc;qc.Group=t=>{const{getPrefixCls:n,direction:r}=e.useContext(Si),{prefixCls:i,size:a,className:o}=t,s=sl(t,["prefixCls","size","className"]),l=n("btn-group",i),[,,c]=fa(),u=e.useMemo(()=>{switch(a){case"large":return"lg";case"small":return"sm";default:return""}},[a]),h=en(l,{[`${l}-${u}`]:u,[`${l}-rtl`]:"rtl"===r},o,c);return e.createElement(ll.Provider,{value:a},e.createElement("div",Object.assign({},s,{className:h})))},qc.__ANT_BUTTON=!0;const Wc=e=>"function"==typeof(null==e?void 0:e.then),Vc=t=>{const{type:n,children:r,prefixCls:i,buttonProps:a,close:o,autoFocus:s,emitEvent:l,isSilent:c,quitOnNullishReturnValue:u,actionFn:h}=t,d=e.useRef(!1),p=e.useRef(null),[f,g]=qi(!1),m=(...e)=>{null==o||o.apply(void 0,e)};e.useEffect(()=>{let e=null;return s&&(e=setTimeout(()=>{var e;null===(e=p.current)||void 0===e||e.focus({preventScroll:!0})})),()=>{e&&clearTimeout(e)}},[]);return e.createElement(qc,Object.assign({},hl(n),{onClick:e=>{if(d.current)return;if(d.current=!0,!h)return void m();let t;if(l){if(t=h(e),u&&!Wc(t))return d.current=!1,void m(e)}else if(h.length)t=h(o),d.current=!1;else if(t=h(),!Wc(t))return void m();(e=>{Wc(e)&&(g(!0),e.then((...e)=>{g(!1,!0),m.apply(void 0,e),d.current=!1},e=>{if(g(!1,!0),d.current=!1,!(null==c?void 0:c()))return Promise.reject(e)}))})(t)},loading:f,prefixCls:i},a,{ref:p}),r)},Yc=t.createContext({}),{Provider:Xc}=Yc,Kc=()=>{const{autoFocusButton:e,cancelButtonProps:r,cancelTextLocale:i,isSilent:a,mergedOkCancel:o,rootPrefixCls:s,close:l,onCancel:c,onConfirm:u}=n(Yc);return o?t.createElement(Vc,{isSilent:a,actionFn:c,close:(...e)=>{null==l||l.apply(void 0,e),null==u||u(!1)},autoFocus:"cancel"===e,buttonProps:r,prefixCls:`${s}-btn`},i):null},Qc=()=>{const{autoFocusButton:e,close:r,isSilent:i,okButtonProps:a,rootPrefixCls:o,okTextLocale:s,okType:l,onConfirm:c,onOk:u}=n(Yc);return t.createElement(Vc,{isSilent:i,type:l||"primary",actionFn:u,close:(...e)=>{null==r||r.apply(void 0,e),null==c||c(!0)},autoFocus:"ok"===e,buttonProps:a,prefixCls:`${o}-btn`},s)};var Zc=e.createContext(null),Jc=[];function eu(e){return"undefined"!=typeof document&&e&&e instanceof Element?function(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r,i,a=n.style;if(a.position="absolute",a.left="0",a.top="0",a.width="100px",a.height="100px",a.overflow="scroll",e){var o=getComputedStyle(e);a.scrollbarColor=o.scrollbarColor,a.scrollbarWidth=o.scrollbarWidth;var s=getComputedStyle(e,"::-webkit-scrollbar"),l=parseInt(s.width,10),c=parseInt(s.height,10);try{var u=l?"width: ".concat(s.width,";"):"",h=c?"height: ".concat(s.height,";"):"";Y("\n#".concat(t,"::-webkit-scrollbar {\n").concat(u,"\n").concat(h,"\n}"),t)}catch(e){console.error(e),r=l,i=c}}document.body.appendChild(n);var d=e&&r&&!isNaN(r)?r:n.offsetWidth-n.clientWidth,p=e&&i&&!isNaN(i)?i:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),V(t),{width:d,height:p}}(e):{width:0,height:0}}var tu="rc-util-locker-".concat(Date.now()),nu=0;function ru(t){var n=!!t,r=A(e.useState(function(){return nu+=1,"".concat(tu,"_").concat(nu)}),1)[0];Be(function(){if(n){var e=eu(document.body).width,t=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;Y("\nhtml body {\n overflow-y: hidden;\n ".concat(t?"width: calc(100% - ".concat(e,"px);"):"","\n}"),r)}else V(r);return function(){V(r)}},[n,r])}var iu=function(e){return!1!==e&&($()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},au=e.forwardRef(function(t,n){var r=t.open,i=t.autoLock,a=t.getContainer;t.debug;var o=t.autoDestroy,s=void 0===o||o,l=t.children,c=A(e.useState(r),2),u=c[0],h=c[1],d=u||r;e.useEffect(function(){(s||r)&&h(r)},[r,s]);var p=A(e.useState(function(){return iu(a)}),2),f=p[0],g=p[1];e.useEffect(function(){var e=iu(a);g(null!=e?e:null)});var m=function(t){var n=A(e.useState(function(){return $()?document.createElement("div"):null}),1)[0],r=e.useRef(!1),i=e.useContext(Zc),a=A(e.useState(Jc),2),o=a[0],s=a[1],l=i||(r.current?void 0:function(e){s(function(t){return[e].concat(M(t))})});function c(){n.parentElement||document.body.appendChild(n),r.current=!0}function u(){var e;null===(e=n.parentElement)||void 0===e||e.removeChild(n),r.current=!1}return Be(function(){return t?i?i(c):c():u(),u},[t]),Be(function(){o.length&&(o.forEach(function(e){return e()}),s(Jc))},[o]),[n,l]}(d&&!f),y=A(m,2),v=y[0],b=y[1],x=null!=f?f:v;ru(i&&r&&$()&&(x===v||x===document.body));var E=null;l&&Ln(l)&&n&&(E=l.ref);var k=On(E,n);if(!d||!$()||void 0===f)return null;var T=!1===x||!1,_=l;return n&&(_=e.cloneElement(l,{ref:k})),e.createElement(Zc.Provider,{value:b},T?_:w(_,x))}),ou=e.createContext({});var su=0,lu=D({},e).useId,cu=lu?function(e){var t=lu();return e||t}:function(t){var n=A(e.useState("ssr-id"),2),r=n[0],i=n[1];return e.useEffect(function(){var e=su;su+=1,i("rc_unique_".concat(e))},[]),t||r};function uu(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function hu(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}var du=e.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),pu={width:0,height:0,overflow:"hidden",outline:"none"},fu={outline:"none"},gu=t.forwardRef(function(e,n){var r=e.prefixCls,i=e.className,a=e.style,s=e.title,l=e.ariaId,c=e.footer,u=e.closable,d=e.closeIcon,p=e.onClose,f=e.children,g=e.bodyStyle,m=e.bodyProps,y=e.modalRender,v=e.onMouseDown,b=e.onMouseUp,x=e.holderRef,w=e.visible,E=e.forceRender,k=e.width,T=e.height,_=e.classNames,C=e.styles,S=t.useContext(ou).panel,A=On(x,S),I=o(),O=o();t.useImperativeHandle(n,function(){return{focus:function(){var e;null===(e=I.current)||void 0===e||e.focus({preventScroll:!0})},changeActive:function(e){var t=document.activeElement;e&&t===O.current?I.current.focus({preventScroll:!0}):e||t!==I.current||O.current.focus({preventScroll:!0})}}});var L={};void 0!==k&&(L.width=k),void 0!==T&&(L.height=T);var M=c?t.createElement("div",{className:en("".concat(r,"-footer"),null==_?void 0:_.footer),style:D({},null==C?void 0:C.footer)},c):null,R=s?t.createElement("div",{className:en("".concat(r,"-header"),null==_?void 0:_.header),style:D({},null==C?void 0:C.header)},t.createElement("div",{className:"".concat(r,"-title"),id:l},s)):null,P=h(function(){return"object"===N(u)&&null!==u?u:u?{closeIcon:null!=d?d:t.createElement("span",{className:"".concat(r,"-close-x")})}:{}},[u,d,r]),$=ss(P,!0),B="object"===N(u)&&u.disabled,F=u?t.createElement("button",Xe({type:"button",onClick:p,"aria-label":"Close"},$,{className:"".concat(r,"-close"),disabled:B}),P.closeIcon):null,z=t.createElement("div",{className:en("".concat(r,"-content"),null==_?void 0:_.content),style:null==C?void 0:C.content},F,R,t.createElement("div",Xe({className:en("".concat(r,"-body"),null==_?void 0:_.body),style:D(D({},g),null==C?void 0:C.body)},m),f),M);return t.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?l:null,"aria-modal":"true",ref:A,style:D(D({},a),L),className:en(r,i),onMouseDown:v,onMouseUp:b},t.createElement("div",{ref:I,tabIndex:0,style:fu},t.createElement(du,{shouldUpdate:w||E},y?y(z):z)),t.createElement("div",{tabIndex:0,ref:O,style:pu}))}),mu=e.forwardRef(function(t,n){var r=t.prefixCls,i=t.title,a=t.style,s=t.className,l=t.visible,c=t.forceRender,u=t.destroyOnClose,h=t.motionName,d=t.ariaId,p=t.onVisibleChanged,f=t.mousePosition,g=o(),m=A(e.useState(),2),y=m[0],v=m[1],b={};function x(){var e=function(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=hu(i),n.top+=hu(i,!0),n}(g.current);v(f&&(f.x||f.y)?"".concat(f.x-e.left,"px ").concat(f.y-e.top,"px"):"")}return y&&(b.transformOrigin=y),e.createElement(so,{visible:l,onVisibleChanged:p,onAppearPrepare:x,onEnterPrepare:x,forceRender:c,motionName:h,removeOnLeave:u,ref:g},function(o,l){var c=o.className,u=o.style;return e.createElement(gu,Xe({},t,{ref:n,title:i,ariaId:d,prefixCls:r,holderRef:l,style:D(D(D({},u),a),b),className:en(s,c)}))})});mu.displayName="Content";var yu=function(t){var n=t.prefixCls,r=t.style,i=t.visible,a=t.maskProps,o=t.motionName,s=t.className;return e.createElement(so,{key:"mask",visible:i,motionName:o,leavedClassName:"".concat(n,"-mask-hidden")},function(t,i){var o=t.className,l=t.style;return e.createElement("div",Xe({ref:i,style:D(D({},l),r),className:en("".concat(n,"-mask"),o,s)},a))})},vu=function(t){var n=t.prefixCls,r=void 0===n?"rc-dialog":n,i=t.zIndex,a=t.visible,s=void 0!==a&&a,c=t.keyboard,u=void 0===c||c,h=t.focusTriggerAfterClose,d=void 0===h||h,p=t.wrapStyle,f=t.wrapClassName,g=t.wrapProps,m=t.onClose,y=t.afterOpenChange,v=t.afterClose,b=t.transitionName,x=t.animation,w=t.closable,E=void 0===w||w,k=t.mask,T=void 0===k||k,_=t.maskTransitionName,C=t.maskAnimation,S=t.maskClosable,N=void 0===S||S,I=t.maskStyle,O=t.maskProps,L=t.rootClassName,M=t.classNames,R=t.styles,P=o(),$=o(),F=o(),z=A(e.useState(s),2),j=z[0],H=z[1],U=cu();function G(e){null==m||m(e)}var q=o(!1),W=o(),V=null;N&&(V=function(e){q.current?q.current=!1:$.current===e.target&&G(e)}),l(function(){s&&(H(!0),B($.current,document.activeElement)||(P.current=document.activeElement))},[s]),l(function(){return function(){clearTimeout(W.current)}},[]);var Y=D(D(D({zIndex:i},p),null==R?void 0:R.wrapper),{},{display:j?null:"none"});return e.createElement("div",Xe({className:en("".concat(r,"-root"),L)},ss(t,{data:!0})),e.createElement(yu,{prefixCls:r,visible:T&&s,motionName:uu(r,_,C),style:D(D({zIndex:i},I),null==R?void 0:R.mask),maskProps:O,className:null==M?void 0:M.mask}),e.createElement("div",Xe({tabIndex:-1,onKeyDown:function(e){if(u&&e.keyCode===ds.ESC)return e.stopPropagation(),void G(e);s&&e.keyCode===ds.TAB&&F.current.changeActive(!e.shiftKey)},className:en("".concat(r,"-wrap"),f,null==M?void 0:M.wrapper),ref:$,onClick:V,style:Y},g),e.createElement(mu,Xe({},t,{onMouseDown:function(){clearTimeout(W.current),q.current=!0},onMouseUp:function(){W.current=setTimeout(function(){q.current=!1})},ref:F,closable:E,ariaId:U,prefixCls:r,visible:s&&j,onClose:G,onVisibleChanged:function(e){if(e)B($.current,document.activeElement)||null===(t=F.current)||void 0===t||t.focus();else{if(H(!1),T&&P.current&&d){try{P.current.focus({preventScroll:!0})}catch(e){}P.current=null}j&&(null==v||v())}var t;null==y||y(e)},motionName:uu(r,b,x)}))))},bu=function(t){var n=t.visible,r=t.getContainer,i=t.forceRender,a=t.destroyOnClose,o=void 0!==a&&a,s=t.afterClose,l=t.panelRef,c=A(e.useState(n),2),u=c[0],h=c[1],d=e.useMemo(function(){return{panel:l}},[l]);return e.useEffect(function(){n&&h(!0)},[n]),i||!o||u?e.createElement(ou.Provider,{value:d},e.createElement(au,{open:n||i||u,autoDestroy:!1,getContainer:r,autoLock:n||u},e.createElement(vu,Xe({},t,{destroyOnClose:o,afterClose:function(){null==s||s(),h(!1)}})))):null};bu.displayName="Dialog";var xu="RC_FORM_INTERNAL_HOOKS",wu=function(){te(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Eu=e.createContext({getFieldValue:wu,getFieldsValue:wu,getFieldError:wu,getFieldWarning:wu,getFieldsError:wu,isFieldsTouched:wu,isFieldTouched:wu,isFieldValidating:wu,isFieldsValidating:wu,resetFields:wu,setFields:wu,setFieldValue:wu,setFieldsValue:wu,validateFields:wu,submit:wu,getInternalHooks:function(){return wu(),{dispatch:wu,initEntityValue:wu,registerField:wu,useSubscribe:wu,setInitialValues:wu,destroyForm:wu,setCallbacks:wu,registerWatch:wu,getFields:wu,setValidateMessages:wu,setPreserve:wu,getInitialValue:wu}}}),ku=e.createContext(null);function Tu(e){return null==e?[]:Array.isArray(e)?e:[e]}function _u(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Cu=_u();function Su(e){var t="function"==typeof Map?new Map:void 0;return Su=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(be())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&me(i,n.prototype),i}(e,arguments,ve(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),me(n,e)},Su(e)}var Au=/%[sdj%]/g;function Nu(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function Iu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=a)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}break;default:return e}});return o}return e}function Ou(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function Lu(e,t,n){var r=0,i=e.length;!function a(o){if(o&&o.length)n(o);else{var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,ju=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Hu={integer:function(e){return Hu.number(e)&&parseInt(e,10)===e},float:function(e){return Hu.number(e)&&!Hu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===N(e)&&!Hu.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(zu)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if($u)return $u;var e="[a-fA-F\\d:]",t=function(t){return t&&t.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:".concat(i.join("|"),")").concat("(?:%[0-9a-zA-Z]{1,})?"),o=new RegExp("(?:^".concat(n,"$)|(?:^").concat(a,"$)")),s=new RegExp("^".concat(n,"$")),l=new RegExp("^".concat(a,"$")),c=function(e){return e&&e.exact?o:new RegExp("(?:".concat(t(e)).concat(n).concat(t(e),")|(?:").concat(t(e)).concat(a).concat(t(e),")"),"g")};c.v4=function(e){return e&&e.exact?s:new RegExp("".concat(t(e)).concat(n).concat(t(e)),"g")},c.v6=function(e){return e&&e.exact?l:new RegExp("".concat(t(e)).concat(a).concat(t(e)),"g")};var u=c.v4().source,h=c.v6().source,d="(?:".concat("(?:(?:[a-z]+:)?//)","|www\\.)").concat("(?:\\S+(?::\\S*)?@)?","(?:localhost|").concat(u,"|").concat(h,"|").concat("(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)").concat("(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*").concat("(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",")").concat("(?::\\d{2,5})?").concat('(?:[/?#][^\\s"]*)?');return $u=new RegExp("(?:^".concat(d,"$)"),"i")}())},hex:function(e){return"string"==typeof e&&!!e.match(ju)}},Uu={required:Fu,whitespace:function(e,t,n,r,i){(/^\s+$/.test(t)||""===t)&&r.push(Iu(i.messages.whitespace,e.fullField))},type:function(e,t,n,r,i){if(e.required&&void 0===t)Fu(e,t,n,r,i);else{var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?Hu[a](t)||r.push(Iu(i.messages.types[a],e.fullField,e.type)):a&&N(t)!==e.type&&r.push(Iu(i.messages.types[a],e.fullField,e.type))}},range:function(e,t,n,r,i){var a="number"==typeof e.len,o="number"==typeof e.min,s="number"==typeof e.max,l=t,c=null,u="number"==typeof t,h="string"==typeof t,d=Array.isArray(t);if(u?c="number":h?c="string":d&&(c="array"),!c)return!1;d&&(l=t.length),h&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?l!==e.len&&r.push(Iu(i.messages[c].len,e.fullField,e.len)):o&&!s&&le.max?r.push(Iu(i.messages[c].max,e.fullField,e.max)):o&&s&&(le.max)&&r.push(Iu(i.messages[c].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,i){e[Bu]=Array.isArray(e[Bu])?e[Bu]:[],-1===e[Bu].indexOf(t)&&r.push(Iu(i.messages[Bu],e.fullField,e[Bu].join(", ")))},pattern:function(e,t,n,r,i){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Iu(i.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||r.push(Iu(i.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Gu=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t,a)&&!e.required)return n();Uu.required(e,t,r,o,i,a),Ou(t,a)||Uu.type(e,t,r,o,i)}n(o)},qu={string:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t,"string")&&!e.required)return n();Uu.required(e,t,r,a,i,"string"),Ou(t,"string")||(Uu.type(e,t,r,a,i),Uu.range(e,t,r,a,i),Uu.pattern(e,t,r,a,i),!0===e.whitespace&&Uu.whitespace(e,t,r,a,i))}n(a)},method:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&Uu.type(e,t,r,a,i)}n(a)},number:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&(Uu.type(e,t,r,a,i),Uu.range(e,t,r,a,i))}n(a)},boolean:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&Uu.type(e,t,r,a,i)}n(a)},regexp:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),Ou(t)||Uu.type(e,t,r,a,i)}n(a)},integer:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&(Uu.type(e,t,r,a,i),Uu.range(e,t,r,a,i))}n(a)},float:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&(Uu.type(e,t,r,a,i),Uu.range(e,t,r,a,i))}n(a)},array:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();Uu.required(e,t,r,a,i,"array"),null!=t&&(Uu.type(e,t,r,a,i),Uu.range(e,t,r,a,i))}n(a)},object:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&Uu.type(e,t,r,a,i)}n(a)},enum:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i),void 0!==t&&Uu.enum(e,t,r,a,i)}n(a)},pattern:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t,"string")&&!e.required)return n();Uu.required(e,t,r,a,i),Ou(t,"string")||Uu.pattern(e,t,r,a,i)}n(a)},date:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t,"date")&&!e.required)return n();var o;if(Uu.required(e,t,r,a,i),!Ou(t,"date"))o=t instanceof Date?t:new Date(t),Uu.type(e,o,r,a,i),o&&Uu.range(e,o.getTime(),r,a,i)}n(a)},url:Gu,hex:Gu,email:Gu,required:function(e,t,n,r,i){var a=[],o=Array.isArray(t)?"array":N(t);Uu.required(e,t,r,a,i,o),n(a)},any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ou(t)&&!e.required)return n();Uu.required(e,t,r,a,i)}n(a)}},Wu=function(){function e(t){re(this,e),O(this,"rules",null),O(this,"_messages",Cu),this.define(t)}return ae(e,[{key:"define",value:function(e){var t=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==N(e)||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})}},{key:"messages",value:function(e){return e&&(this._messages=Pu(_u(),e)),this._messages}},{key:"validate",value:function(t){var n=this,r=t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if("function"==typeof i&&(a=i,i={}),!this.rules||0===Object.keys(this.rules).length)return a&&a(null,r),Promise.resolve(r);if(i.messages){var o=this.messages();o===Cu&&(o=_u()),Pu(o,i.messages),i.messages=o}else i.messages=this.messages();var s={};(i.keys||Object.keys(this.rules)).forEach(function(e){var i=n.rules[e],a=r[e];i.forEach(function(i){var o=i;"function"==typeof o.transform&&(r===t&&(r=D({},r)),null!=(a=r[e]=o.transform(a))&&(o.type=o.type||(Array.isArray(a)?"array":N(a)))),(o="function"==typeof o?{validator:o}:D({},o)).validator=n.getValidationMethod(o),o.validator&&(o.field=e,o.fullField=o.fullField||e,o.type=n.getType(o),s[e]=s[e]||[],s[e].push({rule:o,value:a,source:r,field:e}))})});var l={};return Ru(s,i,function(t,n){var a,o=t.rule,s=!("object"!==o.type&&"array"!==o.type||"object"!==N(o.fields)&&"object"!==N(o.defaultField));function c(e,t){return D(D({},t),{},{fullField:"".concat(o.fullField,".").concat(e),fullFields:o.fullFields?[].concat(M(o.fullFields),[e]):[e]})}function u(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=Array.isArray(a)?a:[a];!i.suppressWarning&&u.length&&e.warning("async-validator:",u),u.length&&void 0!==o.message&&(u=[].concat(o.message));var h=u.map(Du(o,r));if(i.first&&h.length)return l[o.field]=1,n(h);if(s){if(o.required&&!t.value)return void 0!==o.message?h=[].concat(o.message).map(Du(o,r)):i.error&&(h=[i.error(o,Iu(i.messages.required,o.field))]),n(h);var d={};o.defaultField&&Object.keys(t.value).map(function(e){d[e]=o.defaultField}),d=D(D({},d),t.rule.fields);var p={};Object.keys(d).forEach(function(e){var t=d[e],n=Array.isArray(t)?t:[t];p[e]=n.map(c.bind(null,e))});var f=new e(p);f.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),f.validate(t.value,t.rule.options||i,function(e){var t=[];h&&h.length&&t.push.apply(t,M(h)),e&&e.length&&t.push.apply(t,M(e)),n(t.length?t:null)})}else n(h)}if(s=s&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)a=o.asyncValidator(o,t.value,u,t.source,i);else if(o.validator){try{a=o.validator(o,t.value,u,t.source,i)}catch(e){var h,d;null===(h=(d=console).error)||void 0===h||h.call(d,e),i.suppressValidatorError||setTimeout(function(){throw e},0),u(e.message)}!0===a?u():!1===a?u("function"==typeof o.message?o.message(o.fullField||o.field):o.message||"".concat(o.fullField||o.field," fails")):a instanceof Array?u(a):a instanceof Error&&u(a.message)}a&&a.then&&a.then(function(){return u()},function(e){return u(e)})},function(e){!function(e){var t=[],n={};function i(e){var n;Array.isArray(e)?t=(n=t).concat.apply(n,M(e)):t.push(e)}for(var o=0;o2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return oh(t,e,n)})}function oh(e,t){return!(!e||!t)&&(!(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&e.length!==t.length)&&t.every(function(t,n){return e[n]===t}))}function sh(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===N(t.target)&&e in t.target?t.target[e]:t}function lh(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var i=e[t],a=t-n;return a>0?[].concat(M(e.slice(0,n)),[i],M(e.slice(n,t)),M(e.slice(t+1,r))):a<0?[].concat(M(e.slice(0,t)),M(e.slice(t+1,n+1)),[i],M(e.slice(n+1,r))):e}var ch=["name"],uh=[];function hh(e,t,n,r,i,a){return"function"==typeof e?e(t,n,"source"in a?{source:a.source}:{}):r!==i}var dh=function(){ye(n,e.Component);var t=xe(n);function n(r){var i;(re(this,n),O(ge(i=t.call(this,r)),"state",{resetCount:0}),O(ge(i),"cancelRegisterFunc",null),O(ge(i),"mounted",!1),O(ge(i),"touched",!1),O(ge(i),"dirty",!1),O(ge(i),"validatePromise",void 0),O(ge(i),"prevValidating",void 0),O(ge(i),"errors",uh),O(ge(i),"warnings",uh),O(ge(i),"cancelRegister",function(){var e=i.props,t=e.preserve,n=e.isListField,r=e.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(n,t,rh(r)),i.cancelRegisterFunc=null}),O(ge(i),"getNamePath",function(){var e=i.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat(M(void 0===n?[]:n),M(t)):[]}),O(ge(i),"getRules",function(){var e=i.props,t=e.rules,n=void 0===t?[]:t,r=e.fieldContext;return n.map(function(e){return"function"==typeof e?e(r):e})}),O(ge(i),"refresh",function(){i.mounted&&i.setState(function(e){return{resetCount:e.resetCount+1}})}),O(ge(i),"metaCache",null),O(ge(i),"triggerMetaEvent",function(e){var t=i.props.onMetaChange;if(t){var n=D(D({},i.getMeta()),{},{destroy:e});ne(i.metaCache,n)||t(n),i.metaCache=n}else i.metaCache=null}),O(ge(i),"onStoreChange",function(e,t,n){var r=i.props,a=r.shouldUpdate,o=r.dependencies,s=void 0===o?[]:o,l=r.onReset,c=n.store,u=i.getNamePath(),h=i.getValue(e),d=i.getValue(c),p=t&&ah(t,u);switch("valueUpdate"!==n.type||"external"!==n.source||ne(h,d)||(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=uh,i.warnings=uh,i.triggerMetaEvent()),n.type){case"reset":if(!t||p)return i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=uh,i.warnings=uh,i.triggerMetaEvent(),null==l||l(),void i.refresh();break;case"remove":if(a&&hh(a,e,c,h,d,n))return void i.reRender();break;case"setField":var f=n.data;if(p)return"touched"in f&&(i.touched=f.touched),"validating"in f&&!("originRCField"in f)&&(i.validatePromise=f.validating?Promise.resolve([]):null),"errors"in f&&(i.errors=f.errors||uh),"warnings"in f&&(i.warnings=f.warnings||uh),i.dirty=!0,i.triggerMetaEvent(),void i.reRender();if("value"in f&&ah(t,u,!0))return void i.reRender();if(a&&!u.length&&hh(a,e,c,h,d,n))return void i.reRender();break;case"dependenciesUpdate":if(s.map(rh).some(function(e){return ah(n.relatedFields,e)}))return void i.reRender();break;default:if(p||(!s.length||u.length||a)&&hh(a,e,c,h,d,n))return void i.reRender()}!0===a&&i.reRender()}),O(ge(i),"validateRules",function(e){var t=i.getNamePath(),n=i.getValue(),r=e||{},a=r.triggerName,o=r.validateOnly,s=void 0!==o&&o,l=Promise.resolve().then(Os(Ns().mark(function r(){var o,s,c,u,h,d,p;return Ns().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i.mounted){r.next=2;break}return r.abrupt("return",[]);case 2:if(o=i.props,s=o.validateFirst,c=void 0!==s&&s,u=o.messageVariables,h=o.validateDebounce,d=i.getRules(),a&&(d=d.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||Tu(t).includes(a)})),!h||!a){r.next=10;break}return r.next=8,new Promise(function(e){setTimeout(e,h)});case 8:if(i.validatePromise===l){r.next=10;break}return r.abrupt("return",[]);case 10:return(p=eh(t,n,d,e,c,u)).catch(function(e){return e}).then(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uh;if(i.validatePromise===l){var t;i.validatePromise=null;var n=[],r=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,i=e.errors,a=void 0===i?uh:i;t?r.push.apply(r,M(a)):n.push.apply(n,M(a))}),i.errors=n,i.warnings=r,i.triggerMetaEvent(),i.reRender()}}),r.abrupt("return",p);case 13:case"end":return r.stop()}},r)})));return s||(i.validatePromise=l,i.dirty=!0,i.errors=uh,i.warnings=uh,i.triggerMetaEvent(),i.reRender()),l}),O(ge(i),"isFieldValidating",function(){return!!i.validatePromise}),O(ge(i),"isFieldTouched",function(){return i.touched}),O(ge(i),"isFieldDirty",function(){return!(!i.dirty&&void 0===i.props.initialValue)||void 0!==(0,i.props.fieldContext.getInternalHooks(xu).getInitialValue)(i.getNamePath())}),O(ge(i),"getErrors",function(){return i.errors}),O(ge(i),"getWarnings",function(){return i.warnings}),O(ge(i),"isListField",function(){return i.props.isListField}),O(ge(i),"isList",function(){return i.props.isList}),O(ge(i),"isPreserve",function(){return i.props.preserve}),O(ge(i),"getMeta",function(){return i.prevValidating=i.isFieldValidating(),{touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:null===i.validatePromise}}),O(ge(i),"getOnlyChild",function(t){if("function"==typeof t){var n=i.getMeta();return D(D({},i.getOnlyChild(t(i.getControlled(),n,i.props.fieldContext))),{},{isFunction:!0})}var r=on(t);return 1===r.length&&e.isValidElement(r[0])?{child:r[0],isFunction:!1}:{child:r,isFunction:!1}}),O(ge(i),"getValue",function(e){var t=i.props.fieldContext.getFieldsValue,n=i.getNamePath();return br(e||t(!0),n)}),O(ge(i),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.props,n=t.name,r=t.trigger,a=t.validateTrigger,o=t.getValueFromEvent,s=t.normalize,l=t.valuePropName,c=t.getValueProps,u=t.fieldContext,h=void 0!==a?a:u.validateTrigger,d=i.getNamePath(),p=u.getInternalHooks,f=u.getFieldsValue,g=p(xu).dispatch,m=i.getValue(),y=c||function(e){return O({},l,e)},v=e[r],b=void 0!==n?y(m):{},x=D(D({},e),b);return x[r]=function(){var e;i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach(function(n){n(t,r,e)})}}),O(this,"timeoutId",null),O(this,"warningUnhooked",function(){}),O(this,"updateStore",function(e){n.store=e}),O(this,"getFieldEntities",function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities}),O(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new mh;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),O(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=rh(e);return t.get(n)||{INVALIDATE_NAME_PATH:rh(e)}})}),O(this,"getFieldsValue",function(e,t){var r,i,a;if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,i=t):e&&"object"===N(e)&&(a=e.strict,i=e.filter),!0===r&&!i)return n.store;var o=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return o.forEach(function(e){var t,n,o,l,c="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(a){if(null!==(o=(l=e).isList)&&void 0!==o&&o.call(l))return}else if(!r&&null!==(t=(n=e).isListField)&&void 0!==t&&t.call(n))return;if(i){var u="getMeta"in e?e.getMeta():null;i(u)&&s.push(c)}else s.push(c)}),ih(n.store,s.map(rh))}),O(this,"getFieldValue",function(e){n.warningUnhooked();var t=rh(e);return br(n.store,t)}),O(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return t&&!("INVALIDATE_NAME_PATH"in t)?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:rh(e[n]),errors:[],warnings:[]}})}),O(this,"getFieldError",function(e){n.warningUnhooked();var t=rh(e);return n.getFieldsError([t])[0].errors}),O(this,"getFieldWarning",function(e){n.warningUnhooked();var t=rh(e);return n.getFieldsError([t])[0].warnings}),O(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new mh,r=n.getFieldEntities(!0);r.forEach(function(e){var n=e.props.initialValue,r=e.getNamePath();if(void 0!==n){var i=t.get(r)||new Set;i.add({entity:e,value:n}),t.set(r,i)}});var i;e.entities?i=e.entities:e.namePathList?(i=[],e.namePathList.forEach(function(e){var n,r=t.get(e);r&&(n=i).push.apply(n,M(M(r).map(function(e){return e.entity})))})):i=r,i.forEach(function(r){if(void 0!==r.props.initialValue){var i=r.getNamePath();if(void 0!==n.getInitialValue(i))te(!1,"Form already set 'initialValues' with path '".concat(i.join("."),"'. Field can not overwrite it."));else{var a=t.get(i);if(a&&a.size>1)te(!1,"Multiple Field with path '".concat(i.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var o=n.getFieldValue(i);r.isListField()||e.skipExist&&void 0!==o||n.updateStore(wr(n.store,i,M(a)[0].value))}}}})}),O(this,"resetFields",function(e){n.warningUnhooked();var t=n.store;if(!e)return n.updateStore(Tr(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),void n.notifyWatch();var r=e.map(rh);r.forEach(function(e){var t=n.getInitialValue(e);n.updateStore(wr(n.store,e,t))}),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)}),O(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var i=e.name,a=X(e,yh),o=rh(i);r.push(o),"value"in a&&n.updateStore(wr(n.store,o,a.value)),n.notifyObservers(t,[o],{type:"setField",data:e})}),n.notifyWatch(r)}),O(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=D(D({},e.getMeta()),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(r,"originRCField",{value:!0}),r})}),O(this,"initEntityValue",function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===br(n.store,r)&&n.updateStore(wr(n.store,r,t))}}),O(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),O(this,"registerField",function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(i)&&(!r||a.length>1)){var o=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==o&&n.fieldEntities.every(function(e){return!oh(e.getNamePath(),t)})){var s=n.store;n.updateStore(wr(s,t,o,!0)),n.notifyObservers(s,[t],{type:"remove"}),n.triggerDependenciesUpdate(s,t)}}n.notifyWatch([t])}}),O(this,"dispatch",function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var i=e.namePath,a=e.triggerName;n.validateFields([i],{triggerName:a})}}),O(this,"notifyObservers",function(e,t,r){if(n.subscribable){var i=D(D({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,i)})}else n.forceRootUpdate()}),O(this,"triggerDependenciesUpdate",function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat(M(r))}),r}),O(this,"updateValue",function(e,t){var r=rh(e),i=n.store;n.updateStore(wr(n.store,r,t)),n.notifyObservers(i,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var a=n.triggerDependenciesUpdate(i,r),o=n.callbacks.onValuesChange;o&&o(ih(n.store,[r]),n.getFieldsValue());n.triggerOnFieldsChange([r].concat(M(a)))}),O(this,"setFieldsValue",function(e){n.warningUnhooked();var t=n.store;if(e){var r=Tr(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),O(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t,errors:[],warnings:[]}])}),O(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],i=new mh;n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=rh(t);i.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})});return function e(n){(i.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var i=n.getNamePath();n.isFieldDirty()&&i.length&&(r.push(i),e(i))}})}(e),r}),O(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var i=n.getFields();if(t){var a=new mh;t.forEach(function(e){var t=e.name,n=e.errors;a.set(t,n)}),i.forEach(function(e){e.errors=a.get(e.name)||e.errors})}var o=i.filter(function(t){var n=t.name;return ah(e,n)});o.length&&r(o,i)}}),O(this,"validateFields",function(e,t){var r,i;n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(r=e,i=t):i=e;var a=!!r,o=a?r.map(rh):[],s=[],l=String(Date.now()),c=new Set,u=i||{},h=u.recursive,d=u.dirty;n.getFieldEntities(!0).forEach(function(e){if(a||o.push(e.getNamePath()),e.props.rules&&e.props.rules.length&&(!d||e.isFieldDirty())){var t=e.getNamePath();if(c.add(t.join(l)),!a||ah(o,t,h)){var r=e.validateRules(D({validateMessages:D(D({},Yu),n.validateMessages)},i));s.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],i=[];return null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?i.push.apply(i,M(n)):r.push.apply(r,M(n))}),r.length?Promise.reject({name:t,errors:r,warnings:i}):{name:t,errors:r,warnings:i}}))}}});var p=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,a){e.forEach(function(e,o){e.catch(function(e){return t=!0,e}).then(function(e){n-=1,r[o]=e,n>0||(t&&a(r),i(r))})})}):Promise.resolve([])}(s);n.lastValidatePromise=p,p.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)});var f=p.then(function(){return n.lastValidatePromise===p?Promise.resolve(n.getFieldsValue(o)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(o),errorFields:t,outOfDate:n.lastValidatePromise!==p})});f.catch(function(e){return e});var g=o.filter(function(e){return c.has(e.join(l))});return n.triggerOnFieldsChange(g),f}),O(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})}),this.forceRootUpdate=t});function bh(t){var n=e.useRef(),r=A(e.useState({}),2)[1];if(!n.current)if(t)n.current=t;else{var i=new vh(function(){r({})});n.current=i.getForm()}return[n.current]}var xh=e.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),wh=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],Eh=function(t,n){var r=t.name,i=t.initialValues,a=t.fields,o=t.form,s=t.preserve,l=t.children,c=t.component,u=void 0===c?"form":c,h=t.validateMessages,d=t.validateTrigger,p=void 0===d?"onChange":d,f=t.onValuesChange,g=t.onFieldsChange,m=t.onFinish,y=t.onFinishFailed,v=t.clearOnDestroy,b=X(t,wh),x=e.useRef(null),w=e.useContext(xh),E=A(bh(o),1)[0],k=E.getInternalHooks(xu),T=k.useSubscribe,_=k.setInitialValues,C=k.setCallbacks,S=k.setValidateMessages,I=k.setPreserve,O=k.destroyForm;e.useImperativeHandle(n,function(){return D(D({},E),{},{nativeElement:x.current})}),e.useEffect(function(){return w.registerForm(r,E),function(){w.unregisterForm(r)}},[w,E,r]),S(D(D({},w.validateMessages),h)),C({onValuesChange:f,onFieldsChange:function(e){if(w.triggerFormChange(r,e),g){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0&&t<=n.length?(u.keys=[].concat(M(u.keys.slice(0,t)),[u.id],M(u.keys.slice(t))),a([].concat(M(n.slice(0,t)),[e],M(n.slice(t))))):(u.keys=[].concat(M(u.keys),[u.id]),a([].concat(M(n),[e]))),u.id+=1},remove:function(e){var t=s(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(u.keys=u.keys.filter(function(e,t){return!n.has(t)}),a(t.filter(function(e,t){return!n.has(t)})))},move:function(e,t){if(e!==t){var n=s();e<0||e>=n.length||t<0||t>=n.length||(u.keys=lh(u.keys,e,t),a(lh(n,e,t)))}}},d=r||[];return Array.isArray(d)||(d=[]),i(d.map(function(e,t){var n=u.keys[t];return void 0===n&&(u.keys[t]=u.id,n=u.keys[t],u.id+=1),{name:t,key:n,isListField:!0}}),c,t)})))},Th.useForm=bh,Th.useWatch=function(){for(var e=arguments.length,t=new Array(e),r=0;r{const i=e.useContext(_h),a=e.useMemo(()=>{const e=Object.assign({},i);return r&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,r,i]);return e.createElement(_h.Provider,{value:a},t)},Sh=e.createContext(void 0),Ah=e=>{const{space:n,form:r,children:i}=e;if(null==i)return null;let a=i;return r&&(a=t.createElement(Ch,{override:!0,status:!0},a)),n&&(a=t.createElement(ol,null,a)),a};function Nh(...e){const t={};return e.forEach(e=>{e&&Object.keys(e).forEach(n=>{void 0!==e[n]&&(t[n]=e[n])})}),t}function Ih(e){if(!e)return;const{closable:t,closeIcon:n}=e;return{closable:t,closeIcon:n}}function Oh(e){const{closable:n,closeIcon:r}=e||{};return t.useMemo(()=>{if(!n&&(!1===n||!1===r||null===r))return!1;if(void 0===n&&void 0===r)return null;let e={closeIcon:"boolean"!=typeof r&&null!==r?r:void 0};return n&&"object"==typeof n&&(e=Object.assign(Object.assign({},e),n)),e},[n,r])}const Lh={};function Mh(e,n,r=Lh){const i=Oh(e),a=Oh(n),[o]=zr("global",Rr.global),s="boolean"!=typeof i&&!!(null==i?void 0:i.disabled),l=t.useMemo(()=>Object.assign({closeIcon:t.createElement(Zo,null)},r),[r]),c=t.useMemo(()=>!1!==i&&(i?Nh(l,a,i):!1!==a&&(a?Nh(l,a):!!l.closable&&l)),[i,a,l]);return t.useMemo(()=>{var e,n;if(!1===c)return[!1,null,s,{}];const{closeIconRender:r}=l,{closeIcon:i}=c;let a=i;const u=ss(c,!0);return null!=a&&(r&&(a=r(i)),a=t.isValidElement(a)?t.cloneElement(a,Object.assign(Object.assign(Object.assign({},a.props),{"aria-label":null!==(n=null===(e=a.props)||void 0===e?void 0:e["aria-label"])&&void 0!==n?n:o.close}),u)):t.createElement("span",Object.assign({"aria-label":o.close},u),a)),[!0,a,s,u]},[c,l])}function Rh(e,t){return function(e){if($()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1}(e)}const Dh=t=>{const{prefixCls:n,className:r,style:i,size:a,shape:o}=t,s=en({[`${n}-lg`]:"large"===a,[`${n}-sm`]:"small"===a}),l=en({[`${n}-circle`]:"circle"===o,[`${n}-square`]:"square"===o,[`${n}-round`]:"round"===o}),c=e.useMemo(()=>"number"==typeof a?{width:a,height:a,lineHeight:`${a}px`}:{},[a]);return e.createElement("span",{className:en(n,s,l,r),style:Object.assign(Object.assign({},c),i)})},Ph=new Xt("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),$h=e=>({height:e,lineHeight:Le(e)}),Bh=e=>Object.assign({width:e},$h(e)),Fh=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:Ph,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),zh=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},$h(e)),jh=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},Bh(r)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Bh(i)),[`${t}${t}-sm`]:Object.assign({},Bh(a))}},Hh=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:a,gradientFromColor:o,calc:s}=e;return{[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:n},zh(t,s)),[`${r}-lg`]:Object.assign({},zh(i,s)),[`${r}-sm`]:Object.assign({},zh(a,s))}},Uh=e=>Object.assign({width:e},$h(e)),Gh=e=>{const{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:i,calc:a}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:r,borderRadius:i},Uh(a(n).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},Uh(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},qh=(e,t,n)=>{const{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:t}}},Wh=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},$h(e)),Vh=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a,gradientFromColor:o,calc:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:t,width:s(r).mul(2).equal(),minWidth:s(r).mul(2).equal()},Wh(r,s))},qh(e,r,n)),{[`${n}-lg`]:Object.assign({},Wh(i,s))}),qh(e,i,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},Wh(a,s))}),qh(e,a,`${n}-sm`))};var Yh=wa("Skeleton",e=>{const{componentCls:t,calc:n}=e;return(e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:a,skeletonInputCls:o,skeletonImageCls:s,controlHeight:l,controlHeightLG:c,controlHeightSM:u,gradientFromColor:h,padding:d,marginSM:p,borderRadius:f,titleHeight:g,blockRadius:m,paragraphLiHeight:y,controlHeightXS:v,paragraphMarginTop:b}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:d,verticalAlign:"top",[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:h},Bh(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},Bh(c)),[`${n}-sm`]:Object.assign({},Bh(u))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:g,background:h,borderRadius:m,[`+ ${i}`]:{marginBlockStart:u}},[i]:{padding:0,"> li":{width:"100%",height:y,listStyle:"none",background:h,borderRadius:m,"+ li":{marginBlockStart:v}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${r}, ${i} > li`]:{borderRadius:f}}},[`${t}-with-avatar ${t}-content`]:{[r]:{marginBlockStart:p,[`+ ${i}`]:{marginBlockStart:b}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},Vh(e)),jh(e)),Hh(e)),Gh(e)),[`${t}${t}-block`]:{width:"100%",[a]:{width:"100%"},[o]:{width:"100%"}},[`${t}${t}-active`]:{[`\n ${r},\n ${i} > li,\n ${n},\n ${a},\n ${o},\n ${s}\n `]:Object.assign({},Fh(e))}}})(Qi(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{const{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]});const Xh=(e,t)=>{const{width:n,rows:r=2}=t;return Array.isArray(n)?n[e]:r-1===e?n:void 0},Kh=t=>{const{prefixCls:n,className:r,style:i,rows:a=0}=t,o=Array.from({length:a}).map((n,r)=>e.createElement("li",{key:r,style:{width:Xh(r,t)}}));return e.createElement("ul",{className:en(n,r),style:i},o)},Qh=({prefixCls:t,className:n,width:r,style:i})=>e.createElement("h3",{className:en(t,n),style:Object.assign({width:r},i)});function Zh(e){return e&&"object"==typeof e?e:{}}const Jh=t=>{const{prefixCls:n,loading:r,className:i,rootClassName:a,style:o,children:s,avatar:l=!1,title:c=!0,paragraph:u=!0,active:h,round:d}=t,{getPrefixCls:p,direction:f,className:g,style:m}=Ii("skeleton"),y=p("skeleton",n),[v,b,x]=Yh(y);if(r||!("loading"in t)){const t=!!l,n=!!c,r=!!u;let s,p;if(t){const t=Object.assign(Object.assign({prefixCls:`${y}-avatar`},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(n,r)),Zh(l));s=e.createElement("div",{className:`${y}-header`},e.createElement(Dh,Object.assign({},t)))}if(n||r){let i,a;if(n){const n=Object.assign(Object.assign({prefixCls:`${y}-title`},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(t,r)),Zh(c));i=e.createElement(Qh,Object.assign({},n))}if(r){const r=Object.assign(Object.assign({prefixCls:`${y}-paragraph`},function(e,t){const n={};return e&&t||(n.width="61%"),n.rows=!e&&t?3:2,n}(t,n)),Zh(u));a=e.createElement(Kh,Object.assign({},r))}p=e.createElement("div",{className:`${y}-content`},i,a)}const w=en(y,{[`${y}-with-avatar`]:t,[`${y}-active`]:h,[`${y}-rtl`]:"rtl"===f,[`${y}-round`]:d},g,i,a,b,x);return v(e.createElement("div",{className:w,style:Object.assign(Object.assign({},m),o)},s,p))}return null!=s?s:null};function ed(){}Jh.Button=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,block:o=!1,size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Vs(t,["prefixCls"]),f=en(c,`${c}-element`,{[`${c}-active`]:a,[`${c}-block`]:o},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-button`,size:s},p))))},Jh.Avatar=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,shape:o="circle",size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Vs(t,["prefixCls","className"]),f=en(c,`${c}-element`,{[`${c}-active`]:a},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-avatar`,shape:o,size:s},p))))},Jh.Input=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,block:o,size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Vs(t,["prefixCls"]),f=en(c,`${c}-element`,{[`${c}-active`]:a,[`${c}-block`]:o},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-input`,size:s},p))))},Jh.Image=t=>{const{prefixCls:n,className:r,rootClassName:i,style:a,active:o}=t,{getPrefixCls:s}=e.useContext(Si),l=s("skeleton",n),[c,u,h]=Yh(l),d=en(l,`${l}-element`,{[`${l}-active`]:o},r,i,u,h);return c(e.createElement("div",{className:d},e.createElement("div",{className:en(`${l}-image`,r),style:a},e.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${l}-image-svg`},e.createElement("title",null,"Image placeholder"),e.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${l}-image-path`})))))},Jh.Node=t=>{const{prefixCls:n,className:r,rootClassName:i,style:a,active:o,children:s}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=en(c,`${c}-element`,{[`${c}-active`]:o},h,r,i,d);return u(e.createElement("div",{className:p},e.createElement("div",{className:en(`${c}-image`,r),style:a},s)))};const td=e.createContext({add:ed,remove:ed});function nd(t){const n=e.useContext(td),r=e.useRef(null);return Gi(e=>{if(e){const i=t?e.querySelector(t):e;n.add(i),r.current=i}else n.remove(r.current)})}const rd=()=>{const{cancelButtonProps:e,cancelTextLocale:r,onCancel:i}=n(Yc);return t.createElement(qc,Object.assign({onClick:i},e),r)},id=()=>{const{confirmLoading:e,okButtonProps:r,okType:i,okTextLocale:a,onOk:o}=n(Yc);return t.createElement(qc,Object.assign({},hl(i),{loading:e,onClick:o},r),a)};function ad(e,n){return t.createElement("span",{className:`${e}-close-x`},n||t.createElement(Zo,{className:`${e}-close-icon`}))}const od=e=>{const{okText:n,okType:r="primary",cancelText:i,confirmLoading:a,onOk:o,onCancel:s,okButtonProps:l,cancelButtonProps:c,footer:u}=e,[h]=zr("Modal",Br()),d={confirmLoading:a,okButtonProps:l,cancelButtonProps:c,okTextLocale:n||(null==h?void 0:h.okText),cancelTextLocale:i||(null==h?void 0:h.cancelText),okType:r,onOk:o,onCancel:s},p=t.useMemo(()=>d,M(Object.values(d)));let f;return"function"==typeof u||void 0===u?(f=t.createElement(t.Fragment,null,t.createElement(rd,null),t.createElement(id,null)),"function"==typeof u&&(f=u(f,{OkBtn:id,CancelBtn:rd})),f=t.createElement(Xc,{value:p},f)):f=u,t.createElement(Ri,{disabled:!1},f)},sd=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},ld=(e,t)=>((e,t)=>{const{prefixCls:n,componentCls:r,gridColumns:i}=e,a={};for(let e=i;e>=0;e--)0===e?(a[`${r}${t}-${e}`]={display:"none"},a[`${r}-push-${e}`]={insetInlineStart:"auto"},a[`${r}-pull-${e}`]={insetInlineEnd:"auto"},a[`${r}${t}-push-${e}`]={insetInlineStart:"auto"},a[`${r}${t}-pull-${e}`]={insetInlineEnd:"auto"},a[`${r}${t}-offset-${e}`]={marginInlineStart:0},a[`${r}${t}-order-${e}`]={order:0}):(a[`${r}${t}-${e}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${e/i*100}%`,maxWidth:e/i*100+"%"}],a[`${r}${t}-push-${e}`]={insetInlineStart:e/i*100+"%"},a[`${r}${t}-pull-${e}`]={insetInlineEnd:e/i*100+"%"},a[`${r}${t}-offset-${e}`]={marginInlineStart:e/i*100+"%"},a[`${r}${t}-order-${e}`]={order:e});return a[`${r}${t}-flex`]={flex:`var(--${n}${t}-flex)`},a})(e,t),cd=wa("Grid",e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),ud=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),hd=wa("Grid",e=>{const t=Qi(e,{gridColumns:24}),n=ud(t);return delete n.xs,[sd(t),ld(t,""),ld(t,"-xs"),Object.keys(n).map(e=>((e,t,n)=>({[`@media (min-width: ${Le(t)})`]:Object.assign({},ld(e,n))}))(t,n[e],`-${e}`)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}));function dd(e){return{position:e,inset:0}}const pd=e=>{const{componentCls:t,antCls:n}=e;return[{[`${t}-root`]:{[`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${n}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},dd("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},dd("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:Dl(e)}]},fd=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${Le(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},ma(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Le(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:Le(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},va(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${Le(e.borderRadiusLG)} ${Le(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Le(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content,\n ${t}-body,\n ${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},gd=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},md=e=>{const{componentCls:t}=e,n=ud(e),r=Object.assign({},n);delete r.xs;const i=`--${t.replace(".","")}-`,a=Object.keys(r).map(e=>({[`@media (min-width: ${Le(r[e])})`]:{width:`var(${i}${e}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(M(Object.keys(n).map((e,t)=>{const r=Object.keys(n)[t-1];return r?{[`${i}${e}-width`]:`var(${i}${r}-width)`}:null})),[{width:`var(${i}xs-width)`}],M(a))}}},yd=e=>{const t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return Qi(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},vd=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Le(e.paddingMD)} ${Le(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Le(e.padding)} ${Le(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Le(e.paddingXS)} ${Le(e.padding)}`:0,footerBorderTop:e.wireframe?`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${Le(e.borderRadiusLG)} ${Le(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Le(2*e.padding)} ${Le(2*e.padding)} ${Le(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM});var bd=wa("Modal",e=>{const t=yd(e);return[fd(t),gd(t),pd(t),sc(t,"zoom"),md(t)]},vd,{unitless:{titleLineHeight:!0}}),xd=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{wd={x:e.pageX,y:e.pageY},setTimeout(()=>{wd=null},100)};$()&&window.document.documentElement&&document.documentElement.addEventListener("click",Ed,!0);const kd=t=>{const{prefixCls:n,className:r,rootClassName:i,open:a,wrapClassName:o,centered:s,getContainer:l,focusTriggerAfterClose:c=!0,style:u,visible:h,width:d=520,footer:p,classNames:f,styles:g,children:m,loading:y,confirmLoading:v,zIndex:b,mousePosition:x,onOk:w,onCancel:E,destroyOnHidden:k,destroyOnClose:T,panelRef:_=null}=t,C=xd(t,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef"]),{getPopupContainer:S,getPrefixCls:A,direction:N,modal:I}=e.useContext(Si),O=e=>{v||null==E||E(e)},L=A("modal",n),M=A(),R=hs(L),[D,P,$]=bd(L,R),B=en(o,{[`${L}-centered`]:null!=s?s:null==I?void 0:I.centered,[`${L}-wrap-rtl`]:"rtl"===N}),F=null===p||y?null:e.createElement(od,Object.assign({},t,{onOk:e=>{null==w||w(e)},onCancel:O})),[z,j,H,U]=Mh(Ih(t),Ih(I),{closable:!0,closeIcon:e.createElement(Zo,{className:`${L}-close-icon`}),closeIconRender:e=>ad(L,e)}),G=nd(`.${L}-content`),q=In(_,G),[W,V]=xs("Modal",b),[Y,X]=e.useMemo(()=>d&&"object"==typeof d?[void 0,d]:[d,void 0],[d]),K=e.useMemo(()=>{const e={};return X&&Object.keys(X).forEach(t=>{const n=X[t];void 0!==n&&(e[`--${L}-${t}-width`]="number"==typeof n?`${n}px`:n)}),e},[X]);return D(e.createElement(Ah,{form:!0,space:!0},e.createElement(ms.Provider,{value:V},e.createElement(bu,Object.assign({width:Y},C,{zIndex:W,getContainer:void 0===l?S:l,prefixCls:L,rootClassName:en(P,i,$,R),footer:F,visible:null!=a?a:h,mousePosition:null!=x?x:wd,onClose:O,closable:z?Object.assign({disabled:H,closeIcon:j},U):z,closeIcon:j,focusTriggerAfterClose:c,transitionName:Ws(M,"zoom",t.transitionName),maskTransitionName:Ws(M,"fade",t.maskTransitionName),className:en(P,r,null==I?void 0:I.className),style:Object.assign(Object.assign(Object.assign({},null==I?void 0:I.style),u),K),classNames:Object.assign(Object.assign(Object.assign({},null==I?void 0:I.classNames),f),{wrapper:en(B,null==f?void 0:f.wrapper)}),styles:Object.assign(Object.assign({},null==I?void 0:I.styles),g),panelRef:q,destroyOnClose:null!=k?k:T}),y?e.createElement(Jh,{active:!0,title:!1,paragraph:{rows:4},className:`${L}-body-skeleton`}):m))))};var Td=ka(["Modal","confirm"],e=>(e=>{const{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:i,fontSize:a,lineHeight:o,modalTitleHeight:s,fontHeight:l,confirmBodyPadding:c}=e,u=`${t}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},{"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),[`&${t} ${t}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:i,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(i).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(s).sub(i).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${Le(e.marginSM)})`},[`${e.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Le(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${u}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},[`${u}-content`]:{color:e.colorText,fontSize:a,lineHeight:o},[`${u}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${u}-error ${u}-body > ${e.iconCls}`]:{color:e.colorError},[`${u}-warning ${u}-body > ${e.iconCls},\n ${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}})(yd(e)),vd,{order:-1e3}),_d=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ib,M(Object.values(b))),w=e.createElement(e.Fragment,null,e.createElement(Kc,null),e.createElement(Qc,null)),E=void 0!==t.title&&null!==t.title,k=`${o}-body`;return e.createElement("div",{className:`${o}-body-wrapper`},e.createElement("div",{className:en(k,{[`${k}-has-title`]:E})},d,e.createElement("div",{className:`${o}-paragraph`},E&&e.createElement("span",{className:`${o}-title`},t.title),e.createElement("div",{className:`${o}-content`},t.content))),void 0===c||"function"==typeof c?e.createElement(Xc,{value:x},e.createElement("div",{className:`${o}-btns`},"function"==typeof c?c(w,{OkBtn:Qc,CancelBtn:Kc}):w)):c,e.createElement(Td,{prefixCls:n}))}const Sd=t=>{const{close:n,zIndex:r,maskStyle:i,direction:a,prefixCls:o,wrapClassName:s,rootPrefixCls:l,bodyStyle:c,closable:u=!1,onConfirm:h,styles:d}=t,p=`${o}-confirm`,f=t.width||416,g=t.style||{},m=void 0===t.mask||t.mask,y=void 0!==t.maskClosable&&t.maskClosable,v=en(p,`${p}-${t.type}`,{[`${p}-rtl`]:"rtl"===a},t.className),[,b]=fa(),x=e.useMemo(()=>void 0!==r?r:b.zIndexPopupBase+1e3,[r,b]);return e.createElement(kd,Object.assign({},t,{className:v,wrapClassName:en({[`${p}-centered`]:!!t.centered},s),onCancel:()=>{null==n||n({triggerCancel:!0}),null==h||h(!1)},title:"",footer:null,transitionName:Ws(l||"","zoom",t.transitionName),maskTransitionName:Ws(l||"","fade",t.maskTransitionName),mask:m,maskClosable:y,style:g,styles:Object.assign({body:c,mask:i},d),width:f,zIndex:x,closable:u}),e.createElement(Cd,Object.assign({},t,{confirmPrefixCls:p})))},Ad=t=>{const{rootPrefixCls:n,iconPrefixCls:r,direction:i,theme:a}=t;return e.createElement(Io,{prefixCls:n,iconPrefixCls:r,direction:i,theme:a},e.createElement(Sd,Object.assign({},t)))},Nd=[];let Id="";function Od(){return Id}const Ld=e=>{var r,i;const{prefixCls:a,getContainer:o,direction:s}=e,l=Br(),c=n(Si),u=Od()||c.getPrefixCls(),h=a||`${u}-modal`;let d=o;return!1===d&&(d=void 0),t.createElement(Ad,Object.assign({},e,{rootPrefixCls:u,prefixCls:h,iconPrefixCls:c.iconPrefixCls,theme:c.theme,direction:null!=s?s:c.direction,locale:null!==(i=null===(r=c.locale)||void 0===r?void 0:r.Modal)&&void 0!==i?i:l,getContainer:d}))};function Md(e){const n={getPrefixCls:(e,t)=>t||(e?`${So()}-${e}`:So()),getIconPrefixCls:Ao,getRootPrefixCls:()=>ko||So(),getTheme:()=>_o,holderRender:Co},r=document.createDocumentFragment();let i,a,o=Object.assign(Object.assign({},e),{close:c,open:!0});function s(...t){var n;var r;t.some(e=>null==e?void 0:e.triggerCancel)&&(null===(n=e.onCancel)||void 0===n||(r=n).call.apply(r,[e,()=>{}].concat(M(t.slice(1)))));for(let e=0;e{const i=n.getPrefixCls(void 0,Od()),o=n.getIconPrefixCls(),s=n.getTheme(),l=t.createElement(Ld,Object.assign({},e)),c=qs();a=c(t.createElement(Io,{prefixCls:i,iconPrefixCls:o,theme:s},n.holderRender?n.holderRender(l):l),r)})}function c(...t){o=Object.assign(Object.assign({},o),{open:!1,afterClose:()=>{"function"==typeof e.afterClose&&e.afterClose(),s.apply(this,t)}}),o.visible&&delete o.visible,l(o)}return l(o),Nd.push(c),{destroy:c,update:function(e){o="function"==typeof e?e(o):Object.assign(Object.assign({},o),e),l(o)}}}function Rd(e){return Object.assign(Object.assign({},e),{type:"warning"})}function Dd(e){return Object.assign(Object.assign({},e),{type:"info"})}function Pd(e){return Object.assign(Object.assign({},e),{type:"success"})}function $d(e){return Object.assign(Object.assign({},e),{type:"error"})}function Bd(e){return Object.assign(Object.assign({},e),{type:"confirm"})}var Fd=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r,{afterClose:i,config:a}=t,o=Fd(t,["afterClose","config"]);const[s,l]=e.useState(!0),[c,u]=e.useState(a),{direction:h,getPrefixCls:d}=e.useContext(Si),p=d("modal"),f=d(),g=(...e)=>{var t;l(!1);var n;e.some(e=>null==e?void 0:e.triggerCancel)&&(null===(t=c.onCancel)||void 0===t||(n=t).call.apply(n,[c,()=>{}].concat(M(e.slice(1)))))};e.useImperativeHandle(n,()=>({destroy:g,update:e=>{u(t=>{const n="function"==typeof e?e(t):e;return Object.assign(Object.assign({},t),n)})}}));const m=null!==(r=c.okCancel)&&void 0!==r?r:"confirm"===c.type,[y]=zr("Modal",Rr.Modal);return e.createElement(Ad,Object.assign({prefixCls:p,rootPrefixCls:f},c,{close:g,open:s,afterClose:()=>{var e;i(),null===(e=c.afterClose)||void 0===e||e.call(c)},okText:c.okText||(m?null==y?void 0:y.okText:null==y?void 0:y.justOkText),direction:c.direction||h,cancelText:c.cancelText||(null==y?void 0:y.cancelText)},o))};var jd=e.forwardRef(zd);let Hd=0;const Ud=e.memo(e.forwardRef((t,n)=>{const[r,i]=function(){const[t,n]=e.useState([]),r=e.useCallback(e=>(n(t=>[].concat(M(t),[e])),()=>{n(t=>t.filter(t=>t!==e))}),[]);return[t,r]}();return e.useImperativeHandle(n,()=>({patchElement:i}),[]),e.createElement(e.Fragment,null,r)}));function Gd(t){return n=>e.createElement(Io,{theme:{token:{motion:!1,zIndexPopupBase:0}}},e.createElement(t,Object.assign({},n)))}var qd=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))},Wd=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,a=t.children,o=t.onMouseDown,s=t.onClick,l="function"==typeof r?r(i):r;return e.createElement("span",{className:n,onMouseDown:function(e){e.preventDefault(),null==o||o(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},void 0!==l?l:e.createElement("span",{className:en(n.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},a))},Vd=e.createContext(null);function Yd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,n=e.useRef(null),r=e.useRef(null);return e.useEffect(function(){return function(){window.clearTimeout(r.current)}},[]),[function(){return n.current},function(e){(e||null===n.current)&&(n.current=e),window.clearTimeout(r.current),r.current=window.setTimeout(function(){n.current=null},t)}]}var Xd=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Kd=void 0;function Qd(t,n){var r=t.prefixCls,i=t.invalidate,a=t.item,o=t.renderItem,s=t.responsive,l=t.responsiveDisabled,c=t.registerSize,u=t.itemKey,h=t.className,d=t.style,p=t.children,f=t.display,g=t.order,m=t.component,y=void 0===m?"div":m,v=X(t,Xd),b=s&&!f;function x(e){c(u,e)}e.useEffect(function(){return function(){x(null)}},[]);var w,E=o&&a!==Kd?o(a,{index:g}):p;i||(w={opacity:b?0:1,height:b?0:Kd,overflowY:b?"hidden":Kd,order:s?g:Kd,pointerEvents:b?"none":Kd,position:b?"absolute":Kd});var k={};b&&(k["aria-hidden"]=!0);var T=e.createElement(y,Xe({className:en(!i&&r,h),style:D(D({},w),d)},k,v,{ref:n}),E);return s&&(T=e.createElement(ur,{onResize:function(e){x(e.offsetWidth)},disabled:l},T)),T}var Zd=e.forwardRef(Qd);function Jd(){var t=e.useRef(null);return function(e){t.current||(t.current=[],function(e){if("undefined"==typeof MessageChannel)mr(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}(function(){E(function(){t.current.forEach(function(e){e()}),t.current=null})})),t.current.push(e)}}function ep(t,n){var r=A(e.useState(n),2),i=r[0],a=r[1];return[i,Gi(function(e){t(function(){a(e)})})]}Zd.displayName="Item";var tp=t.createContext(null),np=["component"],rp=["className"],ip=["className"],ap=function(t,n){var r=e.useContext(tp);if(!r){var i=t.component,a=void 0===i?"div":i,o=X(t,np);return e.createElement(a,Xe({},o,{ref:n}))}var s=r.className,l=X(r,rp),c=t.className,u=X(t,ip);return e.createElement(tp.Provider,{value:null},e.createElement(Zd,Xe({ref:n,className:en(s,c)},l,u)))},op=e.forwardRef(ap);op.displayName="RawItem";var sp=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],lp="responsive",cp="invalidate";function up(e){return"+ ".concat(e.length," ...")}function hp(t,n){var r=t.prefixCls,i=void 0===r?"rc-overflow":r,a=t.data,o=void 0===a?[]:a,s=t.renderItem,l=t.renderRawItem,c=t.itemKey,u=t.itemWidth,p=void 0===u?10:u,g=t.ssr,m=t.style,y=t.className,v=t.maxCount,b=t.renderRest,x=t.renderRawRest,w=t.suffix,E=t.component,k=void 0===E?"div":E,T=t.itemComponent,_=t.onVisibleChange,C=X(t,sp),S="full"===g,N=Jd(),I=A(ep(N,null),2),O=I[0],L=I[1],M=O||0,R=A(ep(N,new Map),2),P=R[0],$=R[1],B=A(ep(N,0),2),F=B[0],z=B[1],j=A(ep(N,0),2),H=j[0],U=j[1],G=A(ep(N,0),2),q=G[0],W=G[1],V=A(d(null),2),Y=V[0],K=V[1],Q=A(d(null),2),Z=Q[0],J=Q[1],ee=e.useMemo(function(){return null===Z&&S?Number.MAX_SAFE_INTEGER:Z||0},[Z,O]),te=A(d(!1),2),ne=te[0],re=te[1],ie="".concat(i,"-item"),ae=Math.max(F,H),oe=v===lp,se=o.length&&oe,le=v===cp,ce=se||"number"==typeof v&&o.length>v,ue=h(function(){var e=o;return se?e=null===O&&S?o:o.slice(0,Math.min(o.length,M/p)):"number"==typeof v&&(e=o.slice(0,v)),e},[o,p,O,v,se]),he=h(function(){return se?o.slice(ee+1):o.slice(ue.length)},[o,ue,se,ee]),de=f(function(e,t){var n;return"function"==typeof c?c(e):null!==(n=c&&(null==e?void 0:e[c]))&&void 0!==n?n:t},[c]),pe=f(s||function(e){return e},[s]);function fe(e,t,n){(Z!==e||void 0!==t&&t!==Y)&&(J(e),n||(re(eM){fe(r-1,e-i-q+H);break}}w&&me(0)+q>M&&K(null)}},[M,P,H,q,de,ue]);var ye=ne&&!!he.length,ve={};null!==Y&&se&&(ve={position:"absolute",left:Y,top:0});var be={prefixCls:ie,responsive:se,component:T,invalidate:le},xe=l?function(t,n){var r=de(t,n);return e.createElement(tp.Provider,{key:r,value:D(D({},be),{},{order:n,item:t,itemKey:r,registerSize:ge,display:n<=ee})},l(t,n))}:function(t,n){var r=de(t,n);return e.createElement(Zd,Xe({},be,{order:n,key:r,item:t,renderItem:pe,itemKey:r,registerSize:ge,display:n<=ee}))},we={order:ye?ee:Number.MAX_SAFE_INTEGER,className:"".concat(ie,"-rest"),registerSize:function(e,t){U(t),z(H)},display:ye},Ee=b||up,ke=x?e.createElement(tp.Provider,{value:D(D({},be),we)},x(he)):e.createElement(Zd,Xe({},be,we),"function"==typeof Ee?Ee(he):Ee),Te=e.createElement(k,Xe({className:en(!le&&i,y),style:m,ref:n},C),ue.map(xe),ce?ke:null,w&&e.createElement(Zd,Xe({},be,{responsive:oe,responsiveDisabled:!se,order:ee,className:"".concat(ie,"-suffix"),registerSize:function(e,t){W(t)},display:!0,style:ve}),w));return oe?e.createElement(ur,{onResize:function(e,t){L(t.clientWidth)},disabled:!se},Te):Te}var dp=e.forwardRef(hp);dp.displayName="Overflow",dp.Item=op,dp.RESPONSIVE=lp,dp.INVALIDATE=cp;var pp=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],fp=function(t,n){var r=t.prefixCls,i=t.id,a=t.inputElement,o=t.autoFocus,s=t.autoComplete,l=t.editable,c=t.activeDescendantId,u=t.value,h=t.open,d=t.attrs,p=X(t,pp),f=a||e.createElement("input",null),g=f,m=g.ref,y=g.props;return f.props,f=e.cloneElement(f,D(D(D({type:"search"},function(e,t){var n=D(D({},e),t);return Object.keys(t).forEach(function(r){var i=t[r];"function"==typeof i&&(n[r]=function(){for(var t,n=arguments.length,a=new Array(n),o=0;oE&&(a="".concat(o.slice(0,E),"..."))}var s=function(t){t&&t.stopPropagation(),S(e)};return"function"==typeof _?Y(r,a,t,i,s):V(e,a,t,i,s)},renderRest:function(e){if(!o.length)return null;var t="function"==typeof T?T(e):T;return"function"==typeof _?Y(void 0,t,!1,!1,void 0,!0):V({title:t},t,!1)},suffix:X,itemKey:xp,maxCount:w});return e.createElement("span",{className:"".concat(G,"-wrap")},K,!o.length&&!q&&e.createElement("span",{className:"".concat(G,"-placeholder")},h))},kp=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,a=t.inputRef,o=t.disabled,s=t.autoFocus,l=t.autoComplete,c=t.activeDescendantId,u=t.mode,h=t.open,d=t.values,p=t.placeholder,f=t.tabIndex,g=t.showSearch,m=t.searchValue,y=t.activeValue,v=t.maxLength,b=t.onInputKeyDown,x=t.onInputMouseDown,w=t.onInputChange,E=t.onInputPaste,k=t.onInputCompositionStart,T=t.onInputCompositionEnd,_=t.onInputBlur,C=t.title,S=A(e.useState(!1),2),N=S[0],I=S[1],O="combobox"===u,L=O||g,M=d[0],R=m||"";O&&y&&!N&&(R=y),e.useEffect(function(){O&&I(!1)},[O,y]);var D=!("combobox"!==u&&!h&&!g)&&!!R,P=void 0===C?bp(M):C,$=e.useMemo(function(){return M?null:e.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:D?{visibility:"hidden"}:void 0},p)},[M,D,p,r]);return e.createElement("span",{className:"".concat(r,"-selection-wrap")},e.createElement("span",{className:"".concat(r,"-selection-search")},e.createElement(gp,{ref:a,prefixCls:r,id:i,open:h,inputElement:n,disabled:o,autoFocus:s,autoComplete:l,editable:L,activeDescendantId:c,value:R,onKeyDown:b,onMouseDown:x,onChange:function(e){I(!0),w(e)},onPaste:E,onCompositionStart:k,onCompositionEnd:T,onBlur:_,tabIndex:f,attrs:ss(t,!0),maxLength:O?v:void 0})),!O&&M?e.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:D?{visibility:"hidden"}:void 0},M.label):null,$)},Tp=function(t,n){var r=o(null),i=o(!1),a=t.prefixCls,s=t.open,l=t.mode,c=t.showSearch,u=t.tokenWithEnter,h=t.disabled,d=t.prefix,p=t.autoClearSearchValue,f=t.onSearch,g=t.onSearchSubmit,m=t.onToggleOpen,y=t.onInputKeyDown,v=t.onInputBlur,b=t.domRef;e.useImperativeHandle(n,function(){return{focus:function(e){r.current.focus(e)},blur:function(){r.current.blur()}}});var x=A(Yd(0),2),w=x[0],E=x[1],k=o(null),T=function(e){!1!==f(e,!0,i.current)&&m(!0)},_={inputRef:r,onInputKeyDown:function(e){var t,n=e.which,a=r.current instanceof HTMLTextAreaElement;(a||!s||n!==ds.UP&&n!==ds.DOWN||e.preventDefault(),y&&y(e),n!==ds.ENTER||"tags"!==l||i.current||s||null==g||g(e.target.value),a&&!s&&~[ds.UP,ds.DOWN,ds.LEFT,ds.RIGHT].indexOf(n))||(t=n)&&![ds.ESC,ds.SHIFT,ds.BACKSPACE,ds.TAB,ds.WIN_KEY,ds.ALT,ds.META,ds.WIN_KEY_RIGHT,ds.CTRL,ds.SEMICOLON,ds.EQUALS,ds.CAPS_LOCK,ds.CONTEXT_MENU,ds.F1,ds.F2,ds.F3,ds.F4,ds.F5,ds.F6,ds.F7,ds.F8,ds.F9,ds.F10,ds.F11,ds.F12].includes(t)&&m(!0)},onInputMouseDown:function(){E(!0)},onInputChange:function(e){var t=e.target.value;if(u&&k.current&&/[\r\n]/.test(k.current)){var n=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,k.current)}k.current=null,T(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");k.current=n||""},onInputCompositionStart:function(){i.current=!0},onInputCompositionEnd:function(e){i.current=!1,"combobox"!==l&&T(e.target.value)},onInputBlur:v},C="multiple"===l||"tags"===l?e.createElement(Ep,Xe({},t,_)):e.createElement(kp,Xe({},t,_));return e.createElement("div",{ref:b,className:"".concat(a,"-selector"),onClick:function(e){e.target!==r.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){r.current.focus()}):r.current.focus())},onMouseDown:function(e){var t=w();e.target===r.current||t||"combobox"===l&&h||e.preventDefault(),("combobox"===l||c&&t)&&s||(s&&!1!==p&&f("",!0,!1),m())}},d&&e.createElement("div",{className:"".concat(a,"-prefix")},d),C)},_p=e.forwardRef(Tp);function Cp(t){var n=t.prefixCls,r=t.align,i=t.arrow,a=t.arrowPos,o=i||{},s=o.className,l=o.content,c=a.x,u=void 0===c?0:c,h=a.y,d=void 0===h?0:h,p=e.useRef();if(!r||!r.points)return null;var f={position:"absolute"};if(!1!==r.autoArrow){var g=r.points[0],m=r.points[1],y=g[0],v=g[1],b=m[0],x=m[1];y!==b&&["t","b"].includes(y)?"t"===y?f.top=0:f.bottom=0:f.top=d,v!==x&&["l","r"].includes(v)?"l"===v?f.left=0:f.right=0:f.left=u}return e.createElement("div",{ref:p,className:en("".concat(n,"-arrow"),s),style:f},l)}function Sp(t){var n=t.prefixCls,r=t.open,i=t.zIndex,a=t.mask,o=t.motion;return a?e.createElement(so,Xe({},o,{motionAppear:!0,visible:r,removeOnLeave:!0}),function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:en("".concat(n,"-mask"),r)})}):null}var Ap=e.memo(function(e){return e.children},function(e,t){return t.cache}),Np=e.forwardRef(function(t,n){var r=t.popup,i=t.className,a=t.prefixCls,o=t.style,s=t.target,l=t.onVisibleChanged,c=t.open,u=t.keepDom,h=t.fresh,d=t.onClick,p=t.mask,f=t.arrow,g=t.arrowPos,m=t.align,y=t.motion,v=t.maskMotion,b=t.forceRender,x=t.getPopupContainer,w=t.autoDestroy,E=t.portal,k=t.zIndex,T=t.onMouseEnter,_=t.onMouseLeave,C=t.onPointerEnter,S=t.onPointerDownCapture,N=t.ready,I=t.offsetX,O=t.offsetY,L=t.offsetR,M=t.offsetB,R=t.onAlign,P=t.onPrepare,$=t.stretch,B=t.targetWidth,F=t.targetHeight,z="function"==typeof r?r():r,j=c||u,H=(null==x?void 0:x.length)>0,U=A(e.useState(!x||!H),2),G=U[0],q=U[1];if(Be(function(){!G&&H&&s&&q(!0)},[G,H,s]),!G)return null;var W="auto",V={left:"-1000vw",top:"-1000vh",right:W,bottom:W};if(N||!c){var Y,X=m.points,K=m.dynamicInset||(null===(Y=m._experimental)||void 0===Y?void 0:Y.dynamicInset),Q=K&&"r"===X[0][1],Z=K&&"b"===X[0][0];Q?(V.right=L,V.left=W):(V.left=I,V.right=W),Z?(V.bottom=M,V.top=W):(V.top=O,V.bottom=W)}var J={};return $&&($.includes("height")&&F?J.height=F:$.includes("minHeight")&&F&&(J.minHeight=F),$.includes("width")&&B?J.width=B:$.includes("minWidth")&&B&&(J.minWidth=B)),c||(J.pointerEvents="none"),e.createElement(E,{open:b||j,getContainer:x&&function(){return x(s)},autoDestroy:w},e.createElement(Sp,{prefixCls:a,open:c,zIndex:k,mask:p,motion:v}),e.createElement(ur,{onResize:R,disabled:!c},function(t){return e.createElement(so,Xe({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(a,"-hidden")},y,{onAppearPrepare:P,onEnterPrepare:P,visible:c,onVisibleChanged:function(e){var t;null==y||null===(t=y.onVisibleChanged)||void 0===t||t.call(y,e),l(e)}}),function(r,s){var l=r.className,u=r.style,p=en(a,l,i);return e.createElement("div",{ref:In(t,n,s),className:p,style:D(D(D(D({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},V),J),u),{},{boxSizing:"border-box",zIndex:k},o),onMouseEnter:T,onMouseLeave:_,onPointerEnter:C,onClick:d,onPointerDownCapture:S},f&&e.createElement(Cp,{prefixCls:a,arrow:f,arrowPos:g,align:m}),e.createElement(Ap,{cache:!c&&!h},z))})}))}),Ip=e.forwardRef(function(t,n){var r=t.children,i=t.getTriggerDOMNode,a=Ln(r),o=e.useCallback(function(e){Nn(n,i?i(e):e)},[i]),s=On(o,Rn(r));return a?e.cloneElement(r,{ref:s}):r}),Op=e.createContext(null);function Lp(e){return e?Array.isArray(e)?e:[e]:[]}function Mp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>2?arguments[2]:void 0)?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function Rp(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function Dp(e){return e.ownerDocument.defaultView}function Pp(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=Dp(n).getComputedStyle(n);[i.overflowX,i.overflowY,i.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function $p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function Bp(e){return $p(parseFloat(e),0)}function Fp(e,t){var n=D({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=Dp(e).getComputedStyle(e),r=t.overflow,i=t.overflowClipMargin,a=t.borderTopWidth,o=t.borderBottomWidth,s=t.borderLeftWidth,l=t.borderRightWidth,c=e.getBoundingClientRect(),u=e.offsetHeight,h=e.clientHeight,d=e.offsetWidth,p=e.clientWidth,f=Bp(a),g=Bp(o),m=Bp(s),y=Bp(l),v=$p(Math.round(c.width/d*1e3)/1e3),b=$p(Math.round(c.height/u*1e3)/1e3),x=(d-p-m-y)*v,w=(u-h-f-g)*b,E=f*b,k=g*b,T=m*v,_=y*v,C=0,S=0;if("clip"===r){var A=Bp(i);C=A*v,S=A*b}var N=c.x+T-C,I=c.y+E-S,O=N+c.width+2*C-T-_-x,L=I+c.height+2*S-E-k-w;n.left=Math.max(n.left,N),n.top=Math.max(n.top,I),n.right=Math.min(n.right,O),n.bottom=Math.min(n.bottom,L)}}),n}function zp(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),n=t.match(/^(.*)\%$/);return n?e*(parseFloat(n[1])/100):parseFloat(t)}function jp(e,t){var n=A(t||[],2),r=n[0],i=n[1];return[zp(e.width,r),zp(e.height,i)]}function Hp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function Up(e,t){var n,r=t[0],i=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===i?e.x:"r"===i?e.x+e.width:e.x+e.width/2,y:n}}function Gp(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(e,r){return r===t?n[e]||"c":e}).join("")}var qp=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];var Wp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:au,n=e.forwardRef(function(n,r){var i=n.prefixCls,a=void 0===i?"rc-trigger-popup":i,o=n.children,s=n.action,l=void 0===s?"hover":s,c=n.showAction,u=n.hideAction,h=n.popupVisible,d=n.defaultPopupVisible,p=n.onPopupVisibleChange,f=n.afterPopupVisibleChange,g=n.mouseEnterDelay,m=n.mouseLeaveDelay,y=void 0===m?.1:m,v=n.focusDelay,b=n.blurDelay,x=n.mask,w=n.maskClosable,E=void 0===w||w,k=n.getPopupContainer,T=n.forceRender,_=n.autoDestroy,C=n.destroyPopupOnHide,S=n.popup,N=n.popupClassName,I=n.popupStyle,O=n.popupPlacement,L=n.builtinPlacements,R=void 0===L?{}:L,P=n.popupAlign,$=n.zIndex,B=n.stretch,F=n.getPopupClassNameFromAlign,z=n.fresh,j=n.alignPoint,H=n.onPopupClick,U=n.onPopupAlign,G=n.arrow,q=n.popupMotion,W=n.maskMotion,V=n.popupTransitionName,Y=n.popupAnimation,K=n.maskTransitionName,Q=n.maskAnimation,Z=n.className,J=n.getTriggerDOMNode,ee=X(n,qp),te=_||C||!1,ne=A(e.useState(!1),2),re=ne[0],ie=ne[1];Be(function(){ie(qd())},[]);var ae=e.useRef({}),oe=e.useContext(Op),se=e.useMemo(function(){return{registerSubPopup:function(e,t){ae.current[e]=t,null==oe||oe.registerSubPopup(e,t)}}},[oe]),le=cu(),ce=A(e.useState(null),2),ue=ce[0],he=ce[1],de=e.useRef(null),pe=Gi(function(e){de.current=e,sn(e)&&ue!==e&&he(e),null==oe||oe.registerSubPopup(le,e)}),fe=A(e.useState(null),2),ge=fe[0],me=fe[1],ye=e.useRef(null),ve=Gi(function(e){sn(e)&&ge!==e&&(me(e),ye.current=e)}),be=e.Children.only(o),xe=(null==be?void 0:be.props)||{},we={},Ee=Gi(function(e){var t,n,r=ge;return(null==r?void 0:r.contains(e))||(null===(t=Mo(r))||void 0===t?void 0:t.host)===e||e===r||(null==ue?void 0:ue.contains(e))||(null===(n=Mo(ue))||void 0===n?void 0:n.host)===e||e===ue||Object.values(ae.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),ke=Rp(a,q,Y,V),Te=Rp(a,W,Q,K),_e=A(e.useState(d||!1),2),Ce=_e[0],Se=_e[1],Ae=null!=h?h:Ce,Ne=Gi(function(e){void 0===h&&Se(e)});Be(function(){Se(h||!1)},[h]);var Ie=e.useRef(Ae);Ie.current=Ae;var Oe=e.useRef([]);Oe.current=[];var Le=Gi(function(e){var t;Ne(e),(null!==(t=Oe.current[Oe.current.length-1])&&void 0!==t?t:Ae)!==e&&(Oe.current.push(e),null==p||p(e))}),Me=e.useRef(),Re=function(){clearTimeout(Me.current)},De=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Re(),0===t?Le(e):Me.current=setTimeout(function(){Le(e)},1e3*t)};e.useEffect(function(){return Re},[]);var Pe=A(e.useState(!1),2),$e=Pe[0],Fe=Pe[1];Be(function(e){e&&!Ae||Fe(!0)},[Ae]);var ze=A(e.useState(null),2),je=ze[0],He=ze[1],Ue=A(e.useState(null),2),Ge=Ue[0],qe=Ue[1],We=function(e){qe([e.clientX,e.clientY])},Ve=function(t,n,r,i,a,o,s){var l=A(e.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:a[i]||{}}),2),c=l[0],u=l[1],h=e.useRef(0),d=e.useMemo(function(){return n?Pp(n):[]},[n]),p=e.useRef({});t||(p.current={});var f=Gi(function(){if(n&&r&&t){var e,l,c,h,f,g=n,m=g.ownerDocument,y=Dp(g),v=y.getComputedStyle(g).position,b=g.style.left,x=g.style.top,w=g.style.right,E=g.style.bottom,k=g.style.overflow,T=D(D({},a[i]),o),_=m.createElement("div");if(null===(e=g.parentElement)||void 0===e||e.appendChild(_),_.style.left="".concat(g.offsetLeft,"px"),_.style.top="".concat(g.offsetTop,"px"),_.style.position=v,_.style.height="".concat(g.offsetHeight,"px"),_.style.width="".concat(g.offsetWidth,"px"),g.style.left="0",g.style.top="0",g.style.right="auto",g.style.bottom="auto",g.style.overflow="hidden",Array.isArray(r))f={x:r[0],y:r[1],width:0,height:0};else{var C,S,N=r.getBoundingClientRect();N.x=null!==(C=N.x)&&void 0!==C?C:N.left,N.y=null!==(S=N.y)&&void 0!==S?S:N.top,f={x:N.x,y:N.y,width:N.width,height:N.height}}var I=g.getBoundingClientRect(),O=y.getComputedStyle(g),L=O.height,M=O.width;I.x=null!==(l=I.x)&&void 0!==l?l:I.left,I.y=null!==(c=I.y)&&void 0!==c?c:I.top;var R=m.documentElement,P=R.clientWidth,$=R.clientHeight,B=R.scrollWidth,F=R.scrollHeight,z=R.scrollTop,j=R.scrollLeft,H=I.height,U=I.width,G=f.height,q=f.width,W={left:0,top:0,right:P,bottom:$},V={left:-j,top:-z,right:B-j,bottom:F-z},Y=T.htmlRegion,X="visible",K="visibleFirst";"scroll"!==Y&&Y!==K&&(Y=X);var Q=Y===K,Z=Fp(V,d),J=Fp(W,d),ee=Y===X?J:Z,te=Q?J:ee;g.style.left="auto",g.style.top="auto",g.style.right="0",g.style.bottom="0";var ne=g.getBoundingClientRect();g.style.left=b,g.style.top=x,g.style.right=w,g.style.bottom=E,g.style.overflow=k,null===(h=g.parentElement)||void 0===h||h.removeChild(_);var re=$p(Math.round(U/parseFloat(M)*1e3)/1e3),ie=$p(Math.round(H/parseFloat(L)*1e3)/1e3);if(0===re||0===ie||sn(r)&&!Ys(r))return;var ae=T.offset,oe=T.targetOffset,se=A(jp(I,ae),2),le=se[0],ce=se[1],ue=A(jp(f,oe),2),he=ue[0],de=ue[1];f.x-=he,f.y-=de;var pe=A(T.points||[],2),fe=pe[0],ge=Hp(pe[1]),me=Hp(fe),ye=Up(f,ge),ve=Up(I,me),be=D({},T),xe=ye.x-ve.x+le,we=ye.y-ve.y+ce;function ft(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ee,r=I.x+e,i=I.y+t,a=r+U,o=i+H,s=Math.max(r,n.left),l=Math.max(i,n.top),c=Math.min(a,n.right),u=Math.min(o,n.bottom);return Math.max(0,(c-s)*(u-l))}var Ee,ke,Te,_e,Ce=ft(xe,we),Se=ft(xe,we,J),Ae=Up(f,["t","l"]),Ne=Up(I,["t","l"]),Ie=Up(f,["b","r"]),Oe=Up(I,["b","r"]),Le=T.overflow||{},Me=Le.adjustX,Re=Le.adjustY,De=Le.shiftX,Pe=Le.shiftY,$e=function(e){return"boolean"==typeof e?e:e>=0};function gt(){Ee=I.y+we,ke=Ee+H,Te=I.x+xe,_e=Te+U}gt();var Be=$e(Re),Fe=me[0]===ge[0];if(Be&&"t"===me[0]&&(ke>te.bottom||p.current.bt)){var ze=we;Fe?ze-=H-G:ze=Ae.y-Oe.y-ce;var je=ft(xe,ze),He=ft(xe,ze,J);je>Ce||je===Ce&&(!Q||He>=Se)?(p.current.bt=!0,we=ze,ce=-ce,be.points=[Gp(me,0),Gp(ge,0)]):p.current.bt=!1}if(Be&&"b"===me[0]&&(EeCe||Ge===Ce&&(!Q||qe>=Se)?(p.current.tb=!0,we=Ue,ce=-ce,be.points=[Gp(me,0),Gp(ge,0)]):p.current.tb=!1}var We=$e(Me),Ve=me[1]===ge[1];if(We&&"l"===me[1]&&(_e>te.right||p.current.rl)){var Ye=xe;Ve?Ye-=U-q:Ye=Ae.x-Oe.x-le;var Xe=ft(Ye,we),Ke=ft(Ye,we,J);Xe>Ce||Xe===Ce&&(!Q||Ke>=Se)?(p.current.rl=!0,xe=Ye,le=-le,be.points=[Gp(me,1),Gp(ge,1)]):p.current.rl=!1}if(We&&"r"===me[1]&&(TeCe||Ze===Ce&&(!Q||Je>=Se)?(p.current.lr=!0,xe=Qe,le=-le,be.points=[Gp(me,1),Gp(ge,1)]):p.current.lr=!1}gt();var et=!0===De?0:De;"number"==typeof et&&(TeJ.right&&(xe-=_e-J.right-le,f.x>J.right-et&&(xe+=f.x-J.right+et)));var tt=!0===Pe?0:Pe;"number"==typeof tt&&(EeJ.bottom&&(we-=ke-J.bottom-ce,f.y>J.bottom-tt&&(we+=f.y-J.bottom+tt)));var nt=I.x+xe,rt=nt+U,it=I.y+we,at=it+H,ot=f.x,st=ot+q,lt=f.y,ct=lt+G,ut=(Math.max(nt,ot)+Math.min(rt,st))/2-nt,ht=(Math.max(it,lt)+Math.min(at,ct))/2-it;null==s||s(n,be);var dt=ne.right-I.x-(xe+I.width),pt=ne.bottom-I.y-(we+I.height);1===re&&(xe=Math.round(xe),dt=Math.round(dt)),1===ie&&(we=Math.round(we),pt=Math.round(pt)),u({ready:!0,offsetX:xe/re,offsetY:we/ie,offsetR:dt/re,offsetB:pt/ie,arrowX:ut/re,arrowY:ht/ie,scaleX:re,scaleY:ie,align:be})}}),g=function(){u(function(e){return D(D({},e),{},{ready:!1})})};return Be(g,[i]),Be(function(){t||g()},[t]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,function(){h.current+=1;var e=h.current;Promise.resolve().then(function(){h.current===e&&f()})}]}(Ae,ue,j&&null!==Ge?Ge:ge,O,R,P,U),Ye=A(Ve,11),Xe=Ye[0],Ke=Ye[1],Qe=Ye[2],Ze=Ye[3],Je=Ye[4],et=Ye[5],tt=Ye[6],nt=Ye[7],rt=Ye[8],it=Ye[9],at=Ye[10],ot=function(t,n,r,i){return e.useMemo(function(){var e=Lp(null!=r?r:n),a=Lp(null!=i?i:n),o=new Set(e),s=new Set(a);return t&&(o.has("hover")&&(o.delete("hover"),o.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[o,s]},[t,n,r,i])}(re,l,c,u),st=A(ot,2),lt=st[0],ct=st[1],ut=lt.has("click"),ht=ct.has("click")||ct.has("contextMenu"),dt=Gi(function(){$e||at()});!function(e,t,n,r,i){Be(function(){if(e&&t&&n){var a=n,o=Pp(t),s=Pp(a),l=Dp(a),c=new Set([l].concat(M(o),M(s)));function u(){r(),i()}return c.forEach(function(e){e.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),r(),function(){c.forEach(function(e){e.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[e,t,n])}(Ae,ge,ue,dt,function(){Ie.current&&j&&ht&&De(!1)}),Be(function(){dt()},[Ge,O]),Be(function(){!Ae||null!=R&&R[O]||dt()},[JSON.stringify(P)]);var pt=e.useMemo(function(){var e=function(e,t,n,r){for(var i=n.points,a=Object.keys(e),o=0;o1?o-1:0),l=1;l1?n-1:0),i=1;i1?n-1:0),i=1;i50?", ...":null)}var nf=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],rf=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],af=function(e){return"tags"===e||"multiple"===e},of=e.forwardRef(function(n,r){var i,a=n.id,o=n.prefixCls,s=n.className,l=n.showSearch,c=n.tagRender,u=n.direction,h=n.omitDomProps,d=n.displayValues,p=n.onDisplayValuesChange,f=n.emptyOptions,g=n.notFoundContent,m=void 0===g?"Not Found":g,y=n.onClear,v=n.mode,b=n.disabled,x=n.loading,w=n.getInputElement,E=n.getRawInputElement,k=n.open,T=n.defaultOpen,_=n.onDropdownVisibleChange,C=n.activeValue,S=n.onActiveValueChange,I=n.activeDescendantId,L=n.searchValue,R=n.autoClearSearchValue,P=n.onSearch,$=n.onSearchSplit,B=n.tokenSeparators,F=n.allowClear,z=n.prefix,j=n.suffixIcon,H=n.clearIcon,U=n.OptionList,G=n.animation,q=n.transitionName,W=n.dropdownStyle,V=n.dropdownClassName,Y=n.dropdownMatchSelectWidth,K=n.dropdownRender,Q=n.dropdownAlign,Z=n.placement,J=n.builtinPlacements,ee=n.getPopupContainer,te=n.showAction,ne=void 0===te?[]:te,re=n.onFocus,ie=n.onBlur,ae=n.onKeyUp,oe=n.onKeyDown,se=n.onMouseDown,le=X(n,nf),ce=af(v),ue=(void 0!==l?l:ce)||"combobox"===v,he=D({},le);rf.forEach(function(e){delete he[e]}),null==h||h.forEach(function(e){delete he[e]});var de=A(e.useState(!1),2),pe=de[0],fe=de[1];e.useEffect(function(){fe(qd())},[]);var ge=e.useRef(null),me=e.useRef(null),ye=e.useRef(null),ve=e.useRef(null),be=e.useRef(null),xe=e.useRef(!1),we=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=A(e.useState(!1),2),r=n[0],i=n[1],a=e.useRef(null),o=function(){window.clearTimeout(a.current)};return e.useEffect(function(){return o},[]),[r,function(e,n){o(),a.current=window.setTimeout(function(){i(e),n&&n()},t)},o]}(),Ee=A(we,3),ke=Ee[0],Te=Ee[1],_e=Ee[2];e.useImperativeHandle(r,function(){var e,t;return{focus:null===(e=ve.current)||void 0===e?void 0:e.focus,blur:null===(t=ve.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=be.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:ge.current||me.current}});var Ce=e.useMemo(function(){var e;if("combobox"!==v)return L;var t=null===(e=d[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[L,v,d]),Se="combobox"===v&&"function"==typeof w&&w()||null,Ae="function"==typeof E&&E(),Ne=On(me,null==Ae||null===(i=Ae.props)||void 0===i?void 0:i.ref),Ie=A(e.useState(!1),2),Oe=Ie[0],Le=Ie[1];Be(function(){Le(!0)},[]);var Me=A(Vi(!1,{defaultValue:T,value:k}),2),Re=Me[0],De=Me[1],Pe=!!Oe&&Re,$e=!m&&f;(b||$e&&Pe&&"combobox"===v)&&(Pe=!1);var Fe=!$e&&Pe,ze=e.useCallback(function(e){var t=void 0!==e?e:!Pe;b||(De(t),Pe!==t&&(null==_||_(t)))},[b,Pe,De,_]),je=e.useMemo(function(){return(B||[]).some(function(e){return["\n","\r\n"].includes(e)})},[B]),He=e.useContext(ef)||{},Ue=He.maxCount,Ge=He.rawValues,qe=function(e,t,n){if(!(ce&&Qp(Ue)&&(null==Ge?void 0:Ge.size)>=Ue)){var r=!0,i=e;null==S||S(null);var a=function(e,t,n){if(!t||!t.length)return null;var r=!1,i=function e(t,n){var i=vr(n),a=i[0],o=i.slice(1);if(!a)return[t];var s=t.split(a);return r=r||s.length>1,s.reduce(function(t,n){return[].concat(M(t),M(e(n,o)))},[]).filter(Boolean)}(e,t);return r?void 0!==n?i.slice(0,n):i:null}(e,B,Qp(Ue)?Ue-Ge.size:void 0),o=n?null:a;return"combobox"!==v&&o&&(i="",null==$||$(o),ze(!1),r=!1),P&&Ce!==i&&P(i,{source:t?"typing":"effect"}),r}};e.useEffect(function(){Pe||ce||"combobox"===v||qe("",!1,!1)},[Pe]),e.useEffect(function(){Re&&b&&De(!1),b&&!xe.current&&Te(!1)},[b]);var We=A(Yd(),2),Ve=We[0],Ye=We[1],Ke=e.useRef(!1),Qe=e.useRef(!1),Ze=[];e.useEffect(function(){return function(){Ze.forEach(function(e){return clearTimeout(e)}),Ze.splice(0,Ze.length)}},[]);var Je,et=A(e.useState({}),2)[1];Ae&&(Je=function(e){ze(e)}),function(t,n,r,i){var a=e.useRef(null);a.current={open:n,triggerOpen:r,customizedTrigger:i},e.useEffect(function(){function e(e){var n;if(null===(n=a.current)||void 0===n||!n.customizedTrigger){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),a.current.open&&t().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&a.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[])}(function(){var e;return[ge.current,null===(e=ye.current)||void 0===e?void 0:e.getPopupElement()]},Fe,ze,!!Ae);var tt,nt=e.useMemo(function(){return D(D({},n),{},{notFoundContent:m,open:Pe,triggerOpen:Fe,id:a,showSearch:ue,multiple:ce,toggleOpen:ze})},[n,m,Fe,Pe,a,ue,ce,ze]),rt=!!j||x;rt&&(tt=e.createElement(Wd,{className:en("".concat(o,"-arrow"),O({},"".concat(o,"-arrow-loading"),x)),customizeIcon:j,customizeIconProps:{loading:x,searchValue:Ce,open:Pe,focused:ke,showSearch:ue}}));var it,at=function(e,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=t.useMemo(function(){return"object"===N(i)?i.clearIcon:a||void 0},[i,a]);return{allowClear:t.useMemo(function(){return!(o||!i||!r.length&&!s||"combobox"===l&&""===s)},[i,o,r.length,s,l]),clearIcon:t.createElement(Wd,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:c},"×")}}(o,function(){var e;null==y||y(),null===(e=ve.current)||void 0===e||e.focus(),p([],{type:"clear",values:d}),qe("",!1,!1)},d,F,H,b,Ce,v),ot=at.allowClear,st=at.clearIcon,lt=e.createElement(U,{ref:be}),ct=en(o,s,O(O(O(O(O(O(O(O(O(O({},"".concat(o,"-focused"),ke),"".concat(o,"-multiple"),ce),"".concat(o,"-single"),!ce),"".concat(o,"-allow-clear"),F),"".concat(o,"-show-arrow"),rt),"".concat(o,"-disabled"),b),"".concat(o,"-loading"),x),"".concat(o,"-open"),Pe),"".concat(o,"-customize-input"),Se),"".concat(o,"-show-search"),ue)),ut=e.createElement(Xp,{ref:ye,disabled:b,prefixCls:o,visible:Fe,popupElement:lt,animation:G,transitionName:q,dropdownStyle:W,dropdownClassName:V,direction:u,dropdownMatchSelectWidth:Y,dropdownRender:K,dropdownAlign:Q,placement:Z,builtinPlacements:J,getPopupContainer:ee,empty:f,getTriggerDOMNode:function(e){return me.current||e},onPopupVisibleChange:Je,onPopupMouseEnter:function(){et({})}},Ae?e.cloneElement(Ae,{ref:Ne}):e.createElement(_p,Xe({},n,{domRef:me,prefixCls:o,inputElement:Se,ref:ve,id:a,prefix:z,showSearch:ue,autoClearSearchValue:R,mode:v,activeDescendantId:I,tagRender:c,values:d,open:Pe,onToggleOpen:ze,activeValue:C,searchValue:Ce,onSearch:qe,onSearchSubmit:function(e){e&&e.trim()&&P(e,{source:"submit"})},onRemove:function(e){var t=d.filter(function(t){return t!==e});p(t,{type:"remove",values:[e]})},tokenWithEnter:je,onInputBlur:function(){Ke.current=!1}})));return it=Ae?ut:e.createElement("div",Xe({className:ct},he,{ref:ge,onMouseDown:function(e){var t,n=e.target,r=null===(t=ye.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var i=setTimeout(function(){var e,t=Ze.indexOf(i);-1!==t&&Ze.splice(t,1),_e(),pe||r.contains(document.activeElement)||null===(e=ve.current)||void 0===e||e.focus()});Ze.push(i)}for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s=0;s-=1){var l=a[s];if(!l.disabled){a.splice(s,1),o=l;break}}o&&p(a,{type:"remove",values:[o]})}for(var c=arguments.length,u=new Array(c>1?c-1:0),h=1;h1?t-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2],r=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return n&&r?(clearTimeout(a.current),i.current=!1):r&&!i.current||(clearTimeout(a.current),i.current=!0,a.current=setTimeout(function(){i.current=!1},50)),!i.current&&r}};function ff(e,t,n,r,i,a,s){var l=o(0),c=o(null),u=o(null),h=o(!1),d=pf(t,n,r,i);var p=o(null),f=o(null);return[function(t){if(e){mr.cancel(f.current),f.current=mr(function(){p.current=null},2);var n=t.deltaX,r=t.deltaY,i=t.shiftKey,o=n,g=r;("sx"===p.current||!p.current&&i&&r&&!n)&&(o=r,g=0,p.current="sx");var m=Math.abs(o),y=Math.abs(g);null===p.current&&(p.current=a&&m>y?"x":"y"),"y"===p.current?function(e,t){if(mr.cancel(c.current),!d(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,l.current+=t,u.current=t,df||n.preventDefault(),c.current=mr(function(){var e=h.current?10:1;s(l.current*e,!1),l.current=0}))}}(t,g):function(e,t){s(t,!0),df||e.preventDefault()}(t,o)}},function(t){e&&(h.current=t.detail===u.current)}]}var gf=function(){function e(){re(this,e),O(this,"maps",void 0),O(this,"id",0),O(this,"diffRecords",new Map),this.maps=Object.create(null)}return ae(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function mf(e){var t=parseFloat(e);return isNaN(t)?0:t}var yf=14/15;function vf(e){return Math.floor(Math.pow(e,.5))}function bf(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var xf=e.forwardRef(function(t,n){var r=t.prefixCls,i=t.rtl,a=t.scrollOffset,o=t.scrollRange,s=t.onStartMove,l=t.onStopMove,c=t.onScroll,u=t.horizontal,h=t.spinSize,d=t.containerSize,p=t.style,f=t.thumbStyle,g=t.showScrollBar,m=A(e.useState(!1),2),y=m[0],v=m[1],b=A(e.useState(null),2),x=b[0],w=b[1],E=A(e.useState(null),2),k=E[0],T=E[1],_=!i,C=e.useRef(),S=e.useRef(),N=A(e.useState(g),2),I=N[0],L=N[1],M=e.useRef(),R=function(){!0!==g&&!1!==g&&(clearTimeout(M.current),L(!0),M.current=setTimeout(function(){L(!1)},3e3))},P=o-d||0,$=d-h||0,B=e.useMemo(function(){return 0===a||0===P?0:a/P*$},[a,P,$]),F=e.useRef({top:B,dragging:y,pageY:x,startTop:k});F.current={top:B,dragging:y,pageY:x,startTop:k};var z=function(e){v(!0),w(bf(e,u)),T(F.current.top),s(),e.stopPropagation(),e.preventDefault()};e.useEffect(function(){var e=function(e){e.preventDefault()},t=C.current,n=S.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",z,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",z)}},[]);var j=e.useRef();j.current=P;var H=e.useRef();H.current=$,e.useEffect(function(){if(y){var e,t=function(t){var n=F.current,r=n.dragging,i=n.pageY,a=n.startTop;mr.cancel(e);var o=C.current.getBoundingClientRect(),s=d/(u?o.width:o.height);if(r){var l=(bf(t,u)-i)*s,h=a;!_&&u?h-=l:h+=l;var p=j.current,f=H.current,g=f?h/f:0,m=Math.ceil(g*p);m=Math.max(m,0),m=Math.min(m,p),e=mr(function(){c(m,u)})}},n=function(){v(!1),l()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),mr.cancel(e)}}},[y]),e.useEffect(function(){return R(),function(){clearTimeout(M.current)}},[a]),e.useImperativeHandle(n,function(){return{delayHidden:R}});var U="".concat(r,"-scrollbar"),G={position:"absolute",visibility:I?null:"hidden"},q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return u?(Object.assign(G,{height:8,left:0,right:0,bottom:0}),Object.assign(q,O({height:"100%",width:h},_?"left":"right",B))):(Object.assign(G,O({width:8,top:0,bottom:0},_?"right":"left",0)),Object.assign(q,{width:"100%",height:h,top:B})),e.createElement("div",{ref:C,className:en(U,O(O(O({},"".concat(U,"-horizontal"),u),"".concat(U,"-vertical"),!u),"".concat(U,"-visible"),I)),style:D(D({},G),p),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:R},e.createElement("div",{ref:S,className:en("".concat(U,"-thumb"),O({},"".concat(U,"-thumb-moving"),y)),style:D(D({},q),f),onMouseDown:z}))});function wf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)*e;return isNaN(t)&&(t=0),t=Math.max(t,20),Math.floor(t)}var Ef=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],kf=[],Tf={overflowY:"auto",overflowAnchor:"none"};function _f(t,n){var r=t.prefixCls,i=void 0===r?"rc-virtual-list":r,a=t.className,s=t.height,c=t.itemHeight,u=t.fullHeight,h=void 0===u||u,p=t.style,f=t.data,g=t.children,m=t.itemKey,y=t.virtual,v=t.direction,b=t.scrollWidth,x=t.component,w=void 0===x?"div":x,E=t.onScroll,T=t.onVirtualScroll,_=t.onVisibleChange,C=t.innerProps,S=t.extraRender,I=t.styles,L=t.showScrollBar,M=void 0===L?"optional":L,R=X(t,Ef),P=e.useCallback(function(e){return"function"==typeof m?m(e):null==e?void 0:e[m]},[m]),$=function(t){var n=A(e.useState(0),2),r=n[0],i=n[1],a=o(new Map),s=o(new gf),c=o(0);function u(){c.current+=1}function h(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u();var t=function(){var e=!1;a.current.forEach(function(t,n){if(t&&t.offsetParent){var r=t.offsetHeight,i=getComputedStyle(t),a=i.marginTop,o=i.marginBottom,l=r+mf(a)+mf(o);s.current.get(n)!==l&&(s.current.set(n,l),e=!0)}}),e&&i(function(e){return e+1})};if(e)t();else{c.current+=1;var n=c.current;Promise.resolve().then(function(){n===c.current&&t()})}}return l(function(){return u},[]),[function(e,n){var r=t(e);a.current.get(r),n?(a.current.set(r,n),h()):a.current.delete(r)},h,s.current,r]}(P),B=A($,4),F=B[0],z=B[1],j=B[2],H=B[3],U=!(!1===y||!s||!c),G=e.useMemo(function(){return Object.values(j.maps).reduce(function(e,t){return e+t},0)},[j.id,j.maps]),q=U&&f&&(Math.max(c*f.length,G)>s||!!b),W="rtl"===v,V=en(i,O({},"".concat(i,"-rtl"),W),a),Y=f||kf,K=o(),Q=o(),Z=o(),J=A(d(0),2),ee=J[0],te=J[1],ne=A(d(0),2),re=ne[0],ie=ne[1],ae=A(d(!1),2),oe=ae[0],se=ae[1],le=function(){se(!0)},ce=function(){se(!1)},ue={getKey:P};function he(e){te(function(t){var n=function(e){var t=e;Number.isNaN(Ae.current)||(t=Math.min(t,Ae.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return K.current.scrollTop=n,n})}var de=o({start:0,end:Y.length}),pe=o(),fe=A(hf(Y,P),1)[0];pe.current=fe;var ge=e.useMemo(function(){if(!U)return{scrollHeight:void 0,start:0,end:Y.length-1,offset:void 0};var e;if(!q)return{scrollHeight:(null===(e=Q.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:Y.length-1,offset:void 0};for(var t,n,r,i=0,a=Y.length,o=0;o=ee&&void 0===t&&(t=o,n=i),d>ee+s&&void 0===r&&(r=o),i=d}return void 0===t&&(t=0,n=0,r=Math.ceil(s/c)),void 0===r&&(r=Y.length-1),{scrollHeight:i,start:t,end:r=Math.min(r+1,Y.length-1),offset:n}},[q,U,ee,Y,H,s]),me=ge.scrollHeight,ye=ge.start,ve=ge.end,be=ge.offset;de.current.start=ye,de.current.end=ve,e.useLayoutEffect(function(){var e=j.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),r=Y[ye];if(r&&void 0===n)if(P(r)===t){var i=j.get(t)-c;he(function(e){return e+i})}}j.resetRecord()},[me]);var xe=A(e.useState({width:0,height:s}),2),we=xe[0],Ee=xe[1],ke=o(),Te=o(),_e=e.useMemo(function(){return wf(we.width,b)},[we.width,b]),Ce=e.useMemo(function(){return wf(we.height,me)},[we.height,me]),Se=me-s,Ae=o(Se);Ae.current=Se;var Ne=ee<=0,Ie=ee>=Se,Oe=re<=0,Le=re>=b,Me=pf(Ne,Ie,Oe,Le),Re=function(){return{x:W?-re:re,y:ee}},De=o(Re()),Pe=Gi(function(e){if(T){var t=D(D({},Re()),e);De.current.x===t.x&&De.current.y===t.y||(T(t),De.current=t)}});function $e(e,t){var n=e;t?(k(function(){ie(n)}),Pe()):he(n)}var Fe=function(e){var t=e,n=b?b-we.width:0;return t=Math.max(t,0),t=Math.min(t,n)},ze=Gi(function(e,t){t?(k(function(){ie(function(t){return Fe(t+(W?-e:e))})}),Pe()):he(function(t){return t+e})}),je=A(ff(U,Ne,Ie,Oe,Le,!!b,ze),2),He=je[0],Ue=je[1];!function(e,t,n){var r,i=o(!1),a=o(0),s=o(0),l=o(null),c=o(null),u=function(e){if(i.current){var t=Math.ceil(e.touches[0].pageX),r=Math.ceil(e.touches[0].pageY),o=a.current-t,l=s.current-r,u=Math.abs(o)>Math.abs(l);u?a.current=t:s.current=r;var h=n(u,u?o:l,!1,e);h&&e.preventDefault(),clearInterval(c.current),h&&(c.current=setInterval(function(){u?o*=yf:l*=yf;var e=Math.floor(u?o:l);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(c.current)},16))}},h=function(){i.current=!1,r()},d=function(e){r(),1!==e.touches.length||i.current||(i.current=!0,a.current=Math.ceil(e.touches[0].pageX),s.current=Math.ceil(e.touches[0].pageY),l.current=e.target,l.current.addEventListener("touchmove",u,{passive:!1}),l.current.addEventListener("touchend",h,{passive:!0}))};r=function(){l.current&&(l.current.removeEventListener("touchmove",u),l.current.removeEventListener("touchend",h))},Be(function(){return e&&t.current.addEventListener("touchstart",d,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",d),r(),clearInterval(c.current)}},[e])}(U,K,function(e,t,n,r){var i=r;return!Me(e,t,n)&&((!i||!i._virtualHandled)&&(i&&(i._virtualHandled=!0),He({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))}),function(t,n,r){e.useEffect(function(){var e=n.current;if(t&&e){var i,a,o=!1,s=function(){mr.cancel(i)},l=function e(){s(),i=mr(function(){r(a),e()})},c=function(){o=!1,s()},u=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,o=!0)}},h=function(t){if(o){var n=bf(t,!1),r=e.getBoundingClientRect(),i=r.top,c=r.bottom;n<=i?(a=-vf(i-n),l()):n>=c?(a=vf(n-c),l()):s()}};return e.addEventListener("mousedown",u),e.ownerDocument.addEventListener("mouseup",c),e.ownerDocument.addEventListener("mousemove",h),e.ownerDocument.addEventListener("dragend",c),function(){e.removeEventListener("mousedown",u),e.ownerDocument.removeEventListener("mouseup",c),e.ownerDocument.removeEventListener("mousemove",h),e.ownerDocument.removeEventListener("dragend",c),s()}}},[t])}(q,K,function(e){he(function(t){return t+e})}),Be(function(){function e(e){var t=Ne&&e.detail<0,n=Ie&&e.detail>0;!U||t||n||e.preventDefault()}var t=K.current;return t.addEventListener("wheel",He,{passive:!1}),t.addEventListener("DOMMouseScroll",Ue,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",He),t.removeEventListener("DOMMouseScroll",Ue),t.removeEventListener("MozMousePixelScroll",e)}},[U,Ne,Ie]),Be(function(){if(b){var e=Fe(re);ie(e),Pe({x:e})}},[we.width,b]);var Ge=function(){var e,t;null===(e=ke.current)||void 0===e||e.delayHidden(),null===(t=Te.current)||void 0===t||t.delayHidden()},qe=function(t,n,r,i,a,o,s,l){var c=e.useRef(),u=A(e.useState(null),2),h=u[0],d=u[1];return Be(function(){if(h&&h.times<10){if(!t.current)return void d(function(e){return D({},e)});o();var e=h.targetAlign,l=h.originAlign,c=h.index,u=h.offset,p=t.current.clientHeight,f=!1,g=e,m=null;if(p){for(var y=e||l,v=0,b=0,x=0,w=Math.min(n.length-1,c),E=0;E<=w;E+=1){var k=a(n[E]);b=v;var T=r.get(k);v=x=b+(void 0===T?i:T)}for(var _="top"===y?u:p-u,C=w;C>=0;C-=1){var S=a(n[C]),A=r.get(S);if(void 0===A){f=!0;break}if((_-=A)<=0)break}switch(y){case"top":m=b-u;break;case"bottom":m=x-p+u;break;default:var N=t.current.scrollTop;bN+p&&(g="bottom")}null!==m&&s(m),m!==h.lastTop&&(f=!0)}f&&d(D(D({},h),{},{times:h.times+1,targetAlign:g,lastTop:m}))}},[h,t.current]),function(e){if(null!=e){if(mr.cancel(c.current),"number"==typeof e)s(e);else if(e&&"object"===N(e)){var t,r=e.align;t="index"in e?e.index:n.findIndex(function(t){return a(t)===e.key});var i=e.offset;d({times:0,index:t,offset:void 0===i?0:i,originAlign:r})}}else l()}}(K,Y,j,c,P,function(){return z(!0)},he,Ge);e.useImperativeHandle(n,function(){return{nativeElement:Z.current,getScrollInfo:Re,scrollTo:function(e){var t;(t=e)&&"object"===N(t)&&("left"in t||"top"in t)?(void 0!==e.left&&ie(Fe(e.left)),qe(e.top)):qe(e)}}}),Be(function(){if(_){var e=Y.slice(ye,ve+1);_(e,Y)}},[ye,ve,Y]);var We=function(t,n,r,i){var a=A(e.useMemo(function(){return[new Map,[]]},[t,r.id,i]),2),o=a[0],s=a[1];return function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=o.get(e),c=o.get(a);if(void 0===l||void 0===c)for(var u=t.length,h=s.length;hs&&e.createElement(xf,{ref:ke,prefixCls:i,scrollOffset:ee,scrollRange:me,rtl:W,onScroll:$e,onStartMove:le,onStopMove:ce,spinSize:Ce,containerSize:we.height,style:null==I?void 0:I.verticalScrollBar,thumbStyle:null==I?void 0:I.verticalScrollBarThumb,showScrollBar:M}),q&&b>we.width&&e.createElement(xf,{ref:Te,prefixCls:i,scrollOffset:re,scrollRange:b,rtl:W,onScroll:$e,onStartMove:le,onStopMove:ce,spinSize:_e,containerSize:we.width,horizontal:!0,style:null==I?void 0:I.horizontalScrollBar,thumbStyle:null==I?void 0:I.horizontalScrollBarThumb,showScrollBar:M}))}var Cf=e.forwardRef(_f);Cf.displayName="List";var Sf=["disabled","title","children","style","className"];function Af(e){return"string"==typeof e||"number"==typeof e}var Nf=function(t,n){var r=e.useContext(Vd),i=r.prefixCls,a=r.id,o=r.open,s=r.multiple,c=r.mode,u=r.searchValue,h=r.toggleOpen,d=r.notFoundContent,p=r.onPopupScroll,f=e.useContext(ef),g=f.maxCount,m=f.flattenOptions,y=f.onActiveValue,v=f.defaultActiveFirstOption,b=f.onSelect,x=f.menuItemSelectedIcon,w=f.rawValues,E=f.fieldNames,k=f.virtual,T=f.direction,_=f.listHeight,C=f.listItemHeight,S=f.optionRender,N="".concat(i,"-item"),I=K(function(){return m},[o,m],function(e,t){return t[0]&&e[1]!==t[1]}),L=e.useRef(null),R=e.useMemo(function(){return s&&Qp(g)&&(null==w?void 0:w.size)>=g},[s,g,null==w?void 0:w.size]),D=function(e){e.preventDefault()},P=function(e){var t;null===(t=L.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},$=e.useCallback(function(e){return"combobox"!==c&&w.has(e)},[c,M(w).toString(),w.size]),B=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=I.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];j(e);var n={source:t?"keyboard":"mouse"},r=I[e];r?y(r.value,e,n):y(null,-1,n)};l(function(){H(!1!==v?B(0):-1)},[I.length,u]);var U=e.useCallback(function(e){return"combobox"===c?String(e).toLowerCase()===u.toLowerCase():w.has(e)},[c,u,M(w).toString(),w.size]);l(function(){var e,t=setTimeout(function(){if(!s&&o&&1===w.size){var e=Array.from(w)[0],t=I.findIndex(function(t){var n=t.data;return u?String(n.value).startsWith(u):n.value===e});-1!==t&&(H(t),P(t))}});o&&(null===(e=L.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}},[o,u]);var G=function(e){void 0!==e&&b(e,{selected:!w.has(e)}),s||h(!1)};if(e.useImperativeHandle(n,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case ds.N:case ds.P:case ds.UP:case ds.DOWN:var r=0;if(t===ds.UP?r=-1:t===ds.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===ds.N?r=1:t===ds.P&&(r=-1)),0!==r){var i=B(z+r,r);P(i),H(i,!0)}break;case ds.TAB:case ds.ENTER:var a,s=I[z];!s||null!=s&&null!==(a=s.data)&&void 0!==a&&a.disabled||R?G(void 0):G(s.value),o&&e.preventDefault();break;case ds.ESC:h(!1),o&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){P(e)}}}),0===I.length)return e.createElement("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(N,"-empty"),onMouseDown:D},d);var q=Object.keys(E).map(function(e){return E[e]}),W=function(e){return e.label};function V(e,t){return{role:e.group?"presentation":"option",id:"".concat(a,"_list_").concat(t)}}var Y=function(t){var n=I[t];if(!n)return null;var r=n.data||{},i=r.value,a=n.group,o=ss(r,!0),s=W(n);return n?e.createElement("div",Xe({"aria-label":"string"!=typeof s||a?null:s},o,{key:t},V(n,t),{"aria-selected":U(i)}),i):null},Q={role:"listbox",id:"".concat(a,"_list")};return e.createElement(e.Fragment,null,k&&e.createElement("div",Xe({},Q,{style:{height:0,width:0,overflow:"hidden"}}),Y(z-1),Y(z),Y(z+1)),e.createElement(Cf,{itemKey:"key",ref:L,data:I,height:_,itemHeight:C,fullHeight:!1,onMouseDown:D,onScroll:p,virtual:k,direction:T,innerProps:k?null:Q},function(t,n){var r=t.group,i=t.groupOption,a=t.data,o=t.label,s=t.value,l=a.key;if(r){var c,u=null!==(c=a.title)&&void 0!==c?c:Af(o)?o.toString():void 0;return e.createElement("div",{className:en(N,"".concat(N,"-group"),a.className),title:u},void 0!==o?o:l)}var h=a.disabled,d=a.title;a.children;var p=a.style,f=a.className,g=Vs(X(a,Sf),q),m=$(s),y=h||!m&&R,v="".concat(N,"-option"),b=en(N,v,f,O(O(O(O({},"".concat(v,"-grouped"),i),"".concat(v,"-active"),z===n&&!y),"".concat(v,"-disabled"),y),"".concat(v,"-selected"),m)),w=W(t),E=!x||"function"==typeof x||m,T="number"==typeof w?w:w||s,_=Af(T)?T.toString():void 0;return void 0!==d&&(_=d),e.createElement("div",Xe({},ss(g),k?{}:V(t,n),{"aria-selected":U(s),className:b,title:_,onMouseMove:function(){z===n||y||H(n)},onClick:function(){y||G(s)},style:p}),e.createElement("div",{className:"".concat(v,"-content")},"function"==typeof S?S(t,{index:n}):T),e.isValidElement(x)||m,E&&e.createElement(Wd,{className:"".concat(N,"-option-state"),customizeIcon:x,customizeIconProps:{value:s,disabled:y,isSelected:m}},m?"✓":null))}))},If=e.forwardRef(Nf);function Of(e,t){return mp(e).join("").toUpperCase().includes(t)}var Lf=0,Mf=$();function Rf(t){var n=A(e.useState(),2),r=n[0],i=n[1];return e.useEffect(function(){var e;i("rc_select_".concat((Mf?(e=Lf,Lf+=1):e="TEST_OR_SSR",e)))},[]),t||r}var Df=["children","value"],Pf=["children"];function $f(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return on(t).map(function(t,r){if(!e.isValidElement(t)||!t.type)return null;var i=t,a=i.type.isSelectOptGroup,o=i.key,s=i.props,l=s.children,c=X(s,Pf);return n||!a?function(e){var t=e,n=t.key,r=t.props,i=r.children,a=r.value;return D({key:n,value:void 0!==a?a:n,children:i},X(r,Df))}(t):D(D({key:"__RC_SELECT_GRP__".concat(null===o?r:o,"__"),label:o},c),{},{options:$f(l)})}).filter(function(e){return e})}function Bf(t){var n=e.useRef();n.current=t;var r=e.useCallback(function(){return n.current.apply(n,arguments)},[]);return r}var Ff=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],zf=["inputValue"];var jf=e.forwardRef(function(t,n){var r=t.id,i=t.mode,a=t.prefixCls,o=void 0===a?"rc-select":a,s=t.backfill,l=t.fieldNames,c=t.inputValue,u=t.searchValue,h=t.onSearch,d=t.autoClearSearchValue,p=void 0===d||d,f=t.onSelect,g=t.onDeselect,m=t.dropdownMatchSelectWidth,y=void 0===m||m,v=t.filterOption,b=t.filterSort,x=t.optionFilterProp,w=t.optionLabelProp,E=t.options,k=t.optionRender,T=t.children,_=t.defaultActiveFirstOption,C=t.menuItemSelectedIcon,S=t.virtual,I=t.direction,L=t.listHeight,R=void 0===L?200:L,P=t.listItemHeight,$=void 0===P?20:P,B=t.labelRender,F=t.value,z=t.defaultValue,j=t.labelInValue,H=t.onChange,U=t.maxCount,G=X(t,Ff),q=Rf(r),W=af(i),V=!(E||!T),Y=e.useMemo(function(){return(void 0!==v||"combobox"!==i)&&v},[v,i]),K=e.useMemo(function(){return Zp(l,V)},[JSON.stringify(l),V]),Q=Vi("",{value:void 0!==u?u:c,postState:function(e){return e||""}}),Z=A(Q,2),J=Z[0],ee=Z[1],te=function(t,n,r,i,a){return e.useMemo(function(){var e=t;!t&&(e=$f(n));var o=new Map,s=new Map,l=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c0?e(t.options):t.options}):t})},we=e.useMemo(function(){return b?xe(be):be},[be,b,J]),Ee=e.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],a=Zp(n,!1),o=a.label,s=a.value,l=a.options,c=a.groupLabel;return function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(n||!(l in t)){var a=t[s];i.push({key:Kp(t,i.length),groupOption:n,data:t,label:t[o],value:a})}else{var u=t[c];void 0===u&&r&&(u=t.label),i.push({key:Kp(t,i.length),group:!0,data:t,label:u}),e(t[l],!0)}})}(e,!1),i}(we,{fieldNames:K,childrenAsData:V})},[we,K,V]),ke=function(e){var t=ae(e);if(le(t),H&&(t.length!==de.length||t.some(function(e,t){var n;return(null===(n=de[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=j?t:t.map(function(e){return e.value}),r=t.map(function(e){return Jp(pe(e.value))});H(W?n:n[0],W?r:r[0])}},Te=A(e.useState(null),2),_e=Te[0],Ce=Te[1],Se=A(e.useState(0),2),Ae=Se[0],Ne=Se[1],Ie=void 0!==_?_:"combobox"!==i,Oe=e.useCallback(function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).source,r=void 0===n?"keyboard":n;Ne(t),s&&"combobox"===i&&null!==e&&"keyboard"===r&&Ce(String(e))},[s,i]),Le=function(e,t,n){var r=function(){var t,n=pe(e);return[j?{label:null==n?void 0:n[K.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,Jp(n)]};if(t&&f){var i=A(r(),2),a=i[0],o=i[1];f(a,o)}else if(!t&&g&&"clear"!==n){var s=A(r(),2),l=s[0],c=s[1];g(l,c)}},Me=Bf(function(e,t){var n,r=!W||t.selected;n=r?W?[].concat(M(de),[e]):[e]:de.filter(function(t){return t.value!==e}),ke(n),Le(e,r),"combobox"===i?Ce(""):af&&!p||(ee(""),Ce(""))}),Re=e.useMemo(function(){var e=!1!==S&&!1!==y;return D(D({},te),{},{flattenOptions:Ee,onActiveValue:Oe,defaultActiveFirstOption:Ie,onSelect:Me,menuItemSelectedIcon:C,rawValues:ge,fieldNames:K,virtual:e,direction:I,listHeight:R,listItemHeight:$,childrenAsData:V,maxCount:U,optionRender:k})},[U,te,Ee,Oe,Ie,Me,C,ge,K,S,y,I,R,$,V,k]);return e.createElement(ef.Provider,{value:Re},e.createElement(of,Xe({},G,{id:q,prefixCls:o,ref:n,omitDomProps:zf,mode:i,displayValues:fe,onDisplayValuesChange:function(e,t){ke(e);var n=t.type,r=t.values;"remove"!==n&&"clear"!==n||r.forEach(function(e){Le(e.value,!1,n)})},direction:I,searchValue:J,onSearch:function(e,t){if(ee(e),Ce(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===i&&ke(e),null==h||h(e));else{var n=(e||"").trim();if(n){var r=Array.from(new Set([].concat(M(ge),[n])));ke(r),Le(n,!0),ee("")}}},autoClearSearchValue:p,onSearchSplit:function(e){var t=e;"tags"!==i&&(t=e.map(function(e){var t=re.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat(M(ge),M(t))));ke(n),n.forEach(function(e){Le(e,!0)})},dropdownMatchSelectWidth:y,OptionList:If,emptyOptions:!Ee.length,activeValue:_e,activeDescendantId:"".concat(q,"_list_").concat(Ae)})))}),Hf=jf;function Uf(e,t,n){return en({[`${e}-status-success`]:"success"===t,[`${e}-status-warning`]:"warning"===t,[`${e}-status-error`]:"error"===t,[`${e}-status-validating`]:"validating"===t,[`${e}-has-feedback`]:n})}Hf.Option=lf,Hf.OptGroup=sf;const Gf=(e,t)=>t||e,qf=()=>{const[,t]=fa(),[n]=zr("Empty"),r=new Yr(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return e.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,(null==n?void 0:n.description)||"Empty"),e.createElement("g",{fill:"none",fillRule:"evenodd"},e.createElement("g",{transform:"translate(24 31.67)"},e.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),e.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),e.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),e.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),e.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),e.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),e.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},e.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),e.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},Wf=()=>{const[,t]=fa(),[n]=zr("Empty"),{colorFill:r,colorFillTertiary:i,colorFillQuaternary:a,colorBgContainer:o}=t,{borderColor:s,shadowColor:l,contentColor:c}=h(()=>({borderColor:new Yr(r).onBackground(o).toHexString(),shadowColor:new Yr(i).onBackground(o).toHexString(),contentColor:new Yr(a).onBackground(o).toHexString()}),[r,i,a,o]);return e.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,(null==n?void 0:n.description)||"Empty"),e.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},e.createElement("ellipse",{fill:l,cx:"32",cy:"33",rx:"32",ry:"7"}),e.createElement("g",{fillRule:"nonzero",stroke:s},e.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:c}))))};var Vf=wa("Empty",e=>{const{componentCls:t,controlHeightLG:n,calc:r}=e;return(e=>{const{componentCls:t,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:o}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:o,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}})(Qi(e,{emptyImgCls:`${t}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))}),Yf=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var n;const{className:r,rootClassName:i,prefixCls:a,image:o,description:s,children:l,imageStyle:c,style:u,classNames:h,styles:d}=t,p=Yf(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:f,direction:g,className:m,style:y,classNames:v,styles:b,image:x}=Ii("empty"),w=f("empty",a),[E,k,T]=Vf(w),[_]=zr("Empty"),C=void 0!==s?s:null==_?void 0:_.description,S="string"==typeof C?C:"empty",A=null!==(n=null!=o?o:x)&&void 0!==n?n:Xf;let N=null;return N="string"==typeof A?e.createElement("img",{draggable:!1,alt:S,src:A}):A,E(e.createElement("div",Object.assign({className:en(k,T,w,m,{[`${w}-normal`]:A===Kf,[`${w}-rtl`]:"rtl"===g},r,i,v.root,null==h?void 0:h.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},b.root),y),null==d?void 0:d.root),u)},p),e.createElement("div",{className:en(`${w}-image`,v.image,null==h?void 0:h.image),style:Object.assign(Object.assign(Object.assign({},c),b.image),null==d?void 0:d.image)},N),C&&e.createElement("div",{className:en(`${w}-description`,v.description,null==h?void 0:h.description),style:Object.assign(Object.assign({},b.description),null==d?void 0:d.description)},C),l&&e.createElement("div",{className:en(`${w}-footer`,v.footer,null==h?void 0:h.footer),style:Object.assign(Object.assign({},b.footer),null==d?void 0:d.footer)},l)))};Qf.PRESENTED_IMAGE_DEFAULT=Xf,Qf.PRESENTED_IMAGE_SIMPLE=Kf;const Zf=e=>{const{componentName:r}=e,{getPrefixCls:i}=n(Si),a=i("empty");switch(r){case"Table":case"List":return t.createElement(Qf,{image:Qf.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return t.createElement(Qf,{image:Qf.PRESENTED_IMAGE_SIMPLE,className:`${a}-small`});case"Table.filter":return null;default:return t.createElement(Qf,null)}},Jf=(t,n,r=void 0)=>{var i,a;const{variant:o,[t]:s}=e.useContext(Si),l=e.useContext(Sh),c=null==s?void 0:s.variant;let u;u=void 0!==n?n:!1===r?"borderless":null!==(a=null!==(i=null!=l?l:c)&&void 0!==i?i:o)&&void 0!==a?a:"outlined";return[u,Ci.includes(u)]};function eg(e,t){return e||(e=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}})(t)}const tg=e=>{const{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:i}=e;return{position:"relative",display:"block",minHeight:t,padding:i,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},ng=e=>{const{antCls:t,componentCls:n}=e,r=`${n}-item`,i=`&${t}-slide-up-enter${t}-slide-up-enter-active`,a=`&${t}-slide-up-appear${t}-slide-up-appear-active`,o=`&${t}-slide-up-leave${t}-slide-up-leave-active`,s=`${n}-dropdown-placement-`,l=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},ma(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[`\n ${i}${s}bottomLeft,\n ${a}${s}bottomLeft\n `]:{animationName:Gl},[`\n ${i}${s}topLeft,\n ${a}${s}topLeft,\n ${i}${s}topRight,\n ${a}${s}topRight\n `]:{animationName:Wl},[`${o}${s}bottomLeft`]:{animationName:ql},[`\n ${o}${s}topLeft,\n ${o}${s}topRight\n `]:{animationName:Vl},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},tg(e)),{cursor:"pointer",transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},ga),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},tg(e)),{color:e.colorTextDisabled})}),[`${l}:has(+ ${l})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${l}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},Jl(e,"slide-up"),Jl(e,"slide-down"),Ul(e,"move-up"),Ul(e,"move-down")]},rg=e=>{const{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:s,colorIcon:l,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=e,h=`${t}-selection-overflow`;return{[h]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),[`${t}-disabled&`]:{color:o,borderColor:s,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},ig=(e,t)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,i=`${n}-selection-overflow`,a=e.multipleSelectItemHeight,o=(e=>{const{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()})(e),s=t?`${n}-${t}`:"",l=(e=>{const{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=e,a=e.max(e.calc(n).sub(r).equal(),0);return{basePadding:a,containerPadding:e.max(e.calc(a).sub(i).equal(),0),itemHeight:Le(t),itemLineHeight:Le(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}})(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},rg(e)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Le(r)} 0`,lineHeight:Le(a),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:l.itemHeight,lineHeight:Le(l.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Le(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal()},[`${i}-item + ${i}-item,\n ${n}-prefix + ${n}-selection-wrap\n `]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:l.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(o).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:Le(a),transition:`all ${e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${e.motionDurationSlow}`}})}};function ag(e,t){const{componentCls:n}=e,r=t?`${n}-${t}`:"",i={[`${n}-multiple${r}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`\n &${n}-show-arrow ${n}-selector,\n &${n}-allow-clear ${n}-selector\n `]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[ig(e,t),i]}const og=e=>{const{componentCls:t}=e,n=Qi(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=Qi(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[ag(e),ag(n,"sm"),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},ag(r,"lg")]};function sg(e,t){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),o=t?`${n}-${t}`:"";return{[`${n}-single${o}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},ma(e,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-wrap:after`]:{lineHeight:Le(a)},[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`\n ${n}-selection-item,\n ${n}-selection-placeholder\n `]:{display:"block",padding:0,lineHeight:Le(a),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`\n &${n}-show-arrow ${n}-selection-item,\n &${n}-show-arrow ${n}-selection-search,\n &${n}-show-arrow ${n}-selection-placeholder\n `]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Le(r)}`,[`${n}-selection-search-input`]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:Le(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Le(r)}`,"&:after":{display:"none"}}}}}}}function lg(e){const{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[sg(e),sg(Qi(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${Le(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`\n &${t}-show-arrow ${t}-selection-item,\n &${t}-show-arrow ${t}-selection-placeholder\n `]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},sg(Qi(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}const cg=(e,t)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Le(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${Le(i)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},ug=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},cg(e,t))}),hg=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},cg(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),ug(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),ug(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),dg=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${Le(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},pg=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},dg(e,t))}),fg=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},dg(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),pg(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),pg(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),gg=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),mg=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Le(e.lineWidth)} 0`,borderStyle:`none none ${e.lineType} none`,borderColor:t.borderColor,background:e.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,outline:0},[`${n}-prefix`]:{color:t.color}}}},yg=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},mg(e,t))}),vg=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},mg(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),yg(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),yg(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),bg=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},hg(e)),fg(e)),gg(e)),vg(e))}),xg=e=>{const{componentCls:t}=e;return{position:"relative",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:"pointer"},[`${t}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${t}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},wg=e=>{const{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},Eg=e=>{const{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=e,a={[`${n}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},ma(e)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},xg(e)),wg(e)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},ga),{[`> ${t}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},ga),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${e.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:e.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":a,"&:hover":a}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},kg=e=>{const{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:"100%"}}},Eg(e),lg(e),og(e),ng(e),{[`${t}-rtl`]:{direction:"rtl"}},$c(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]};var Tg=wa("Select",(e,{rootPrefixCls:t})=>{const n=Qi(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[kg(n),bg(n)]},e=>{const{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:o,paddingXXS:s,controlPaddingHorizontal:l,zIndexPopupBase:c,colorText:u,fontWeightStrong:h,controlItemBgActive:d,controlItemBgHover:p,colorBgContainer:f,colorFillSecondary:g,colorBgContainerDisabled:m,colorTextDisabled:y,colorPrimaryHover:v,colorPrimary:b,controlOutline:x}=e,w=2*s,E=2*r,k=Math.min(i-w,i-E),T=Math.min(a-w,a-E),_=Math.min(o-w,o-E);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:h,optionSelectedBg:d,optionActiveBg:p,optionPadding:`${(i-t*n)/2}px ${l}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:f,clearBg:f,singleItemHeightLG:o,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:k,multipleItemHeightSM:T,multipleItemHeightLG:_,multipleSelectorBgDisabled:m,multipleItemColorDisabled:y,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize),hoverBorderColor:v,activeBorderColor:b,activeOutlineColor:x,selectAffixPadding:s}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),_g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},Cg=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:_g}))},Sg=e.forwardRef(Cg),Ag={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},Ng=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Ag}))},Ig=e.forwardRef(Ng),Og={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},Lg=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Og}))},Mg=e.forwardRef(Lg);var Rg=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i,a,o,s,l;const{prefixCls:c,bordered:u,className:h,rootClassName:d,getPopupContainer:p,popupClassName:f,dropdownClassName:g,listHeight:m=256,placement:y,listItemHeight:v,size:b,disabled:x,notFoundContent:w,status:E,builtinPlacements:k,dropdownMatchSelectWidth:T,popupMatchSelectWidth:_,direction:C,style:S,allowClear:A,variant:N,dropdownStyle:I,transitionName:O,tagRender:L,maxCount:M,prefix:R,dropdownRender:D,popupRender:P,onDropdownVisibleChange:$,onOpenChange:B,styles:F,classNames:z}=n,j=Rg(n,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:H,getPrefixCls:U,renderEmpty:G,direction:q,virtual:W,popupMatchSelectWidth:V,popupOverflow:Y}=e.useContext(Si),{showSearch:X,style:K,styles:Q,className:Z,classNames:J}=Ii("select"),[,ee]=fa(),te=null!=v?v:null==ee?void 0:ee.controlHeight,ne=U("select",c),re=U(),ie=null!=C?C:q,{compactSize:ae,compactItemClassnames:oe}=al(ne,ie),[se,le]=Jf("select",N,u),ce=hs(ne),[ue,he,de]=Tg(ne,ce),pe=e.useMemo(()=>{const{mode:e}=n;if("combobox"!==e)return e===Dg?"combobox":e},[n.mode]),fe="multiple"===pe||"tags"===pe,ge=function(e,t){return void 0!==t?t:null!==e}(n.suffixIcon,n.showArrow),me=null!==(i=null!=_?_:T)&&void 0!==i?i:V,ye=(null===(a=null==F?void 0:F.popup)||void 0===a?void 0:a.root)||(null===(o=Q.popup)||void 0===o?void 0:o.root)||I,ve=(be=P||D,t.useMemo(()=>{if(be)return(...e)=>t.createElement(Ah,{space:!0},be.apply(void 0,e))},[be]));var be;const xe=B||$,{status:we,hasFeedback:Ee,isFormItemInput:ke,feedbackIcon:Te}=e.useContext(_h),_e=Gf(we,E);let Ce;Ce=void 0!==w?w:"combobox"===pe?null:(null==G?void 0:G("Select"))||e.createElement(Zf,{componentName:"Select"});const{suffixIcon:Se,itemIcon:Ae,removeIcon:Ne,clearIcon:Ie}=function({suffixIcon:t,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:a,multiple:o,hasFeedback:s,prefixCls:l,showSuffixIcon:c,feedbackIcon:u,showArrow:h,componentName:d}){const p=null!=n?n:e.createElement(Xo,null),f=n=>null!==t||s||h?e.createElement(e.Fragment,null,!1!==c&&n,s&&u):null;let g=null;if(void 0!==t)g=f(t);else if(a)g=f(e.createElement(gs,{spin:!0}));else{const t=`${l}-suffix`;g=({open:n,showSearch:r})=>f(n&&r?e.createElement(Mg,{className:t}):e.createElement(Ig,{className:t}))}let m=null;m=void 0!==r?r:o?e.createElement(Sg,null):null;let y=null;return y=void 0!==i?i:e.createElement(Zo,null),{clearIcon:p,suffixIcon:g,itemIcon:m,removeIcon:y}}(Object.assign(Object.assign({},j),{multiple:fe,hasFeedback:Ee,feedbackIcon:Te,showSuffixIcon:ge,prefixCls:ne,componentName:"Select"})),Oe=!0===A?{clearIcon:Ie}:A,Le=Vs(j,["suffixIcon","itemIcon"]),Me=en((null===(s=null==z?void 0:z.popup)||void 0===s?void 0:s.root)||(null===(l=null==J?void 0:J.popup)||void 0===l?void 0:l.root)||f||g,{[`${ne}-dropdown-${ie}`]:"rtl"===ie},d,J.root,null==z?void 0:z.root,de,ce,he),Re=rl(e=>{var t;return null!==(t=null!=b?b:ae)&&void 0!==t?t:e}),De=e.useContext(Mi),Pe=null!=x?x:De,$e=en({[`${ne}-lg`]:"large"===Re,[`${ne}-sm`]:"small"===Re,[`${ne}-rtl`]:"rtl"===ie,[`${ne}-${se}`]:le,[`${ne}-in-form-item`]:ke},Uf(ne,_e,Ee),oe,Z,h,J.root,null==z?void 0:z.root,d,de,ce,he),Be=e.useMemo(()=>void 0!==y?y:"rtl"===ie?"bottomRight":"bottomLeft",[y,ie]),[Fe]=xs("SelectLike",null==ye?void 0:ye.zIndex);return ue(e.createElement(Hf,Object.assign({ref:r,virtual:W,showSearch:X},Le,{style:Object.assign(Object.assign(Object.assign(Object.assign({},Q.root),null==F?void 0:F.root),K),S),dropdownMatchSelectWidth:me,transitionName:Ws(re,"slide-up",O),builtinPlacements:eg(k,Y),listHeight:m,listItemHeight:te,mode:pe,prefixCls:ne,placement:Be,direction:ie,prefix:R,suffixIcon:Se,menuItemSelectedIcon:Ae,removeIcon:Ne,allowClear:Oe,notFoundContent:Ce,className:$e,getPopupContainer:p||H,dropdownClassName:Me,disabled:Pe,dropdownStyle:Object.assign(Object.assign({},ye),{zIndex:Fe}),maxCount:fe?M:void 0,tagRender:fe?L:void 0,dropdownRender:ve,onDropdownVisibleChange:xe})))},$g=e.forwardRef(Pg),Bg=((t,n)=>Gd(r=>{const{prefixCls:i,style:a}=r,o=e.useRef(null),[s,l]=e.useState(0),[c,u]=e.useState(0),[h,d]=Vi(!1,{value:r.open}),{getPrefixCls:p}=e.useContext(Si),f=p("select",i);e.useEffect(()=>{if(d(!0),"undefined"!=typeof ResizeObserver){const e=new ResizeObserver(e=>{const t=e[0].target;l(t.offsetHeight+8),u(t.offsetWidth)}),t=setInterval(()=>{var n;const r=`.${f}-dropdown`,i=null===(n=o.current)||void 0===n?void 0:n.querySelector(r);i&&(clearInterval(t),e.observe(i))},10);return()=>{clearInterval(t),e.disconnect()}}},[]);let g=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:h,visible:h,getPopupContainer:()=>o.current});Object.assign(g,{[n]:{overflow:{adjustX:!1,adjustY:!1}}});const m={paddingBottom:s,position:"relative",minWidth:c};return e.createElement("div",{ref:o,style:m},e.createElement(t,Object.assign({},g)))}))($g,"dropdownAlign");$g.SECRET_COMBOBOX_MODE_DO_NOT_USE=Dg,$g.Option=lf,$g.OptGroup=sf,$g._InternalPanelDoNotUseOrYouWillBeFired=Bg;const Fg=(e,t)=>{void 0!==(null==e?void 0:e.addEventListener)?e.addEventListener("change",t):void 0!==(null==e?void 0:e.addListener)&&e.addListener(t)},zg=(e,t)=>{void 0!==(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",t):void 0!==(null==e?void 0:e.removeListener)&&e.removeListener(t)},jg=["xxl","xl","lg","md","sm","xs"],Hg=(e,t)=>{if(t)for(const n of jg)if(e[n]&&void 0!==(null==t?void 0:t[n]))return t[n]},Ug=()=>{const[,e]=fa(),n=(e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`}))((e=>{const t=e,n=[].concat(jg).reverse();return n.forEach((e,r)=>{const i=e.toUpperCase(),a=`screen${i}Min`,o=`screen${i}`;if(!(t[a]<=t[o]))throw new Error(`${a}<=${o} fails : !(${t[a]}<=${t[o]})`);if(r{const e=new Map;let t=-1,r={};return{responsiveMap:n,matchHandlers:{},dispatch:t=>(r=t,e.forEach(e=>e(r)),e.size>=1),subscribe(n){return e.size||this.register(),t+=1,e.set(t,n),n(r),t},unsubscribe(t){e.delete(t),e.size||this.unregister()},register(){Object.entries(n).forEach(([e,t])=>{const n=({matches:t})=>{this.dispatch(Object.assign(Object.assign({},r),{[e]:t}))},i=window.matchMedia(t);Fg(i,n),this.matchHandlers[t]={mql:i,listener:n},n(i)})},unregister(){Object.values(n).forEach(e=>{const t=this.matchHandlers[e];zg(null==t?void 0:t.mql,null==t?void 0:t.listener)}),e.clear()}}},[e])};function Gg(t=!0,n={}){const r=o(n),i=function(){const[,t]=e.useReducer(e=>e+1,0);return t}(),a=Ug();return Be(()=>{const e=a.subscribe(e=>{r.current=e,t&&i()});return()=>a.unsubscribe(e)},[]),r.current}function qg(t){var n=t.children,r=t.prefixCls,i=t.id,a=t.overlayInnerStyle,o=t.bodyClassName,s=t.className,l=t.style;return e.createElement("div",{className:en("".concat(r,"-content"),s),style:l},e.createElement("div",{className:en("".concat(r,"-inner"),o),id:i,role:"tooltip",style:a},"function"==typeof n?n():n))}var Wg={shiftX:64,adjustY:1},Vg={adjustX:1,shiftY:!0},Yg=[0,0],Xg={left:{points:["cr","cl"],overflow:Vg,offset:[-4,0],targetOffset:Yg},right:{points:["cl","cr"],overflow:Vg,offset:[4,0],targetOffset:Yg},top:{points:["bc","tc"],overflow:Wg,offset:[0,-4],targetOffset:Yg},bottom:{points:["tc","bc"],overflow:Wg,offset:[0,4],targetOffset:Yg},topLeft:{points:["bl","tl"],overflow:Wg,offset:[0,-4],targetOffset:Yg},leftTop:{points:["tr","tl"],overflow:Vg,offset:[-4,0],targetOffset:Yg},topRight:{points:["br","tr"],overflow:Wg,offset:[0,-4],targetOffset:Yg},rightTop:{points:["tl","tr"],overflow:Vg,offset:[4,0],targetOffset:Yg},bottomRight:{points:["tr","br"],overflow:Wg,offset:[0,4],targetOffset:Yg},rightBottom:{points:["bl","br"],overflow:Vg,offset:[4,0],targetOffset:Yg},bottomLeft:{points:["tl","bl"],overflow:Wg,offset:[0,4],targetOffset:Yg},leftBottom:{points:["br","bl"],overflow:Vg,offset:[-4,0],targetOffset:Yg}},Kg=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Qg=function(t,n){var r=t.overlayClassName,i=t.trigger,a=void 0===i?["hover"]:i,s=t.mouseEnterDelay,l=void 0===s?0:s,c=t.mouseLeaveDelay,u=void 0===c?.1:c,h=t.overlayStyle,d=t.prefixCls,p=void 0===d?"rc-tooltip":d,f=t.children,m=t.onVisibleChange,y=t.afterVisibleChange,v=t.transitionName,b=t.animation,x=t.motion,w=t.placement,E=void 0===w?"right":w,k=t.align,T=void 0===k?{}:k,_=t.destroyTooltipOnHide,C=void 0!==_&&_,S=t.defaultVisible,A=t.getTooltipContainer,N=t.overlayInnerStyle;t.arrowContent;var I=t.overlay,O=t.id,L=t.showArrow,M=void 0===L||L,R=t.classNames,P=t.styles,$=X(t,Kg),B=cu(O),F=o(null);g(n,function(){return F.current});var z=D({},$);"visible"in t&&(z.popupVisible=t.visible);var j,H;return e.createElement(Wp,Xe({popupClassName:en(r,null==R?void 0:R.root),prefixCls:p,popup:function(){return e.createElement(qg,{key:"content",prefixCls:p,id:B,bodyClassName:null==R?void 0:R.body,overlayInnerStyle:D(D({},N),null==P?void 0:P.body)},I)},action:a,builtinPlacements:Xg,popupPlacement:E,ref:F,popupAlign:T,getPopupContainer:A,onPopupVisibleChange:m,afterPopupVisibleChange:y,popupTransitionName:v,popupAnimation:b,popupMotion:x,defaultPopupVisible:S,autoDestroy:C,mouseLeaveDelay:u,popupStyle:D(D({},h),null==P?void 0:P.root),mouseEnterDelay:l,arrow:M},z),(j=e.Children.only(f),H=D(D({},(null==j?void 0:j.props)||{}),{},{"aria-describedby":I?B:null}),e.cloneElement(f,H)))},Zg=u(Qg);const Jg=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:o,borderRadiusXS:s,calc:l}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:l(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:o,height:o,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Le(s)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}};function em(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?8:r}}function tm(e,t){return e?t:{}}function nm(e,t,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:o}=e,{arrowDistance:s=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},Jg(e,t,i)),{"&:before":{background:t}})]},tm(!!l.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:s,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Le(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),tm(!!l.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:s,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Le(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),tm(!!l.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:s},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),tm(!!l.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:s},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}const rm={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},im={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},am=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function om(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=e,o=t/2,s={},l=em({contentRadius:a,limitVerticalRadius:!0});return Object.keys(rm).forEach(e=>{const a=r&&im[e]||rm[e],c=Object.assign(Object.assign({},a),{offset:[0,0],dynamicInset:!0});switch(s[e]=c,am.has(e)&&(c.autoArrow=!1),e){case"top":case"topLeft":case"topRight":c.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":c.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":c.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":c.offset[0]=o+i}if(r)switch(e){case"topLeft":case"bottomLeft":c.offset[0]=-l.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":c.offset[0]=l.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":c.offset[1]=2*-l.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":c.offset[1]=2*l.arrowOffsetHorizontal-o}c.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+n,a.shiftX=!0,a.adjustX=!0}const o=Object.assign(Object.assign({},a),i);return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}(e,l,t,n),c.htmlRegion="visibleFirst"}),s}const sm=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:l,boxShadowSecondary:c,paddingSM:u,paddingXS:h,arrowOffsetHorizontal:d,sizePopupArrow:p}=e,f=t(o).add(p).add(d).equal(),g=t(o).mul(2).add(p).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:g,minHeight:l,padding:`${Le(e.calc(u).div(2).equal())} ${Le(h)}`,color:`var(--ant-tooltip-color, ${i})`,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:o,boxShadow:c,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:f},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(o,8)}},[`${n}-content`]:{position:"relative"}}),Ta(e,(e,{darkColor:t})=>({[`&${n}-${e}`]:{[`${n}-inner`]:{backgroundColor:t},[`${n}-arrow`]:{"--antd-arrow-background-color":t}}}))),{"&-rtl":{direction:"rtl"}})},nm(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},lm=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},em({contentRadius:e.borderRadius,limitVerticalRadius:!0})),function(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,i=t/2,a=i,o=1*r/Math.sqrt(2),s=i-r*(1-1/Math.sqrt(2)),l=i-n*(1/Math.sqrt(2)),c=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),u=2*i-l,h=c,d=2*i-o,p=s,f=2*i-0,g=a,m=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),y=r*(Math.sqrt(2)-1);return{arrowShadowWidth:m,arrowPath:`path('M 0 ${a} A ${r} ${r} 0 0 0 ${o} ${s} L ${l} ${c} A ${n} ${n} 0 0 1 ${u} ${h} L ${d} ${p} A ${r} ${r} 0 0 0 ${f} ${g} Z')`,arrowPolygon:`polygon(${y}px 100%, 50% ${y}px, ${2*i-y}px 100%, ${y}px 100%)`}}(Qi(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));var cm=(e,t=!0)=>{const n=wa("Tooltip",e=>{const{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e,i=Qi(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r});return[sm(i),sc(e,"zoom-big-fast")]},lm,{resetStyle:!1,injectStyle:t});return n(e)};const um=ia.map(e=>`${e}-inverse`),hm=["success","processing","error","default","warning"];function dm(e,t=!0){return t?[].concat(M(um),M(ia)).includes(e):ia.includes(e)}function pm(e,t){const n=dm(t),r=en({[`${e}-${t}`]:t&&n}),i={},a={},o=(e=>e instanceof Cl?e:new Cl(e))(t).toRgb(),s=(.299*o.r+.587*o.g+.114*o.b)/255<.5?"#FFF":"#000";return t&&!n&&(i.background=t,i["--ant-tooltip-color"]=s,a["--antd-arrow-background-color"]=t),{className:r,overlayStyle:i,arrowStyle:a}}var fm=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r,i;const{prefixCls:a,openClassName:o,getTooltipContainer:s,color:l,overlayInnerStyle:c,children:u,afterOpenChange:h,afterVisibleChange:d,destroyTooltipOnHide:p,destroyOnHidden:f,arrow:g=!0,title:m,overlay:y,builtinPlacements:v,arrowPointAtCenter:b=!1,autoAdjustOverflow:x=!0,motion:w,getPopupContainer:E,placement:k="top",mouseEnterDelay:T=.1,mouseLeaveDelay:_=.1,overlayStyle:C,rootClassName:S,overlayClassName:A,styles:N,classNames:I}=t,O=fm(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),L=!!g,[,M]=fa(),{getPopupContainer:R,getPrefixCls:D,direction:P,className:$,style:B,classNames:F,styles:z}=Ii("tooltip"),j=Sr(),H=e.useRef(null),U=()=>{var e;null===(e=H.current)||void 0===e||e.forceAlign()};e.useImperativeHandle(n,()=>{var e,t;return{forceAlign:U,forcePopupAlign:()=>{j.deprecated(!1,"forcePopupAlign","forceAlign"),U()},nativeElement:null===(e=H.current)||void 0===e?void 0:e.nativeElement,popupElement:null===(t=H.current)||void 0===t?void 0:t.popupElement}});const[G,q]=Vi(!1,{value:null!==(r=t.open)&&void 0!==r?r:t.visible,defaultValue:null!==(i=t.defaultOpen)&&void 0!==i?i:t.defaultVisible}),W=!m&&!y&&0!==m,V=e.useMemo(()=>{var e,t;let n=b;return"object"==typeof g&&(n=null!==(t=null!==(e=g.pointAtCenter)&&void 0!==e?e:g.arrowPointAtCenter)&&void 0!==t?t:b),v||om({arrowPointAtCenter:n,autoAdjustOverflow:x,arrowWidth:L?M.sizePopupArrow:0,borderRadius:M.borderRadius,offset:M.marginXXS})},[b,g,v,M]),Y=e.useMemo(()=>0===m?m:y||m||"",[y,m]),X=e.createElement(Ah,{space:!0},"function"==typeof Y?Y():Y),K=D("tooltip",a),Q=D(),Z=t["data-popover-inject"];let J=G;"open"in t||"visible"in t||!W||(J=!1);const ee=e.isValidElement(u)&&!ls(u)?u:e.createElement("span",null,u),te=ee.props,ne=te.className&&"string"!=typeof te.className?te.className:en(te.className,o||`${K}-open`),[re,ie,ae]=cm(K,!Z),oe=pm(K,l),se=oe.arrowStyle,le=en(A,{[`${K}-rtl`]:"rtl"===P},oe.className,S,ie,ae,$,F.root,null==I?void 0:I.root),ce=en(F.body,null==I?void 0:I.body),[ue,he]=xs("Tooltip",O.zIndex),de=e.createElement(Zg,Object.assign({},O,{zIndex:ue,showArrow:L,placement:k,mouseEnterDelay:T,mouseLeaveDelay:_,prefixCls:K,classNames:{root:le,body:ce},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},se),z.root),B),C),null==N?void 0:N.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},z.body),c),null==N?void 0:N.body),oe.overlayStyle)},getTooltipContainer:E||s||R,ref:H,builtinPlacements:V,overlay:X,visible:J,onVisibleChange:e=>{var n,r;q(!W&&e),W||(null===(n=t.onOpenChange)||void 0===n||n.call(t,e),null===(r=t.onVisibleChange)||void 0===r||r.call(t,e))},afterVisibleChange:null!=h?h:d,arrowContent:e.createElement("span",{className:`${K}-arrow-content`}),motion:{motionName:Ws(Q,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:null!=f?f:!!p}),J?us(ee,{className:ne}):ee);return re(e.createElement(ms.Provider,{value:he},de))}),mm=gm;mm._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:n,className:r,placement:i="top",title:a,color:o,overlayInnerStyle:s}=t,{getPrefixCls:l}=e.useContext(Si),c=l("tooltip",n),[u,h,d]=cm(c),p=pm(c,o),f=p.arrowStyle,g=Object.assign(Object.assign({},s),p.overlayStyle),m=en(h,d,c,`${c}-pure`,`${c}-placement-${i}`,r,p.className);return u(e.createElement("div",{className:m,style:f},e.createElement("div",{className:`${c}-arrow`}),e.createElement(qg,Object.assign({},t,{className:h,prefixCls:c,overlayInnerStyle:g}),a)))};var ym={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},vm=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ym}))},bm=e.forwardRef(vm),xm={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},wm=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:xm}))},Em=e.forwardRef(wm);const km=e.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),Tm=e=>{const{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:i,controlHeightSM:a,marginXXS:o,colorTextLightSolid:s,colorBgContainer:l}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:`0 ${c}px`,headerColor:i,footerPadding:`${a}px ${c}px`,footerBg:t,siderBg:"#001529",triggerHeight:r+2*o,triggerBg:"#002140",triggerColor:s,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:l,lightTriggerBg:l,lightTriggerColor:i}},_m=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];var Cm=wa("Layout",e=>{const{antCls:t,componentCls:n,colorText:r,footerBg:i,headerHeight:a,headerPadding:o,headerColor:s,footerPadding:l,fontSize:c,bodyBg:u,headerBg:h}=e;return{[n]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:u,"&, *":{boxSizing:"border-box"},[`&${n}-has-sider`]:{flexDirection:"row",[`> ${n}, > ${n}-content`]:{width:0}},[`${n}-header, &${n}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${n}-header`]:{height:a,padding:o,color:s,lineHeight:Le(a),background:h,[`${t}-menu`]:{lineHeight:"inherit"}},[`${n}-footer`]:{padding:l,color:r,fontSize:c,background:i},[`${n}-content`]:{flex:"auto",color:r,minHeight:0}}},Tm,{deprecatedTokens:_m});var Sm=wa(["Layout","Sider"],e=>{const{componentCls:t,siderBg:n,motionDurationMid:r,motionDurationSlow:i,antCls:a,triggerHeight:o,triggerColor:s,triggerBg:l,headerHeight:c,zeroTriggerWidth:u,zeroTriggerHeight:h,borderRadiusLG:d,lightSiderBg:p,lightTriggerColor:f,lightTriggerBg:g,bodyBg:m}=e;return{[t]:{position:"relative",minWidth:0,background:n,transition:`all ${r}, background 0s`,"&-has-trigger":{paddingBottom:o},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${a}-menu${a}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:o,color:s,lineHeight:Le(o),textAlign:"center",background:l,cursor:"pointer",transition:`all ${r}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:c,insetInlineEnd:e.calc(u).mul(-1).equal(),zIndex:1,width:u,height:h,color:s,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:n,borderRadius:`0 ${Le(d)} ${Le(d)} 0`,cursor:"pointer",transition:`background ${i} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${i}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(u).mul(-1).equal(),borderRadius:`${Le(d)} 0 0 ${Le(d)}`}},"&-light":{background:p,[`${t}-trigger`]:{color:f,background:g},[`${t}-zero-width-trigger`]:{color:f,background:g,border:`1px solid ${m}`,borderInlineStart:0}}}}},Tm,{deprecatedTokens:_m}),Am=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),Lm=e.forwardRef((t,r)=>{const{prefixCls:i,className:a,trigger:s,children:c,defaultCollapsed:u=!1,theme:h="dark",style:p={},collapsible:f=!1,reverseArrow:g=!1,width:m=200,collapsedWidth:y=80,zeroWidthTriggerStyle:v,breakpoint:b,onCollapse:x,onBreakpoint:w}=t,E=Am(t,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:k}=n(km),[T,_]=d("collapsed"in t?t.collapsed:u),[C,S]=d(!1);l(()=>{"collapsed"in t&&_(t.collapsed)},[t.collapsed]);const A=(e,n)=>{"collapsed"in t||_(e),null==x||x(e,n)},{getPrefixCls:N,direction:I}=n(Si),O=N("layout-sider",i),[L,M,R]=Sm(O),D=o(null);D.current=e=>{S(e.matches),null==w||w(e.matches),T!==e.matches&&A(e.matches,"responsive")},l(()=>{function e(e){var t;return null===(t=D.current)||void 0===t?void 0:t.call(D,e)}let t;return void 0!==(null===window||void 0===window?void 0:window.matchMedia)&&b&&b in Nm&&(t=window.matchMedia(`screen and (max-width: ${Nm[b]})`),Fg(t,e),e(t)),()=>{zg(t,e)}},[b]),l(()=>{const e=Om("ant-sider-");return k.addSider(e),()=>k.removeSider(e)},[]);const P=()=>{A(!T,"clickTrigger")},$=Vs(E,["collapsed"]),B=T?y:m,F=(e=>!Number.isNaN(Number.parseFloat(e))&&isFinite(e))(B)?`${B}px`:String(B),z=0===parseFloat(String(y||0))?e.createElement("span",{onClick:P,className:en(`${O}-zero-width-trigger`,`${O}-zero-width-trigger-${g?"right":"left"}`),style:v},s||e.createElement(Em,null)):null,j="rtl"===I==!g,H={expanded:j?e.createElement(Nl,null):e.createElement(bm,null),collapsed:j?e.createElement(bm,null):e.createElement(Nl,null)}[T?"collapsed":"expanded"],U=null!==s?z||e.createElement("div",{className:`${O}-trigger`,onClick:P,style:{width:F}},s||H):null,G=Object.assign(Object.assign({},p),{flex:`0 0 ${F}`,maxWidth:F,minWidth:F,width:F}),q=en(O,`${O}-${h}`,{[`${O}-collapsed`]:!!T,[`${O}-has-trigger`]:f&&null!==s&&!z,[`${O}-below`]:!!C,[`${O}-zero-width`]:0===parseFloat(F)},a,M,R),W=e.useMemo(()=>({siderCollapsed:T}),[T]);return L(e.createElement(Im.Provider,{value:W},e.createElement("aside",Object.assign({className:q},$,{style:G,ref:r}),e.createElement("div",{className:`${O}-children`},c),f||C&&z?U:null)))});var Mm={exports:{}};Mm.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",a="minute",o="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|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,m={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 t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;x[s]=t,i=s}return!r&&i&&(b=i),i||!r&&b},T=function(e,t){if(E(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},_=v;_.l=k,_.i=E,_.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function m(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var y=m.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(f);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return _},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return T(e)68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},h=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[a,function(e){this.afternoon=h(e,!1)}],a:[a,function(e){this.afternoon=h(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,l("seconds")],ss:[i,l("seconds")],m:[i,l("minutes")],mm:[i,l("minutes")],H:[i,l("hours")],h:[i,l("hours")],HH:[i,l("hours")],hh:[i,l("hours")],D:[i,l("day")],DD:[r,l("day")],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[i,l("week")],ww:[r,l("week")],M:[i,l("month")],MM:[r,l("month")],MMM:[a,function(e){var t=u("months"),n=(u("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function p(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),s=a.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,l=i.hours,c=i.minutes,u=i.seconds,h=i.milliseconds,d=i.zone,f=i.week,g=new Date,m=s||(a||o?1:g.getDate()),y=a||g.getFullYear(),v=0;a&&!o||(v=o>0?o-1:g.getMonth());var b,x=l||0,w=c||0,E=u||0,k=h||0;return d?new Date(Date.UTC(y,v,m,x,w,E,k+60*d.offset*1e3)):n?new Date(Date.UTC(y,v,m,x,w,E,k)):(b=new Date(y,v,m,x,w,E,k),f&&(b=r(b).week(f).toDate()),b)}catch(e){return new Date("")}}(t,s,r,n),this.init(),h&&!0!==h&&(this.$L=this.locale(h).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var d=s.length,f=1;f<=d;f+=1){a[1]=s[f-1];var g=n.apply(this,a);if(g.isValid()){this.$d=g.$d,this.$L=g.$L,this.init();break}f===d&&(this.$d=new Date(""))}else i.call(this,e)}}}();var Bm=Zt($m.exports),Fm=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],zm=u(function(t,n){var r=t.prefixCls,i=void 0===r?"rc-checkbox":r,a=t.className,s=t.style,l=t.checked,c=t.disabled,u=t.defaultChecked,h=void 0!==u&&u,d=t.type,p=void 0===d?"checkbox":d,f=t.title,m=t.onChange,y=X(t,Fm),v=o(null),b=o(null),x=A(Vi(h,{value:l}),2),w=x[0],E=x[1];g(n,function(){return{focus:function(e){var t;null===(t=v.current)||void 0===t||t.focus(e)},blur:function(){var e;null===(e=v.current)||void 0===e||e.blur()},input:v.current,nativeElement:b.current}});var k=en(i,a,O(O({},"".concat(i,"-checked"),w),"".concat(i,"-disabled"),c));return e.createElement("span",{className:k,title:f,style:s,ref:b},e.createElement("input",Xe({},y,{className:"".concat(i,"-input"),ref:v,onChange:function(e){c||("checked"in t||E(e.target.checked),null==m||m({target:D(D({},t),{},{type:p,checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},disabled:c,checked:!!w,type:p})),e.createElement("span",{className:"".concat(i,"-inner")}))});function jm(e){return Qi(e,{inputAffixPadding:e.paddingXXS})}const Hm=e=>{const{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:i,controlHeightSM:a,controlHeightLG:o,fontSizeLG:s,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:h,colorFillAlter:d,colorPrimaryHover:p,colorPrimary:f,controlOutlineWidth:g,controlOutline:m,colorErrorOutline:y,colorWarningOutline:v,colorBgContainer:b,inputFontSize:x,inputFontSizeLG:w,inputFontSizeSM:E}=e,k=x||n,T=E||k,_=w||s,C=Math.round((t-k*r)/2*10)/10-i,S=Math.round((a-T*r)/2*10)/10-i,A=Math.ceil((o-_*l)/2*10)/10-i;return{paddingBlock:Math.max(C,0),paddingBlockSM:Math.max(S,0),paddingBlockLG:Math.max(A,0),paddingInline:c-i,paddingInlineSM:u-i,paddingInlineLG:h-i,addonBg:d,activeBorderColor:f,hoverBorderColor:p,activeShadow:`0 0 0 ${g}px ${m}`,errorActiveShadow:`0 0 0 ${g}px ${y}`,warningActiveShadow:`0 0 0 ${g}px ${v}`,hoverBg:b,activeBg:b,inputFontSize:k,inputFontSizeLG:_,inputFontSizeSM:T}},Um=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),Gm=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},Um(Qi(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),qm=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),Wm=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},qm(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),Vm=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},qm(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gm(e))}),Wm(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),Wm(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),Ym=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),Xm=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},Ym(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),Ym(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:Object.assign({},Gm(e))}})}),Km=(e,t)=>{const{componentCls:n}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${n}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${n}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},Qm=(e,t)=>{var n;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null!==(n=null==t?void 0:t.inputColor)&&void 0!==n?n:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},Zm=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},Qm(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}})}),Jm=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Qm(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gm(e))}),Zm(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),Zm(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),ey=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),ty=e=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},ey(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),ey(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}})}),ny=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Le(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.borderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),ry=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},ny(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),iy=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ny(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),ry(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),ry(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),ay=e=>{const{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:r,paddingInlineLG:i}=e;return{padding:`${Le(t)} ${Le(i)}`,fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:r}},oy=e=>({padding:`${Le(e.paddingBlockSM)} ${Le(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),sy=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Le(e.paddingBlock)} ${Le(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},(e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}))(e.colorTextPlaceholder)),{"&-lg":Object.assign({},ay(e)),"&-sm":Object.assign({},oy(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),ly=e=>{const{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Object.assign({},ay(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Object.assign({},oy(e)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Le(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Le(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Le(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}}},[`${n}-cascader-picker`]:{margin:`-9px ${Le(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Object.assign(Object.assign({display:"block"},{"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`\n & > ${t}-affix-wrapper,\n & > ${t}-number-affix-wrapper,\n & > ${n}-picker-range\n `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},[`& > ${n}-select > ${n}-select-selector,\n & > ${n}-select-auto-complete ${t},\n & > ${n}-cascader-picker ${t},\n & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,\n & > ${n}-select:first-child > ${n}-select-selector,\n & > ${n}-select-auto-complete:first-child ${t},\n & > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,\n & > ${n}-select:last-child > ${n}-select-selector,\n & > ${n}-cascader-picker:last-child ${t},\n & > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:"top"},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},cy=e=>{const{componentCls:t,controlHeightSM:n,lineWidth:r,calc:i}=e,a=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),sy(e)),Vm(e)),Jm(e)),Km(e)),iy(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},uy=e=>{const{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${e.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Le(e.inputAffixPadding)}`}}}},hy=e=>{const{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e,l=`${t}-affix-wrapper`,c=`${t}-affix-wrapper-disabled`;return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},sy(e)),{display:"inline-flex",[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),uy(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:"pointer",transition:`all ${i}`,"&:hover":{color:o}}}),[`${t}-underlined`]:{borderRadius:0},[c]:{[`${s}${t}-password-icon`]:{color:a,cursor:"not-allowed","&:hover":{color:a}}}}},dy=e=>{const{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},ma(e)),ly(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},Xm(e)),ty(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},py=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${t}-compact-item`]:{[`&:not(${t}-compact-last-item)`]:{[`${t}-group-addon`]:{[`${t}-search-button`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${t}-compact-first-item)`]:{[`${t},${t}-affix-wrapper`]:{borderRadius:0}},[`> ${t}-group-addon ${t}-search-button,\n > ${t},\n ${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},fy=e=>{const{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},gy=wa(["Input","Shared"],e=>{const t=Qi(e,jm(e));return[cy(t),hy(t)]},Hm,{resetFont:!1});var my=wa(["Input","Component"],e=>{const t=Qi(e,jm(e));return[dy(t),py(t),fy(t),$c(t)]},Hm,{resetFont:!1});function yy(e,t,n){var r={}.atBegin;return function(e,t,n){var r,i=n||{},a=i.noTrailing,o=void 0!==a&&a,s=i.noLeading,l=void 0!==s&&s,c=i.debounceMode,u=void 0===c?void 0:c,h=!1,d=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,i=new Array(n),a=0;ae?l?(d=Date.now(),o||(r=setTimeout(u?g:f,e))):f():!0!==o&&(r=setTimeout(u?g:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),h=!n},f}(e,t,{debounceMode:!1!==(void 0!==r&&r)})}function vy(e,t){return(e=>{const{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},ma(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},ma(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},ma(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:ya(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${Le(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`\n ${n}:not(${n}-disabled),\n ${t}:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`\n ${n}-checked:not(${n}-disabled),\n ${t}-checked:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]})(Qi(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}var by=wa("Checkbox",(e,{prefixCls:t})=>[vy(t,e)]);const xy=t.createContext(null);var wy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i;const{prefixCls:a,className:o,rootClassName:s,children:l,indeterminate:c=!1,style:u,onMouseEnter:h,onMouseLeave:d,skipGroup:p=!1,disabled:f}=n,g=wy(n,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:m,direction:y,checkbox:v}=e.useContext(Si),b=e.useContext(xy),{isFormItemInput:x}=e.useContext(_h),w=e.useContext(Mi),E=null!==(i=(null==b?void 0:b.disabled)||f)&&void 0!==i?i:w,k=e.useRef(g.value),T=e.useRef(null),_=In(r,T);e.useEffect(()=>{null==b||b.registerValue(g.value)},[]),e.useEffect(()=>{if(!p)return g.value!==k.current&&(null==b||b.cancelValue(k.current),null==b||b.registerValue(g.value),k.current=g.value),()=>null==b?void 0:b.cancelValue(g.value)},[g.value]),e.useEffect(()=>{var e;(null===(e=T.current)||void 0===e?void 0:e.input)&&(T.current.input.indeterminate=c)},[c]);const C=m("checkbox",a),S=hs(C),[A,N,I]=by(C,S),O=Object.assign({},g);b&&!p&&(O.onChange=(...e)=>{g.onChange&&g.onChange.apply(g,e),b.toggleOption&&b.toggleOption({label:l,value:g.value})},O.name=b.name,O.checked=b.value.includes(g.value));const L=en(`${C}-wrapper`,{[`${C}-rtl`]:"rtl"===y,[`${C}-wrapper-checked`]:O.checked,[`${C}-wrapper-disabled`]:E,[`${C}-wrapper-in-form-item`]:x},null==v?void 0:v.className,o,s,I,S,N),M=en({[`${C}-indeterminate`]:c},Ks,N),[R,D]=function(e){const n=t.useRef(null),r=()=>{mr.cancel(n.current),n.current=null};return[()=>{r(),n.current=mr(()=>{n.current=null})},t=>{n.current&&(t.stopPropagation(),r()),null==e||e(t)}]}(O.onClick);return A(e.createElement(nl,{component:"Checkbox",disabled:E},e.createElement("label",{className:L,style:Object.assign(Object.assign({},null==v?void 0:v.style),u),onMouseEnter:h,onMouseLeave:d,onClick:R},e.createElement(zm,Object.assign({},O,{onClick:D,prefixCls:C,className:M,disabled:E,ref:_})),null!=l&&e.createElement("span",{className:`${C}-label`},l))))},ky=e.forwardRef(Ey);var Ty=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{defaultValue:r,children:i,options:a=[],prefixCls:o,className:s,rootClassName:l,style:c,onChange:u}=t,h=Ty(t,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:d,direction:p}=e.useContext(Si),[f,g]=e.useState(h.value||r||[]),[m,y]=e.useState([]);e.useEffect(()=>{"value"in h&&g(h.value||[])},[h.value]);const v=e.useMemo(()=>a.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[a]),b=e=>{y(t=>t.filter(t=>t!==e))},x=e=>{y(t=>[].concat(M(t),[e]))},w=e=>{const t=f.indexOf(e.value),n=M(f);-1===t?n.push(e.value):n.splice(t,1),"value"in h||g(n),null==u||u(n.filter(e=>m.includes(e)).sort((e,t)=>v.findIndex(t=>t.value===e)-v.findIndex(e=>e.value===t)))},E=d("checkbox",o),k=`${E}-group`,T=hs(E),[_,C,S]=by(E,T),A=Vs(h,["value","disabled"]),N=a.length?v.map(t=>e.createElement(ky,{prefixCls:E,key:t.value.toString(),disabled:"disabled"in t?t.disabled:h.disabled,value:t.value,checked:f.includes(t.value),onChange:t.onChange,className:en(`${k}-item`,t.className),style:t.style,title:t.title,id:t.id,required:t.required},t.label)):i,I=e.useMemo(()=>({toggleOption:w,value:f,disabled:h.disabled,name:h.name,registerValue:x,cancelValue:b}),[w,f,h.disabled,h.name,x,b]),O=en(k,{[`${k}-rtl`]:"rtl"===p},s,l,S,T,C);return _(e.createElement("div",Object.assign({className:O,style:c},A,{ref:n}),e.createElement(xy.Provider,{value:I},N)))}),Cy=ky;Cy.Group=_y,Cy.__ANT_CHECKBOX=!0;const Sy=a({});var Ay=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{getPrefixCls:r,direction:i}=e.useContext(Si),{gutter:a,wrap:o}=e.useContext(Sy),{prefixCls:s,span:l,order:c,offset:u,push:h,pull:d,className:p,children:f,flex:g,style:m}=t,y=Ay(t,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),v=r("col",s),[b,x,w]=hd(v),E={};let k={};Iy.forEach(e=>{let n={};const r=t[e];"number"==typeof r?n.span=r:"object"==typeof r&&(n=r||{}),delete y[e],k=Object.assign(Object.assign({},k),{[`${v}-${e}-${n.span}`]:void 0!==n.span,[`${v}-${e}-order-${n.order}`]:n.order||0===n.order,[`${v}-${e}-offset-${n.offset}`]:n.offset||0===n.offset,[`${v}-${e}-push-${n.push}`]:n.push||0===n.push,[`${v}-${e}-pull-${n.pull}`]:n.pull||0===n.pull,[`${v}-rtl`]:"rtl"===i}),n.flex&&(k[`${v}-${e}-flex`]=!0,E[`--${v}-${e}-flex`]=Ny(n.flex))});const T=en(v,{[`${v}-${l}`]:void 0!==l,[`${v}-order-${c}`]:c,[`${v}-offset-${u}`]:u,[`${v}-push-${h}`]:h,[`${v}-pull-${d}`]:d},p,k,x,w),_={};if(a&&a[0]>0){const e=a[0]/2;_.paddingLeft=e,_.paddingRight=e}return g&&(_.flex=Ny(g),!1!==o||_.minWidth||(_.minWidth=0)),b(e.createElement("div",Object.assign({},y,{style:Object.assign(Object.assign(Object.assign({},_),m),E),className:T,ref:n}),f))});var Ly=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{(()=>{if("string"==typeof t&&i(t),"object"==typeof t)for(let e=0;e{const{prefixCls:r,justify:i,align:a,className:o,style:s,children:l,gutter:c=0,wrap:u}=t,h=Ly(t,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:p}=e.useContext(Si),f=Gg(!0,null),g=My(a,f),m=My(i,f),y=d("row",r),[v,b,x]=cd(y),w=function(e,t){const n=[void 0,void 0],r=Array.isArray(e)?e:[e,void 0],i=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return r.forEach((e,t)=>{if("object"==typeof e&&null!==e)for(let r=0;r0?w[0]/-2:void 0;T&&(k.marginLeft=T,k.marginRight=T);const[_,C]=w;k.rowGap=C;const S=e.useMemo(()=>({gutter:[_,C],wrap:u}),[_,C,u]);return v(e.createElement(Sy.Provider,{value:S},e.createElement("div",Object.assign({},h,{className:E,style:Object.assign(Object.assign({},k),s),ref:n}),l)))});function Dy(e,t,n){var r=t.cloneNode(!0),i=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},i}function Py(e,t,n,r){if(n){var i=t;"click"!==t.type?"file"===e.type||void 0===r?n(i):n(i=Dy(t,e,r)):n(i=Dy(t,e,""))}}function $y(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}var By=t.forwardRef(function(e,n){var r,i,a,s=e.inputElement,l=e.children,c=e.prefixCls,u=e.prefix,h=e.suffix,d=e.addonBefore,p=e.addonAfter,f=e.className,g=e.style,y=e.disabled,v=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,E=e.value,k=e.handleReset,T=e.hidden,_=e.classes,C=e.classNames,S=e.dataAttrs,A=e.styles,I=e.components,L=e.onClear,M=null!=l?l:s,R=(null==I?void 0:I.affixWrapper)||"span",P=(null==I?void 0:I.groupWrapper)||"span",$=(null==I?void 0:I.wrapper)||"span",B=(null==I?void 0:I.groupAddon)||"span",F=o(null),z=function(e){return!!(e.prefix||e.suffix||e.allowClear)}(e),j=m(M,{value:E,className:en(null===(r=M.props)||void 0===r?void 0:r.className,!z&&(null==C?void 0:C.variant))||null}),H=o(null);if(t.useImperativeHandle(n,function(){return{nativeElement:H.current||F.current}}),z){var U=null;if(w){var G=!y&&!v&&E,q="".concat(c,"-clear-icon"),W="object"===N(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";U=t.createElement("button",{type:"button",tabIndex:-1,onClick:function(e){null==k||k(e),null==L||L()},onMouseDown:function(e){return e.preventDefault()},className:en(q,O(O({},"".concat(q,"-hidden"),!G),"".concat(q,"-has-suffix"),!!h))},W)}var V="".concat(c,"-affix-wrapper"),Y=en(V,O(O(O(O(O({},"".concat(c,"-disabled"),y),"".concat(V,"-disabled"),y),"".concat(V,"-focused"),b),"".concat(V,"-readonly"),v),"".concat(V,"-input-with-clear-btn"),h&&w&&E),null==_?void 0:_.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),X=(h||w)&&t.createElement("span",{className:en("".concat(c,"-suffix"),null==C?void 0:C.suffix),style:null==A?void 0:A.suffix},U,h);j=t.createElement(R,Xe({className:Y,style:null==A?void 0:A.affixWrapper,onClick:function(e){var t;null!==(t=F.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==S?void 0:S.affixWrapper,{ref:F}),u&&t.createElement("span",{className:en("".concat(c,"-prefix"),null==C?void 0:C.prefix),style:null==A?void 0:A.prefix},u),j,X)}if(function(e){return!(!e.addonBefore&&!e.addonAfter)}(e)){var K="".concat(c,"-group"),Q="".concat(K,"-addon"),Z="".concat(K,"-wrapper"),J=en("".concat(c,"-wrapper"),K,null==_?void 0:_.wrapper,null==C?void 0:C.wrapper),ee=en(Z,O({},"".concat(Z,"-disabled"),y),null==_?void 0:_.group,null==C?void 0:C.groupWrapper);j=t.createElement(P,{className:ee,ref:H},t.createElement($,{className:J},d&&t.createElement(B,{className:Q},d),j,p&&t.createElement(B,{className:Q},p)))}return t.cloneElement(j,{className:en(null===(i=j.props)||void 0===i?void 0:i.className,f)||null,style:D(D({},null===(a=j.props)||void 0===a?void 0:a.style),g),hidden:T})}),Fy=["show"];function zy(t,n){return e.useMemo(function(){var e={};n&&(e.show="object"===N(n)&&n.formatter?n.formatter:!!n);var r=e=D(D({},e),t),i=r.show,a=X(r,Fy);return D(D({},a),{},{show:!!i,showFormatter:"function"==typeof i?i:void 0,strategy:a.strategy||function(e){return e.length}})},[t,n])}var jy=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Hy=u(function(e,n){var r=e.autoComplete,i=e.onChange,a=e.onFocus,s=e.onBlur,c=e.onPressEnter,u=e.onKeyDown,h=e.onKeyUp,p=e.prefixCls,f=void 0===p?"rc-input":p,m=e.disabled,y=e.htmlSize,v=e.className,b=e.maxLength,x=e.suffix,w=e.showCount,E=e.count,k=e.type,T=void 0===k?"text":k,_=e.classes,C=e.classNames,S=e.styles,N=e.onCompositionStart,I=e.onCompositionEnd,L=X(e,jy),R=A(d(!1),2),P=R[0],$=R[1],B=o(!1),F=o(!1),z=o(null),j=o(null),H=function(e){z.current&&$y(z.current,e)},U=A(Vi(e.defaultValue,{value:e.value}),2),G=U[0],q=U[1],W=null==G?"":String(G),V=A(d(null),2),Y=V[0],K=V[1],Q=zy(E,w),Z=Q.max||b,J=Q.strategy(W),ee=!!Z&&J>Z;g(n,function(){var e;return{focus:H,blur:function(){var e;null===(e=z.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=z.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=z.current)||void 0===e||e.select()},input:z.current,nativeElement:(null===(e=j.current)||void 0===e?void 0:e.nativeElement)||z.current}}),l(function(){F.current&&(F.current=!1),$(function(e){return(!e||!m)&&e})},[m]);var te=function(e,t,n){var r,a,o=t;if(!B.current&&Q.exceedFormatter&&Q.max&&Q.strategy(t)>Q.max)t!==(o=Q.exceedFormatter(t,{max:Q.max}))&&K([(null===(r=z.current)||void 0===r?void 0:r.selectionStart)||0,(null===(a=z.current)||void 0===a?void 0:a.selectionEnd)||0]);else if("compositionEnd"===n.source)return;q(o),z.current&&Py(z.current,e,i,o)};l(function(){var e;Y&&(null===(e=z.current)||void 0===e||e.setSelectionRange.apply(e,M(Y)))},[Y]);var ne,re=function(e){te(e,e.target.value,{source:"change"})},ie=function(e){B.current=!1,te(e,e.currentTarget.value,{source:"compositionEnd"}),null==I||I(e)},ae=function(e){c&&"Enter"===e.key&&!F.current&&(F.current=!0,c(e)),null==u||u(e)},oe=function(e){"Enter"===e.key&&(F.current=!1),null==h||h(e)},se=function(e){$(!0),null==a||a(e)},le=function(e){F.current&&(F.current=!1),$(!1),null==s||s(e)},ce=ee&&"".concat(f,"-out-of-range");return t.createElement(By,Xe({},L,{prefixCls:f,className:en(v,ce),handleReset:function(e){q(""),H(),z.current&&Py(z.current,e,i)},value:W,focused:P,triggerFocus:H,suffix:function(){var e=Number(Z)>0;if(x||Q.show){var n=Q.showFormatter?Q.showFormatter({value:W,count:J,maxLength:Z}):"".concat(J).concat(e?" / ".concat(Z):"");return t.createElement(t.Fragment,null,Q.show&&t.createElement("span",{className:en("".concat(f,"-show-count-suffix"),O({},"".concat(f,"-show-count-has-suffix"),!!x),null==C?void 0:C.count),style:D({},null==S?void 0:S.count)},n),x)}return null}(),disabled:m,classes:_,classNames:C,styles:S,ref:j}),(ne=Vs(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),t.createElement("input",Xe({autoComplete:r},ne,{onChange:re,onFocus:se,onBlur:le,onKeyDown:ae,onKeyUp:oe,className:en(f,O({},"".concat(f,"-disabled"),m),null==C?void 0:C.input),style:null==S?void 0:S.input,ref:z,size:y,type:T,onCompositionStart:function(e){B.current=!0,null==N||N(e)},onCompositionEnd:ie}))))});const Uy=e=>{let n;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?n=e:e&&(n={clearIcon:t.createElement(Xo,null)}),n};function Gy(e,t){const n=o([]),r=()=>{n.current.push(setTimeout(()=>{var t,n,r,i;(null===(t=e.current)||void 0===t?void 0:t.input)&&"password"===(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(i=e.current)||void 0===i||i.input.removeAttribute("value"))}))};return l(()=>(t&&r(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),r}var qy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:i,bordered:a=!0,status:s,size:l,disabled:c,onBlur:u,onFocus:h,suffix:d,allowClear:p,addonAfter:f,addonBefore:g,className:m,style:y,styles:v,rootClassName:b,onChange:x,classNames:w,variant:E}=e,k=qy(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:T,direction:_,allowClear:C,autoComplete:S,className:A,style:N,classNames:I,styles:O}=Ii("input"),L=T("input",i),M=o(null),R=hs(L),[D,P,$]=gy(L,b),[B]=my(L,R),{compactSize:F,compactItemClassnames:z}=al(L,_),j=rl(e=>{var t;return null!==(t=null!=l?l:F)&&void 0!==t?t:e}),H=t.useContext(Mi),U=null!=c?c:H,{status:G,hasFeedback:q,feedbackIcon:W}=n(_h),V=Gf(G,s),Y=function(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}(e)||!!q;o(Y);const X=Gy(M,!0),K=(q||d)&&t.createElement(t.Fragment,null,d,q&&W),Q=Uy(null!=p?p:C),[Z,J]=Jf("input",E,a);return D(B(t.createElement(Hy,Object.assign({ref:In(r,M),prefixCls:L,autoComplete:S},k,{disabled:U,onBlur:e=>{X(),null==u||u(e)},onFocus:e=>{X(),null==h||h(e)},style:Object.assign(Object.assign({},N),y),styles:Object.assign(Object.assign({},O),v),suffix:K,allowClear:Q,className:en(m,b,$,R,z,A),onChange:e=>{X(),null==x||x(e)},addonBefore:g&&t.createElement(Ah,{form:!0,space:!0},g),addonAfter:f&&t.createElement(Ah,{form:!0,space:!0},f),classNames:Object.assign(Object.assign(Object.assign({},w),I),{input:en({[`${L}-sm`]:"small"===j,[`${L}-lg`]:"large"===j,[`${L}-rtl`]:"rtl"===_},null==w?void 0:w.input,I.input,P),variant:en({[`${L}-${Z}`]:J},Uf(L,V)),affixWrapper:en({[`${L}-affix-wrapper-sm`]:"small"===j,[`${L}-affix-wrapper-lg`]:"large"===j,[`${L}-affix-wrapper-rtl`]:"rtl"===_},P),wrapper:en({[`${L}-group-rtl`]:"rtl"===_},P),groupWrapper:en({[`${L}-group-wrapper-sm`]:"small"===j,[`${L}-group-wrapper-lg`]:"large"===j,[`${L}-group-wrapper-rtl`]:"rtl"===_,[`${L}-group-wrapper-${Z}`]:J},Uf(`${L}-group-wrapper`,V,q),P)})}))))}),Vy={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},Yy=t.createContext({});var Xy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);in||on(r).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key})),[n,r]);return e.useMemo(()=>i.map(e=>{var{span:n}=e,r=Xy(e,["span"]);return"filled"===n?Object.assign(Object.assign({},r),{filled:!0}):Object.assign(Object.assign({},r),{span:"number"==typeof n?n:Hg(t,n)})}),[i,t])}var Qy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const[n,r]=h(()=>function(e,t){let n=[],r=[],i=!1,a=0;return e.filter(e=>e).forEach(e=>{const{filled:o}=e,s=Qy(e,["filled"]);if(o)return r.push(s),n.push(r),r=[],void(a=0);const l=t-a;a+=e.span||1,a>=t?(a>t?(i=!0,r.push(Object.assign(Object.assign({},s),{span:l}))):r.push(s),n.push(r),r=[],a=0):r.push(s)}),r.length>0&&n.push(r),n=n.map(e=>{const n=e.reduce((e,t)=>e+(t.span||1),0);if(n{const{itemPrefixCls:n,component:r,span:i,className:a,style:o,labelStyle:s,contentStyle:l,bordered:c,label:u,content:h,colon:d,type:p,styles:f}=t,g=r,m=e.useContext(Yy),{classNames:y}=m;return c?e.createElement(g,{className:en({[`${n}-item-label`]:"label"===p,[`${n}-item-content`]:"content"===p,[`${null==y?void 0:y.label}`]:"label"===p,[`${null==y?void 0:y.content}`]:"content"===p},a),style:o,colSpan:i},Jy(u)&&e.createElement("span",{style:Object.assign(Object.assign({},s),null==f?void 0:f.label)},u),Jy(h)&&e.createElement("span",{style:Object.assign(Object.assign({},s),null==f?void 0:f.content)},h)):e.createElement(g,{className:en(`${n}-item`,a),style:o,colSpan:i},e.createElement("div",{className:`${n}-item-container`},(u||0===u)&&e.createElement("span",{className:en(`${n}-item-label`,null==y?void 0:y.label,{[`${n}-item-no-colon`]:!d}),style:Object.assign(Object.assign({},s),null==f?void 0:f.label)},u),(h||0===h)&&e.createElement("span",{className:en(`${n}-item-content`,null==y?void 0:y.content),style:Object.assign(Object.assign({},l),null==f?void 0:f.content)},h)))};function tv(t,{colon:n,prefixCls:r,bordered:i},{component:a,type:o,showLabel:s,showContent:l,labelStyle:c,contentStyle:u,styles:h}){return t.map(({label:t,children:d,prefixCls:p=r,className:f,style:g,labelStyle:m,contentStyle:y,span:v=1,key:b,styles:x},w)=>"string"==typeof a?e.createElement(ev,{key:`${o}-${b||w}`,className:f,style:g,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},c),null==h?void 0:h.label),m),null==x?void 0:x.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},u),null==h?void 0:h.content),y),null==x?void 0:x.content)},span:v,colon:n,component:a,itemPrefixCls:p,bordered:i,label:s?t:null,content:l?d:null,type:o}):[e.createElement(ev,{key:`label-${b||w}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),null==h?void 0:h.label),g),m),null==x?void 0:x.label),span:1,colon:n,component:a[0],itemPrefixCls:p,bordered:i,label:t,type:"label"}),e.createElement(ev,{key:`content-${b||w}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),null==h?void 0:h.content),g),y),null==x?void 0:x.content),span:2*v-1,component:a[1],itemPrefixCls:p,bordered:i,content:d,type:"content"})])}const nv=t=>{const n=e.useContext(Yy),{prefixCls:r,vertical:i,row:a,index:o,bordered:s}=t;return i?e.createElement(e.Fragment,null,e.createElement("tr",{key:`label-${o}`,className:`${r}-row`},tv(a,t,Object.assign({component:"th",type:"label",showLabel:!0},n))),e.createElement("tr",{key:`content-${o}`,className:`${r}-row`},tv(a,t,Object.assign({component:"td",type:"content",showContent:!0},n)))):e.createElement("tr",{key:o,className:`${r}-row`},tv(a,t,Object.assign({component:s?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},n)))},rv=e=>{const{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.padding)} ${Le(e.paddingLG)}`,borderInlineEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.paddingSM)} ${Le(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.paddingXS)} ${Le(e.padding)}`}}}}}};var iv=wa("Descriptions",e=>(e=>{const{componentCls:t,extraColor:n,itemPaddingBottom:r,itemPaddingEnd:i,colonMarginRight:a,colonMarginLeft:o,titleMarginBottom:s}=e;return{[t]:Object.assign(Object.assign(Object.assign({},ma(e)),rv(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:s},[`${t}-title`]:Object.assign(Object.assign({},ga),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:r,paddingInlineEnd:i},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${Le(o)} ${Le(a)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}})(Qi(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText})),av=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:n,title:r,extra:i,column:a,colon:o=!0,bordered:s,layout:l,children:c,className:u,rootClassName:h,style:d,size:p,labelStyle:f,contentStyle:g,styles:m,items:y,classNames:v}=t,b=av(t,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:x,direction:w,className:E,style:k,classNames:T,styles:_}=Ii("descriptions"),C=x("descriptions",n),S=Gg(),A=e.useMemo(()=>{var e;return"number"==typeof a?a:null!==(e=Hg(S,Object.assign(Object.assign({},Vy),a)))&&void 0!==e?e:3},[S,a]),N=Ky(S,y,c),I=rl(p),O=Zy(A,N),[L,M,R]=iv(C),D=e.useMemo(()=>({labelStyle:f,contentStyle:g,styles:{content:Object.assign(Object.assign({},_.content),null==m?void 0:m.content),label:Object.assign(Object.assign({},_.label),null==m?void 0:m.label)},classNames:{label:en(T.label,null==v?void 0:v.label),content:en(T.content,null==v?void 0:v.content)}}),[f,g,m,v,T,_]);return L(e.createElement(Yy.Provider,{value:D},e.createElement("div",Object.assign({className:en(C,E,T.root,null==v?void 0:v.root,{[`${C}-${I}`]:I&&"default"!==I,[`${C}-bordered`]:!!s,[`${C}-rtl`]:"rtl"===w},u,h,M,R),style:Object.assign(Object.assign(Object.assign(Object.assign({},k),_.root),null==m?void 0:m.root),d)},b),(r||i)&&e.createElement("div",{className:en(`${C}-header`,T.header,null==v?void 0:v.header),style:Object.assign(Object.assign({},_.header),null==m?void 0:m.header)},r&&e.createElement("div",{className:en(`${C}-title`,T.title,null==v?void 0:v.title),style:Object.assign(Object.assign({},_.title),null==m?void 0:m.title)},r),i&&e.createElement("div",{className:en(`${C}-extra`,T.extra,null==v?void 0:v.extra),style:Object.assign(Object.assign({},_.extra),null==m?void 0:m.extra)},i)),e.createElement("div",{className:`${C}-view`},e.createElement("table",null,e.createElement("tbody",null,O.map((t,n)=>e.createElement(nv,{key:n,index:n,colon:o,prefixCls:C,vertical:"vertical"===l,bordered:s,row:t}))))))))};ov.Item=({children:e})=>e;var sv=e.createContext(null),lv=e.createContext({}),cv=["prefixCls","className","containerRef"],uv=function(t){var n=t.prefixCls,r=t.className,i=t.containerRef,a=X(t,cv),o=e.useContext(lv).panel,s=On(o,i);return e.createElement("div",Xe({className:en("".concat(n,"-content"),r),role:"dialog",ref:s},ss(t,{aria:!0}),{"aria-modal":"true"},a))};function hv(e){return"string"==typeof e&&String(Number(e))===e?(te(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var dv={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function pv(t,n){var r,i,a,o=t.prefixCls,s=t.open,l=t.placement,c=t.inline,u=t.push,h=t.forceRender,d=t.autoFocus,p=t.keyboard,f=t.classNames,g=t.rootClassName,m=t.rootStyle,y=t.zIndex,v=t.className,b=t.id,x=t.style,w=t.motion,E=t.width,k=t.height,T=t.children,_=t.mask,C=t.maskClosable,S=t.maskMotion,N=t.maskClassName,I=t.maskStyle,L=t.afterOpenChange,M=t.onClose,R=t.onMouseEnter,P=t.onMouseOver,$=t.onMouseLeave,B=t.onClick,F=t.onKeyDown,z=t.onKeyUp,j=t.styles,H=t.drawerRender,U=e.useRef(),G=e.useRef(),q=e.useRef();e.useImperativeHandle(n,function(){return U.current});e.useEffect(function(){var e;s&&d&&(null===(e=U.current)||void 0===e||e.focus({preventScroll:!0}))},[s]);var W=A(e.useState(!1),2),V=W[0],Y=W[1],X=e.useContext(sv),K=null!==(r=null!==(i=null===(a="boolean"==typeof u?u?{}:{distance:0}:u||{})||void 0===a?void 0:a.distance)&&void 0!==i?i:null==X?void 0:X.pushDistance)&&void 0!==r?r:180,Q=e.useMemo(function(){return{pushDistance:K,push:function(){Y(!0)},pull:function(){Y(!1)}}},[K]);e.useEffect(function(){var e,t;s?null==X||null===(e=X.push)||void 0===e||e.call(X):null==X||null===(t=X.pull)||void 0===t||t.call(X)},[s]),e.useEffect(function(){return function(){var e;null==X||null===(e=X.pull)||void 0===e||e.call(X)}},[]);var Z=e.createElement(so,Xe({key:"mask"},S,{visible:_&&s}),function(t,n){var r=t.className,i=t.style;return e.createElement("div",{className:en("".concat(o,"-mask"),r,null==f?void 0:f.mask,N),style:D(D(D({},i),I),null==j?void 0:j.mask),onClick:C&&s?M:void 0,ref:n})}),J="function"==typeof w?w(l):w,ee={};if(V&&K)switch(l){case"top":ee.transform="translateY(".concat(K,"px)");break;case"bottom":ee.transform="translateY(".concat(-K,"px)");break;case"left":ee.transform="translateX(".concat(K,"px)");break;default:ee.transform="translateX(".concat(-K,"px)")}"left"===l||"right"===l?ee.width=hv(E):ee.height=hv(k);var te={onMouseEnter:R,onMouseOver:P,onMouseLeave:$,onClick:B,onKeyDown:F,onKeyUp:z},ne=e.createElement(so,Xe({key:"panel"},J,{visible:s,forceRender:h,onVisibleChanged:function(e){null==L||L(e)},removeOnLeave:!1,leavedClassName:"".concat(o,"-content-wrapper-hidden")}),function(n,r){var i=n.className,a=n.style,s=e.createElement(uv,Xe({id:b,containerRef:r,prefixCls:o,className:en(v,null==f?void 0:f.content),style:D(D({},x),null==j?void 0:j.content)},ss(t,{aria:!0}),te),T);return e.createElement("div",Xe({className:en("".concat(o,"-content-wrapper"),null==f?void 0:f.wrapper,i),style:D(D(D({},ee),a),null==j?void 0:j.wrapper)},ss(t,{data:!0})),H?H(s):s)}),re=D({},m);return y&&(re.zIndex=y),e.createElement(sv.Provider,{value:Q},e.createElement("div",{className:en(o,"".concat(o,"-").concat(l),g,O(O({},"".concat(o,"-open"),s),"".concat(o,"-inline"),c)),style:re,tabIndex:-1,ref:U,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case ds.TAB:var r;if(t===ds.TAB)if(n||document.activeElement!==q.current){if(n&&document.activeElement===G.current){var i;null===(i=q.current)||void 0===i||i.focus({preventScroll:!0})}}else null===(r=G.current)||void 0===r||r.focus({preventScroll:!0});break;case ds.ESC:M&&p&&(e.stopPropagation(),M(e))}}},Z,e.createElement("div",{tabIndex:0,ref:G,style:dv,"aria-hidden":"true","data-sentinel":"start"}),ne,e.createElement("div",{tabIndex:0,ref:q,style:dv,"aria-hidden":"true","data-sentinel":"end"})))}var fv=e.forwardRef(pv),gv=function(t){var n=t.open,r=void 0!==n&&n,i=t.prefixCls,a=void 0===i?"rc-drawer":i,o=t.placement,s=void 0===o?"right":o,l=t.autoFocus,c=void 0===l||l,u=t.keyboard,h=void 0===u||u,d=t.width,p=void 0===d?378:d,f=t.mask,g=void 0===f||f,m=t.maskClosable,y=void 0===m||m,v=t.getContainer,b=t.forceRender,x=t.afterOpenChange,w=t.destroyOnClose,E=t.onMouseEnter,k=t.onMouseOver,T=t.onMouseLeave,_=t.onClick,C=t.onKeyDown,S=t.onKeyUp,N=t.panelRef,I=A(e.useState(!1),2),O=I[0],L=I[1],M=A(e.useState(!1),2),R=M[0],P=M[1];Be(function(){P(!0)},[]);var $=!!R&&r,B=e.useRef(),F=e.useRef();Be(function(){$&&(F.current=document.activeElement)},[$]);var z=e.useMemo(function(){return{panel:N}},[N]);if(!b&&!O&&!$&&w)return null;var j={onMouseEnter:E,onMouseOver:k,onMouseLeave:T,onClick:_,onKeyDown:C,onKeyUp:S},H=D(D({},t),{},{open:$,prefixCls:a,placement:s,autoFocus:c,keyboard:h,width:p,mask:g,maskClosable:y,inline:!1===v,afterOpenChange:function(e){var t,n;(L(e),null==x||x(e),e||!F.current||null!==(t=B.current)&&void 0!==t&&t.contains(F.current))||(null===(n=F.current)||void 0===n||n.focus({preventScroll:!0}))},ref:B},j);return e.createElement(lv.Provider,{value:z},e.createElement(au,{open:$||b||O,autoDestroy:!1,getContainer:v,autoLock:g&&($||O)},e.createElement(fv,H)))};const mv=t=>{var n,r;const{prefixCls:i,title:a,footer:o,extra:s,loading:l,onClose:c,headerStyle:u,bodyStyle:h,footerStyle:d,children:p,classNames:f,styles:g}=t,m=Ii("drawer"),y=e.useCallback(t=>e.createElement("button",{type:"button",onClick:c,className:`${i}-close`},t),[c]),[v,b]=Mh(Ih(t),Ih(m),{closable:!0,closeIconRender:y}),x=e.useMemo(()=>{var t,n;return a||v?e.createElement("div",{style:Object.assign(Object.assign(Object.assign({},null===(t=m.styles)||void 0===t?void 0:t.header),u),null==g?void 0:g.header),className:en(`${i}-header`,{[`${i}-header-close-only`]:v&&!a&&!s},null===(n=m.classNames)||void 0===n?void 0:n.header,null==f?void 0:f.header)},e.createElement("div",{className:`${i}-header-title`},b,a&&e.createElement("div",{className:`${i}-title`},a)),s&&e.createElement("div",{className:`${i}-extra`},s)):null},[v,b,s,u,i,a]),w=e.useMemo(()=>{var t,n;if(!o)return null;const r=`${i}-footer`;return e.createElement("div",{className:en(r,null===(t=m.classNames)||void 0===t?void 0:t.footer,null==f?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},null===(n=m.styles)||void 0===n?void 0:n.footer),d),null==g?void 0:g.footer)},o)},[o,d,i]);return e.createElement(e.Fragment,null,x,e.createElement("div",{className:en(`${i}-body`,null==f?void 0:f.body,null===(n=m.classNames)||void 0===n?void 0:n.body),style:Object.assign(Object.assign(Object.assign({},null===(r=m.styles)||void 0===r?void 0:r.body),h),null==g?void 0:g.body)},l?e.createElement(Jh,{active:!0,title:!1,paragraph:{rows:5},className:`${i}-body-skeleton`}):p),w)},yv=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},vv=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),bv=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},vv({opacity:e},{opacity:1})),xv=(e,t)=>[bv(.7,t),vv({transform:yv(e)},{transform:"none"})],wv=e=>{const{componentCls:t,motionDurationSlow:n}=e;return{[t]:{[`${t}-mask-motion`]:bv(0,n),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((e,t)=>Object.assign(Object.assign({},e),{[`&-${t}`]:xv(t,n)}),{})}}},Ev=e=>{const{borderRadiusSM:t,componentCls:n,zIndexPopup:r,colorBgMask:i,colorBgElevated:a,motionDurationSlow:o,motionDurationMid:s,paddingXS:l,padding:c,paddingLG:u,fontSizeLG:h,lineHeightLG:d,lineWidth:p,lineType:f,colorSplit:g,marginXS:m,colorIcon:y,colorIconHover:v,colorBgTextHover:b,colorBgTextActive:x,colorText:w,fontWeightStrong:E,footerPaddingBlock:k,footerPaddingInline:T,calc:_}=e,C=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:r,pointerEvents:"none",color:w,"&-pure":{position:"relative",background:a,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:r,background:i,pointerEvents:"auto"},[C]:{position:"absolute",zIndex:r,maxWidth:"100vw",transition:`all ${o}`,"&-hidden":{display:"none"}},[`&-left > ${C}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${C}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${C}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${C}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:a,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Le(c)} ${Le(u)}`,fontSize:h,lineHeight:d,borderBottom:`${Le(p)} ${f} ${g}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:_(h).add(l).equal(),height:_(h).add(l).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",marginInlineEnd:m,color:y,fontWeight:E,fontSize:h,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${s}`,textRendering:"auto","&:hover":{color:v,backgroundColor:b,textDecoration:"none"},"&:active":{backgroundColor:x}},va(e)),[`${n}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:h,lineHeight:d},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:u,overflow:"auto",[`${n}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${n}-footer`]:{flexShrink:0,padding:`${Le(k)} ${Le(T)}`,borderTop:`${Le(p)} ${f} ${g}`},"&-rtl":{direction:"rtl"}}}};var kv=wa("Drawer",e=>{const t=Qi(e,{});return[Ev(t),wv(t)]},e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding})),Tv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{rootClassName:n,width:r,height:i,size:a="default",mask:o=!0,push:s=_v,open:l,afterOpenChange:c,onClose:u,prefixCls:h,getContainer:d,panelRef:p=null,style:f,className:g,visible:m,afterVisibleChange:y,maskStyle:v,drawerStyle:b,contentWrapperStyle:x,destroyOnClose:w,destroyOnHidden:E}=t,k=Tv(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),{getPopupContainer:T,getPrefixCls:_,direction:C,className:S,style:A,classNames:N,styles:I}=Ii("drawer"),O=_("drawer",h),[L,M,R]=kv(O),D=void 0===d&&T?()=>T(document.body):d,P=en({"no-mask":!o,[`${O}-rtl`]:"rtl"===C},n,M,R),$=e.useMemo(()=>null!=r?r:"large"===a?736:378,[r,a]),B=e.useMemo(()=>null!=i?i:"large"===a?736:378,[i,a]),F={motionName:Ws(O,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},z=nd(),j=In(p,z),[H,U]=xs("Drawer",k.zIndex),{classNames:G={},styles:q={}}=k;return L(e.createElement(Ah,{form:!0,space:!0},e.createElement(ms.Provider,{value:U},e.createElement(gv,Object.assign({prefixCls:O,onClose:u,maskMotion:F,motion:e=>({motionName:Ws(O,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},k,{classNames:{mask:en(G.mask,N.mask),content:en(G.content,N.content),wrapper:en(G.wrapper,N.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},q.mask),v),I.mask),content:Object.assign(Object.assign(Object.assign({},q.content),b),I.content),wrapper:Object.assign(Object.assign(Object.assign({},q.wrapper),x),I.wrapper)},open:null!=l?l:m,mask:o,push:s,width:$,height:B,style:Object.assign(Object.assign({},A),f),className:en(S,g),rootClassName:P,getContainer:D,afterOpenChange:null!=c?c:y,panelRef:j,zIndex:H,destroyOnClose:null!=E?E:w}),e.createElement(mv,Object.assign({prefixCls:O},k,{onClose:u}))))))};Cv._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:n,style:r,className:i,placement:a="right"}=t,o=Tv(t,["prefixCls","style","className","placement"]),{getPrefixCls:s}=e.useContext(Si),l=s("drawer",n),[c,u,h]=kv(l),d=en(l,`${l}-pure`,`${l}-${a}`,u,h,i);return c(e.createElement("div",{className:d,style:r},e.createElement(mv,Object.assign({prefixCls:l},o))))};var Sv={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Av=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Sv}))},Nv=e.forwardRef(Av);var Iv=wa(["Input","OTP"],e=>(e=>{const{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,[`${t}-input-wrapper`]:{position:"relative",[`${t}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${t}-mask-input`]:{color:"transparent",caretColor:e.colorText},[`${t}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${t}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${t}-input`]:{textAlign:"center",paddingInline:e.paddingXXS},[`&${t}-sm ${t}-input`]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},[`&${t}-lg ${t}-input`]:{paddingInline:e.paddingXS}}}})(Qi(e,jm(e))),Hm),Ov=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{className:r,value:i,onChange:a,onActiveChange:o,index:s,mask:l}=t,c=Ov(t,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:u}=e.useContext(Si),h=u("otp"),d="string"==typeof l?l:i,p=e.useRef(null);e.useImperativeHandle(n,()=>p.current);const f=()=>{mr(()=>{var e;const t=null===(e=p.current)||void 0===e?void 0:e.input;document.activeElement===t&&t&&t.select()})};return e.createElement("span",{className:`${h}-input-wrapper`,role:"presentation"},l&&""!==i&&void 0!==i&&e.createElement("span",{className:`${h}-mask-icon`,"aria-hidden":"true"},d),e.createElement(Wy,Object.assign({"aria-label":`OTP Input ${s+1}`,type:!0===l?"password":"text"},c,{ref:p,value:i,onInput:e=>{a(s,e.target.value)},onFocus:f,onKeyDown:e=>{const{key:t,ctrlKey:n,metaKey:r}=e;"ArrowLeft"===t?o(s-1):"ArrowRight"===t?o(s+1):"z"===t&&(n||r)?e.preventDefault():"Backspace"!==t||i||o(s-1),f()},onMouseDown:f,onMouseUp:f,className:en(r,{[`${h}-mask-input`]:l})})))});var Mv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{index:n,prefixCls:r,separator:i}=t,a="function"==typeof i?i(n):i;return a?e.createElement("span",{className:`${r}-separator`},a):null},Pv=e.forwardRef((t,n)=>{const{prefixCls:r,length:i=6,size:a,defaultValue:o,value:s,onChange:l,formatter:c,separator:u,variant:h,disabled:d,status:p,autoFocus:f,mask:g,type:m,onInput:y,inputMode:v}=t,b=Mv(t,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:x,direction:w}=e.useContext(Si),E=x("otp",r),k=ss(b,{aria:!0,data:!0,attr:!0}),[T,_,C]=Iv(E),S=rl(e=>null!=a?a:e),A=e.useContext(_h),N=Gf(A.status,p),I=e.useMemo(()=>Object.assign(Object.assign({},A),{status:N,hasFeedback:!1,feedbackIcon:null}),[A,N]),O=e.useRef(null),L=e.useRef({});e.useImperativeHandle(n,()=>({focus:()=>{var e;null===(e=L.current[0])||void 0===e||e.focus()},blur:()=>{var e;for(let t=0;tc?c(e):e,[D,P]=e.useState(()=>Rv(R(o||"")));e.useEffect(()=>{void 0!==s&&P(Rv(s))},[s]);const $=Gi(e=>{P(e),y&&y(e),l&&e.length===i&&e.every(e=>e)&&e.some((e,t)=>D[t]!==e)&&l(e.join(""))}),B=Gi((e,t)=>{let n=M(D);for(let t=0;t=0&&!n[e];e-=1)n.pop();const r=R(n.map(e=>e||" ").join(""));return n=Rv(r).map((e,t)=>" "!==e||n[t]?e:n[t]),n}),F=(e,t)=>{var n;const r=B(e,t),a=Math.min(e+t.length,i-1);a!==e&&void 0!==r[e]&&(null===(n=L.current[a])||void 0===n||n.focus()),$(r)},z=e=>{var t;null===(t=L.current[e])||void 0===t||t.focus()},j={variant:h,disabled:d,status:N,mask:g,type:m,inputMode:v};return T(e.createElement("div",Object.assign({},k,{ref:O,className:en(E,{[`${E}-sm`]:"small"===S,[`${E}-lg`]:"large"===S,[`${E}-rtl`]:"rtl"===w},C,_),role:"group"}),e.createElement(_h.Provider,{value:I},Array.from({length:i}).map((t,n)=>{const r=`otp-${n}`,a=D[n]||"";return e.createElement(e.Fragment,{key:r},e.createElement(Lv,Object.assign({ref:e=>{L.current[n]=e},index:n,size:S,htmlSize:1,className:`${E}-input`,onChange:F,value:a,onActiveChange:z,autoFocus:0===n&&f},j)),nt?e.createElement(Nv,null):e.createElement(Fv,null),Hv={click:"onClick",hover:"onMouseOver"},Uv=e.forwardRef((t,n)=>{const{disabled:r,action:i="click",visibilityToggle:a=!0,iconRender:s=jv,suffix:l}=t,c=e.useContext(Mi),u=null!=r?r:c,h="object"==typeof a&&void 0!==a.visible,[p,f]=d(()=>!!h&&a.visible),g=o(null);e.useEffect(()=>{h&&f(a.visible)},[h,a]);const m=Gy(g),y=()=>{var e;if(u)return;p&&m();const t=!p;f(t),"object"==typeof a&&(null===(e=a.onVisibleChange)||void 0===e||e.call(a,t))},{className:v,prefixCls:b,inputPrefixCls:x,size:w}=t,E=zv(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:k}=e.useContext(Si),T=k("input",x),_=k("input-password",b),C=a&&(t=>{const n=Hv[i]||"",r=s(p),a={[n]:y,className:`${t}-icon`,key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}};return e.cloneElement(e.isValidElement(r)?r:e.createElement("span",null,r),a)})(_),S=en(_,v,{[`${_}-${w}`]:!!w}),A=Object.assign(Object.assign({},Vs(E,["suffix","iconRender","visibilityToggle"])),{type:p?"text":"password",className:S,prefixCls:T,suffix:e.createElement(e.Fragment,null,C,l)});return w&&(A.size=w),e.createElement(Wy,Object.assign({ref:In(n,g)},A))});var Gv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,inputPrefixCls:i,className:a,size:o,suffix:s,enterButton:l=!1,addonAfter:c,loading:u,disabled:h,onSearch:d,onChange:p,onCompositionStart:f,onCompositionEnd:g,variant:m,onPressEnter:y}=t,v=Gv(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:b,direction:x}=e.useContext(Si),w=e.useRef(!1),E=b("input-search",r),k=b("input",i),{compactSize:T}=al(E,x),_=rl(e=>{var t;return null!==(t=null!=o?o:T)&&void 0!==t?t:e}),C=e.useRef(null),S=e=>{var t;document.activeElement===(null===(t=C.current)||void 0===t?void 0:t.input)&&e.preventDefault()},A=e=>{var t,n;d&&d(null===(n=null===(t=C.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},N="boolean"==typeof l?e.createElement(Mg,null):null,I=`${E}-button`;let O;const L=l||{},M=L.type&&!0===L.type.__ANT_BUTTON;O=M||"button"===L.type?us(L,Object.assign({onMouseDown:S,onClick:e=>{var t,n;null===(n=null===(t=null==L?void 0:L.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),A(e)},key:"enterButton"},M?{className:I,size:_}:{})):e.createElement(qc,{className:I,color:l?"primary":"default",size:_,disabled:h,key:"enterButton",onMouseDown:S,onClick:A,loading:u,icon:N,variant:"borderless"===m||"filled"===m||"underlined"===m?"text":l?"solid":void 0},l),c&&(O=[O,us(c,{key:"addonAfter"})]);const R=en(E,{[`${E}-rtl`]:"rtl"===x,[`${E}-${_}`]:!!_,[`${E}-with-button`]:!!l},a),D=Object.assign(Object.assign({},v),{className:R,prefixCls:k,type:"search",size:_,variant:m,onPressEnter:e=>{w.current||u||(null==y||y(e),A(e))},onCompositionStart:e=>{w.current=!0,null==f||f(e)},onCompositionEnd:e=>{w.current=!1,null==g||g(e)},addonAfter:O,suffix:s,onChange:e=>{(null==e?void 0:e.target)&&"click"===e.type&&d&&d(e.target.value,e,{source:"clear"}),null==p||p(e)},disabled:h});return e.createElement(Wy,Object.assign({ref:In(C,n)},D))});var Wv,Vv=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Yv={};function Xv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Wv||((Wv=document.createElement("textarea")).setAttribute("tab-index","-1"),Wv.setAttribute("aria-hidden","true"),Wv.setAttribute("name","hiddenTextarea"),document.body.appendChild(Wv)),e.getAttribute("wrap")?Wv.setAttribute("wrap",e.getAttribute("wrap")):Wv.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Yv[n])return Yv[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=Vv.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),l={sizingStyle:s,paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(Yv[n]=l),l}(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,l=i.sizingStyle;Wv.setAttribute("style","".concat(l,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),Wv.value=e.value||e.placeholder||"";var c,u=void 0,h=void 0,d=Wv.scrollHeight;if("border-box"===s?d+=o:"content-box"===s&&(d-=a),null!==n||null!==r){Wv.value=" ";var p=Wv.scrollHeight-a;null!==n&&(u=p*n,"border-box"===s&&(u=u+a+o),d=Math.max(u,d)),null!==r&&(h=p*r,"border-box"===s&&(h=h+a+o),c=d>h?"":"hidden",d=Math.min(h,d))}var f={height:d,overflowY:c,resize:"none"};return u&&(f.minHeight=u),h&&(f.maxHeight=h),f}var Kv=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Qv=e.forwardRef(function(t,n){var r=t,i=r.prefixCls,a=r.defaultValue,o=r.value,s=r.autoSize,l=r.onResize,c=r.className,u=r.style,h=r.disabled,d=r.onChange;r.onInternalAutoSize;var p=X(r,Kv),f=A(Vi(a,{value:o,postState:function(e){return null!=e?e:""}}),2),g=f[0],m=f[1],y=e.useRef();e.useImperativeHandle(n,function(){return{textArea:y.current}});var v=A(e.useMemo(function(){return s&&"object"===N(s)?[s.minRows,s.maxRows]:[]},[s]),2),b=v[0],x=v[1],w=!!s,E=A(e.useState(2),2),k=E[0],T=E[1],_=A(e.useState(),2),C=_[0],S=_[1],I=function(){T(0)};Be(function(){w&&I()},[o,b,x,w]),Be(function(){if(0===k)T(1);else if(1===k){var e=Xv(y.current,!1,b,x);T(2),S(e)}},[k]);var L=e.useRef(),M=function(){mr.cancel(L.current)};e.useEffect(function(){return M},[]);var R=w?C:null,P=D(D({},u),R);return 0!==k&&1!==k||(P.overflowY="hidden",P.overflowX="hidden"),e.createElement(ur,{onResize:function(e){2===k&&(null==l||l(e),s&&(M(),L.current=mr(function(){I()})))},disabled:!(s||l)},e.createElement("textarea",Xe({},p,{ref:y,style:P,className:en(i,c,O({},"".concat(i,"-disabled"),h)),disabled:h,value:g,onChange:function(e){m(e.target.value),null==d||d(e)}})))}),Zv=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],Jv=t.forwardRef(function(e,n){var r,i=e.defaultValue,a=e.value,s=e.onFocus,c=e.onBlur,u=e.onChange,h=e.allowClear,d=e.maxLength,p=e.onCompositionStart,f=e.onCompositionEnd,m=e.suffix,y=e.prefixCls,v=void 0===y?"rc-textarea":y,b=e.showCount,x=e.count,w=e.className,E=e.style,k=e.disabled,T=e.hidden,_=e.classNames,C=e.styles,S=e.onResize,N=e.onClear,I=e.onPressEnter,L=e.readOnly,R=e.autoSize,P=e.onKeyDown,$=X(e,Zv),B=A(Vi(i,{value:a,defaultValue:i}),2),F=B[0],z=B[1],j=null==F?"":String(F),H=A(t.useState(!1),2),U=H[0],G=H[1],q=t.useRef(!1),W=A(t.useState(null),2),V=W[0],Y=W[1],K=o(null),Q=o(null),Z=function(){var e;return null===(e=Q.current)||void 0===e?void 0:e.textArea},J=function(){Z().focus()};g(n,function(){var e;return{resizableTextArea:Q.current,focus:J,blur:function(){Z().blur()},nativeElement:(null===(e=K.current)||void 0===e?void 0:e.nativeElement)||Z()}}),l(function(){G(function(e){return!k&&e})},[k]);var ee=A(t.useState(null),2),te=ee[0],ne=ee[1];t.useEffect(function(){var e;te&&(e=Z()).setSelectionRange.apply(e,M(te))},[te]);var re,ie=zy(x,b),ae=null!==(r=ie.max)&&void 0!==r?r:d,oe=Number(ae)>0,se=ie.strategy(j),le=!!ae&&se>ae,ce=function(e,t){var n=t;!q.current&&ie.exceedFormatter&&ie.max&&ie.strategy(t)>ie.max&&t!==(n=ie.exceedFormatter(t,{max:ie.max}))&&ne([Z().selectionStart||0,Z().selectionEnd||0]),z(n),Py(e.currentTarget,e,u,n)},ue=m;ie.show&&(re=ie.showFormatter?ie.showFormatter({value:j,count:se,maxLength:ae}):"".concat(se).concat(oe?" / ".concat(ae):""),ue=t.createElement(t.Fragment,null,ue,t.createElement("span",{className:en("".concat(v,"-data-count"),null==_?void 0:_.count),style:null==C?void 0:C.count},re)));var he=!R&&!b&&!h;return t.createElement(By,{ref:K,value:j,allowClear:h,handleReset:function(e){z(""),J(),Py(Z(),e,u)},suffix:ue,prefixCls:v,classNames:D(D({},_),{},{affixWrapper:en(null==_?void 0:_.affixWrapper,O(O({},"".concat(v,"-show-count"),b),"".concat(v,"-textarea-allow-clear"),h))}),disabled:k,focused:U,className:en(w,le&&"".concat(v,"-out-of-range")),style:D(D({},E),V&&!he?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof re?re:void 0}},hidden:T,readOnly:L,onClear:N},t.createElement(Qv,Xe({},$,{autoSize:R,maxLength:d,onKeyDown:function(e){"Enter"===e.key&&I&&I(e),null==P||P(e)},onChange:function(e){ce(e,e.target.value)},onFocus:function(e){G(!0),null==s||s(e)},onBlur:function(e){G(!1),null==c||c(e)},onCompositionStart:function(e){q.current=!0,null==p||p(e)},onCompositionEnd:function(e){q.current=!1,ce(e,e.currentTarget.value),null==f||f(e)},className:en(null==_?void 0:_.textarea),style:D(D({},null==C?void 0:C.textarea),{},{resize:null==E?void 0:E.resize}),disabled:k,prefixCls:v,onResize:function(e){var t;null==S||S(e),null!==(t=Z())&&void 0!==t&&t.style.height&&Y(!0)},ref:Q,readOnly:L})))});var eb=wa(["Input","TextArea"],e=>(e=>{const{componentCls:t,paddingLG:n}=e,r=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[r]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`\n &-allow-clear > ${t},\n &-affix-wrapper${r}-has-feedback ${t}\n `]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}})(Qi(e,jm(e))),Hm,{resetFont:!1}),tb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;const{prefixCls:i,bordered:a=!0,size:o,disabled:s,status:l,allowClear:c,classNames:u,rootClassName:h,className:d,style:p,styles:f,variant:g,showCount:m,onMouseDown:y,onResize:v}=t,b=tb(t,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:x,direction:w,allowClear:E,autoComplete:k,className:T,style:_,classNames:C,styles:S}=Ii("textArea"),A=e.useContext(Mi),N=null!=s?s:A,{status:I,hasFeedback:O,feedbackIcon:L}=e.useContext(_h),M=Gf(I,l),R=e.useRef(null);e.useImperativeHandle(n,()=>{var e;return{resizableTextArea:null===(e=R.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;$y(null===(n=null===(t=R.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=R.current)||void 0===e?void 0:e.blur()}}});const D=x("input",i),P=hs(D),[$,B,F]=gy(D,h),[z]=eb(D,P),{compactSize:j,compactItemClassnames:H}=al(D,w),U=rl(e=>{var t;return null!==(t=null!=o?o:j)&&void 0!==t?t:e}),[G,q]=Jf("textArea",g,a),W=Uy(null!=c?c:E),[V,Y]=e.useState(!1),[X,K]=e.useState(!1);return $(z(e.createElement(Jv,Object.assign({autoComplete:k},b,{style:Object.assign(Object.assign({},_),p),styles:Object.assign(Object.assign({},S),f),disabled:N,allowClear:W,className:en(F,P,d,h,H,T,X&&`${D}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},u),C),{textarea:en({[`${D}-sm`]:"small"===U,[`${D}-lg`]:"large"===U},B,null==u?void 0:u.textarea,C.textarea,V&&`${D}-mouse-active`),variant:en({[`${D}-${G}`]:q},Uf(D,M)),affixWrapper:en(`${D}-textarea-affix-wrapper`,{[`${D}-affix-wrapper-rtl`]:"rtl"===w,[`${D}-affix-wrapper-sm`]:"small"===U,[`${D}-affix-wrapper-lg`]:"large"===U,[`${D}-textarea-show-count`]:m||(null===(r=t.count)||void 0===r?void 0:r.show)},B)}),prefixCls:D,suffix:O&&e.createElement("span",{className:`${D}-textarea-suffix`},L),showCount:m,ref:R,onResize:e=>{var t,n;if(null==v||v(e),V&&"function"==typeof getComputedStyle){const e=null===(n=null===(t=R.current)||void 0===t?void 0:t.nativeElement)||void 0===n?void 0:n.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&K(!0)}},onMouseDown:e=>{Y(!0),null==y||y(e);const t=()=>{Y(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}}))))}),rb=Wy;rb.Group=t=>{const{getPrefixCls:r,direction:i}=n(Si),{prefixCls:a,className:o}=t,s=r("input-group",a),l=r("input"),[c,u,d]=my(l),p=en(s,d,{[`${s}-lg`]:"large"===t.size,[`${s}-sm`]:"small"===t.size,[`${s}-compact`]:t.compact,[`${s}-rtl`]:"rtl"===i},u,o),f=n(_h),g=h(()=>Object.assign(Object.assign({},f),{isFormItemInput:!1}),[f]);return c(e.createElement("span",{className:p,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},e.createElement(_h.Provider,{value:g},t.children)))},rb.Search=qv,rb.TextArea=nb,rb.Password=Uv,rb.OTP=Pv;var ib=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.forwardRef((i,a)=>e.createElement(r,Object.assign({ref:a,suffixCls:t,tagName:n},i)))}const ob=e.forwardRef((t,n)=>{const{prefixCls:r,suffixCls:i,className:a,tagName:o}=t,s=ib(t,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:l}=e.useContext(Si),c=l("layout",r),[u,h,d]=Cm(c),p=i?`${c}-${i}`:c;return u(e.createElement(o,Object.assign({className:en(r||p,a,h,d),ref:n},s)))}),sb=e.forwardRef((t,n)=>{const{direction:r}=e.useContext(Si),[i,a]=e.useState([]),{prefixCls:o,className:s,rootClassName:l,children:c,hasSider:u,tagName:h,style:d}=t,p=Vs(ib(t,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),["suffixCls"]),{getPrefixCls:f,className:g,style:m}=Ii("layout"),y=f("layout",o),v=function(e,t,n){return"boolean"==typeof n?n:!!e.length||on(t).some(e=>e.type===Lm)}(i,c,u),[b,x,w]=Cm(y),E=en(y,{[`${y}-has-sider`]:v,[`${y}-rtl`]:"rtl"===r},g,s,l,x,w),k=e.useMemo(()=>({siderHook:{addSider:e=>{a(t=>[].concat(M(t),[e]))},removeSider:e=>{a(t=>t.filter(t=>t!==e))}}}),[]);return b(e.createElement(km.Provider,{value:k},e.createElement(h,Object.assign({ref:n,className:E,style:Object.assign(Object.assign({},m),d)},p),c)))}),lb=ab({tagName:"div",displayName:"Layout"})(sb),cb=ab({suffixCls:"header",tagName:"header",displayName:"Header"})(ob),ub=ab({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(ob),hb=ab({suffixCls:"content",tagName:"main",displayName:"Content"})(ob),db=lb;db.Header=cb,db.Footer=ub,db.Content=hb,db.Sider=Lm,db._InternalSiderContext=Im;var pb={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},fb=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:pb}))},gb=e.forwardRef(fb),mb={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},yb=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:mb}))},vb=e.forwardRef(yb),bb={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},xb=[10,20,50,100],wb=function(e){var n=e.pageSizeOptions,r=void 0===n?xb:n,i=e.locale,a=e.changeSize,o=e.pageSize,s=e.goButton,l=e.quickGo,c=e.rootPrefixCls,u=e.disabled,h=e.buildOptionText,d=e.showSizeChanger,p=e.sizeChangerRender,f=A(t.useState(""),2),g=f[0],m=f[1],y=function(){return!g||Number.isNaN(g)?void 0:Number(g)},v="function"==typeof h?h:function(e){return"".concat(e," ").concat(i.items_per_page)},b=function(e){""!==g&&(e.keyCode!==ds.ENTER&&"click"!==e.type||(m(""),null==l||l(y())))},x="".concat(c,"-options");if(!d&&!l)return null;var w=null,E=null,k=null;return d&&p&&(w=p({disabled:u,size:o,onSizeChange:function(e){null==a||a(Number(e))},"aria-label":i.page_size,className:"".concat(x,"-size-changer"),options:(r.some(function(e){return e.toString()===o.toString()})?r:r.concat([o]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e){return{label:v(e),value:e}})})),l&&(s&&(k="boolean"==typeof s?t.createElement("button",{type:"button",onClick:b,onKeyUp:b,disabled:u,className:"".concat(x,"-quick-jumper-button")},i.jump_to_confirm):t.createElement("span",{onClick:b,onKeyUp:b},s)),E=t.createElement("div",{className:"".concat(x,"-quick-jumper")},i.jump_to,t.createElement("input",{disabled:u,type:"text",value:g,onChange:function(e){m(e.target.value)},onKeyUp:b,onBlur:function(e){s||""===g||(m(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(c,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(c,"-item"))>=0)||null==l||l(y()))},"aria-label":i.page}),i.page,k)),t.createElement("li",{className:x},w,E)},Eb=function(e){var n=e.rootPrefixCls,r=e.page,i=e.active,a=e.className,o=e.showTitle,s=e.onClick,l=e.onKeyPress,c=e.itemRender,u="".concat(n,"-item"),h=en(u,"".concat(u,"-").concat(r),O(O({},"".concat(u,"-active"),i),"".concat(u,"-disabled"),!r),a),d=c(r,"page",t.createElement("a",{rel:"nofollow"},r));return d?t.createElement("li",{title:o?String(r):null,className:h,onClick:function(){s(r)},onKeyDown:function(e){l(e,s,r)},tabIndex:0},d):null},kb=function(e,t,n){return n};function Tb(){}function _b(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function Cb(e,t,n){var r=void 0===e?t:e;return Math.floor((n-1)/r)+1}var Sb=function(e){var n=e.prefixCls,r=void 0===n?"rc-pagination":n,i=e.selectPrefixCls,a=void 0===i?"rc-select":i,o=e.className,s=e.current,c=e.defaultCurrent,u=void 0===c?1:c,h=e.total,d=void 0===h?0:h,p=e.pageSize,f=e.defaultPageSize,g=void 0===f?10:f,m=e.onChange,y=void 0===m?Tb:m,v=e.hideOnSinglePage,b=e.align,x=e.showPrevNextJumpers,w=void 0===x||x,E=e.showQuickJumper,k=e.showLessItems,T=e.showTitle,_=void 0===T||T,C=e.onShowSizeChange,S=void 0===C?Tb:C,I=e.locale,L=void 0===I?bb:I,M=e.style,R=e.totalBoundaryShowSizeChanger,P=void 0===R?50:R,$=e.disabled,B=e.simple,F=e.showTotal,z=e.showSizeChanger,j=void 0===z?d>P:z,H=e.sizeChangerRender,U=e.pageSizeOptions,G=e.itemRender,q=void 0===G?kb:G,W=e.jumpPrevIcon,V=e.jumpNextIcon,Y=e.prevIcon,X=e.nextIcon,K=t.useRef(null),Q=A(Vi(10,{value:p,defaultValue:g}),2),Z=Q[0],J=Q[1],ee=A(Vi(1,{value:s,defaultValue:u,postState:function(e){return Math.max(1,Math.min(e,Cb(void 0,Z,d)))}}),2),te=ee[0],ne=ee[1],re=A(t.useState(te),2),ie=re[0],ae=re[1];l(function(){ae(te)},[te]);var oe=Math.max(1,te-(k?3:5)),se=Math.min(Cb(void 0,Z,d),te+(k?3:5));function le(n,i){var a=n||t.createElement("button",{type:"button","aria-label":i,className:"".concat(r,"-item-link")});return"function"==typeof n&&(a=t.createElement(n,D({},e))),a}function ce(e){var t=e.target.value,n=Cb(void 0,Z,d);return""===t?t:Number.isNaN(Number(t))?ie:t>=n?n:Number(t)}var ue=d>Z&&E;function he(e){var t=ce(e);switch(t!==ie&&ae(t),e.keyCode){case ds.ENTER:de(t);break;case ds.UP:de(t-1);break;case ds.DOWN:de(t+1)}}function de(e){if(function(e){return _b(e)&&e!==te&&_b(d)&&d>0}(e)&&!$){var t=Cb(void 0,Z,d),n=e;return e>t?n=t:e<1&&(n=1),n!==ie&&ae(n),ne(n),null==y||y(n,Z),n}return te}var pe=te>1,fe=te2?n-2:0),i=2;id?d:te*Z])),Te=null,_e=Cb(void 0,Z,d);if(v&&d<=Z)return null;var Ce=[],Se={rootPrefixCls:r,onClick:de,onKeyPress:be,showTitle:_,itemRender:q,page:-1},Ae=te-1>0?te-1:0,Ne=te+1<_e?te+1:_e,Ie=E&&E.goButton,Oe="object"===N(B)?B.readOnly:!B,Le=Ie,Me=null;B&&(Ie&&(Le="boolean"==typeof Ie?t.createElement("button",{type:"button",onClick:xe,onKeyUp:xe},L.jump_to_confirm):t.createElement("span",{onClick:xe,onKeyUp:xe},Ie),Le=t.createElement("li",{title:_?"".concat(L.jump_to).concat(te,"/").concat(_e):null,className:"".concat(r,"-simple-pager")},Le)),Me=t.createElement("li",{title:_?"".concat(te,"/").concat(_e):null,className:"".concat(r,"-simple-pager")},Oe?ie:t.createElement("input",{type:"text","aria-label":L.jump_to,value:ie,disabled:$,onKeyDown:function(e){e.keyCode!==ds.UP&&e.keyCode!==ds.DOWN||e.preventDefault()},onKeyUp:he,onChange:he,onBlur:function(e){de(ce(e))},size:3}),t.createElement("span",{className:"".concat(r,"-slash")},"/"),_e));var Re=k?1:2;if(_e<=3+2*Re){_e||Ce.push(t.createElement(Eb,Xe({},Se,{key:"noPager",page:1,className:"".concat(r,"-item-disabled")})));for(var De=1;De<=_e;De+=1)Ce.push(t.createElement(Eb,Xe({},Se,{key:De,page:De,active:te===De})))}else{var Pe=k?L.prev_3:L.prev_5,$e=k?L.next_3:L.next_5,Be=q(oe,"jump-prev",le(W,"prev page")),Fe=q(se,"jump-next",le(V,"next page"));w&&(we=Be?t.createElement("li",{title:_?Pe:null,key:"prev",onClick:ye,tabIndex:0,onKeyDown:function(e){be(e,ye)},className:en("".concat(r,"-jump-prev"),O({},"".concat(r,"-jump-prev-custom-icon"),!!W))},Be):null,Te=Fe?t.createElement("li",{title:_?$e:null,key:"next",onClick:ve,tabIndex:0,onKeyDown:function(e){be(e,ve)},className:en("".concat(r,"-jump-next"),O({},"".concat(r,"-jump-next-custom-icon"),!!V))},Fe):null);var ze=Math.max(1,te-Re),je=Math.min(te+Re,_e);te-1<=Re&&(je=1+2*Re),_e-te<=Re&&(ze=_e-2*Re);for(var He=ze;He<=je;He+=1)Ce.push(t.createElement(Eb,Xe({},Se,{key:He,page:He,active:te===He})));if(te-1>=2*Re&&3!==te&&(Ce[0]=t.cloneElement(Ce[0],{className:en("".concat(r,"-item-after-jump-prev"),Ce[0].props.className)}),Ce.unshift(we)),_e-te>=2*Re&&te!==_e-2){var Ue=Ce[Ce.length-1];Ce[Ce.length-1]=t.cloneElement(Ue,{className:en("".concat(r,"-item-before-jump-next"),Ue.props.className)}),Ce.push(Te)}1!==ze&&Ce.unshift(t.createElement(Eb,Xe({},Se,{key:1,page:1}))),je!==_e&&Ce.push(t.createElement(Eb,Xe({},Se,{key:_e,page:_e})))}var Ge=function(e){var n=q(e,"prev",le(Y,"prev page"));return t.isValidElement(n)?t.cloneElement(n,{disabled:!pe}):n}(Ae);if(Ge){var qe=!pe||!_e;Ge=t.createElement("li",{title:_?L.prev_page:null,onClick:ge,tabIndex:qe?null:0,onKeyDown:function(e){be(e,ge)},className:en("".concat(r,"-prev"),O({},"".concat(r,"-disabled"),qe)),"aria-disabled":qe},Ge)}var We,Ve,Ye=function(e){var n=q(e,"next",le(X,"next page"));return t.isValidElement(n)?t.cloneElement(n,{disabled:!fe}):n}(Ne);Ye&&(B?(We=!fe,Ve=pe?0:null):Ve=(We=!fe||!_e)?null:0,Ye=t.createElement("li",{title:_?L.next_page:null,onClick:me,tabIndex:Ve,onKeyDown:function(e){be(e,me)},className:en("".concat(r,"-next"),O({},"".concat(r,"-disabled"),We)),"aria-disabled":We},Ye));var Ke=en(r,o,O(O(O(O(O({},"".concat(r,"-start"),"start"===b),"".concat(r,"-center"),"center"===b),"".concat(r,"-end"),"end"===b),"".concat(r,"-simple"),B),"".concat(r,"-disabled"),$));return t.createElement("ul",Xe({className:Ke,style:M,ref:K},Ee),ke,Ge,B?Me:Ce,Ye,t.createElement(wb,{locale:L,rootPrefixCls:r,disabled:$,selectPrefixCls:a,changeSize:function(e){var t=Cb(e,Z,d),n=te>t&&0!==t?t:te;J(e),ae(n),null==S||S(te,e),ne(n),null==y||y(n,e)},pageSize:Z,pageSizeOptions:U,quickGo:ue?de:null,goButton:Le,showSizeChanger:j,sizeChangerRender:H}))};const Ab=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Nb=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:Le(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`\n &${t}-mini ${t}-prev ${t}-item-link,\n &${t}-mini ${t}-next ${t}-item-link\n `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM),input:Object.assign(Object.assign({},oy(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},Ib=e=>{const{componentCls:t}=e;return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSize,lineHeight:Le(e.itemSize),verticalAlign:"top",[`${t}-item-link`]:{height:e.itemSize,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSize,lineHeight:Le(e.itemSize)}}},[`${t}-simple-pager`]:{display:"inline-flex",alignItems:"center",height:e.itemSize,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",width:e.quickJumperInputWidth,padding:`0 ${Le(e.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${Le(e.inputOutlineOffset)} 0 ${Le(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}},[`&${t}-mini`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM),[`${t}-item-link`]:{height:e.itemSizeSM,"&::after":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)}}},[`${t}-simple-pager`]:{height:e.itemSizeSM,input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},Ob=e=>{const{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`\n ${t}-prev,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{marginInlineEnd:e.marginXS},[`\n ${t}-prev,\n ${t}-next,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:Le(e.itemSize),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:Le(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},sy(e)),qm(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},Gm(e)),width:e.quickJumperInputWidth,height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},Lb=e=>{const{componentCls:t}=e;return{[`${t}-item`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:Le(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:e.itemBg,border:`${Le(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Le(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},Mb=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),{display:"flex","&-start":{justifyContent:"start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"end"},"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:Le(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),Lb(e)),Ob(e)),Ib(e)),Nb(e)),Ab(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}}),[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},Rb=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},va(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},ya(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:ya(e)}}}},Db=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},Hm(e)),Pb=e=>Qi(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},jm(e));var $b=wa("Pagination",e=>{const t=Pb(e);return[Mb(t),Rb(t)]},Db);var Bb=ka(["Pagination","bordered"],e=>(e=>{const{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}${t}-bordered:not(${t}-mini)`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}})(Pb(e)),Db);function Fb(e){return h(()=>"boolean"==typeof e?[e,{}]:e&&"object"==typeof e?[!0,e]:[void 0,void 0],[e])}var zb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{align:n,prefixCls:r,selectPrefixCls:i,className:a,rootClassName:o,style:s,size:l,locale:c,responsive:u,showSizeChanger:h,selectComponentClass:d,pageSizeOptions:p}=t,f=zb(t,["align","prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","responsive","showSizeChanger","selectComponentClass","pageSizeOptions"]),{xs:g}=Gg(u),[,m]=fa(),{getPrefixCls:y,direction:v,showSizeChanger:b,className:x,style:w}=Ii("pagination"),E=y("pagination",r),[k,T,_]=$b(E),C=rl(l),S="small"===C||!(!g||C||!u),[A]=zr("Pagination",Nr),N=Object.assign(Object.assign({},A),c),[I,O]=Fb(h),[L,M]=Fb(b),R=null!=I?I:L,D=null!=O?O:M,P=d||$g,$=e.useMemo(()=>p?p.map(e=>Number(e)):void 0,[p]),B=e.useMemo(()=>{const t=e.createElement("span",{className:`${E}-item-ellipsis`},"•••");return{prevIcon:e.createElement("button",{className:`${E}-item-link`,type:"button",tabIndex:-1},"rtl"===v?e.createElement(Nl,null):e.createElement(bm,null)),nextIcon:e.createElement("button",{className:`${E}-item-link`,type:"button",tabIndex:-1},"rtl"===v?e.createElement(bm,null):e.createElement(Nl,null)),jumpPrevIcon:e.createElement("a",{className:`${E}-item-link`},e.createElement("div",{className:`${E}-item-container`},"rtl"===v?e.createElement(vb,{className:`${E}-item-link-icon`}):e.createElement(gb,{className:`${E}-item-link-icon`}),t)),jumpNextIcon:e.createElement("a",{className:`${E}-item-link`},e.createElement("div",{className:`${E}-item-container`},"rtl"===v?e.createElement(gb,{className:`${E}-item-link-icon`}):e.createElement(vb,{className:`${E}-item-link-icon`}),t))}},[v,E]),F=y("select",i),z=en({[`${E}-${n}`]:!!n,[`${E}-mini`]:S,[`${E}-rtl`]:"rtl"===v,[`${E}-bordered`]:m.wireframe},x,a,o,T,_),j=Object.assign(Object.assign({},w),s);return k(e.createElement(e.Fragment,null,m.wireframe&&e.createElement(Bb,{prefixCls:E}),e.createElement(Sb,Object.assign({},B,f,{style:j,prefixCls:E,selectPrefixCls:F,className:z,locale:N,pageSizeOptions:$,showSizeChanger:R,sizeChangerRender:t=>{var n;const{disabled:r,size:i,onSizeChange:a,"aria-label":o,className:s,options:l}=t,{className:c,onChange:u}=D||{},h=null===(n=l.find(e=>String(e.value)===String(i)))||void 0===n?void 0:n.value;return e.createElement(P,Object.assign({disabled:r,showSearch:!0,popupMatchSelectWidth:!1,getPopupContainer:e=>e.parentNode,"aria-label":o,options:l},D,{value:h,onChange:(e,t)=>{null==a||a(e),null==u||u(e,t)},size:S?"small":"middle",className:en(s,c)}))}}))))},Hb=80*Math.PI,Ub=t=>{const{dotClassName:n,style:r,hasCircleCls:i}=t;return e.createElement("circle",{className:en(`${n}-circle`,{[`${n}-circle-bg`]:i}),r:40,cx:50,cy:50,strokeWidth:20,style:r})},Gb=({percent:t,prefixCls:n})=>{const r=`${n}-dot`,i=`${r}-holder`,a=`${i}-hidden`,[o,s]=e.useState(!1);Be(()=>{0!==t&&s(!0)},[0!==t]);const l=Math.max(Math.min(t,100),0);if(!o)return null;const c={strokeDashoffset:""+Hb/4,strokeDasharray:`${Hb*l/100} ${Hb*(100-l)/100}`};return e.createElement("span",{className:en(i,`${r}-progress`,l<=0&&a)},e.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":l},e.createElement(Ub,{dotClassName:r,hasCircleCls:!0}),e.createElement(Ub,{dotClassName:r,style:c})))};function qb(t){const{prefixCls:n,percent:r=0}=t,i=`${n}-dot`,a=`${i}-holder`,o=`${a}-hidden`;return e.createElement(e.Fragment,null,e.createElement("span",{className:en(a,r>0&&o)},e.createElement("span",{className:en(i,`${n}-dot-spin`)},[1,2,3,4].map(t=>e.createElement("i",{className:`${n}-dot-item`,key:t})))),e.createElement(Gb,{prefixCls:n,percent:r}))}function Wb(t){var n;const{prefixCls:r,indicator:i,percent:a}=t,o=`${r}-dot`;return i&&e.isValidElement(i)?us(i,{className:en(null===(n=i.props)||void 0===n?void 0:n.className,o),percent:a}):e.createElement(qb,{prefixCls:r,percent:a})}const Vb=new Xt("antSpinMove",{to:{opacity:1}}),Yb=new Xt("antRotate",{to:{transform:"rotate(405deg)"}});var Xb=wa("Spin",e=>(e=>{const{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},ma(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Vb,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Yb,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})(Qi(e,{spinDotDefault:e.colorTextDescription})),e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}});const Kb=[[30,.05],[70,.03],[96,.01]];var Qb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var n;const{prefixCls:r,spinning:i=!0,delay:a=0,className:o,rootClassName:s,size:l="default",tip:c,wrapperClassName:u,style:h,children:d,fullscreen:p=!1,indicator:f,percent:g}=t,m=Qb(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:y,direction:v,className:b,style:x,indicator:w}=Ii("spin"),E=y("spin",r),[k,T,_]=Xb(E),[C,S]=e.useState(()=>i&&!function(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}(i,a)),A=function(t,n){const[r,i]=e.useState(0),a=e.useRef(null),o="auto"===n;return e.useEffect(()=>(o&&t&&(i(0),a.current=setInterval(()=>{i(e=>{const t=100-e;for(let n=0;n{clearInterval(a.current)}),[o,t]),o?r:n}(C,g);e.useEffect(()=>{if(i){const e=yy(a,()=>{S(!0)});return e(),()=>{var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}}S(!1)},[a,i]);const N=e.useMemo(()=>void 0!==d&&!p,[d,p]),I=en(E,b,{[`${E}-sm`]:"small"===l,[`${E}-lg`]:"large"===l,[`${E}-spinning`]:C,[`${E}-show-text`]:!!c,[`${E}-rtl`]:"rtl"===v},o,!p&&s,T,_),O=en(`${E}-container`,{[`${E}-blur`]:C}),L=null!==(n=null!=f?f:w)&&void 0!==n?n:Zb,M=Object.assign(Object.assign({},x),h),R=e.createElement("div",Object.assign({},m,{style:M,className:I,"aria-live":"polite","aria-busy":C}),e.createElement(Wb,{prefixCls:E,indicator:L,percent:A}),c&&(N||p)?e.createElement("div",{className:`${E}-text`},c):null);return k(N?e.createElement("div",Object.assign({},m,{className:en(`${E}-nested-loading`,u,T,_)}),C&&e.createElement("div",{key:"loading"},R),e.createElement("div",{className:O,key:"container"},d)):p?e.createElement("div",{className:en(`${E}-fullscreen`,{[`${E}-fullscreen-show`]:C},s,T,_)},R):R)};Jb.setDefaultIndicator=e=>{Zb=e};const ex=t.createContext({});ex.Consumer;var tx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:i,children:a,actions:o,extra:s,styles:l,className:c,classNames:u,colStyle:h}=e,d=tx(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:f,itemLayout:g}=n(ex),{getPrefixCls:m,list:y}=n(Si),v=e=>{var t,n;return en(null===(n=null===(t=null==y?void 0:y.item)||void 0===t?void 0:t.classNames)||void 0===n?void 0:n[e],null==u?void 0:u[e])},b=e=>{var t,n;return Object.assign(Object.assign({},null===(n=null===(t=null==y?void 0:y.item)||void 0===t?void 0:t.styles)||void 0===n?void 0:n[e]),null==l?void 0:l[e])},x=m("list",i),w=o&&o.length>0&&t.createElement("ul",{className:en(`${x}-item-action`,v("actions")),key:"actions",style:b("actions")},o.map((e,n)=>t.createElement("li",{key:`${x}-item-action-${n}`},e,n!==o.length-1&&t.createElement("em",{className:`${x}-item-action-split`})))),E=f?"div":"li",k=t.createElement(E,Object.assign({},d,f?{}:{ref:r},{className:en(`${x}-item`,{[`${x}-item-no-flex`]:!("vertical"===g?s:!(()=>{let e=!1;return p.forEach(a,t=>{"string"==typeof t&&(e=!0)}),e&&p.count(a)>1})())},c)}),"vertical"===g&&s?[t.createElement("div",{className:`${x}-item-main`,key:"content"},a,w),t.createElement("div",{className:en(`${x}-item-extra`,v("extra")),key:"extra",style:b("extra")},s)]:[a,w,us(s,{key:"extra"})]);return f?t.createElement(Oy,{ref:r,flex:1,style:h},k):k}),rx=nx;rx.Meta=e=>{var{prefixCls:r,className:i,avatar:a,title:o,description:s}=e,l=tx(e,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:c}=n(Si),u=c("list",r),h=en(`${u}-item-meta`,i),d=t.createElement("div",{className:`${u}-item-meta-content`},o&&t.createElement("h4",{className:`${u}-item-meta-title`},o),s&&t.createElement("div",{className:`${u}-item-meta-description`},s));return t.createElement("div",Object.assign({},l,{className:h}),a&&t.createElement("div",{className:`${u}-item-meta-avatar`},a),(o||s)&&d)};const ix=e=>{const{listBorderedCls:t,componentCls:n,paddingLG:r,margin:i,itemPaddingSM:a,itemPaddingLG:o,marginLG:s,borderRadiusLG:l}=e;return{[t]:{border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:l,[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:r},[`${n}-pagination`]:{margin:`${Le(i)} ${Le(s)}`}},[`${t}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:a}},[`${t}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:o}}}},ax=e=>{const{componentCls:t,screenSM:n,screenMD:r,marginLG:i,marginSM:a,margin:o}=e;return{[`@media screen and (max-width:${r}px)`]:{[t]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:i}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:i}}}},[`@media screen and (max-width: ${n}px)`]:{[t]:{[`${t}-item`]:{flexWrap:"wrap",[`${t}-action`]:{marginInlineStart:a}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:"wrap-reverse",[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${Le(o)}`}}}}}},ox=e=>{const{componentCls:t,antCls:n,controlHeight:r,minHeight:i,paddingSM:a,marginLG:o,padding:s,itemPadding:l,colorPrimary:c,itemPaddingSM:u,itemPaddingLG:h,paddingXS:d,margin:p,colorText:f,colorTextDescription:g,motionDurationSlow:m,lineWidth:y,headerBg:v,footerBg:b,emptyTextPadding:x,metaMarginBottom:w,avatarMarginRight:E,titleMarginBottom:k,descriptionFontSize:T}=e;return{[t]:Object.assign(Object.assign({},ma(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},[`${t}-header`]:{background:v},[`${t}-footer`]:{background:b},[`${t}-header, ${t}-footer`]:{paddingBlock:a},[`${t}-pagination`]:{marginBlockStart:o,[`${n}-pagination-options`]:{textAlign:"start"}},[`${t}-spin`]:{minHeight:i,textAlign:"center"},[`${t}-items`]:{margin:0,padding:0,listStyle:"none"},[`${t}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:f,[`${t}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${t}-item-meta-avatar`]:{marginInlineEnd:E},[`${t}-item-meta-content`]:{flex:"1 0",width:0,color:f},[`${t}-item-meta-title`]:{margin:`0 0 ${Le(e.marginXXS)} 0`,color:f,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:f,transition:`all ${m}`,"&:hover":{color:c}}},[`${t}-item-meta-description`]:{color:g,fontSize:T,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${Le(d)}`,color:g,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:y,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${Le(s)} 0`,color:g,fontSize:e.fontSizeSM,textAlign:"center"},[`${t}-empty-text`]:{padding:x,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},[`${t}-item-no-flex`]:{display:"block"}}),[`${t}-grid ${n}-col > ${t}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},[`${t}-vertical ${t}-item`]:{alignItems:"initial",[`${t}-item-main`]:{display:"block",flex:1},[`${t}-item-extra`]:{marginInlineStart:o},[`${t}-item-meta`]:{marginBlockEnd:w,[`${t}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:k,color:f,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:s,marginInlineStart:"auto","> li":{padding:`0 ${Le(s)}`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:r},[`${t}-split${t}-something-after-last-item ${n}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:h},[`${t}-sm ${t}-item`]:{padding:u},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:"right"}}}}};var sx=wa("List",e=>{const t=Qi(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG});return[ox(t),ix(t),ax(t)]},e=>({contentWidth:220,itemPadding:`${Le(e.paddingContentVertical)} 0`,itemPaddingSM:`${Le(e.paddingContentVerticalSM)} ${Le(e.paddingContentHorizontal)}`,itemPaddingLG:`${Le(e.paddingContentVerticalLG)} ${Le(e.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize})),lx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(t,n)=>{var i;_(t),S(n),r&&(null===(i=null==r?void 0:r[e])||void 0===i||i.call(r,t,n))},D=R("onChange"),P=R("onShowSizeChange"),$=(t,n)=>{if(!x)return null;let r;return r="function"==typeof b?b(t):b?t[b]:t.key,r||(r=`list-item-${n}`),e.createElement(e.Fragment,{key:r},x(t,n))},B=!!(d||r||y),F=A("list",i),[z,j,H]=sx(F);let U=v;"boolean"==typeof U&&(U={spinning:U});const G=!!(null==U?void 0:U.spinning);let q="";switch(rl(g)){case"large":q="lg";break;case"small":q="sm"}const W=en(F,{[`${F}-vertical`]:"vertical"===h,[`${F}-${q}`]:q,[`${F}-split`]:o,[`${F}-bordered`]:a,[`${F}-loading`]:G,[`${F}-grid`]:!!p,[`${F}-something-after-last-item`]:B,[`${F}-rtl`]:"rtl"===N},I,s,l,j,H),V=Nh({current:1,total:0,position:"bottom"},{total:f.length,current:T,pageSize:C},r||{}),Y=Math.ceil(V.total/V.pageSize);V.current=Math.min(V.current,Y);const X=r&&e.createElement("div",{className:en(`${F}-pagination`)},e.createElement(jb,Object.assign({align:"end"},V,{onChange:D,onShowSizeChange:P})));let K=M(f);r&&f.length>(V.current-1)*V.pageSize&&(K=M(f).splice((V.current-1)*V.pageSize,V.pageSize));const Q=Gg(Object.keys(p||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e))),Z=e.useMemo(()=>{for(let e=0;e{if(!p)return;const e=Z&&p[Z]?p[Z]:p.column;return e?{width:100/e+"%",maxWidth:100/e+"%"}:void 0},[JSON.stringify(p),Z]);let ee=G&&e.createElement("div",{style:{minHeight:53}});if(K.length>0){const t=K.map($);ee=p?e.createElement(Ry,{gutter:p.gutter},e.Children.map(t,t=>e.createElement("div",{key:null==t?void 0:t.key,style:J},t))):e.createElement("ul",{className:`${F}-items`},t)}else u||G||(ee=e.createElement("div",{className:`${F}-empty-text`},(null==w?void 0:w.emptyText)||(null==L?void 0:L("List"))||e.createElement(Zf,{componentName:"List"})));const te=V.position,ne=e.useMemo(()=>({grid:p,itemLayout:h}),[JSON.stringify(p),h]);return z(e.createElement(ex.Provider,{value:ne},e.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},O),c),className:W},E),("top"===te||"both"===te)&&X,m&&e.createElement("div",{className:`${F}-header`},m),e.createElement(Jb,Object.assign({},U),ee,u),y&&e.createElement("div",{className:`${F}-footer`},y),d||("bottom"===te||"both"===te)&&X)))}const ux=e.forwardRef(cx);ux.Item=rx;var hx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:n,className:r,closeIcon:i,closable:a,type:o,title:s,children:l,footer:c}=t,u=hx(t,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:h}=e.useContext(Si),d=h(),p=n||h("modal"),f=hs(d),[g,m,y]=bd(p,f),v=`${p}-confirm`;let b={};return b=o?{closable:null!=a&&a,title:"",footer:"",children:e.createElement(Cd,Object.assign({},t,{prefixCls:p,confirmPrefixCls:v,rootPrefixCls:d,content:l}))}:{closable:null==a||a,title:s,footer:null!==c&&e.createElement(od,Object.assign({},t)),children:l},g(e.createElement(gu,Object.assign({prefixCls:p,className:en(m,`${p}-pure-panel`,o&&v,o&&`${v}-${o}`,r,y,f)},u,{closeIcon:ad(p,i),closable:a},b)))});function px(e){return Md(Rd(e))}const fx=kd;fx.useModal=function(){const t=e.useRef(null),[n,r]=e.useState([]);e.useEffect(()=>{if(n.length){M(n).forEach(e=>{e()}),r([])}},[n]);const i=e.useCallback(n=>function(i){var a;Hd+=1;const o=e.createRef();let s;const l=new Promise(e=>{s=e});let c,u=!1;const h=e.createElement(jd,{key:`modal-${Hd}`,config:n(i),ref:o,afterClose:()=>{null==c||c()},isSilent:()=>u,onConfirm:e=>{s(e)}});c=null===(a=t.current)||void 0===a?void 0:a.patchElement(h),c&&Nd.push(c);const d={destroy:()=>{function e(){var e;null===(e=o.current)||void 0===e||e.destroy()}o.current?e():r(t=>[].concat(M(t),[e]))},update:e=>{function t(){var t;null===(t=o.current)||void 0===t||t.update(e)}o.current?t():r(e=>[].concat(M(e),[t]))},then:e=>(u=!0,l.then(e))};return d},[]);return[e.useMemo(()=>({info:i(Dd),success:i(Pd),error:i($d),warning:i(Rd),confirm:i(Bd)}),[]),e.createElement(Ud,{key:"modal-holder",ref:t})]},fx.info=function(e){return Md(Dd(e))},fx.success=function(e){return Md(Pd(e))},fx.error=function(e){return Md($d(e))},fx.warning=px,fx.warn=px,fx.confirm=function(e){return Md(Bd(e))},fx.destroyAll=function(){for(;Nd.length;){const e=Nd.pop();e&&e()}},fx.config=function({rootPrefixCls:e}){Id=e},fx._InternalPanelDoNotUseOrYouWillBeFired=dx;const gx=e=>{const{lineWidth:t,fontSizeIcon:n,calc:r}=e,i=e.fontSizeSM;return Qi(e,{tagFontSize:i,tagLineHeight:Le(r(e.lineHeightSM).mul(i).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},mx=e=>({defaultBg:new Yr(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var yx=wa("Tag",e=>(e=>{const{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:i,calc:a}=e,o=a(r).sub(n).equal(),s=a(t).sub(n).equal();return{[i]:Object.assign(Object.assign({},ma(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:o,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${i}-close-icon`]:{marginInlineStart:s,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${i}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:o}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(gx(e)),mx),vx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,style:i,className:a,checked:o,children:s,icon:l,onChange:c,onClick:u}=t,h=vx(t,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:d,tag:p}=e.useContext(Si),f=d("tag",r),[g,m,y]=yx(f),v=en(f,`${f}-checkable`,{[`${f}-checkable-checked`]:o},null==p?void 0:p.className,a,m,y);return g(e.createElement("span",Object.assign({},h,{ref:n,style:Object.assign(Object.assign({},i),null==p?void 0:p.style),className:v,onClick:e=>{null==c||c(!o),null==u||u(e)}}),l,e.createElement("span",null,s)))});var xx=ka(["Tag","preset"],e=>(e=>Ta(e,(t,{textColor:n,lightBorderColor:r,lightColor:i,darkColor:a})=>({[`${e.componentCls}${e.componentCls}-${t}`]:{color:n,background:i,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}})))(gx(e)),mx);const wx=(e,t,n)=>{const r=function(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}(n);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var Ex=ka(["Tag","status"],e=>{const t=gx(e);return[wx(t,"success","Success"),wx(t,"processing","Info"),wx(t,"error","Error"),wx(t,"warning","Warning")]},mx),kx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,className:i,rootClassName:a,style:o,children:s,icon:l,color:c,onClose:u,bordered:h=!0,visible:d}=t,p=kx(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:f,direction:g,tag:m}=e.useContext(Si),[y,v]=e.useState(!0),b=Vs(p,["closeIcon","closable"]);e.useEffect(()=>{void 0!==d&&v(d)},[d]);const x=dm(c),w=function(e){return hm.includes(e)}(c),E=x||w,k=Object.assign(Object.assign({backgroundColor:c&&!E?c:void 0},null==m?void 0:m.style),o),T=f("tag",r),[_,C,S]=yx(T),A=en(T,null==m?void 0:m.className,{[`${T}-${c}`]:E,[`${T}-has-color`]:c&&!E,[`${T}-hidden`]:!y,[`${T}-rtl`]:"rtl"===g,[`${T}-borderless`]:!h},i,a,C,S),N=e=>{e.stopPropagation(),null==u||u(e),e.defaultPrevented||v(!1)},[,I]=Mh(Ih(t),Ih(m),{closable:!1,closeIconRender:t=>cs(t,e.createElement("span",{className:`${T}-close-icon`,onClick:N},t),e=>({onClick:t=>{var n;null===(n=null==e?void 0:e.onClick)||void 0===n||n.call(e,t),N(t)},className:en(null==e?void 0:e.className,`${T}-close-icon`)}))}),O="function"==typeof p.onClick||s&&"a"===s.type,L=l||null,M=L?e.createElement(e.Fragment,null,L,s&&e.createElement("span",null,s)):s,R=e.createElement("span",Object.assign({},b,{ref:n,className:A,style:k}),M,I,x&&e.createElement(xx,{key:"preset",prefixCls:T}),w&&e.createElement(Ex,{key:"status",prefixCls:T}));return _(O?e.createElement(nl,{component:"Tag"},R):R)}),_x=Tx;_x.CheckableTag=bx;var Cx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Sx=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Cx}))},Ax=e.forwardRef(Sx),Nx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},Ix=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Nx}))},Ox=e.forwardRef(Ix);const Lx=e=>{const t={};return[1,2,3,4,5].forEach(n=>{t[`\n h${n}&,\n div&-h${n},\n div&-h${n} > textarea,\n h${n}\n `]=((e,t,n,r)=>{const{titleMarginBottom:i,fontWeightStrong:a}=r;return{marginBottom:i,color:n,fontWeight:a,fontSize:e,lineHeight:t}})(e[`fontSizeHeading${n}`],e[`lineHeightHeading${n}`],e.colorTextHeading,e)}),t},Mx=e=>{const{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},xa(e)),{userSelect:"text",[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},Rx=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:ii[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),Dx=e=>{const{componentCls:t,paddingSM:n}=e,r=n;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(r).div(-2).add(1).equal(),marginBottom:e.calc(r).div(2).sub(2).equal()},[`${t}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},Px=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}});var $x=wa("Typography",e=>{const{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccessText},[`&${t}-warning`]:{color:e.colorWarningText},[`&${t}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},Lx(e)),{[`\n & + h1${t},\n & + h2${t},\n & + h3${t},\n & + h4${t},\n & + h5${t}\n `]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),Rx(e)),Mx(e)),{[`\n ${t}-expand,\n ${t}-collapse,\n ${t}-edit,\n ${t}-copy\n `]:Object.assign(Object.assign({},xa(e)),{marginInlineStart:e.marginXXS})}),Dx(e)),Px(e)),{"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-ellipsis-single-line":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),{"&-rtl":{direction:"rtl"}})}},()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}));const Bx=t=>{const{prefixCls:n,"aria-label":r,className:i,style:a,direction:o,maxLength:s,autoSize:l=!0,value:c,onSave:u,onCancel:h,onEnd:d,component:p,enterIcon:f=e.createElement(Ox,null)}=t,g=e.useRef(null),m=e.useRef(!1),y=e.useRef(null),[v,b]=e.useState(c);e.useEffect(()=>{b(c)},[c]),e.useEffect(()=>{var e;if(null===(e=g.current)||void 0===e?void 0:e.resizableTextArea){const{textArea:e}=g.current.resizableTextArea;e.focus();const{length:t}=e.value;e.setSelectionRange(t,t)}},[]);const x=()=>{u(v.trim())},[w,E,k]=$x(n),T=en(n,`${n}-edit-content`,{[`${n}-rtl`]:"rtl"===o,[`${n}-${p}`]:!!p},i,E,k);return w(e.createElement("div",{className:T,style:a},e.createElement(nb,{ref:g,maxLength:s,value:v,onChange:({target:e})=>{b(e.value.replace(/[\n\r]/g,""))},onKeyDown:({keyCode:e})=>{m.current||(y.current=e)},onKeyUp:({keyCode:e,ctrlKey:t,altKey:n,metaKey:r,shiftKey:i})=>{y.current!==e||m.current||t||n||r||i||(e===ds.ENTER?(x(),null==d||d()):e===ds.ESC&&h())},onCompositionStart:()=>{m.current=!0},onCompositionEnd:()=>{m.current=!1},onBlur:()=>{x()},"aria-label":r,rows:1,autoSize:l}),null!==f?us(f,{className:`${n}-edit-content-confirm`}):null))};var Fx=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r{const[r,i]=e.useState(!1),[a,o]=e.useState(!1),s=e.useRef(null),l=()=>{s.current&&clearTimeout(s.current)},c={};t.format&&(c.format=t.format),e.useEffect(()=>l,[]);const u=Gi(e=>Ux(void 0,void 0,void 0,function*(){var r;null==e||e.preventDefault(),null==e||e.stopPropagation(),o(!0);try{const a="function"==typeof t.text?yield t.text():t.text;Hx(a||((e,t=!1)=>t&&null==e?[]:Array.isArray(e)?e:[e])(n,!0).join("")||"",c),o(!1),i(!0),l(),s.current=setTimeout(()=>{i(!1)},3e3),null===(r=t.onCopy)||void 0===r||r.call(t,e)}catch(e){throw o(!1),e}}));return{copied:r,copyLoading:a,onClick:u}};function qx(t,n){return e.useMemo(()=>{const e=!!t;return[e,Object.assign(Object.assign({},n),e&&"object"==typeof t?t:null)]},[t])}var Wx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,component:i="article",className:a,rootClassName:o,setContentRef:s,children:l,direction:c,style:u}=t,h=Wx(t,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:p,className:f,style:g}=Ii("typography"),m=null!=c?c:p,y=s?In(n,s):n,v=d("typography",r),[b,x,w]=$x(v),E=en(v,f,{[`${v}-rtl`]:"rtl"===m},a,o,x,w),k=Object.assign(Object.assign({},g),u);return b(e.createElement(i,Object.assign({className:E,style:k,ref:y},h),l))});var Yx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},Xx=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Yx}))},Kx=e.forwardRef(Xx);function Qx(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}function Zx(e,t,n){return!0===e||void 0===e?t:e||n&&t}const Jx=e=>["string","number"].includes(typeof e),ew=({prefixCls:t,copied:n,locale:r,iconOnly:i,tooltips:a,icon:o,tabIndex:s,onCopy:l,loading:c})=>{const u=Qx(a),h=Qx(o),{copied:d,copy:p}=null!=r?r:{},f=n?d:p,g=Zx(u[n?1:0],f),m="string"==typeof g?g:f;return e.createElement(mm,{title:g},e.createElement("button",{type:"button",className:en(`${t}-copy`,{[`${t}-copy-success`]:n,[`${t}-copy-icon-only`]:i}),onClick:l,"aria-label":m,tabIndex:s},n?Zx(h[1],e.createElement(Sg,null),!0):Zx(h[0],c?e.createElement(gs,null):e.createElement(Kx,null),!0)))},tw=e.forwardRef(({style:t,children:n},r)=>{const i=e.useRef(null);return e.useImperativeHandle(r,()=>({isExceed:()=>{const e=i.current;return e.scrollHeight>e.clientHeight},getHeight:()=>i.current.clientHeight})),e.createElement("span",{"aria-hidden":!0,ref:i,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},t)},n)});function nw(e,t){let n=0;const r=[];for(let i=0;it){const e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=o}return e}const rw=0,iw=4,aw={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function ow(t){const{enableMeasure:n,width:r,text:i,children:a,rows:o,expanded:s,miscDeps:l,onEllipsis:c}=t,u=e.useMemo(()=>on(i),[i]),h=e.useMemo(()=>(e=>e.reduce((e,t)=>e+(Jx(t)?String(t).length:1),0))(u),[i]),d=e.useMemo(()=>a(u,!1),[i]),[p,f]=e.useState(null),g=e.useRef(null),m=e.useRef(null),y=e.useRef(null),v=e.useRef(null),b=e.useRef(null),[x,w]=e.useState(!1),[E,k]=e.useState(rw),[T,_]=e.useState(0),[C,S]=e.useState(null);Be(()=>{k(n&&r&&h?1:rw)},[r,i,o,n,u]),Be(()=>{var e,t,n,r;if(1===E){k(2);const e=m.current&&getComputedStyle(m.current).whiteSpace;S(e)}else if(2===E){const i=!!(null===(e=y.current)||void 0===e?void 0:e.isExceed());k(i?3:iw),f(i?[0,h]:null),w(i);const a=(null===(t=y.current)||void 0===t?void 0:t.getHeight())||0,s=1===o?0:(null===(n=v.current)||void 0===n?void 0:n.getHeight())||0,l=(null===(r=b.current)||void 0===r?void 0:r.getHeight())||0,u=Math.max(a,s+l);_(u+1),c(i)}},[E]);const A=p?Math.ceil((p[0]+p[1])/2):0;Be(()=>{var e;const[t,n]=p||[0,0];if(t!==n){const r=((null===(e=g.current)||void 0===e?void 0:e.getHeight())||0)>T;let i=A;n-t===1&&(i=r?t:n),f(r?[t,i]:[i,n])}},[p,A]);const N=e.useMemo(()=>{if(!n)return a(u,!1);if(3!==E||!p||p[0]!==p[1]){const t=a(u,!1);return[iw,rw].includes(E)?t:e.createElement("span",{style:Object.assign(Object.assign({},aw),{WebkitLineClamp:o})},t)}return a(s?u:nw(u,p[0]),x)},[s,E,p,u].concat(M(l))),I={width:r,margin:0,padding:0,whiteSpace:"nowrap"===C?"normal":"inherit"};return e.createElement(e.Fragment,null,N,2===E&&e.createElement(e.Fragment,null,e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:o}),ref:y},d),e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:o-1}),ref:v},d),e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:1}),ref:b},a([],!0))),3===E&&p&&p[0]!==p[1]&&e.createElement(tw,{style:Object.assign(Object.assign({},I),{top:400}),ref:g},a(nw(u,A),!0)),1===E&&e.createElement("span",{style:{whiteSpace:"inherit"},ref:m}))}const sw=({enableEllipsis:t,isEllipsis:n,children:r,tooltipProps:i})=>(null==i?void 0:i.title)&&t?e.createElement(mm,Object.assign({open:!!n&&void 0},i),r):r;var lw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i;const{prefixCls:a,className:s,style:c,type:u,disabled:d,children:p,ellipsis:f,editable:g,copyable:m,component:y,title:v}=t,b=lw(t,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:x,direction:w}=e.useContext(Si),[E]=zr("Text"),k=e.useRef(null),T=e.useRef(null),_=x("typography",a),C=Vs(b,cw),[S,A]=qx(g),[N,I]=Vi(!1,{value:A.editing}),{triggerType:O=["icon"]}=A,L=e=>{var t;e&&(null===(t=A.onStart)||void 0===t||t.call(A)),I(e)},R=(e=>{const t=o(void 0);return l(()=>{t.current=e}),t.current})(N);Be(()=>{var e;!N&&R&&(null===(e=T.current)||void 0===e||e.focus())},[N]);const D=e=>{null==e||e.preventDefault(),L(!0)},P=e=>{var t;null===(t=A.onChange)||void 0===t||t.call(A,e),L(!1)},$=()=>{var e;null===(e=A.onCancel)||void 0===e||e.call(A),L(!1)},[B,F]=qx(m),{copied:z,copyLoading:j,onClick:H}=Gx({copyConfig:F,children:p}),[U,G]=e.useState(!1),[q,W]=e.useState(!1),[V,Y]=e.useState(!1),[X,K]=e.useState(!1),[Q,Z]=e.useState(!0),[J,ee]=qx(f,{expandable:!1,symbol:e=>e?null==E?void 0:E.collapse:null==E?void 0:E.expand}),[te,ne]=Vi(ee.defaultExpanded||!1,{value:ee.expanded}),re=J&&(!te||"collapsible"===ee.expandable),{rows:ie=1}=ee,ae=e.useMemo(()=>re&&(void 0!==ee.suffix||ee.onEllipsis||ee.expandable||S||B),[re,ee,S,B]);Be(()=>{J&&!ae&&(G(Rh("webkitLineClamp")),W(Rh("textOverflow")))},[ae,J]);const[oe,se]=e.useState(re),le=e.useMemo(()=>!ae&&(1===ie?q:U),[ae,q,U]);Be(()=>{se(le&&re)},[le,re]);const ce=re&&(oe?X:V),ue=re&&1===ie&&oe,he=re&&ie>1&&oe,[de,pe]=e.useState(0),fe=e=>{var t;Y(e),V!==e&&(null===(t=ee.onEllipsis)||void 0===t||t.call(ee,e))};e.useEffect(()=>{const e=k.current;if(J&&oe&&e){const t=function(e){const t=document.createElement("em");e.appendChild(t);const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.removeChild(t),n.left>r.left||r.right>n.right||n.top>r.top||r.bottom>n.bottom}(e);X!==t&&K(t)}},[J,oe,p,he,Q,de]),e.useEffect(()=>{const e=k.current;if("undefined"==typeof IntersectionObserver||!e||!oe||!re)return;const t=new IntersectionObserver(()=>{Z(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[oe,re]);const ge=((e,t,n)=>h(()=>!0===e?{title:null!=t?t:n}:r(e)?{title:e}:"object"==typeof e?Object.assign({title:null!=t?t:n},e):{title:e},[e,t,n]))(ee.tooltip,A.text,p),me=e.useMemo(()=>{if(J&&!oe)return[A.text,p,v,ge.title].find(Jx)},[J,oe,v,ge.title,ce]);if(N)return e.createElement(Bx,{value:null!==(i=A.text)&&void 0!==i?i:"string"==typeof p?p:"",onSave:P,onCancel:$,onEnd:A.onEnd,prefixCls:_,className:s,style:c,direction:w,component:y,maxLength:A.maxLength,autoSize:A.autoSize,enterIcon:A.enterIcon});const ye=()=>{const{expandable:t,symbol:n}=ee;return t?e.createElement("button",{type:"button",key:"expand",className:`${_}-${te?"collapse":"expand"}`,onClick:e=>((e,t)=>{var n;ne(t.expanded),null===(n=ee.onExpand)||void 0===n||n.call(ee,e,t)})(e,{expanded:!te}),"aria-label":te?E.collapse:null==E?void 0:E.expand},"function"==typeof n?n(te):n):null},ve=()=>{if(!S)return;const{icon:t,tooltip:n,tabIndex:r}=A,i=on(n)[0]||(null==E?void 0:E.edit),a="string"==typeof i?i:"";return O.includes("icon")?e.createElement(mm,{key:"edit",title:!1===n?"":i},e.createElement("button",{type:"button",ref:T,className:`${_}-edit`,onClick:D,"aria-label":a,tabIndex:r},t||e.createElement(Ax,{role:"button"}))):null},be=t=>[t&&ye(),ve(),B?e.createElement(ew,Object.assign({key:"copy"},F,{prefixCls:_,copied:z,locale:E,onCopy:H,loading:j,iconOnly:null==p})):null];return e.createElement(ur,{onResize:({offsetWidth:e})=>{pe(e)},disabled:!re},r=>e.createElement(sw,{tooltipProps:ge,enableEllipsis:re,isEllipsis:ce},e.createElement(Vx,Object.assign({className:en({[`${_}-${u}`]:u,[`${_}-disabled`]:d,[`${_}-ellipsis`]:J,[`${_}-ellipsis-single-line`]:ue,[`${_}-ellipsis-multiple-line`]:he},s),prefixCls:a,style:Object.assign(Object.assign({},c),{WebkitLineClamp:he?ie:void 0}),component:y,ref:In(r,k,n),direction:w,onClick:O.includes("text")?D:void 0,"aria-label":null==me?void 0:me.toString(),title:v},C),e.createElement(ow,{enableMeasure:re&&!oe,text:p,rows:ie,width:de,onEllipsis:fe,expanded:te,miscDeps:[z,te,j,S,B,E].concat(M(cw.map(e=>t[e])))},(n,r)=>function({mark:t,code:n,underline:r,delete:i,strong:a,keyboard:o,italic:s},l){let c=l;function u(t,n){n&&(c=e.createElement(t,{},c))}return u("strong",a),u("u",r),u("del",i),u("code",n),u("mark",t),u("kbd",o),u("i",s),c}(t,e.createElement(e.Fragment,null,n.length>0&&r&&!te&&me?e.createElement("span",{key:"show-content","aria-hidden":!0},n):n,(t=>[t&&!te&&e.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),ee.suffix,be(t)])(r)))))))});var hw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var{ellipsis:r,rel:i}=t,a=hw(t,["ellipsis","rel"]);const o=Object.assign(Object.assign({},a),{rel:void 0===i&&"_blank"===a.target?"noopener noreferrer":i});return delete o.navigate,e.createElement(uw,Object.assign({},o,{ref:n,ellipsis:!!r,component:"a"}))}),pw=e.forwardRef((t,n)=>e.createElement(uw,Object.assign({ref:n},t,{component:"div"})));var fw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var{ellipsis:r}=t,i=fw(t,["ellipsis"]);const a=e.useMemo(()=>r&&"object"==typeof r?Vs(r,["expandable","rows"]):r,[r]);return e.createElement(uw,Object.assign({ref:n},i,{ellipsis:a,component:"span"}))};var mw=e.forwardRef(gw),yw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{level:r=1}=t,i=yw(t,["level"]),a=vw.includes(r)?`h${r}`:"h1";return e.createElement(uw,Object.assign({ref:n},i,{component:a}))}),xw=Vx;xw.Text=mw,xw.Link=dw,xw.Title=bw,xw.Paragraph=pw;var ww={exports:{}},Ew={},kw=t,Tw=Symbol.for("react.element"),_w=Symbol.for("react.fragment"),Cw=Object.prototype.hasOwnProperty,Sw=kw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Aw={key:!0,ref:!0,__self:!0,__source:!0};function Nw(e,t,n){var r,i={},a=null,o=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(o=t.ref),t)Cw.call(t,r)&&!Aw.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:Tw,type:e,key:a,ref:o,props:i,_owner:Sw.current}}Ew.Fragment=_w,Ew.jsx=Nw,Ew.jsxs=Nw,ww.exports=Ew;var Iw=ww.exports;const{Header:Ow,Content:Lw}=db,Mw=e=>{const{rootID:t,isFirst:n,loading:r,logo:i,welcome:a,searchbox:o,rightMenuWidth:s,aggregations:l,resultHeader:c,aiOverview:u,resultList:h,widgets:d,isMobile:p}=e;return Iw.jsx(Jb,{spinning:r,children:Iw.jsx(db,{id:t,children:n?Iw.jsxs(Lw,{className:"bg-[rgba(250,250,250,1)] min-h-[calc(100vh)] flex flex-col items-center justify-center",children:[Iw.jsx("div",{className:"mb-24px w-200px",children:i}),a&&Iw.jsx("div",{className:(p?"w-full px-32px":"w-627px")+" mb-60px",children:a}),Iw.jsx("div",{className:""+(p?"w-full px-24px":"w-664px"),children:o})]}):Iw.jsxs(Iw.Fragment,{children:[Iw.jsx(Ow,{className:"bg-white position-sticky top-0 z-1 w-full h-72px shadow-md px-0",children:Iw.jsxs("div",{className:"px-12px m-auto h-full flex items-center justify-"+(p?"left":"center"),children:[Iw.jsx("div",{className:"h-full "+(p?"w-40px mr-8px":"w-200px"),children:i}),Iw.jsx("div",{style:p&&s?{paddingRight:s}:{},className:"h-full "+(p?"w-[calc(100%-48px)]":"w-[calc(100%-500px)] max-w-724px pl-12 pr-10"),children:o}),!p&&Iw.jsx("div",{className:"w-300px h-full"})]})}),Iw.jsx(Lw,{className:"bg-[rgba(250,250,250,1)] h-[calc(100vh-72px)] overflow-auto",children:Iw.jsxs("div",{className:"px-12px py-24px w-full m-auto "+(p?"":"flex justify-center"),children:[!p&&Iw.jsx("div",{className:"w-200px",children:l}),Iw.jsxs("div",{className:""+(p?"mb-40px w-full":"w-[calc(100%-500px)] max-w-724px px-40px"),children:[Iw.jsx("div",{className:"mb-12px",children:c}),u&&Iw.jsx("div",{className:"mb-16px",children:u}),Iw.jsx("div",{className:"mb-24px",children:h})]}),Iw.jsx("div",{className:(p?"w-full":"w-300px mt-28px")+" flex flex-col gap-16px",children:d})]})})]})})})};var Rw="index-module__searchbox___Dj4nM"; +var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Ss(c,"_invoke",function(n,r,i){var a,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,l=e,d.n=n,o}};function p(n,r){for(s=n,l=r,t=0;!h&&c&&!i&&t3?(i=f===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&pr||r>f)&&(a[4]=n,a[5]=r,d.n=f,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==o)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,i,a),!0),c}var o={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ss(t={},r,function(){return this}),t),h=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ss(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,Ss(h,"constructor",c),Ss(c,"constructor",l),l.displayName="GeneratorFunction",Ss(c,i,"GeneratorFunction"),Ss(h),Ss(h,i,"Generator"),Ss(h,r,function(){return this}),Ss(h,"toString",function(){return"[object Generator]"}),(As=function(){return{w:a,m:d}})()}function Ns(e,t){function n(r,i,a,o){try{var s=e[r](i),l=s.value;return l instanceof Cs?t.resolve(l.v).then(function(e){n("next",e,a,o)},function(e){n("throw",e,a,o)}):t.resolve(l).then(function(e){s.value=e,a(s)},function(e){return n("throw",e,a,o)})}catch(e){o(e)}}var r;this.next||(Ss(Ns.prototype),Ss(Ns.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Ss(this,"_invoke",function(e,i,a){function o(){return new t(function(t,r){n(e,a,t,r)})}return r=r?r.then(o,o):o()},!0)}function Is(e,t,n,r,i){return new Ns(As().w(e,t,n,r),i||Promise)}function Os(e,t,n,r,i){var a=Is(e,t,n,r,i);return a.next().then(function(e){return e.done?e.value:a.next()})}function Ls(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function Ms(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(N(e)+" is not iterable")}function Rs(){var e=As(),t=e.m(Rs),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var i={throw:1,return:2,break:3,continue:3};function a(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,i[e],t)},delegateYield:function(e,i,a){return t.resultName=i,n(r.d,Ms(e),a)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(Rs=function(){return{wrap:function(t,n,r,i){return e.w(a(t),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new Cs(e,t)},AsyncIterator:Ns,async:function(e,t,n,i,o){return(r(t)?Is:Os)(a(e),t,n,i,o)},keys:Ls,values:Ms}})()}function Ds(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Ps(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Ds(a,r,i,o,s,"next",e)}function s(e){Ds(a,r,i,o,s,"throw",e)}o(void 0)})}}var $s,Bs=D({},b),Fs=Bs.version,zs=Bs.render,js=Bs.unmountComponentAtNode;try{Number((Fs||"").split(".")[0])>=18&&($s=Bs.createRoot)}catch(b7){}function Hs(e){var t=Bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===N(t)&&(t.usingClientEntryPoint=e)}var Us="__rc_react_root__";function Gs(e,t){$s?function(e,t){Hs(!0);var n=t[Us]||$s(t);Hs(!1),n.render(e),t[Us]=n}(e,t):function(e,t){null==zs||zs(e,t)}(e,t)}function qs(e){return Ws.apply(this,arguments)}function Ws(){return(Ws=Ps(Rs().mark(function e(t){return Rs().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[Us])||void 0===e||e.unmount(),delete t[Us]}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Vs(e){js(e)}function Ys(){return(Ys=Ps(Rs().mark(function e(t){return Rs().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===$s){e.next=2;break}return e.abrupt("return",qs(t));case 2:Vs(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}let Xs=(e,t)=>(Gs(e,t),()=>function(e){return Ys.apply(this,arguments)}(t));function Ks(e){return Xs}const Qs=(e,t,n)=>void 0!==n?n:`${e}-${t}`;function Zs(e,t){var n=Object.assign({},e);return Array.isArray(t)&&t.forEach(function(e){delete n[e]}),n}var Js=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),a=i.width,o=i.height;if(a||o)return!0}}return!1};var el=Ea("Wave",e=>{const{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`,`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")}}}}});const tl=`${Ti}-wave-target`;function nl(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e&&"canvastext"!==e}function rl(e){return Number.isNaN(e)?0:e}const il=t=>{const{className:n,target:r,component:i,registerUnmount:a}=t,o=e.useRef(null),s=e.useRef(null);e.useEffect(()=>{s.current=a()},[]);const[l,c]=e.useState(null),[u,h]=e.useState([]),[d,p]=e.useState(0),[f,g]=e.useState(0),[m,y]=e.useState(0),[v,b]=e.useState(0),[x,w]=e.useState(!1),E={left:d,top:f,width:m,height:v,borderRadius:u.map(e=>`${e}px`).join(" ")};function k(){const e=getComputedStyle(r);c(function(e){var t;const{borderTopColor:n,borderColor:r,backgroundColor:i}=getComputedStyle(e);return null!==(t=[n,r,i].find(nl))&&void 0!==t?t:null}(r));const t="static"===e.position,{borderLeftWidth:n,borderTopWidth:i}=e;p(t?r.offsetLeft:rl(-Number.parseFloat(n))),g(t?r.offsetTop:rl(-Number.parseFloat(i))),y(r.offsetWidth),b(r.offsetHeight);const{borderTopLeftRadius:a,borderTopRightRadius:o,borderBottomLeftRadius:s,borderBottomRightRadius:l}=e;h([a,o,l,s].map(e=>rl(Number.parseFloat(e))))}if(l&&(E["--wave-color"]=l),e.useEffect(()=>{if(r){const e=mr(()=>{k(),w(!0)});let t;return"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(k),t.observe(r)),()=>{mr.cancel(e),null==t||t.disconnect()}}},[r]),!x)return null;const T=("Checkbox"===i||"Radio"===i)&&(null==r?void 0:r.classList.contains(tl));return e.createElement(so,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n,r;if(t.deadline||"opacity"===t.propertyName){const e=null===(n=o.current)||void 0===n?void 0:n.parentElement;null===(r=s.current)||void 0===r||r.call(s).then(()=>{null==e||e.remove()})}return!1}},({className:t},r)=>e.createElement("div",{ref:In(o,r),className:en(n,t,{"wave-quick":T}),style:E}))},al=(t,n)=>{var r;const{component:i}=n;if("Checkbox"===i&&!(null===(r=t.querySelector("input"))||void 0===r?void 0:r.checked))return;const a=document.createElement("div");a.style.position="absolute",a.style.left="0px",a.style.top="0px",null==t||t.insertBefore(a,null==t?void 0:t.firstChild);const o=Ks();let s=null;s=o(e.createElement(il,Object.assign({},n,{target:t,registerUnmount:function(){return s}})),a)},ol=(t,n,r)=>{const{wave:i}=e.useContext(Si),[,a,o]=fa(),s=Gi(e=>{const s=t.current;if((null==i?void 0:i.disabled)||!s)return;const l=s.querySelector(`.${tl}`)||s,{showEffect:c}=i||{};(c||al)(l,{className:n,token:a,component:r,event:e,hashId:o})}),l=e.useRef(null);return e=>{mr.cancel(l.current),l.current=mr(()=>{s(e)})}},sl=e=>{const{children:r,disabled:i,component:a}=e,{getPrefixCls:s}=n(Si),l=o(null),c=s("wave"),[,u]=el(c),h=ol(l,en(c,u),a);if(t.useEffect(()=>{const e=l.current;if(!e||e.nodeType!==window.Node.ELEMENT_NODE||i)return;const t=t=>{!Js(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")&&!e.className.includes("disabled:")||"true"===e.getAttribute("aria-disabled")||e.className.includes("-leave")||h(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[i]),!t.isValidElement(r))return null!=r?r:null;return us(r,{ref:Ln(r)?In(Rn(r),l):l})},ll=e=>{const n=t.useContext(Di);return t.useMemo(()=>e?"string"==typeof e?null!=e?e:n:"function"==typeof e?e(n):n:n,[e,n])};window&&window.__rest;const cl=e.createContext(null),ul=(t,n)=>{const r=e.useContext(cl),i=e.useMemo(()=>{if(!r)return"";const{compactDirection:e,isFirstItem:i,isLastItem:a}=r,o="vertical"===e?"-vertical-":"-";return en(`${t}-compact${o}item`,{[`${t}-compact${o}first-item`]:i,[`${t}-compact${o}last-item`]:a,[`${t}-compact${o}item-rtl`]:"rtl"===n})},[t,n,r]);return{compactSize:null==r?void 0:r.compactSize,compactDirection:null==r?void 0:r.compactDirection,compactItemClassnames:i}},hl=t=>{const{children:n}=t;return e.createElement(cl.Provider,{value:null},n)};var dl=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const t=typeof e,n="string"===t||"number"===t;if(r&&n){const t=i.length-1,n=i[t];i[t]=`${n}${e}`}else i.push(e);r=n}),t.Children.map(i,e=>function(e,n){if(null==e)return;const r=n?" ":"";return"string"!=typeof e&&"number"!=typeof e&&yl(e.type)&&gl(e.props.children)?us(e,{children:e.props.children.split("").join(r)}):yl(e)?gl(e)?t.createElement("span",null,e.split("").join(r)):t.createElement("span",null,e):ls(e)?t.createElement("span",null,e):e}(e,n))}["default","primary","danger"].concat(M(ia));const xl=u((e,n)=>{const{className:r,style:i,children:a,prefixCls:o}=e,s=en(`${o}-icon`,r);return t.createElement("span",{ref:n,className:s,style:i},a)}),wl=u((e,n)=>{const{prefixCls:r,className:i,style:a,iconClassName:o}=e,s=en(`${r}-loading-icon`,i);return t.createElement(xl,{prefixCls:r,className:s,style:a,ref:n},t.createElement(gs,{className:o}))}),El=()=>({width:0,opacity:0,transform:"scale(0)"}),kl=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"}),Tl=e=>{const{prefixCls:n,loading:r,existIcon:i,className:a,style:o,mount:s}=e,l=!!r;return i?t.createElement(wl,{prefixCls:n,className:a,style:o}):t.createElement(so,{visible:l,motionName:`${n}-loading-icon-motion`,motionAppear:!s,motionEnter:!s,motionLeave:!s,removeOnLeave:!0,onAppearStart:El,onAppearActive:kl,onEnterStart:El,onEnterActive:kl,onLeaveStart:kl,onLeaveActive:El},({className:e,style:r},i)=>{const s=Object.assign(Object.assign({},o),r);return t.createElement(wl,{prefixCls:n,className:en(a,e),style:s,ref:i})})},_l=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),Cl=e=>{const{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},_l(`${t}-primary`,i),_l(`${t}-danger`,a)]}};var Sl=["b"],Al=["v"],Nl=function(e){return Math.round(Number(e||0))},Il=function(){ye(t,Yr);var e=xe(t);function t(n){return re(this,t),e.call(this,function(e){if(e instanceof Yr)return e;if(e&&"object"===N(e)&&"h"in e&&"b"in e){var t=e,n=t.b;return D(D({},X(t,Sl)),{},{v:n})}return"string"==typeof e&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e}(n))}return ae(t,[{key:"toHsbString",value:function(){var e=this.toHsb(),t=Nl(100*e.s),n=Nl(100*e.b),r=Nl(e.h),i=e.a,a="hsb(".concat(r,", ").concat(t,"%, ").concat(n,"%)"),o="hsba(".concat(r,", ").concat(t,"%, ").concat(n,"%, ").concat(i.toFixed(0===i?0:2),")");return 1===i?a:o}},{key:"toHsb",value:function(){var e=this.toHsv(),t=e.v;return D(D({},X(e,Al)),{},{b:t,a:this.a})}}]),t}();!function(e){e instanceof Il||new Il(e)}("#1677ff");let Ol=function(){return ae(function e(t){var n;if(re(this,e),this.cleared=!1,t instanceof e)return this.metaColor=t.metaColor.clone(),this.colors=null===(n=t.colors)||void 0===n?void 0:n.map(t=>({color:new e(t.color),percent:t.percent})),void(this.cleared=t.cleared);const r=Array.isArray(t);r&&t.length?(this.colors=t.map(({color:t,percent:n})=>({color:new e(t),percent:n})),this.metaColor=new Il(this.colors[0].color.metaColor)):this.metaColor=new Il(r?"":t),(!t||r&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)},[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return((e,t)=>e?((e,t)=>(null==e?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"")(e,t):"")(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:e}=this;if(e){return`linear-gradient(90deg, ${e.map(e=>`${e.color.toRgbString()} ${e.percent}%`).join(", ")})`}return this.metaColor.toRgbString()}},{key:"equals",value:function(e){return!(!e||this.isGradient()!==e.isGradient())&&(this.isGradient()?this.colors.length===e.colors.length&&this.colors.every((t,n)=>{const r=e.colors[n];return t.percent===r.percent&&t.color.equals(r.color)}):this.toHexString()===e.toHexString())}}])}();var Ll={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},Ml=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Ll}))},Rl=e.forwardRef(Ml);const Dl=e=>({animationDuration:e,animationFillMode:"both"}),Pl=e=>({animationDuration:e,animationFillMode:"both"}),$l=(e,t,n,r,i=!1)=>{const a=i?"&":"";return{[`\n ${a}${e}-enter,\n ${a}${e}-appear\n `]:Object.assign(Object.assign({},Dl(r)),{animationPlayState:"paused"}),[`${a}${e}-leave`]:Object.assign(Object.assign({},Pl(r)),{animationPlayState:"paused"}),[`\n ${a}${e}-enter${e}-enter-active,\n ${a}${e}-appear${e}-appear-active\n `]:{animationName:t,animationPlayState:"running"},[`${a}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},Bl=new Xt("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Fl=new Xt("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),zl=(e,t=!1)=>{const{antCls:n}=e,r=`${n}-fade`,i=t?"&":"";return[$l(r,Bl,Fl,e.motionDurationMid,t),{[`\n ${i}${r}-enter,\n ${i}${r}-appear\n `]:{opacity:0,animationTimingFunction:"linear"},[`${i}${r}-leave`]:{animationTimingFunction:"linear"}}]},jl=new Xt("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Hl=new Xt("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),Ul=new Xt("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Gl=new Xt("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ql=new Xt("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Wl=new Xt("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Vl={"move-up":{inKeyframes:new Xt("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new Xt("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:jl,outKeyframes:Hl},"move-left":{inKeyframes:Ul,outKeyframes:Gl},"move-right":{inKeyframes:ql,outKeyframes:Wl}},Yl=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Vl[t];return[$l(r,i,a,e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},Xl=new Xt("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Kl=new Xt("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Ql=new Xt("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Zl=new Xt("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Jl=new Xt("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ec=new Xt("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),tc=new Xt("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),nc=new Xt("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),rc={"slide-up":{inKeyframes:Xl,outKeyframes:Kl},"slide-down":{inKeyframes:Ql,outKeyframes:Zl},"slide-left":{inKeyframes:Jl,outKeyframes:ec},"slide-right":{inKeyframes:tc,outKeyframes:nc}},ic=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=rc[t];return[$l(r,i,a,e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},ac=new Xt("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),oc=new Xt("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),sc=new Xt("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),lc=new Xt("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),cc=new Xt("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),uc=new Xt("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),hc={zoom:{inKeyframes:ac,outKeyframes:oc},"zoom-big":{inKeyframes:sc,outKeyframes:lc},"zoom-big-fast":{inKeyframes:sc,outKeyframes:lc},"zoom-left":{inKeyframes:new Xt("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),outKeyframes:new Xt("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}})},"zoom-right":{inKeyframes:new Xt("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),outKeyframes:new Xt("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}})},"zoom-up":{inKeyframes:cc,outKeyframes:uc},"zoom-down":{inKeyframes:new Xt("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),outKeyframes:new Xt("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}})}},dc=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=hc[t];return[$l(r,i,a,"zoom-big-fast"===t?e.motionDurationFast:e.motionDurationMid),{[`\n ${r}-enter,\n ${r}-appear\n `]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},pc=e=>{const{paddingInline:t,onlyIconSize:n}=e;return Qi(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},fc=e=>{var t,n,r,i,a,o;const s=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,c=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(i=e.contentLineHeight)&&void 0!==i?i:gi(s),h=null!==(a=e.contentLineHeightSM)&&void 0!==a?a:gi(l),d=null!==(o=e.contentLineHeightLG)&&void 0!==o?o:gi(c),p=((e,t)=>{const{r:n,g:r,b:i,a:a}=e.toRgb(),o=new Il(e.toRgbString()).onBackground(t).toHsv();return a<=.5?o.v>.5:.299*n+.587*r+.114*i>192})(new Ol(e.colorBgSolid),"#fff")?"#000":"#fff",f=ia.reduce((t,n)=>Object.assign(Object.assign({},t),{[`${n}ShadowColor`]:`0 ${Le(e.controlOutlineWidth)} 0 ${oa(e[`${n}1`],e.colorBgContainer)}`}),{});return Object.assign(Object.assign({},f),{fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:p,contentFontSize:s,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:h,contentLineHeightLG:d,paddingBlock:Math.max((e.controlHeight-s*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*h)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-c*d)/2-e.lineWidth,0)})},gc=e=>{const{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:s,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},[`${t}-icon > svg`]:{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}},"> a":{color:"currentColor"},"&:not(:disabled)":va(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:"none"}},[`&${t}-loading`]:{opacity:i,cursor:"default"},[`${t}-loading-icon`]:{transition:["width","opacity","margin"].map(e=>`${e} ${a} ${o}`).join(",")},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(s).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:l(s).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(s).mul(-1).equal()}}}}}},mc=(e,t,n)=>({[`&:not(:disabled):not(${e}-disabled)`]:{"&:hover":t,"&:active":n}}),yc=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),vc=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),bc=(e,t,n,r,i,a,o,s)=>({[`&${e}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},mc(e,Object.assign({background:t},o),Object.assign({background:t},s))),{"&:disabled":{cursor:"not-allowed",color:i||void 0,borderColor:a||void 0}})}),xc=e=>({[`&:disabled, &${e.componentCls}-disabled`]:Object.assign({},vc(e))}),wc=e=>({[`&:disabled, &${e.componentCls}-disabled`]:{cursor:"not-allowed",color:e.colorTextDisabled}}),Ec=(e,t,n,r)=>{const i=r&&["link","text"].includes(r)?wc:xc;return Object.assign(Object.assign({},i(e)),mc(e.componentCls,t,n))},kc=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-solid`]:Object.assign({color:t,background:n},Ec(e,r,i))}),Tc=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]:Object.assign({borderColor:t,background:n},Ec(e,r,i))}),_c=e=>({[`&${e.componentCls}-variant-dashed`]:{borderStyle:"dashed"}}),Cc=(e,t,n,r)=>({[`&${e.componentCls}-variant-filled`]:Object.assign({boxShadow:"none",background:t},Ec(e,n,r))}),Sc=(e,t,n,r,i)=>({[`&${e.componentCls}-variant-${n}`]:Object.assign({color:t,boxShadow:"none"},Ec(e,r,i,n))}),Ac=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},kc(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),_c(e)),Cc(e,e.colorFillTertiary,{color:e.defaultColor,background:e.colorFillSecondary},{color:e.defaultColor,background:e.colorFill})),bc(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),Sc(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),Nc=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},Tc(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),_c(e)),Cc(e,e.colorPrimaryBg,{color:e.colorPrimary,background:e.colorPrimaryBgHover},{color:e.colorPrimary,background:e.colorPrimaryBorder})),Sc(e,e.colorPrimaryText,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),Sc(e,e.colorPrimaryText,"link",{color:e.colorPrimaryTextHover,background:e.linkHoverBg},{color:e.colorPrimaryTextActive})),bc(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),Ic=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},kc(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),Tc(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),_c(e)),Cc(e,e.colorErrorBg,{color:e.colorError,background:e.colorErrorBgFilledHover},{color:e.colorError,background:e.colorErrorBgActive})),Sc(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),Sc(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),bc(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),Oc=e=>Object.assign(Object.assign({},Sc(e,e.colorLink,"link",{color:e.colorLinkHover},{color:e.colorLinkActive})),bc(e.componentCls,e.ghostBg,e.colorInfo,e.colorInfo,e.colorTextDisabled,e.colorBorder,{color:e.colorInfoHover,borderColor:e.colorInfoHover},{color:e.colorInfoActive,borderColor:e.colorInfoActive})),Lc=e=>{const{componentCls:t}=e;return Object.assign({[`${t}-color-default`]:Ac(e),[`${t}-color-primary`]:Nc(e),[`${t}-color-dangerous`]:Ic(e),[`${t}-color-link`]:Oc(e)},(e=>{const{componentCls:t}=e;return ia.reduce((n,r)=>{const i=e[`${r}6`],a=e[`${r}1`],o=e[`${r}5`],s=e[`${r}2`],l=e[`${r}3`],c=e[`${r}7`];return Object.assign(Object.assign({},n),{[`&${t}-color-${r}`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:i,boxShadow:e[`${r}ShadowColor`]},kc(e,e.colorTextLightSolid,i,{background:o},{background:c})),Tc(e,i,e.colorBgContainer,{color:o,borderColor:o,background:e.colorBgContainer},{color:c,borderColor:c,background:e.colorBgContainer})),_c(e)),Cc(e,a,{color:i,background:s},{color:i,background:l})),Sc(e,i,"link",{color:o},{color:c})),Sc(e,i,"text",{color:o,background:a},{color:c,background:l}))})},{})})(e))},Mc=e=>Object.assign(Object.assign(Object.assign(Object.assign({},Tc(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),Sc(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),kc(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),Sc(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),Rc=(e,t="")=>{const{componentCls:n,controlHeight:r,fontSize:i,borderRadius:a,buttonPaddingHorizontal:o,iconCls:s,buttonPaddingVertical:l,buttonIconOnlyFontSize:c}=e;return[{[t]:{fontSize:i,height:r,padding:`${Le(l)} ${Le(o)}`,borderRadius:a,[`&${n}-icon-only`]:{width:r,[s]:{fontSize:c}}}},{[`${n}${n}-circle${t}`]:yc(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},Dc=e=>{const t=Qi(e,{fontSize:e.contentFontSize});return Rc(t,e.componentCls)},Pc=e=>{const t=Qi(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM});return Rc(t,`${e.componentCls}-sm`)},$c=e=>{const t=Qi(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG});return Rc(t,`${e.componentCls}-lg`)},Bc=e=>{const{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:"100%"}}}};var Fc=wa("Button",e=>{const t=pc(e);return[gc(t),Dc(t),Pc(t),$c(t),Bc(t),Lc(t),Mc(t),Cl(t)]},fc,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function zc(e,t,n,r){const{focusElCls:i,focus:a,borderElCls:o}=n,s=o?"> *":"",l=["hover",a?"focus":null,"active"].filter(Boolean).map(e=>`&:${e} ${s}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${r}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},i?{[`&${i}`]:{zIndex:3}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function jc(e,t,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function Hc(e,t={focus:!0}){const{componentCls:n}=e,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},zc(e,r,t,n)),jc(n,r,t))}}function Uc(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}}}function Gc(e){const t=`${e.componentCls}-compact-vertical`;return{[t]:Object.assign(Object.assign({},Uc(e,t,e.componentCls)),(n=e.componentCls,r=t,{[`&-item:not(${r}-first-item):not(${r}-last-item)`]:{borderRadius:0},[`&-item${r}-first-item:not(${r}-last-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${r}-last-item:not(${r}-first-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))};var n,r}const qc=e=>{const{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:i}=e,a=i(r).mul(-1).equal(),o=e=>{const i=`${t}-compact${e?"-vertical":""}-item${t}-primary:not([disabled])`;return{[`${i} + ${i}::before`]:{position:"absolute",top:e?a:0,insetInlineStart:e?0:a,backgroundColor:n,content:'""',width:e?"100%":r,height:e?r:"100%"}}};return Object.assign(Object.assign({},o()),o(!0))};var Wc=ka(["Button","compact"],e=>{const t=pc(e);return[Hc(t),Gc(t),qc(t)]},fc),Vc=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i,a;const{loading:s=!1,prefixCls:c,color:u,variant:f,type:g,danger:m=!1,shape:y,size:v,styles:b,disabled:x,className:w,rootClassName:E,children:k,icon:T,iconPosition:_="start",ghost:C=!1,block:S=!1,htmlType:A="button",classNames:N,style:I={},autoInsertSpace:O,autoFocus:L}=e,M=Vc(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),R=g||"default",{button:D}=t.useContext(Si),P=y||(null==D?void 0:D.shape)||"default",[$,B]=h(()=>{if(u&&f)return[u,f];if(g||m){const e=Yc[R]||[];return m?["danger",e[1]]:e}return(null==D?void 0:D.color)&&(null==D?void 0:D.variant)?[D.color,D.variant]:["default","outlined"]},[u,f,g,m,null==D?void 0:D.color,null==D?void 0:D.variant,R]),F="danger"===$?"dangerous":$,{getPrefixCls:z,direction:j,autoInsertSpace:H,className:U,style:G,classNames:q,styles:W}=Ii("button"),V=null===(i=null!=O?O:H)||void 0===i||i,Y=z("btn",c),[X,K,Q]=Fc(Y),Z=n(Mi),J=null!=x?x:Z,ee=n(pl),te=h(()=>function(e){if("object"==typeof e&&e){let t=null==e?void 0:e.delay;return t=Number.isNaN(t)||"number"!=typeof t?0:t,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}(s),[s]),[ne,re]=d(te.loading),[ie,ae]=d(!1),oe=o(null),se=On(r,oe),le=1===p.count(k)&&!T&&!vl(B),ce=o(!0);t.useEffect(()=>(ce.current=!1,()=>{ce.current=!0}),[]),Be(()=>{let e=null;return te.delay>0?e=setTimeout(()=>{e=null,re(!0)},te.delay):re(te.loading),function(){e&&(clearTimeout(e),e=null)}},[te.delay,te.loading]),l(()=>{if(!oe.current||!V)return;const e=oe.current.textContent||"";le&&gl(e)?ie||ae(!0):ie&&ae(!1)}),l(()=>{L&&oe.current&&oe.current.focus()},[]);const ue=t.useCallback(t=>{var n;ne||J?t.preventDefault():null===(n=e.onClick)||void 0===n||n.call(e,t)},[e.onClick,ne,J]),{compactSize:he,compactItemClassnames:de}=ul(Y,j),pe={large:"lg",small:"sm",middle:void 0},fe=ll(e=>{var t,n;return null!==(n=null!==(t=null!=v?v:he)&&void 0!==t?t:ee)&&void 0!==n?n:e}),ge=fe&&null!==(a=pe[fe])&&void 0!==a?a:"",me=ne?"loading":T,ye=Zs(M,["navigate"]),ve=en(Y,K,Q,{[`${Y}-${P}`]:"default"!==P&&P,[`${Y}-${R}`]:R,[`${Y}-dangerous`]:m,[`${Y}-color-${F}`]:F,[`${Y}-variant-${B}`]:B,[`${Y}-${ge}`]:ge,[`${Y}-icon-only`]:!k&&0!==k&&!!me,[`${Y}-background-ghost`]:C&&!vl(B),[`${Y}-loading`]:ne,[`${Y}-two-chinese-chars`]:ie&&V&&!ne,[`${Y}-block`]:S,[`${Y}-rtl`]:"rtl"===j,[`${Y}-icon-end`]:"end"===_},de,w,E,U),be=Object.assign(Object.assign({},G),I),xe=en(null==N?void 0:N.icon,q.icon),we=Object.assign(Object.assign({},(null==b?void 0:b.icon)||{}),W.icon||{}),Ee=T&&!ne?t.createElement(xl,{prefixCls:Y,className:xe,style:we},T):s&&"object"==typeof s&&s.icon?t.createElement(xl,{prefixCls:Y,className:xe,style:we},s.icon):t.createElement(Tl,{existIcon:!!T,prefixCls:Y,loading:ne,mount:ce.current}),ke=k||0===k?bl(k,le&&V):null;if(void 0!==ye.href)return X(t.createElement("a",Object.assign({},ye,{className:en(ve,{[`${Y}-disabled`]:J}),href:J?void 0:ye.href,style:be,onClick:ue,ref:se,tabIndex:J?-1:0,"aria-disabled":J}),Ee,ke));let Te=t.createElement("button",Object.assign({},M,{type:A,className:ve,style:be,onClick:ue,disabled:J,ref:se}),Ee,ke,de&&t.createElement(Wc,{prefixCls:Y}));return vl(B)||(Te=t.createElement(sl,{component:"Button",disabled:ne},Te)),X(Te)}),Kc=Xc;Kc.Group=t=>{const{getPrefixCls:n,direction:r}=e.useContext(Si),{prefixCls:i,size:a,className:o}=t,s=dl(t,["prefixCls","size","className"]),l=n("btn-group",i),[,,c]=fa(),u=e.useMemo(()=>{switch(a){case"large":return"lg";case"small":return"sm";default:return""}},[a]),h=en(l,{[`${l}-${u}`]:u,[`${l}-rtl`]:"rtl"===r},o,c);return e.createElement(pl.Provider,{value:a},e.createElement("div",Object.assign({},s,{className:h})))},Kc.__ANT_BUTTON=!0;const Qc=e=>"function"==typeof(null==e?void 0:e.then),Zc=t=>{const{type:n,children:r,prefixCls:i,buttonProps:a,close:o,autoFocus:s,emitEvent:l,isSilent:c,quitOnNullishReturnValue:u,actionFn:h}=t,d=e.useRef(!1),p=e.useRef(null),[f,g]=qi(!1),m=(...e)=>{null==o||o.apply(void 0,e)};e.useEffect(()=>{let e=null;return s&&(e=setTimeout(()=>{var e;null===(e=p.current)||void 0===e||e.focus({preventScroll:!0})})),()=>{e&&clearTimeout(e)}},[s]);return e.createElement(Kc,Object.assign({},ml(n),{onClick:e=>{if(d.current)return;if(d.current=!0,!h)return void m();let t;if(l){if(t=h(e),u&&!Qc(t))return d.current=!1,void m(e)}else if(h.length)t=h(o),d.current=!1;else if(t=h(),!Qc(t))return void m();(e=>{Qc(e)&&(g(!0),e.then((...e)=>{g(!1,!0),m.apply(void 0,e),d.current=!1},e=>{if(g(!1,!0),d.current=!1,!(null==c?void 0:c()))return Promise.reject(e)}))})(t)},loading:f,prefixCls:i},a,{ref:p}),r)},Jc=t.createContext({}),{Provider:eu}=Jc,tu=()=>{const{autoFocusButton:e,cancelButtonProps:r,cancelTextLocale:i,isSilent:a,mergedOkCancel:o,rootPrefixCls:s,close:l,onCancel:c,onConfirm:u}=n(Jc);return o?t.createElement(Zc,{isSilent:a,actionFn:c,close:(...e)=>{null==l||l.apply(void 0,e),null==u||u(!1)},autoFocus:"cancel"===e,buttonProps:r,prefixCls:`${s}-btn`},i):null},nu=()=>{const{autoFocusButton:e,close:r,isSilent:i,okButtonProps:a,rootPrefixCls:o,okTextLocale:s,okType:l,onConfirm:c,onOk:u}=n(Jc);return t.createElement(Zc,{isSilent:i,type:l||"primary",actionFn:u,close:(...e)=>{null==r||r.apply(void 0,e),null==c||c(!0)},autoFocus:"ok"===e,buttonProps:a,prefixCls:`${o}-btn`},s)};var ru=e.createContext(null),iu=[];function au(e){return"undefined"!=typeof document&&e&&e instanceof Element?function(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r,i,a=n.style;if(a.position="absolute",a.left="0",a.top="0",a.width="100px",a.height="100px",a.overflow="scroll",e){var o=getComputedStyle(e);a.scrollbarColor=o.scrollbarColor,a.scrollbarWidth=o.scrollbarWidth;var s=getComputedStyle(e,"::-webkit-scrollbar"),l=parseInt(s.width,10),c=parseInt(s.height,10);try{var u=l?"width: ".concat(s.width,";"):"",h=c?"height: ".concat(s.height,";"):"";Y("\n#".concat(t,"::-webkit-scrollbar {\n").concat(u,"\n").concat(h,"\n}"),t)}catch(e){console.error(e),r=l,i=c}}document.body.appendChild(n);var d=e&&r&&!isNaN(r)?r:n.offsetWidth-n.clientWidth,p=e&&i&&!isNaN(i)?i:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),V(t),{width:d,height:p}}(e):{width:0,height:0}}var ou="rc-util-locker-".concat(Date.now()),su=0;function lu(t){var n=!!t,r=A(e.useState(function(){return su+=1,"".concat(ou,"_").concat(su)}),1)[0];Be(function(){if(n){var e=au(document.body).width,t=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;Y("\nhtml body {\n overflow-y: hidden;\n ".concat(t?"width: calc(100% - ".concat(e,"px);"):"","\n}"),r)}else V(r);return function(){V(r)}},[n,r])}var cu=function(e){return!1!==e&&($()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},uu=e.forwardRef(function(t,n){var r=t.open,i=t.autoLock,a=t.getContainer;t.debug;var o=t.autoDestroy,s=void 0===o||o,l=t.children,c=A(e.useState(r),2),u=c[0],h=c[1],d=u||r;e.useEffect(function(){(s||r)&&h(r)},[r,s]);var p=A(e.useState(function(){return cu(a)}),2),f=p[0],g=p[1];e.useEffect(function(){var e=cu(a);g(null!=e?e:null)});var m=function(t){var n=A(e.useState(function(){return $()?document.createElement("div"):null}),1)[0],r=e.useRef(!1),i=e.useContext(ru),a=A(e.useState(iu),2),o=a[0],s=a[1],l=i||(r.current?void 0:function(e){s(function(t){return[e].concat(M(t))})});function c(){n.parentElement||document.body.appendChild(n),r.current=!0}function u(){var e;null===(e=n.parentElement)||void 0===e||e.removeChild(n),r.current=!1}return Be(function(){return t?i?i(c):c():u(),u},[t]),Be(function(){o.length&&(o.forEach(function(e){return e()}),s(iu))},[o]),[n,l]}(d&&!f),y=A(m,2),v=y[0],b=y[1],x=null!=f?f:v;lu(i&&r&&$()&&(x===v||x===document.body));var E=null;l&&Ln(l)&&n&&(E=l.ref);var k=On(E,n);if(!d||!$()||void 0===f)return null;var T=!1===x||!1,_=l;return n&&(_=e.cloneElement(l,{ref:k})),e.createElement(ru.Provider,{value:b},T?_:w(_,x))}),hu=e.createContext({});var du=0,pu=D({},e).useId,fu=pu?function(e){var t=pu();return e||t}:function(t){var n=A(e.useState("ssr-id"),2),r=n[0],i=n[1];return e.useEffect(function(){var e=du;du+=1,i("rc_unique_".concat(e))},[]),t||r};function gu(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}function mu(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}var yu=e.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),vu={width:0,height:0,overflow:"hidden",outline:"none"},bu={outline:"none"},xu=t.forwardRef(function(e,n){var r=e.prefixCls,i=e.className,a=e.style,s=e.title,l=e.ariaId,c=e.footer,u=e.closable,d=e.closeIcon,p=e.onClose,f=e.children,g=e.bodyStyle,m=e.bodyProps,y=e.modalRender,v=e.onMouseDown,b=e.onMouseUp,x=e.holderRef,w=e.visible,E=e.forceRender,k=e.width,T=e.height,_=e.classNames,C=e.styles,S=t.useContext(hu).panel,A=On(x,S),I=o(),O=o();t.useImperativeHandle(n,function(){return{focus:function(){var e;null===(e=I.current)||void 0===e||e.focus({preventScroll:!0})},changeActive:function(e){var t=document.activeElement;e&&t===O.current?I.current.focus({preventScroll:!0}):e||t!==I.current||O.current.focus({preventScroll:!0})}}});var L={};void 0!==k&&(L.width=k),void 0!==T&&(L.height=T);var M=c?t.createElement("div",{className:en("".concat(r,"-footer"),null==_?void 0:_.footer),style:D({},null==C?void 0:C.footer)},c):null,R=s?t.createElement("div",{className:en("".concat(r,"-header"),null==_?void 0:_.header),style:D({},null==C?void 0:C.header)},t.createElement("div",{className:"".concat(r,"-title"),id:l},s)):null,P=h(function(){return"object"===N(u)&&null!==u?u:u?{closeIcon:null!=d?d:t.createElement("span",{className:"".concat(r,"-close-x")})}:{}},[u,d,r]),$=ss(P,!0),B="object"===N(u)&&u.disabled,F=u?t.createElement("button",Xe({type:"button",onClick:p,"aria-label":"Close"},$,{className:"".concat(r,"-close"),disabled:B}),P.closeIcon):null,z=t.createElement("div",{className:en("".concat(r,"-content"),null==_?void 0:_.content),style:null==C?void 0:C.content},F,R,t.createElement("div",Xe({className:en("".concat(r,"-body"),null==_?void 0:_.body),style:D(D({},g),null==C?void 0:C.body)},m),f),M);return t.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?l:null,"aria-modal":"true",ref:A,style:D(D({},a),L),className:en(r,i),onMouseDown:v,onMouseUp:b},t.createElement("div",{ref:I,tabIndex:0,style:bu},t.createElement(yu,{shouldUpdate:w||E},y?y(z):z)),t.createElement("div",{tabIndex:0,ref:O,style:vu}))}),wu=e.forwardRef(function(t,n){var r=t.prefixCls,i=t.title,a=t.style,s=t.className,l=t.visible,c=t.forceRender,u=t.destroyOnClose,h=t.motionName,d=t.ariaId,p=t.onVisibleChanged,f=t.mousePosition,g=o(),m=A(e.useState(),2),y=m[0],v=m[1],b={};function x(){var e=function(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=mu(i),n.top+=mu(i,!0),n}(g.current);v(f&&(f.x||f.y)?"".concat(f.x-e.left,"px ").concat(f.y-e.top,"px"):"")}return y&&(b.transformOrigin=y),e.createElement(so,{visible:l,onVisibleChanged:p,onAppearPrepare:x,onEnterPrepare:x,forceRender:c,motionName:h,removeOnLeave:u,ref:g},function(o,l){var c=o.className,u=o.style;return e.createElement(xu,Xe({},t,{ref:n,title:i,ariaId:d,prefixCls:r,holderRef:l,style:D(D(D({},u),a),b),className:en(s,c)}))})});wu.displayName="Content";var Eu=function(t){var n=t.prefixCls,r=t.style,i=t.visible,a=t.maskProps,o=t.motionName,s=t.className;return e.createElement(so,{key:"mask",visible:i,motionName:o,leavedClassName:"".concat(n,"-mask-hidden")},function(t,i){var o=t.className,l=t.style;return e.createElement("div",Xe({ref:i,style:D(D({},l),r),className:en("".concat(n,"-mask"),o,s)},a))})},ku=function(t){var n=t.prefixCls,r=void 0===n?"rc-dialog":n,i=t.zIndex,a=t.visible,s=void 0!==a&&a,c=t.keyboard,u=void 0===c||c,h=t.focusTriggerAfterClose,d=void 0===h||h,p=t.wrapStyle,f=t.wrapClassName,g=t.wrapProps,m=t.onClose,y=t.afterOpenChange,v=t.afterClose,b=t.transitionName,x=t.animation,w=t.closable,E=void 0===w||w,k=t.mask,T=void 0===k||k,_=t.maskTransitionName,C=t.maskAnimation,S=t.maskClosable,N=void 0===S||S,I=t.maskStyle,O=t.maskProps,L=t.rootClassName,M=t.classNames,R=t.styles,P=o(),$=o(),F=o(),z=A(e.useState(s),2),j=z[0],H=z[1],U=fu();function G(e){null==m||m(e)}var q=o(!1),W=o(),V=null;N&&(V=function(e){q.current?q.current=!1:$.current===e.target&&G(e)}),l(function(){s&&(H(!0),B($.current,document.activeElement)||(P.current=document.activeElement))},[s]),l(function(){return function(){clearTimeout(W.current)}},[]);var Y=D(D(D({zIndex:i},p),null==R?void 0:R.wrapper),{},{display:j?null:"none"});return e.createElement("div",Xe({className:en("".concat(r,"-root"),L)},ss(t,{data:!0})),e.createElement(Eu,{prefixCls:r,visible:T&&s,motionName:gu(r,_,C),style:D(D({zIndex:i},I),null==R?void 0:R.mask),maskProps:O,className:null==M?void 0:M.mask}),e.createElement("div",Xe({tabIndex:-1,onKeyDown:function(e){if(u&&e.keyCode===ds.ESC)return e.stopPropagation(),void G(e);s&&e.keyCode===ds.TAB&&F.current.changeActive(!e.shiftKey)},className:en("".concat(r,"-wrap"),f,null==M?void 0:M.wrapper),ref:$,onClick:V,style:Y},g),e.createElement(wu,Xe({},t,{onMouseDown:function(){clearTimeout(W.current),q.current=!0},onMouseUp:function(){W.current=setTimeout(function(){q.current=!1})},ref:F,closable:E,ariaId:U,prefixCls:r,visible:s&&j,onClose:G,onVisibleChanged:function(e){if(e)B($.current,document.activeElement)||null===(t=F.current)||void 0===t||t.focus();else{if(H(!1),T&&P.current&&d){try{P.current.focus({preventScroll:!0})}catch(e){}P.current=null}j&&(null==v||v())}var t;null==y||y(e)},motionName:gu(r,b,x)}))))},Tu=function(t){var n=t.visible,r=t.getContainer,i=t.forceRender,a=t.destroyOnClose,o=void 0!==a&&a,s=t.afterClose,l=t.panelRef,c=A(e.useState(n),2),u=c[0],h=c[1],d=e.useMemo(function(){return{panel:l}},[l]);return e.useEffect(function(){n&&h(!0)},[n]),i||!o||u?e.createElement(hu.Provider,{value:d},e.createElement(uu,{open:n||i||u,autoDestroy:!1,getContainer:r,autoLock:n||u},e.createElement(ku,Xe({},t,{destroyOnClose:o,afterClose:function(){null==s||s(),h(!1)}})))):null};Tu.displayName="Dialog";var _u="RC_FORM_INTERNAL_HOOKS",Cu=function(){te(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Su=e.createContext({getFieldValue:Cu,getFieldsValue:Cu,getFieldError:Cu,getFieldWarning:Cu,getFieldsError:Cu,isFieldsTouched:Cu,isFieldTouched:Cu,isFieldValidating:Cu,isFieldsValidating:Cu,resetFields:Cu,setFields:Cu,setFieldValue:Cu,setFieldsValue:Cu,validateFields:Cu,submit:Cu,getInternalHooks:function(){return Cu(),{dispatch:Cu,initEntityValue:Cu,registerField:Cu,useSubscribe:Cu,setInitialValues:Cu,destroyForm:Cu,setCallbacks:Cu,registerWatch:Cu,getFields:Cu,setValidateMessages:Cu,setPreserve:Cu,getInitialValue:Cu}}}),Au=e.createContext(null);function Nu(e){return null==e?[]:Array.isArray(e)?e:[e]}function Iu(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Ou=Iu();function Lu(e){var t="function"==typeof Map?new Map:void 0;return Lu=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(be())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&me(i,n.prototype),i}(e,arguments,ve(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),me(n,e)},Lu(e)}var Mu=/%[sdj%]/g;function Ru(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function Du(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=a)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}break;default:return e}});return o}return e}function Pu(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function $u(e,t,n){var r=0,i=e.length;!function a(o){if(o&&o.length)n(o);else{var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Wu=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Vu={integer:function(e){return Vu.number(e)&&parseInt(e,10)===e},float:function(e){return Vu.number(e)&&!Vu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===N(e)&&!Vu.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(qu)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(Hu)return Hu;var e="[a-fA-F\\d:]",t=function(t){return t&&t.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:".concat(i.join("|"),")").concat("(?:%[0-9a-zA-Z]{1,})?"),o=new RegExp("(?:^".concat(n,"$)|(?:^").concat(a,"$)")),s=new RegExp("^".concat(n,"$")),l=new RegExp("^".concat(a,"$")),c=function(e){return e&&e.exact?o:new RegExp("(?:".concat(t(e)).concat(n).concat(t(e),")|(?:").concat(t(e)).concat(a).concat(t(e),")"),"g")};c.v4=function(e){return e&&e.exact?s:new RegExp("".concat(t(e)).concat(n).concat(t(e)),"g")},c.v6=function(e){return e&&e.exact?l:new RegExp("".concat(t(e)).concat(a).concat(t(e)),"g")};var u=c.v4().source,h=c.v6().source,d="(?:".concat("(?:(?:[a-z]+:)?//)","|www\\.)").concat("(?:\\S+(?::\\S*)?@)?","(?:localhost|").concat(u,"|").concat(h,"|").concat("(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)").concat("(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*").concat("(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",")").concat("(?::\\d{2,5})?").concat('(?:[/?#][^\\s"]*)?');return Hu=new RegExp("(?:^".concat(d,"$)"),"i")}())},hex:function(e){return"string"==typeof e&&!!e.match(Wu)}},Yu={required:Gu,whitespace:function(e,t,n,r,i){(/^\s+$/.test(t)||""===t)&&r.push(Du(i.messages.whitespace,e.fullField))},type:function(e,t,n,r,i){if(e.required&&void 0===t)Gu(e,t,n,r,i);else{var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?Vu[a](t)||r.push(Du(i.messages.types[a],e.fullField,e.type)):a&&N(t)!==e.type&&r.push(Du(i.messages.types[a],e.fullField,e.type))}},range:function(e,t,n,r,i){var a="number"==typeof e.len,o="number"==typeof e.min,s="number"==typeof e.max,l=t,c=null,u="number"==typeof t,h="string"==typeof t,d=Array.isArray(t);if(u?c="number":h?c="string":d&&(c="array"),!c)return!1;d&&(l=t.length),h&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?l!==e.len&&r.push(Du(i.messages[c].len,e.fullField,e.len)):o&&!s&&le.max?r.push(Du(i.messages[c].max,e.fullField,e.max)):o&&s&&(le.max)&&r.push(Du(i.messages[c].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,i){e[Uu]=Array.isArray(e[Uu])?e[Uu]:[],-1===e[Uu].indexOf(t)&&r.push(Du(i.messages[Uu],e.fullField,e[Uu].join(", ")))},pattern:function(e,t,n,r,i){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Du(i.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||r.push(Du(i.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Xu=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t,a)&&!e.required)return n();Yu.required(e,t,r,o,i,a),Pu(t,a)||Yu.type(e,t,r,o,i)}n(o)},Ku={string:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t,"string")&&!e.required)return n();Yu.required(e,t,r,a,i,"string"),Pu(t,"string")||(Yu.type(e,t,r,a,i),Yu.range(e,t,r,a,i),Yu.pattern(e,t,r,a,i),!0===e.whitespace&&Yu.whitespace(e,t,r,a,i))}n(a)},method:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&Yu.type(e,t,r,a,i)}n(a)},number:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&(Yu.type(e,t,r,a,i),Yu.range(e,t,r,a,i))}n(a)},boolean:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&Yu.type(e,t,r,a,i)}n(a)},regexp:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),Pu(t)||Yu.type(e,t,r,a,i)}n(a)},integer:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&(Yu.type(e,t,r,a,i),Yu.range(e,t,r,a,i))}n(a)},float:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&(Yu.type(e,t,r,a,i),Yu.range(e,t,r,a,i))}n(a)},array:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();Yu.required(e,t,r,a,i,"array"),null!=t&&(Yu.type(e,t,r,a,i),Yu.range(e,t,r,a,i))}n(a)},object:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&Yu.type(e,t,r,a,i)}n(a)},enum:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i),void 0!==t&&Yu.enum(e,t,r,a,i)}n(a)},pattern:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t,"string")&&!e.required)return n();Yu.required(e,t,r,a,i),Pu(t,"string")||Yu.pattern(e,t,r,a,i)}n(a)},date:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t,"date")&&!e.required)return n();var o;if(Yu.required(e,t,r,a,i),!Pu(t,"date"))o=t instanceof Date?t:new Date(t),Yu.type(e,o,r,a,i),o&&Yu.range(e,o.getTime(),r,a,i)}n(a)},url:Xu,hex:Xu,email:Xu,required:function(e,t,n,r,i){var a=[],o=Array.isArray(t)?"array":N(t);Yu.required(e,t,r,a,i,o),n(a)},any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Pu(t)&&!e.required)return n();Yu.required(e,t,r,a,i)}n(a)}},Qu=function(){function e(t){re(this,e),O(this,"rules",null),O(this,"_messages",Ou),this.define(t)}return ae(e,[{key:"define",value:function(e){var t=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==N(e)||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})}},{key:"messages",value:function(e){return e&&(this._messages=ju(Iu(),e)),this._messages}},{key:"validate",value:function(t){var n=this,r=t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if("function"==typeof i&&(a=i,i={}),!this.rules||0===Object.keys(this.rules).length)return a&&a(null,r),Promise.resolve(r);if(i.messages){var o=this.messages();o===Ou&&(o=Iu()),ju(o,i.messages),i.messages=o}else i.messages=this.messages();var s={};(i.keys||Object.keys(this.rules)).forEach(function(e){var i=n.rules[e],a=r[e];i.forEach(function(i){var o=i;"function"==typeof o.transform&&(r===t&&(r=D({},r)),null!=(a=r[e]=o.transform(a))&&(o.type=o.type||(Array.isArray(a)?"array":N(a)))),(o="function"==typeof o?{validator:o}:D({},o)).validator=n.getValidationMethod(o),o.validator&&(o.field=e,o.fullField=o.fullField||e,o.type=n.getType(o),s[e]=s[e]||[],s[e].push({rule:o,value:a,source:r,field:e}))})});var l={};return Fu(s,i,function(t,n){var a,o=t.rule,s=!("object"!==o.type&&"array"!==o.type||"object"!==N(o.fields)&&"object"!==N(o.defaultField));function c(e,t){return D(D({},t),{},{fullField:"".concat(o.fullField,".").concat(e),fullFields:o.fullFields?[].concat(M(o.fullFields),[e]):[e]})}function u(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=Array.isArray(a)?a:[a];!i.suppressWarning&&u.length&&e.warning("async-validator:",u),u.length&&void 0!==o.message&&(u=[].concat(o.message));var h=u.map(zu(o,r));if(i.first&&h.length)return l[o.field]=1,n(h);if(s){if(o.required&&!t.value)return void 0!==o.message?h=[].concat(o.message).map(zu(o,r)):i.error&&(h=[i.error(o,Du(i.messages.required,o.field))]),n(h);var d={};o.defaultField&&Object.keys(t.value).map(function(e){d[e]=o.defaultField}),d=D(D({},d),t.rule.fields);var p={};Object.keys(d).forEach(function(e){var t=d[e],n=Array.isArray(t)?t:[t];p[e]=n.map(c.bind(null,e))});var f=new e(p);f.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),f.validate(t.value,t.rule.options||i,function(e){var t=[];h&&h.length&&t.push.apply(t,M(h)),e&&e.length&&t.push.apply(t,M(e)),n(t.length?t:null)})}else n(h)}if(s=s&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)a=o.asyncValidator(o,t.value,u,t.source,i);else if(o.validator){try{a=o.validator(o,t.value,u,t.source,i)}catch(e){var h,d;null===(h=(d=console).error)||void 0===h||h.call(d,e),i.suppressValidatorError||setTimeout(function(){throw e},0),u(e.message)}!0===a?u():!1===a?u("function"==typeof o.message?o.message(o.fullField||o.field):o.message||"".concat(o.fullField||o.field," fails")):a instanceof Array?u(a):a instanceof Error&&u(a.message)}a&&a.then&&a.then(function(){return u()},function(e){return u(e)})},function(e){!function(e){var t=[],n={};function i(e){var n;Array.isArray(e)?t=(n=t).concat.apply(n,M(e)):t.push(e)}for(var o=0;o0)){t.next=23;break}return t.next=21,Promise.all(r.map(function(e,t){return rh("".concat(n,".").concat(t),e,c,a,o)}));case 21:return p=t.sent,t.abrupt("return",p.reduce(function(e,t){return[].concat(M(e),M(t))},[]));case 23:return f=D(D({},i),{},{name:n,enum:(i.enum||[]).join(", ")},o),g=d.map(function(e){return"string"==typeof e?th(e,f):e}),t.abrupt("return",g);case 26:case"end":return t.stop()}},t,null,[[10,15]])})),ih.apply(this,arguments)}function ah(e,t,n,r,i,a){var o,s=e.join("."),l=n.map(function(e,t){var n=e.validator,r=D(D({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var i=!1,a=n(e,t,function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return hh(t,e,n)})}function hh(e,t){return!(!e||!t)&&(!(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&e.length!==t.length)&&t.every(function(t,n){return e[n]===t}))}function dh(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===N(t.target)&&e in t.target?t.target[e]:t}function ph(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var i=e[t],a=t-n;return a>0?[].concat(M(e.slice(0,n)),[i],M(e.slice(n,t)),M(e.slice(t+1,r))):a<0?[].concat(M(e.slice(0,t)),M(e.slice(t+1,n+1)),[i],M(e.slice(n+1,r))):e}var fh=["name"],gh=[];function mh(e,t,n,r,i,a){return"function"==typeof e?e(t,n,"source"in a?{source:a.source}:{}):r!==i}var yh=function(){ye(n,e.Component);var t=xe(n);function n(r){var i;(re(this,n),O(ge(i=t.call(this,r)),"state",{resetCount:0}),O(ge(i),"cancelRegisterFunc",null),O(ge(i),"mounted",!1),O(ge(i),"touched",!1),O(ge(i),"dirty",!1),O(ge(i),"validatePromise",void 0),O(ge(i),"prevValidating",void 0),O(ge(i),"errors",gh),O(ge(i),"warnings",gh),O(ge(i),"cancelRegister",function(){var e=i.props,t=e.preserve,n=e.isListField,r=e.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(n,t,lh(r)),i.cancelRegisterFunc=null}),O(ge(i),"getNamePath",function(){var e=i.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat(M(void 0===n?[]:n),M(t)):[]}),O(ge(i),"getRules",function(){var e=i.props,t=e.rules,n=void 0===t?[]:t,r=e.fieldContext;return n.map(function(e){return"function"==typeof e?e(r):e})}),O(ge(i),"refresh",function(){i.mounted&&i.setState(function(e){return{resetCount:e.resetCount+1}})}),O(ge(i),"metaCache",null),O(ge(i),"triggerMetaEvent",function(e){var t=i.props.onMetaChange;if(t){var n=D(D({},i.getMeta()),{},{destroy:e});ne(i.metaCache,n)||t(n),i.metaCache=n}else i.metaCache=null}),O(ge(i),"onStoreChange",function(e,t,n){var r=i.props,a=r.shouldUpdate,o=r.dependencies,s=void 0===o?[]:o,l=r.onReset,c=n.store,u=i.getNamePath(),h=i.getValue(e),d=i.getValue(c),p=t&&uh(t,u);switch("valueUpdate"!==n.type||"external"!==n.source||ne(h,d)||(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=gh,i.warnings=gh,i.triggerMetaEvent()),n.type){case"reset":if(!t||p)return i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=gh,i.warnings=gh,i.triggerMetaEvent(),null==l||l(),void i.refresh();break;case"remove":if(a&&mh(a,e,c,h,d,n))return void i.reRender();break;case"setField":var f=n.data;if(p)return"touched"in f&&(i.touched=f.touched),"validating"in f&&!("originRCField"in f)&&(i.validatePromise=f.validating?Promise.resolve([]):null),"errors"in f&&(i.errors=f.errors||gh),"warnings"in f&&(i.warnings=f.warnings||gh),i.dirty=!0,i.triggerMetaEvent(),void i.reRender();if("value"in f&&uh(t,u,!0))return void i.reRender();if(a&&!u.length&&mh(a,e,c,h,d,n))return void i.reRender();break;case"dependenciesUpdate":if(s.map(lh).some(function(e){return uh(n.relatedFields,e)}))return void i.reRender();break;default:if(p||(!s.length||u.length||a)&&mh(a,e,c,h,d,n))return void i.reRender()}!0===a&&i.reRender()}),O(ge(i),"validateRules",function(e){var t=i.getNamePath(),n=i.getValue(),r=e||{},a=r.triggerName,o=r.validateOnly,s=void 0!==o&&o,l=Promise.resolve().then(Ps(Rs().mark(function r(){var o,s,c,u,h,d,p;return Rs().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i.mounted){r.next=2;break}return r.abrupt("return",[]);case 2:if(o=i.props,s=o.validateFirst,c=void 0!==s&&s,u=o.messageVariables,h=o.validateDebounce,d=i.getRules(),a&&(d=d.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||Nu(t).includes(a)})),!h||!a){r.next=10;break}return r.next=8,new Promise(function(e){setTimeout(e,h)});case 8:if(i.validatePromise===l){r.next=10;break}return r.abrupt("return",[]);case 10:return(p=ah(t,n,d,e,c,u)).catch(function(e){return e}).then(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gh;if(i.validatePromise===l){var t;i.validatePromise=null;var n=[],r=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,i=e.errors,a=void 0===i?gh:i;t?r.push.apply(r,M(a)):n.push.apply(n,M(a))}),i.errors=n,i.warnings=r,i.triggerMetaEvent(),i.reRender()}}),r.abrupt("return",p);case 13:case"end":return r.stop()}},r)})));return s||(i.validatePromise=l,i.dirty=!0,i.errors=gh,i.warnings=gh,i.triggerMetaEvent(),i.reRender()),l}),O(ge(i),"isFieldValidating",function(){return!!i.validatePromise}),O(ge(i),"isFieldTouched",function(){return i.touched}),O(ge(i),"isFieldDirty",function(){return!(!i.dirty&&void 0===i.props.initialValue)||void 0!==(0,i.props.fieldContext.getInternalHooks(_u).getInitialValue)(i.getNamePath())}),O(ge(i),"getErrors",function(){return i.errors}),O(ge(i),"getWarnings",function(){return i.warnings}),O(ge(i),"isListField",function(){return i.props.isListField}),O(ge(i),"isList",function(){return i.props.isList}),O(ge(i),"isPreserve",function(){return i.props.preserve}),O(ge(i),"getMeta",function(){return i.prevValidating=i.isFieldValidating(),{touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:null===i.validatePromise}}),O(ge(i),"getOnlyChild",function(t){if("function"==typeof t){var n=i.getMeta();return D(D({},i.getOnlyChild(t(i.getControlled(),n,i.props.fieldContext))),{},{isFunction:!0})}var r=on(t);return 1===r.length&&e.isValidElement(r[0])?{child:r[0],isFunction:!1}:{child:r,isFunction:!1}}),O(ge(i),"getValue",function(e){var t=i.props.fieldContext.getFieldsValue,n=i.getNamePath();return br(e||t(!0),n)}),O(ge(i),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.props,n=t.name,r=t.trigger,a=t.validateTrigger,o=t.getValueFromEvent,s=t.normalize,l=t.valuePropName,c=t.getValueProps,u=t.fieldContext,h=void 0!==a?a:u.validateTrigger,d=i.getNamePath(),p=u.getInternalHooks,f=u.getFieldsValue,g=p(_u).dispatch,m=i.getValue(),y=c||function(e){return O({},l,e)},v=e[r],b=void 0!==n?y(m):{},x=D(D({},e),b);return x[r]=function(){var e;i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach(function(n){n(t,r,e)})}}),O(this,"timeoutId",null),O(this,"warningUnhooked",function(){}),O(this,"updateStore",function(e){n.store=e}),O(this,"getFieldEntities",function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities}),O(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new wh;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),O(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=lh(e);return t.get(n)||{INVALIDATE_NAME_PATH:lh(e)}})}),O(this,"getFieldsValue",function(e,t){var r,i,a;if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,i=t):e&&"object"===N(e)&&(a=e.strict,i=e.filter),!0===r&&!i)return n.store;var o=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return o.forEach(function(e){var t,n,o,l,c="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(a){if(null!==(o=(l=e).isList)&&void 0!==o&&o.call(l))return}else if(!r&&null!==(t=(n=e).isListField)&&void 0!==t&&t.call(n))return;if(i){var u="getMeta"in e?e.getMeta():null;i(u)&&s.push(c)}else s.push(c)}),ch(n.store,s.map(lh))}),O(this,"getFieldValue",function(e){n.warningUnhooked();var t=lh(e);return br(n.store,t)}),O(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return t&&!("INVALIDATE_NAME_PATH"in t)?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:lh(e[n]),errors:[],warnings:[]}})}),O(this,"getFieldError",function(e){n.warningUnhooked();var t=lh(e);return n.getFieldsError([t])[0].errors}),O(this,"getFieldWarning",function(e){n.warningUnhooked();var t=lh(e);return n.getFieldsError([t])[0].warnings}),O(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new wh,r=n.getFieldEntities(!0);r.forEach(function(e){var n=e.props.initialValue,r=e.getNamePath();if(void 0!==n){var i=t.get(r)||new Set;i.add({entity:e,value:n}),t.set(r,i)}});var i;e.entities?i=e.entities:e.namePathList?(i=[],e.namePathList.forEach(function(e){var n,r=t.get(e);r&&(n=i).push.apply(n,M(M(r).map(function(e){return e.entity})))})):i=r,i.forEach(function(r){if(void 0!==r.props.initialValue){var i=r.getNamePath();if(void 0!==n.getInitialValue(i))te(!1,"Form already set 'initialValues' with path '".concat(i.join("."),"'. Field can not overwrite it."));else{var a=t.get(i);if(a&&a.size>1)te(!1,"Multiple Field with path '".concat(i.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var o=n.getFieldValue(i);r.isListField()||e.skipExist&&void 0!==o||n.updateStore(wr(n.store,i,M(a)[0].value))}}}})}),O(this,"resetFields",function(e){n.warningUnhooked();var t=n.store;if(!e)return n.updateStore(Tr(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),void n.notifyWatch();var r=e.map(lh);r.forEach(function(e){var t=n.getInitialValue(e);n.updateStore(wr(n.store,e,t))}),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)}),O(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var i=e.name,a=X(e,Eh),o=lh(i);r.push(o),"value"in a&&n.updateStore(wr(n.store,o,a.value)),n.notifyObservers(t,[o],{type:"setField",data:e})}),n.notifyWatch(r)}),O(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=D(D({},e.getMeta()),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(r,"originRCField",{value:!0}),r})}),O(this,"initEntityValue",function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===br(n.store,r)&&n.updateStore(wr(n.store,r,t))}}),O(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),O(this,"registerField",function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(i)&&(!r||a.length>1)){var o=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==o&&n.fieldEntities.every(function(e){return!hh(e.getNamePath(),t)})){var s=n.store;n.updateStore(wr(s,t,o,!0)),n.notifyObservers(s,[t],{type:"remove"}),n.triggerDependenciesUpdate(s,t)}}n.notifyWatch([t])}}),O(this,"dispatch",function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var i=e.namePath,a=e.triggerName;n.validateFields([i],{triggerName:a})}}),O(this,"notifyObservers",function(e,t,r){if(n.subscribable){var i=D(D({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,i)})}else n.forceRootUpdate()}),O(this,"triggerDependenciesUpdate",function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat(M(r))}),r}),O(this,"updateValue",function(e,t){var r=lh(e),i=n.store;n.updateStore(wr(n.store,r,t)),n.notifyObservers(i,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var a=n.triggerDependenciesUpdate(i,r),o=n.callbacks.onValuesChange;o&&o(ch(n.store,[r]),n.getFieldsValue());n.triggerOnFieldsChange([r].concat(M(a)))}),O(this,"setFieldsValue",function(e){n.warningUnhooked();var t=n.store;if(e){var r=Tr(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),O(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t,errors:[],warnings:[]}])}),O(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],i=new wh;n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=lh(t);i.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})});return function e(n){(i.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var i=n.getNamePath();n.isFieldDirty()&&i.length&&(r.push(i),e(i))}})}(e),r}),O(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var i=n.getFields();if(t){var a=new wh;t.forEach(function(e){var t=e.name,n=e.errors;a.set(t,n)}),i.forEach(function(e){e.errors=a.get(e.name)||e.errors})}var o=i.filter(function(t){var n=t.name;return uh(e,n)});o.length&&r(o,i)}}),O(this,"validateFields",function(e,t){var r,i;n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(r=e,i=t):i=e;var a=!!r,o=a?r.map(lh):[],s=[],l=String(Date.now()),c=new Set,u=i||{},h=u.recursive,d=u.dirty;n.getFieldEntities(!0).forEach(function(e){if(a||o.push(e.getNamePath()),e.props.rules&&e.props.rules.length&&(!d||e.isFieldDirty())){var t=e.getNamePath();if(c.add(t.join(l)),!a||uh(o,t,h)){var r=e.validateRules(D({validateMessages:D(D({},Ju),n.validateMessages)},i));s.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],i=[];return null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?i.push.apply(i,M(n)):r.push.apply(r,M(n))}),r.length?Promise.reject({name:t,errors:r,warnings:i}):{name:t,errors:r,warnings:i}}))}}});var p=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,a){e.forEach(function(e,o){e.catch(function(e){return t=!0,e}).then(function(e){n-=1,r[o]=e,n>0||(t&&a(r),i(r))})})}):Promise.resolve([])}(s);n.lastValidatePromise=p,p.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)});var f=p.then(function(){return n.lastValidatePromise===p?Promise.resolve(n.getFieldsValue(o)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(o),errorFields:t,outOfDate:n.lastValidatePromise!==p})});f.catch(function(e){return e});var g=o.filter(function(e){return c.has(e.join(l))});return n.triggerOnFieldsChange(g),f}),O(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})}),this.forceRootUpdate=t});function Th(t){var n=e.useRef(),r=A(e.useState({}),2)[1];if(!n.current)if(t)n.current=t;else{var i=new kh(function(){r({})});n.current=i.getForm()}return[n.current]}var _h=e.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ch=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],Sh=function(t,n){var r=t.name,i=t.initialValues,a=t.fields,o=t.form,s=t.preserve,l=t.children,c=t.component,u=void 0===c?"form":c,h=t.validateMessages,d=t.validateTrigger,p=void 0===d?"onChange":d,f=t.onValuesChange,g=t.onFieldsChange,m=t.onFinish,y=t.onFinishFailed,v=t.clearOnDestroy,b=X(t,Ch),x=e.useRef(null),w=e.useContext(_h),E=A(Th(o),1)[0],k=E.getInternalHooks(_u),T=k.useSubscribe,_=k.setInitialValues,C=k.setCallbacks,S=k.setValidateMessages,I=k.setPreserve,O=k.destroyForm;e.useImperativeHandle(n,function(){return D(D({},E),{},{nativeElement:x.current})}),e.useEffect(function(){return w.registerForm(r,E),function(){w.unregisterForm(r)}},[w,E,r]),S(D(D({},w.validateMessages),h)),C({onValuesChange:f,onFieldsChange:function(e){if(w.triggerFormChange(r,e),g){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0&&t<=n.length?(u.keys=[].concat(M(u.keys.slice(0,t)),[u.id],M(u.keys.slice(t))),a([].concat(M(n.slice(0,t)),[e],M(n.slice(t))))):(u.keys=[].concat(M(u.keys),[u.id]),a([].concat(M(n),[e]))),u.id+=1},remove:function(e){var t=s(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(u.keys=u.keys.filter(function(e,t){return!n.has(t)}),a(t.filter(function(e,t){return!n.has(t)})))},move:function(e,t){if(e!==t){var n=s();e<0||e>=n.length||t<0||t>=n.length||(u.keys=ph(u.keys,e,t),a(ph(n,e,t)))}}},d=r||[];return Array.isArray(d)||(d=[]),i(d.map(function(e,t){var n=u.keys[t];return void 0===n&&(u.keys[t]=u.id,n=u.keys[t],u.id+=1),{name:t,key:n,isListField:!0}}),c,t)})))},Nh.useForm=Th,Nh.useWatch=function(){for(var e=arguments.length,t=new Array(e),r=0;r{const i=e.useContext(Ih),a=e.useMemo(()=>{const e=Object.assign({},i);return r&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,r,i]);return e.createElement(Ih.Provider,{value:a},t)},Lh=e.createContext(void 0),Mh=e=>{const{space:n,form:r,children:i}=e;if(null==i)return null;let a=i;return r&&(a=t.createElement(Oh,{override:!0,status:!0},a)),n&&(a=t.createElement(hl,null,a)),a};function Rh(e,t){return function(e){if($()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1}(e)}const Dh=t=>{const{prefixCls:n,className:r,style:i,size:a,shape:o}=t,s=en({[`${n}-lg`]:"large"===a,[`${n}-sm`]:"small"===a}),l=en({[`${n}-circle`]:"circle"===o,[`${n}-square`]:"square"===o,[`${n}-round`]:"round"===o}),c=e.useMemo(()=>"number"==typeof a?{width:a,height:a,lineHeight:`${a}px`}:{},[a]);return e.createElement("span",{className:en(n,s,l,r),style:Object.assign(Object.assign({},c),i)})},Ph=new Xt("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),$h=e=>({height:e,lineHeight:Le(e)}),Bh=e=>Object.assign({width:e},$h(e)),Fh=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:Ph,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),zh=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},$h(e)),jh=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},Bh(r)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Bh(i)),[`${t}${t}-sm`]:Object.assign({},Bh(a))}},Hh=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:i,controlHeightSM:a,gradientFromColor:o,calc:s}=e;return{[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:n},zh(t,s)),[`${r}-lg`]:Object.assign({},zh(i,s)),[`${r}-sm`]:Object.assign({},zh(a,s))}},Uh=e=>Object.assign({width:e},$h(e)),Gh=e=>{const{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:i,calc:a}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:r,borderRadius:i},Uh(a(n).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},Uh(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},qh=(e,t,n)=>{const{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:t}}},Wh=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},$h(e)),Vh=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:i,controlHeightSM:a,gradientFromColor:o,calc:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:o,borderRadius:t,width:s(r).mul(2).equal(),minWidth:s(r).mul(2).equal()},Wh(r,s))},qh(e,r,n)),{[`${n}-lg`]:Object.assign({},Wh(i,s))}),qh(e,i,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},Wh(a,s))}),qh(e,a,`${n}-sm`))};var Yh=wa("Skeleton",e=>{const{componentCls:t,calc:n}=e;return(e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:i,skeletonButtonCls:a,skeletonInputCls:o,skeletonImageCls:s,controlHeight:l,controlHeightLG:c,controlHeightSM:u,gradientFromColor:h,padding:d,marginSM:p,borderRadius:f,titleHeight:g,blockRadius:m,paragraphLiHeight:y,controlHeightXS:v,paragraphMarginTop:b}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:d,verticalAlign:"top",[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:h},Bh(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},Bh(c)),[`${n}-sm`]:Object.assign({},Bh(u))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:g,background:h,borderRadius:m,[`+ ${i}`]:{marginBlockStart:u}},[i]:{padding:0,"> li":{width:"100%",height:y,listStyle:"none",background:h,borderRadius:m,"+ li":{marginBlockStart:v}}},[`${i}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${r}, ${i} > li`]:{borderRadius:f}}},[`${t}-with-avatar ${t}-content`]:{[r]:{marginBlockStart:p,[`+ ${i}`]:{marginBlockStart:b}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},Vh(e)),jh(e)),Hh(e)),Gh(e)),[`${t}${t}-block`]:{width:"100%",[a]:{width:"100%"},[o]:{width:"100%"}},[`${t}${t}-active`]:{[`\n ${r},\n ${i} > li,\n ${n},\n ${a},\n ${o},\n ${s}\n `]:Object.assign({},Fh(e))}}})(Qi(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{const{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]});const Xh=(e,t)=>{const{width:n,rows:r=2}=t;return Array.isArray(n)?n[e]:r-1===e?n:void 0},Kh=t=>{const{prefixCls:n,className:r,style:i,rows:a=0}=t,o=Array.from({length:a}).map((n,r)=>e.createElement("li",{key:r,style:{width:Xh(r,t)}}));return e.createElement("ul",{className:en(n,r),style:i},o)},Qh=({prefixCls:t,className:n,width:r,style:i})=>e.createElement("h3",{className:en(t,n),style:Object.assign({width:r},i)});function Zh(e){return e&&"object"==typeof e?e:{}}const Jh=t=>{const{prefixCls:n,loading:r,className:i,rootClassName:a,style:o,children:s,avatar:l=!1,title:c=!0,paragraph:u=!0,active:h,round:d}=t,{getPrefixCls:p,direction:f,className:g,style:m}=Ii("skeleton"),y=p("skeleton",n),[v,b,x]=Yh(y);if(r||!("loading"in t)){const t=!!l,n=!!c,r=!!u;let s,p;if(t){const t=Object.assign(Object.assign({prefixCls:`${y}-avatar`},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(n,r)),Zh(l));s=e.createElement("div",{className:`${y}-header`},e.createElement(Dh,Object.assign({},t)))}if(n||r){let i,a;if(n){const n=Object.assign(Object.assign({prefixCls:`${y}-title`},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(t,r)),Zh(c));i=e.createElement(Qh,Object.assign({},n))}if(r){const r=Object.assign(Object.assign({prefixCls:`${y}-paragraph`},function(e,t){const n={};return e&&t||(n.width="61%"),n.rows=!e&&t?3:2,n}(t,n)),Zh(u));a=e.createElement(Kh,Object.assign({},r))}p=e.createElement("div",{className:`${y}-content`},i,a)}const w=en(y,{[`${y}-with-avatar`]:t,[`${y}-active`]:h,[`${y}-rtl`]:"rtl"===f,[`${y}-round`]:d},g,i,a,b,x);return v(e.createElement("div",{className:w,style:Object.assign(Object.assign({},m),o)},s,p))}return null!=s?s:null};function ed(){}Jh.Button=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,block:o=!1,size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Zs(t,["prefixCls"]),f=en(c,`${c}-element`,{[`${c}-active`]:a,[`${c}-block`]:o},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-button`,size:s},p))))},Jh.Avatar=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,shape:o="circle",size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Zs(t,["prefixCls","className"]),f=en(c,`${c}-element`,{[`${c}-active`]:a},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-avatar`,shape:o,size:s},p))))},Jh.Input=t=>{const{prefixCls:n,className:r,rootClassName:i,active:a,block:o,size:s="default"}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=Zs(t,["prefixCls"]),f=en(c,`${c}-element`,{[`${c}-active`]:a,[`${c}-block`]:o},r,i,h,d);return u(e.createElement("div",{className:f},e.createElement(Dh,Object.assign({prefixCls:`${c}-input`,size:s},p))))},Jh.Image=t=>{const{prefixCls:n,className:r,rootClassName:i,style:a,active:o}=t,{getPrefixCls:s}=e.useContext(Si),l=s("skeleton",n),[c,u,h]=Yh(l),d=en(l,`${l}-element`,{[`${l}-active`]:o},r,i,u,h);return c(e.createElement("div",{className:d},e.createElement("div",{className:en(`${l}-image`,r),style:a},e.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${l}-image-svg`},e.createElement("title",null,"Image placeholder"),e.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${l}-image-path`})))))},Jh.Node=t=>{const{prefixCls:n,className:r,rootClassName:i,style:a,active:o,children:s}=t,{getPrefixCls:l}=e.useContext(Si),c=l("skeleton",n),[u,h,d]=Yh(c),p=en(c,`${c}-element`,{[`${c}-active`]:o},h,r,i,d);return u(e.createElement("div",{className:p},e.createElement("div",{className:en(`${c}-image`,r),style:a},s)))};const td=e.createContext({add:ed,remove:ed});function nd(t){const n=e.useContext(td),r=e.useRef(null);return Gi(e=>{if(e){const i=t?e.querySelector(t):e;i&&(n.add(i),r.current=i)}else n.remove(r.current)})}const rd=()=>{const{cancelButtonProps:e,cancelTextLocale:r,onCancel:i}=n(Jc);return t.createElement(Kc,Object.assign({onClick:i},e),r)},id=()=>{const{confirmLoading:e,okButtonProps:r,okType:i,okTextLocale:a,onOk:o}=n(Jc);return t.createElement(Kc,Object.assign({},ml(i),{loading:e,onClick:o},r),a)};function ad(e,n){return t.createElement("span",{className:`${e}-close-x`},n||t.createElement(Zo,{className:`${e}-close-icon`}))}const od=e=>{const{okText:n,okType:r="primary",cancelText:i,confirmLoading:a,onOk:o,onCancel:s,okButtonProps:l,cancelButtonProps:c,footer:u}=e,[h]=zr("Modal",Br()),d=n||(null==h?void 0:h.okText),p=i||(null==h?void 0:h.cancelText),f=t.useMemo(()=>({confirmLoading:a,okButtonProps:l,cancelButtonProps:c,okTextLocale:d,cancelTextLocale:p,okType:r,onOk:o,onCancel:s}),[a,l,c,d,p,r,o,s]);let g;return"function"==typeof u||void 0===u?(g=t.createElement(t.Fragment,null,t.createElement(rd,null),t.createElement(id,null)),"function"==typeof u&&(g=u(g,{OkBtn:id,CancelBtn:rd})),g=t.createElement(eu,{value:f},g)):g=u,t.createElement(Ri,{disabled:!1},g)},sd=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},ld=(e,t)=>((e,t)=>{const{prefixCls:n,componentCls:r,gridColumns:i}=e,a={};for(let e=i;e>=0;e--)0===e?(a[`${r}${t}-${e}`]={display:"none"},a[`${r}-push-${e}`]={insetInlineStart:"auto"},a[`${r}-pull-${e}`]={insetInlineEnd:"auto"},a[`${r}${t}-push-${e}`]={insetInlineStart:"auto"},a[`${r}${t}-pull-${e}`]={insetInlineEnd:"auto"},a[`${r}${t}-offset-${e}`]={marginInlineStart:0},a[`${r}${t}-order-${e}`]={order:0}):(a[`${r}${t}-${e}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${e/i*100}%`,maxWidth:e/i*100+"%"}],a[`${r}${t}-push-${e}`]={insetInlineStart:e/i*100+"%"},a[`${r}${t}-pull-${e}`]={insetInlineEnd:e/i*100+"%"},a[`${r}${t}-offset-${e}`]={marginInlineStart:e/i*100+"%"},a[`${r}${t}-order-${e}`]={order:e});return a[`${r}${t}-flex`]={flex:`var(--${n}${t}-flex)`},a})(e,t),cd=wa("Grid",e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),ud=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),hd=wa("Grid",e=>{const t=Qi(e,{gridColumns:24}),n=ud(t);return delete n.xs,[sd(t),ld(t,""),ld(t,"-xs"),Object.keys(n).map(e=>((e,t,n)=>({[`@media (min-width: ${Le(t)})`]:Object.assign({},ld(e,n))}))(t,n[e],`-${e}`)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}));function dd(e){return{position:e,inset:0}}const pd=e=>{const{componentCls:t,antCls:n}=e;return[{[`${t}-root`]:{[`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${n}-zoom-leave ${t}-content`]:{pointerEvents:"none"},[`${t}-mask`]:Object.assign(Object.assign({},dd("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`${t}-hidden`]:{display:"none"}}),[`${t}-wrap`]:Object.assign(Object.assign({},dd("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${t}-root`]:zl(e)}]},fd=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${Le(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},ma(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Le(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:e.paddingLG,[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-content`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:Le(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive}},va(e)),[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${Le(e.borderRadiusLG)} ${Le(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Le(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}})},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-content,\n ${t}-body,\n ${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},gd=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},md=e=>{const{componentCls:t}=e,n=ud(e),r=Object.assign({},n);delete r.xs;const i=`--${t.replace(".","")}-`,a=Object.keys(r).map(e=>({[`@media (min-width: ${Le(r[e])})`]:{width:`var(${i}${e}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(M(Object.keys(n).map((e,t)=>{const r=Object.keys(n)[t-1];return r?{[`${i}${e}-width`]:`var(${i}${r}-width)`}:null})),[{width:`var(${i}xs-width)`}],M(a))}}},yd=e=>{const t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return Qi(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},vd=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Le(e.paddingMD)} ${Le(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Le(e.padding)} ${Le(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Le(e.paddingXS)} ${Le(e.padding)}`:0,footerBorderTop:e.wireframe?`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${Le(e.borderRadiusLG)} ${Le(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Le(2*e.padding)} ${Le(2*e.padding)} ${Le(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM});var bd=wa("Modal",e=>{const t=yd(e);return[fd(t),gd(t),pd(t),dc(t,"zoom"),md(t)]},vd,{unitless:{titleLineHeight:!0}}),xd=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{wd={x:e.pageX,y:e.pageY},setTimeout(()=>{wd=null},100)};$()&&window.document.documentElement&&document.documentElement.addEventListener("click",Ed,!0);const kd=t=>{const{prefixCls:n,className:r,rootClassName:i,open:a,wrapClassName:o,centered:s,getContainer:l,focusTriggerAfterClose:c=!0,style:u,visible:h,width:d=520,footer:p,classNames:f,styles:g,children:m,loading:y,confirmLoading:v,zIndex:b,mousePosition:x,onOk:w,onCancel:E,destroyOnHidden:k,destroyOnClose:T,panelRef:_=null,modalRender:C}=t,S=xd(t,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef","modalRender"]),{getPopupContainer:A,getPrefixCls:N,direction:I,modal:O}=e.useContext(Si),L=e=>{v||null==E||E(e)},M=N("modal",n),R=N(),D=hs(M),[P,$,B]=bd(M,D),F=en(o,{[`${M}-centered`]:null!=s?s:null==O?void 0:O.centered,[`${M}-wrap-rtl`]:"rtl"===I}),z=null===p||y?null:e.createElement(od,Object.assign({},t,{onOk:e=>{null==w||w(e)},onCancel:L})),[j,H,U,G]=xs(ys(t),ys(O),{closable:!0,closeIcon:e.createElement(Zo,{className:`${M}-close-icon`}),closeIconRender:e=>ad(M,e)}),q=C?t=>e.createElement("div",{className:`${M}-render`},C(t)):void 0,W=nd(`.${M}-${C?"render":"content"}`),V=In(_,W),[Y,X]=_s("Modal",b),[K,Q]=e.useMemo(()=>d&&"object"==typeof d?[void 0,d]:[d,void 0],[d]),Z=e.useMemo(()=>{const e={};return Q&&Object.keys(Q).forEach(t=>{const n=Q[t];void 0!==n&&(e[`--${M}-${t}-width`]="number"==typeof n?`${n}px`:n)}),e},[M,Q]);return P(e.createElement(Mh,{form:!0,space:!0},e.createElement(ws.Provider,{value:X},e.createElement(Tu,Object.assign({width:K},S,{zIndex:Y,getContainer:void 0===l?A:l,prefixCls:M,rootClassName:en($,i,B,D),footer:z,visible:null!=a?a:h,mousePosition:null!=x?x:wd,onClose:L,closable:j?Object.assign({disabled:U,closeIcon:H},G):j,closeIcon:H,focusTriggerAfterClose:c,transitionName:Qs(R,"zoom",t.transitionName),maskTransitionName:Qs(R,"fade",t.maskTransitionName),className:en($,r,null==O?void 0:O.className),style:Object.assign(Object.assign(Object.assign({},null==O?void 0:O.style),u),Z),classNames:Object.assign(Object.assign(Object.assign({},null==O?void 0:O.classNames),f),{wrapper:en(F,null==f?void 0:f.wrapper)}),styles:Object.assign(Object.assign({},null==O?void 0:O.styles),g),panelRef:V,destroyOnClose:null!=k?k:T,modalRender:q}),y?e.createElement(Jh,{active:!0,title:!1,paragraph:{rows:4},className:`${M}-body-skeleton`}):m))))};var Td=ka(["Modal","confirm"],e=>(e=>{const{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:i,fontSize:a,lineHeight:o,modalTitleHeight:s,fontHeight:l,confirmBodyPadding:c}=e,u=`${t}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},{"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),[`&${t} ${t}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:i,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(l).sub(i).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(s).sub(i).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${Le(e.marginSM)})`},[`${e.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Le(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${u}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},[`${u}-content`]:{color:e.colorText,fontSize:a,lineHeight:o},[`${u}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${u}-error ${u}-body > ${e.iconCls}`]:{color:e.colorError},[`${u}-warning ${u}-body > ${e.iconCls},\n ${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}})(yd(e)),vd,{order:-1e3}),_d=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:n,icon:r,okText:i,cancelText:a,confirmPrefixCls:o,type:s,okCancel:l,footer:c,locale:u}=t,h=_d(t,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);let d=r;if(!r&&null!==r)switch(s){case"info":d=e.createElement(is,null);break;case"success":d=e.createElement(Wo,null);break;case"error":d=e.createElement(Xo,null);break;default:d=e.createElement(ts,null)}const p=null!=l?l:"confirm"===s,f=null!==t.autoFocusButton&&(t.autoFocusButton||"ok"),[g]=zr("Modal"),m=u||g,y=i||(p?null==m?void 0:m.okText:null==m?void 0:m.justOkText),v=a||(null==m?void 0:m.cancelText),b=e.useMemo(()=>Object.assign({autoFocusButton:f,cancelTextLocale:v,okTextLocale:y,mergedOkCancel:p},h),[f,v,y,p,h]),x=e.createElement(e.Fragment,null,e.createElement(tu,null),e.createElement(nu,null)),w=void 0!==t.title&&null!==t.title,E=`${o}-body`;return e.createElement("div",{className:`${o}-body-wrapper`},e.createElement("div",{className:en(E,{[`${E}-has-title`]:w})},d,e.createElement("div",{className:`${o}-paragraph`},w&&e.createElement("span",{className:`${o}-title`},t.title),e.createElement("div",{className:`${o}-content`},t.content))),void 0===c||"function"==typeof c?e.createElement(eu,{value:b},e.createElement("div",{className:`${o}-btns`},"function"==typeof c?c(x,{OkBtn:nu,CancelBtn:tu}):x)):c,e.createElement(Td,{prefixCls:n}))},Sd=t=>{const{close:n,zIndex:r,maskStyle:i,direction:a,prefixCls:o,wrapClassName:s,rootPrefixCls:l,bodyStyle:c,closable:u=!1,onConfirm:h,styles:d,title:p}=t,f=`${o}-confirm`,g=t.width||416,m=t.style||{},y=void 0===t.mask||t.mask,v=void 0!==t.maskClosable&&t.maskClosable,b=en(f,`${f}-${t.type}`,{[`${f}-rtl`]:"rtl"===a},t.className),[,x]=fa(),w=e.useMemo(()=>void 0!==r?r:x.zIndexPopupBase+1e3,[r,x]);return e.createElement(kd,Object.assign({},t,{className:b,wrapClassName:en({[`${f}-centered`]:!!t.centered},s),onCancel:()=>{null==n||n({triggerCancel:!0}),null==h||h(!1)},title:p,footer:null,transitionName:Qs(l||"","zoom",t.transitionName),maskTransitionName:Qs(l||"","fade",t.maskTransitionName),mask:y,maskClosable:v,style:m,styles:Object.assign({body:c,mask:i},d),width:g,zIndex:w,closable:u}),e.createElement(Cd,Object.assign({},t,{confirmPrefixCls:f})))},Ad=t=>{const{rootPrefixCls:n,iconPrefixCls:r,direction:i,theme:a}=t;return e.createElement(Io,{prefixCls:n,iconPrefixCls:r,direction:i,theme:a},e.createElement(Sd,Object.assign({},t)))},Nd=[];let Id="";function Od(){return Id}const Ld=e=>{var r,i;const{prefixCls:a,getContainer:o,direction:s}=e,l=Br(),c=n(Si),u=Od()||c.getPrefixCls(),h=a||`${u}-modal`;let d=o;return!1===d&&(d=void 0),t.createElement(Ad,Object.assign({},e,{rootPrefixCls:u,prefixCls:h,iconPrefixCls:c.iconPrefixCls,theme:c.theme,direction:null!=s?s:c.direction,locale:null!==(i=null===(r=c.locale)||void 0===r?void 0:r.Modal)&&void 0!==i?i:l,getContainer:d}))};function Md(e){const n={getPrefixCls:(e,t)=>t||(e?`${So()}-${e}`:So()),getIconPrefixCls:Ao,getRootPrefixCls:()=>ko||So(),getTheme:()=>_o,holderRender:Co},r=document.createDocumentFragment();let i,a,o=Object.assign(Object.assign({},e),{close:c,open:!0});function s(...t){var n;var r;t.some(e=>null==e?void 0:e.triggerCancel)&&(null===(n=e.onCancel)||void 0===n||(r=n).call.apply(r,[e,()=>{}].concat(M(t.slice(1)))));for(let e=0;e{clearTimeout(i),i=setTimeout(()=>{const i=n.getPrefixCls(void 0,Od()),o=n.getIconPrefixCls(),s=n.getTheme(),l=t.createElement(Ld,Object.assign({},e)),c=Ks();a=c(t.createElement(Io,{prefixCls:i,iconPrefixCls:o,theme:s},"function"==typeof n.holderRender?n.holderRender(l):l),r)})};function c(...t){o=Object.assign(Object.assign({},o),{open:!1,afterClose:()=>{"function"==typeof e.afterClose&&e.afterClose(),s.apply(this,t)}}),o.visible&&delete o.visible,l(o)}return l(o),Nd.push(c),{destroy:c,update:function(e){o="function"==typeof e?e(o):Object.assign(Object.assign({},o),e),l(o)}}}function Rd(e){return Object.assign(Object.assign({},e),{type:"warning"})}function Dd(e){return Object.assign(Object.assign({},e),{type:"info"})}function Pd(e){return Object.assign(Object.assign({},e),{type:"success"})}function $d(e){return Object.assign(Object.assign({},e),{type:"error"})}function Bd(e){return Object.assign(Object.assign({},e),{type:"confirm"})}var Fd=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r,{afterClose:i,config:a}=t,o=Fd(t,["afterClose","config"]);const[s,l]=e.useState(!0),[c,u]=e.useState(a),{direction:h,getPrefixCls:d}=e.useContext(Si),p=d("modal"),f=d(),g=(...e)=>{var t;l(!1);var n;e.some(e=>null==e?void 0:e.triggerCancel)&&(null===(t=c.onCancel)||void 0===t||(n=t).call.apply(n,[c,()=>{}].concat(M(e.slice(1)))))};e.useImperativeHandle(n,()=>({destroy:g,update:e=>{u(t=>{const n="function"==typeof e?e(t):e;return Object.assign(Object.assign({},t),n)})}}));const m=null!==(r=c.okCancel)&&void 0!==r?r:"confirm"===c.type,[y]=zr("Modal",Rr.Modal);return e.createElement(Ad,Object.assign({prefixCls:p,rootPrefixCls:f},c,{close:g,open:s,afterClose:()=>{var e;i(),null===(e=c.afterClose)||void 0===e||e.call(c)},okText:c.okText||(m?null==y?void 0:y.okText:null==y?void 0:y.justOkText),direction:c.direction||h,cancelText:c.cancelText||(null==y?void 0:y.cancelText)},o))};var jd=e.forwardRef(zd);let Hd=0;const Ud=e.memo(e.forwardRef((t,n)=>{const[r,i]=(()=>{const[t,n]=e.useState([]),r=e.useCallback(e=>(n(t=>[].concat(M(t),[e])),()=>{n(t=>t.filter(t=>t!==e))}),[]);return[t,r]})();return e.useImperativeHandle(n,()=>({patchElement:i}),[i]),e.createElement(e.Fragment,null,r)}));function Gd(t){return n=>e.createElement(Io,{theme:{token:{motion:!1,zIndexPopupBase:0}}},e.createElement(t,Object.assign({},n)))}var qd=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))},Wd=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,a=t.children,o=t.onMouseDown,s=t.onClick,l="function"==typeof r?r(i):r;return e.createElement("span",{className:n,onMouseDown:function(e){e.preventDefault(),null==o||o(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},void 0!==l?l:e.createElement("span",{className:en(n.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},a))},Vd=e.createContext(null);function Yd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,n=e.useRef(null),r=e.useRef(null);return e.useEffect(function(){return function(){window.clearTimeout(r.current)}},[]),[function(){return n.current},function(e){(e||null===n.current)&&(n.current=e),window.clearTimeout(r.current),r.current=window.setTimeout(function(){n.current=null},t)}]}var Xd=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Kd=void 0;function Qd(t,n){var r=t.prefixCls,i=t.invalidate,a=t.item,o=t.renderItem,s=t.responsive,l=t.responsiveDisabled,c=t.registerSize,u=t.itemKey,h=t.className,d=t.style,p=t.children,f=t.display,g=t.order,m=t.component,y=void 0===m?"div":m,v=X(t,Xd),b=s&&!f;function x(e){c(u,e)}e.useEffect(function(){return function(){x(null)}},[]);var w,E=o&&a!==Kd?o(a,{index:g}):p;i||(w={opacity:b?0:1,height:b?0:Kd,overflowY:b?"hidden":Kd,order:s?g:Kd,pointerEvents:b?"none":Kd,position:b?"absolute":Kd});var k={};b&&(k["aria-hidden"]=!0);var T=e.createElement(y,Xe({className:en(!i&&r,h),style:D(D({},w),d)},k,v,{ref:n}),E);return s&&(T=e.createElement(ur,{onResize:function(e){x(e.offsetWidth)},disabled:l},T)),T}var Zd=e.forwardRef(Qd);function Jd(){var t=e.useRef(null);return function(e){t.current||(t.current=[],function(e){if("undefined"==typeof MessageChannel)mr(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}(function(){E(function(){t.current.forEach(function(e){e()}),t.current=null})})),t.current.push(e)}}function ep(t,n){var r=A(e.useState(n),2),i=r[0],a=r[1];return[i,Gi(function(e){t(function(){a(e)})})]}Zd.displayName="Item";var tp=t.createContext(null),np=["component"],rp=["className"],ip=["className"],ap=function(t,n){var r=e.useContext(tp);if(!r){var i=t.component,a=void 0===i?"div":i,o=X(t,np);return e.createElement(a,Xe({},o,{ref:n}))}var s=r.className,l=X(r,rp),c=t.className,u=X(t,ip);return e.createElement(tp.Provider,{value:null},e.createElement(Zd,Xe({ref:n,className:en(s,c)},l,u)))},op=e.forwardRef(ap);op.displayName="RawItem";var sp=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],lp="responsive",cp="invalidate";function up(e){return"+ ".concat(e.length," ...")}function hp(t,n){var r=t.prefixCls,i=void 0===r?"rc-overflow":r,a=t.data,o=void 0===a?[]:a,s=t.renderItem,l=t.renderRawItem,c=t.itemKey,u=t.itemWidth,p=void 0===u?10:u,g=t.ssr,m=t.style,y=t.className,v=t.maxCount,b=t.renderRest,x=t.renderRawRest,w=t.prefix,E=t.suffix,k=t.component,T=void 0===k?"div":k,_=t.itemComponent,C=t.onVisibleChange,S=X(t,sp),N="full"===g,I=Jd(),O=A(ep(I,null),2),L=O[0],M=O[1],R=L||0,P=A(ep(I,new Map),2),$=P[0],B=P[1],F=A(ep(I,0),2),z=F[0],j=F[1],H=A(ep(I,0),2),U=H[0],G=H[1],q=A(ep(I,0),2),W=q[0],V=q[1],Y=A(ep(I,0),2),K=Y[0],Q=Y[1],Z=A(d(null),2),J=Z[0],ee=Z[1],te=A(d(null),2),ne=te[0],re=te[1],ie=e.useMemo(function(){return null===ne&&N?Number.MAX_SAFE_INTEGER:ne||0},[ne,L]),ae=A(d(!1),2),oe=ae[0],se=ae[1],le="".concat(i,"-item"),ce=Math.max(z,U),ue=v===lp,he=o.length&&ue,de=v===cp,pe=he||"number"==typeof v&&o.length>v,fe=h(function(){var e=o;return he?e=null===L&&N?o:o.slice(0,Math.min(o.length,R/p)):"number"==typeof v&&(e=o.slice(0,v)),e},[o,p,L,v,he]),ge=h(function(){return he?o.slice(ie+1):o.slice(fe.length)},[o,fe,he,ie]),me=f(function(e,t){var n;return"function"==typeof c?c(e):null!==(n=c&&(null==e?void 0:e[c]))&&void 0!==n?n:t},[c]),ye=f(s||function(e){return e},[s]);function ve(e,t,n){(ne!==e||void 0!==t&&t!==J)&&(re(e),n||(se(eR){ve(r-1,e-i-K+U);break}}E&&xe(0)+K>R&&ee(null)}},[R,$,U,W,K,me,fe]);var we=oe&&!!ge.length,Ee={};null!==J&&he&&(Ee={position:"absolute",left:J,top:0});var ke={prefixCls:le,responsive:he,component:_,invalidate:de},Te=l?function(t,n){var r=me(t,n);return e.createElement(tp.Provider,{key:r,value:D(D({},ke),{},{order:n,item:t,itemKey:r,registerSize:be,display:n<=ie})},l(t,n))}:function(t,n){var r=me(t,n);return e.createElement(Zd,Xe({},ke,{order:n,key:r,item:t,renderItem:ye,itemKey:r,registerSize:be,display:n<=ie}))},_e={order:we?ie:Number.MAX_SAFE_INTEGER,className:"".concat(le,"-rest"),registerSize:function(e,t){G(t),j(U)},display:we},Ce=b||up,Se=x?e.createElement(tp.Provider,{value:D(D({},ke),_e)},x(ge)):e.createElement(Zd,Xe({},ke,_e),"function"==typeof Ce?Ce(ge):Ce),Ae=e.createElement(T,Xe({className:en(!de&&i,y),style:m,ref:n},S),w&&e.createElement(Zd,Xe({},ke,{responsive:ue,responsiveDisabled:!he,order:-1,className:"".concat(le,"-prefix"),registerSize:function(e,t){V(t)},display:!0}),w),fe.map(Te),pe?Se:null,E&&e.createElement(Zd,Xe({},ke,{responsive:ue,responsiveDisabled:!he,order:ie,className:"".concat(le,"-suffix"),registerSize:function(e,t){Q(t)},display:!0,style:Ee}),E));return ue?e.createElement(ur,{onResize:function(e,t){M(t.clientWidth)},disabled:!he},Ae):Ae}var dp=e.forwardRef(hp);dp.displayName="Overflow",dp.Item=op,dp.RESPONSIVE=lp,dp.INVALIDATE=cp;var pp=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],fp=function(t,n){var r=t.prefixCls,i=t.id,a=t.inputElement,o=t.autoFocus,s=t.autoComplete,l=t.editable,c=t.activeDescendantId,u=t.value,h=t.open,d=t.attrs,p=X(t,pp),f=a||e.createElement("input",null),g=f,m=g.ref,y=g.props;return f.props,f=e.cloneElement(f,D(D(D({type:"search"},function(e,t){var n=D(D({},e),t);return Object.keys(t).forEach(function(r){var i=t[r];"function"==typeof i&&(n[r]=function(){for(var t,n=arguments.length,a=new Array(n),o=0;oE&&(a="".concat(o.slice(0,E),"..."))}var s=function(t){t&&t.stopPropagation(),S(e)};return"function"==typeof _?Y(r,a,t,i,s):V(e,a,t,i,s)},renderRest:function(e){if(!o.length)return null;var t="function"==typeof T?T(e):T;return"function"==typeof _?Y(void 0,t,!1,!1,void 0,!0):V({title:t},t,!1)},suffix:X,itemKey:xp,maxCount:w});return e.createElement("span",{className:"".concat(G,"-wrap")},K,!o.length&&!q&&e.createElement("span",{className:"".concat(G,"-placeholder")},h))},kp=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,a=t.inputRef,o=t.disabled,s=t.autoFocus,l=t.autoComplete,c=t.activeDescendantId,u=t.mode,h=t.open,d=t.values,p=t.placeholder,f=t.tabIndex,g=t.showSearch,m=t.searchValue,y=t.activeValue,v=t.maxLength,b=t.onInputKeyDown,x=t.onInputMouseDown,w=t.onInputChange,E=t.onInputPaste,k=t.onInputCompositionStart,T=t.onInputCompositionEnd,_=t.onInputBlur,C=t.title,S=A(e.useState(!1),2),N=S[0],I=S[1],O="combobox"===u,L=O||g,M=d[0],R=m||"";O&&y&&!N&&(R=y),e.useEffect(function(){O&&I(!1)},[O,y]);var D=!("combobox"!==u&&!h&&!g)&&!!R,P=void 0===C?bp(M):C,$=e.useMemo(function(){return M?null:e.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:D?{visibility:"hidden"}:void 0},p)},[M,D,p,r]);return e.createElement("span",{className:"".concat(r,"-selection-wrap")},e.createElement("span",{className:"".concat(r,"-selection-search")},e.createElement(gp,{ref:a,prefixCls:r,id:i,open:h,inputElement:n,disabled:o,autoFocus:s,autoComplete:l,editable:L,activeDescendantId:c,value:R,onKeyDown:b,onMouseDown:x,onChange:function(e){I(!0),w(e)},onPaste:E,onCompositionStart:k,onCompositionEnd:T,onBlur:_,tabIndex:f,attrs:ss(t,!0),maxLength:O?v:void 0})),!O&&M?e.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:D?{visibility:"hidden"}:void 0},M.label):null,$)},Tp=function(t,n){var r=o(null),i=o(!1),a=t.prefixCls,s=t.open,l=t.mode,c=t.showSearch,u=t.tokenWithEnter,h=t.disabled,d=t.prefix,p=t.autoClearSearchValue,f=t.onSearch,g=t.onSearchSubmit,m=t.onToggleOpen,y=t.onInputKeyDown,v=t.onInputBlur,b=t.domRef;e.useImperativeHandle(n,function(){return{focus:function(e){r.current.focus(e)},blur:function(){r.current.blur()}}});var x=A(Yd(0),2),w=x[0],E=x[1],k=o(null),T=function(e){!1!==f(e,!0,i.current)&&m(!0)},_={inputRef:r,onInputKeyDown:function(e){var t,n=e.which,a=r.current instanceof HTMLTextAreaElement;(a||!s||n!==ds.UP&&n!==ds.DOWN||e.preventDefault(),y&&y(e),n!==ds.ENTER||"tags"!==l||i.current||s||null==g||g(e.target.value),a&&!s&&~[ds.UP,ds.DOWN,ds.LEFT,ds.RIGHT].indexOf(n))||(t=n)&&![ds.ESC,ds.SHIFT,ds.BACKSPACE,ds.TAB,ds.WIN_KEY,ds.ALT,ds.META,ds.WIN_KEY_RIGHT,ds.CTRL,ds.SEMICOLON,ds.EQUALS,ds.CAPS_LOCK,ds.CONTEXT_MENU,ds.F1,ds.F2,ds.F3,ds.F4,ds.F5,ds.F6,ds.F7,ds.F8,ds.F9,ds.F10,ds.F11,ds.F12].includes(t)&&m(!0)},onInputMouseDown:function(){E(!0)},onInputChange:function(e){var t=e.target.value;if(u&&k.current&&/[\r\n]/.test(k.current)){var n=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,k.current)}k.current=null,T(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");k.current=n||""},onInputCompositionStart:function(){i.current=!0},onInputCompositionEnd:function(e){i.current=!1,"combobox"!==l&&T(e.target.value)},onInputBlur:v},C="multiple"===l||"tags"===l?e.createElement(Ep,Xe({},t,_)):e.createElement(kp,Xe({},t,_));return e.createElement("div",{ref:b,className:"".concat(a,"-selector"),onClick:function(e){e.target!==r.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){r.current.focus()}):r.current.focus())},onMouseDown:function(e){var t=w();e.target===r.current||t||"combobox"===l&&h||e.preventDefault(),("combobox"===l||c&&t)&&s||(s&&!1!==p&&f("",!0,!1),m())}},d&&e.createElement("div",{className:"".concat(a,"-prefix")},d),C)},_p=e.forwardRef(Tp);function Cp(t){var n=t.prefixCls,r=t.align,i=t.arrow,a=t.arrowPos,o=i||{},s=o.className,l=o.content,c=a.x,u=void 0===c?0:c,h=a.y,d=void 0===h?0:h,p=e.useRef();if(!r||!r.points)return null;var f={position:"absolute"};if(!1!==r.autoArrow){var g=r.points[0],m=r.points[1],y=g[0],v=g[1],b=m[0],x=m[1];y!==b&&["t","b"].includes(y)?"t"===y?f.top=0:f.bottom=0:f.top=d,v!==x&&["l","r"].includes(v)?"l"===v?f.left=0:f.right=0:f.left=u}return e.createElement("div",{ref:p,className:en("".concat(n,"-arrow"),s),style:f},l)}function Sp(t){var n=t.prefixCls,r=t.open,i=t.zIndex,a=t.mask,o=t.motion;return a?e.createElement(so,Xe({},o,{motionAppear:!0,visible:r,removeOnLeave:!0}),function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:en("".concat(n,"-mask"),r)})}):null}var Ap=e.memo(function(e){return e.children},function(e,t){return t.cache}),Np=e.forwardRef(function(t,n){var r=t.popup,i=t.className,a=t.prefixCls,o=t.style,s=t.target,l=t.onVisibleChanged,c=t.open,u=t.keepDom,h=t.fresh,d=t.onClick,p=t.mask,f=t.arrow,g=t.arrowPos,m=t.align,y=t.motion,v=t.maskMotion,b=t.forceRender,x=t.getPopupContainer,w=t.autoDestroy,E=t.portal,k=t.zIndex,T=t.onMouseEnter,_=t.onMouseLeave,C=t.onPointerEnter,S=t.onPointerDownCapture,N=t.ready,I=t.offsetX,O=t.offsetY,L=t.offsetR,M=t.offsetB,R=t.onAlign,P=t.onPrepare,$=t.stretch,B=t.targetWidth,F=t.targetHeight,z="function"==typeof r?r():r,j=c||u,H=(null==x?void 0:x.length)>0,U=A(e.useState(!x||!H),2),G=U[0],q=U[1];if(Be(function(){!G&&H&&s&&q(!0)},[G,H,s]),!G)return null;var W="auto",V={left:"-1000vw",top:"-1000vh",right:W,bottom:W};if(N||!c){var Y,X=m.points,K=m.dynamicInset||(null===(Y=m._experimental)||void 0===Y?void 0:Y.dynamicInset),Q=K&&"r"===X[0][1],Z=K&&"b"===X[0][0];Q?(V.right=L,V.left=W):(V.left=I,V.right=W),Z?(V.bottom=M,V.top=W):(V.top=O,V.bottom=W)}var J={};return $&&($.includes("height")&&F?J.height=F:$.includes("minHeight")&&F&&(J.minHeight=F),$.includes("width")&&B?J.width=B:$.includes("minWidth")&&B&&(J.minWidth=B)),c||(J.pointerEvents="none"),e.createElement(E,{open:b||j,getContainer:x&&function(){return x(s)},autoDestroy:w},e.createElement(Sp,{prefixCls:a,open:c,zIndex:k,mask:p,motion:v}),e.createElement(ur,{onResize:R,disabled:!c},function(t){return e.createElement(so,Xe({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(a,"-hidden")},y,{onAppearPrepare:P,onEnterPrepare:P,visible:c,onVisibleChanged:function(e){var t;null==y||null===(t=y.onVisibleChanged)||void 0===t||t.call(y,e),l(e)}}),function(r,s){var l=r.className,u=r.style,p=en(a,l,i);return e.createElement("div",{ref:In(t,n,s),className:p,style:D(D(D(D({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},V),J),u),{},{boxSizing:"border-box",zIndex:k},o),onMouseEnter:T,onMouseLeave:_,onPointerEnter:C,onClick:d,onPointerDownCapture:S},f&&e.createElement(Cp,{prefixCls:a,arrow:f,arrowPos:g,align:m}),e.createElement(Ap,{cache:!c&&!h},z))})}))}),Ip=e.forwardRef(function(t,n){var r=t.children,i=t.getTriggerDOMNode,a=Ln(r),o=e.useCallback(function(e){Nn(n,i?i(e):e)},[i]),s=On(o,Rn(r));return a?e.cloneElement(r,{ref:s}):r}),Op=e.createContext(null);function Lp(e){return e?Array.isArray(e)?e:[e]:[]}function Mp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>2?arguments[2]:void 0)?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function Rp(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function Dp(e){return e.ownerDocument.defaultView}function Pp(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=Dp(n).getComputedStyle(n);[i.overflowX,i.overflowY,i.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function $p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function Bp(e){return $p(parseFloat(e),0)}function Fp(e,t){var n=D({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=Dp(e).getComputedStyle(e),r=t.overflow,i=t.overflowClipMargin,a=t.borderTopWidth,o=t.borderBottomWidth,s=t.borderLeftWidth,l=t.borderRightWidth,c=e.getBoundingClientRect(),u=e.offsetHeight,h=e.clientHeight,d=e.offsetWidth,p=e.clientWidth,f=Bp(a),g=Bp(o),m=Bp(s),y=Bp(l),v=$p(Math.round(c.width/d*1e3)/1e3),b=$p(Math.round(c.height/u*1e3)/1e3),x=(d-p-m-y)*v,w=(u-h-f-g)*b,E=f*b,k=g*b,T=m*v,_=y*v,C=0,S=0;if("clip"===r){var A=Bp(i);C=A*v,S=A*b}var N=c.x+T-C,I=c.y+E-S,O=N+c.width+2*C-T-_-x,L=I+c.height+2*S-E-k-w;n.left=Math.max(n.left,N),n.top=Math.max(n.top,I),n.right=Math.min(n.right,O),n.bottom=Math.min(n.bottom,L)}}),n}function zp(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),n=t.match(/^(.*)\%$/);return n?e*(parseFloat(n[1])/100):parseFloat(t)}function jp(e,t){var n=A(t||[],2),r=n[0],i=n[1];return[zp(e.width,r),zp(e.height,i)]}function Hp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function Up(e,t){var n,r=t[0],i=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===i?e.x:"r"===i?e.x+e.width:e.x+e.width/2,y:n}}function Gp(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(e,r){return r===t?n[e]||"c":e}).join("")}var qp=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];var Wp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uu,n=e.forwardRef(function(n,r){var i=n.prefixCls,a=void 0===i?"rc-trigger-popup":i,o=n.children,s=n.action,l=void 0===s?"hover":s,c=n.showAction,u=n.hideAction,h=n.popupVisible,d=n.defaultPopupVisible,p=n.onPopupVisibleChange,f=n.afterPopupVisibleChange,g=n.mouseEnterDelay,m=n.mouseLeaveDelay,y=void 0===m?.1:m,v=n.focusDelay,b=n.blurDelay,x=n.mask,w=n.maskClosable,E=void 0===w||w,k=n.getPopupContainer,T=n.forceRender,_=n.autoDestroy,C=n.destroyPopupOnHide,S=n.popup,N=n.popupClassName,I=n.popupStyle,O=n.popupPlacement,L=n.builtinPlacements,R=void 0===L?{}:L,P=n.popupAlign,$=n.zIndex,B=n.stretch,F=n.getPopupClassNameFromAlign,z=n.fresh,j=n.alignPoint,H=n.onPopupClick,U=n.onPopupAlign,G=n.arrow,q=n.popupMotion,W=n.maskMotion,V=n.popupTransitionName,Y=n.popupAnimation,K=n.maskTransitionName,Q=n.maskAnimation,Z=n.className,J=n.getTriggerDOMNode,ee=X(n,qp),te=_||C||!1,ne=A(e.useState(!1),2),re=ne[0],ie=ne[1];Be(function(){ie(qd())},[]);var ae=e.useRef({}),oe=e.useContext(Op),se=e.useMemo(function(){return{registerSubPopup:function(e,t){ae.current[e]=t,null==oe||oe.registerSubPopup(e,t)}}},[oe]),le=fu(),ce=A(e.useState(null),2),ue=ce[0],he=ce[1],de=e.useRef(null),pe=Gi(function(e){de.current=e,sn(e)&&ue!==e&&he(e),null==oe||oe.registerSubPopup(le,e)}),fe=A(e.useState(null),2),ge=fe[0],me=fe[1],ye=e.useRef(null),ve=Gi(function(e){sn(e)&&ge!==e&&(me(e),ye.current=e)}),be=e.Children.only(o),xe=(null==be?void 0:be.props)||{},we={},Ee=Gi(function(e){var t,n,r=ge;return(null==r?void 0:r.contains(e))||(null===(t=Mo(r))||void 0===t?void 0:t.host)===e||e===r||(null==ue?void 0:ue.contains(e))||(null===(n=Mo(ue))||void 0===n?void 0:n.host)===e||e===ue||Object.values(ae.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),ke=Rp(a,q,Y,V),Te=Rp(a,W,Q,K),_e=A(e.useState(d||!1),2),Ce=_e[0],Se=_e[1],Ae=null!=h?h:Ce,Ne=Gi(function(e){void 0===h&&Se(e)});Be(function(){Se(h||!1)},[h]);var Ie=e.useRef(Ae);Ie.current=Ae;var Oe=e.useRef([]);Oe.current=[];var Le=Gi(function(e){var t;Ne(e),(null!==(t=Oe.current[Oe.current.length-1])&&void 0!==t?t:Ae)!==e&&(Oe.current.push(e),null==p||p(e))}),Me=e.useRef(),Re=function(){clearTimeout(Me.current)},De=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Re(),0===t?Le(e):Me.current=setTimeout(function(){Le(e)},1e3*t)};e.useEffect(function(){return Re},[]);var Pe=A(e.useState(!1),2),$e=Pe[0],Fe=Pe[1];Be(function(e){e&&!Ae||Fe(!0)},[Ae]);var ze=A(e.useState(null),2),je=ze[0],He=ze[1],Ue=A(e.useState(null),2),Ge=Ue[0],qe=Ue[1],We=function(e){qe([e.clientX,e.clientY])},Ve=function(t,n,r,i,a,o,s){var l=A(e.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:a[i]||{}}),2),c=l[0],u=l[1],h=e.useRef(0),d=e.useMemo(function(){return n?Pp(n):[]},[n]),p=e.useRef({});t||(p.current={});var f=Gi(function(){if(n&&r&&t){var e,l,c,h,f,g=n,m=g.ownerDocument,y=Dp(g),v=y.getComputedStyle(g).position,b=g.style.left,x=g.style.top,w=g.style.right,E=g.style.bottom,k=g.style.overflow,T=D(D({},a[i]),o),_=m.createElement("div");if(null===(e=g.parentElement)||void 0===e||e.appendChild(_),_.style.left="".concat(g.offsetLeft,"px"),_.style.top="".concat(g.offsetTop,"px"),_.style.position=v,_.style.height="".concat(g.offsetHeight,"px"),_.style.width="".concat(g.offsetWidth,"px"),g.style.left="0",g.style.top="0",g.style.right="auto",g.style.bottom="auto",g.style.overflow="hidden",Array.isArray(r))f={x:r[0],y:r[1],width:0,height:0};else{var C,S,N=r.getBoundingClientRect();N.x=null!==(C=N.x)&&void 0!==C?C:N.left,N.y=null!==(S=N.y)&&void 0!==S?S:N.top,f={x:N.x,y:N.y,width:N.width,height:N.height}}var I=g.getBoundingClientRect(),O=y.getComputedStyle(g),L=O.height,M=O.width;I.x=null!==(l=I.x)&&void 0!==l?l:I.left,I.y=null!==(c=I.y)&&void 0!==c?c:I.top;var R=m.documentElement,P=R.clientWidth,$=R.clientHeight,B=R.scrollWidth,F=R.scrollHeight,z=R.scrollTop,j=R.scrollLeft,H=I.height,U=I.width,G=f.height,q=f.width,W={left:0,top:0,right:P,bottom:$},V={left:-j,top:-z,right:B-j,bottom:F-z},Y=T.htmlRegion,X="visible",K="visibleFirst";"scroll"!==Y&&Y!==K&&(Y=X);var Q=Y===K,Z=Fp(V,d),J=Fp(W,d),ee=Y===X?J:Z,te=Q?J:ee;g.style.left="auto",g.style.top="auto",g.style.right="0",g.style.bottom="0";var ne=g.getBoundingClientRect();g.style.left=b,g.style.top=x,g.style.right=w,g.style.bottom=E,g.style.overflow=k,null===(h=g.parentElement)||void 0===h||h.removeChild(_);var re=$p(Math.round(U/parseFloat(M)*1e3)/1e3),ie=$p(Math.round(H/parseFloat(L)*1e3)/1e3);if(0===re||0===ie||sn(r)&&!Js(r))return;var ae=T.offset,oe=T.targetOffset,se=A(jp(I,ae),2),le=se[0],ce=se[1],ue=A(jp(f,oe),2),he=ue[0],de=ue[1];f.x-=he,f.y-=de;var pe=A(T.points||[],2),fe=pe[0],ge=Hp(pe[1]),me=Hp(fe),ye=Up(f,ge),ve=Up(I,me),be=D({},T),xe=ye.x-ve.x+le,we=ye.y-ve.y+ce;function ft(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ee,r=I.x+e,i=I.y+t,a=r+U,o=i+H,s=Math.max(r,n.left),l=Math.max(i,n.top),c=Math.min(a,n.right),u=Math.min(o,n.bottom);return Math.max(0,(c-s)*(u-l))}var Ee,ke,Te,_e,Ce=ft(xe,we),Se=ft(xe,we,J),Ae=Up(f,["t","l"]),Ne=Up(I,["t","l"]),Ie=Up(f,["b","r"]),Oe=Up(I,["b","r"]),Le=T.overflow||{},Me=Le.adjustX,Re=Le.adjustY,De=Le.shiftX,Pe=Le.shiftY,$e=function(e){return"boolean"==typeof e?e:e>=0};function gt(){Ee=I.y+we,ke=Ee+H,Te=I.x+xe,_e=Te+U}gt();var Be=$e(Re),Fe=me[0]===ge[0];if(Be&&"t"===me[0]&&(ke>te.bottom||p.current.bt)){var ze=we;Fe?ze-=H-G:ze=Ae.y-Oe.y-ce;var je=ft(xe,ze),He=ft(xe,ze,J);je>Ce||je===Ce&&(!Q||He>=Se)?(p.current.bt=!0,we=ze,ce=-ce,be.points=[Gp(me,0),Gp(ge,0)]):p.current.bt=!1}if(Be&&"b"===me[0]&&(EeCe||Ge===Ce&&(!Q||qe>=Se)?(p.current.tb=!0,we=Ue,ce=-ce,be.points=[Gp(me,0),Gp(ge,0)]):p.current.tb=!1}var We=$e(Me),Ve=me[1]===ge[1];if(We&&"l"===me[1]&&(_e>te.right||p.current.rl)){var Ye=xe;Ve?Ye-=U-q:Ye=Ae.x-Oe.x-le;var Xe=ft(Ye,we),Ke=ft(Ye,we,J);Xe>Ce||Xe===Ce&&(!Q||Ke>=Se)?(p.current.rl=!0,xe=Ye,le=-le,be.points=[Gp(me,1),Gp(ge,1)]):p.current.rl=!1}if(We&&"r"===me[1]&&(TeCe||Ze===Ce&&(!Q||Je>=Se)?(p.current.lr=!0,xe=Qe,le=-le,be.points=[Gp(me,1),Gp(ge,1)]):p.current.lr=!1}gt();var et=!0===De?0:De;"number"==typeof et&&(TeJ.right&&(xe-=_e-J.right-le,f.x>J.right-et&&(xe+=f.x-J.right+et)));var tt=!0===Pe?0:Pe;"number"==typeof tt&&(EeJ.bottom&&(we-=ke-J.bottom-ce,f.y>J.bottom-tt&&(we+=f.y-J.bottom+tt)));var nt=I.x+xe,rt=nt+U,it=I.y+we,at=it+H,ot=f.x,st=ot+q,lt=f.y,ct=lt+G,ut=(Math.max(nt,ot)+Math.min(rt,st))/2-nt,ht=(Math.max(it,lt)+Math.min(at,ct))/2-it;null==s||s(n,be);var dt=ne.right-I.x-(xe+I.width),pt=ne.bottom-I.y-(we+I.height);1===re&&(xe=Math.round(xe),dt=Math.round(dt)),1===ie&&(we=Math.round(we),pt=Math.round(pt)),u({ready:!0,offsetX:xe/re,offsetY:we/ie,offsetR:dt/re,offsetB:pt/ie,arrowX:ut/re,arrowY:ht/ie,scaleX:re,scaleY:ie,align:be})}}),g=function(){u(function(e){return D(D({},e),{},{ready:!1})})};return Be(g,[i]),Be(function(){t||g()},[t]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,function(){h.current+=1;var e=h.current;Promise.resolve().then(function(){h.current===e&&f()})}]}(Ae,ue,j&&null!==Ge?Ge:ge,O,R,P,U),Ye=A(Ve,11),Xe=Ye[0],Ke=Ye[1],Qe=Ye[2],Ze=Ye[3],Je=Ye[4],et=Ye[5],tt=Ye[6],nt=Ye[7],rt=Ye[8],it=Ye[9],at=Ye[10],ot=function(t,n,r,i){return e.useMemo(function(){var e=Lp(null!=r?r:n),a=Lp(null!=i?i:n),o=new Set(e),s=new Set(a);return t&&(o.has("hover")&&(o.delete("hover"),o.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[o,s]},[t,n,r,i])}(re,l,c,u),st=A(ot,2),lt=st[0],ct=st[1],ut=lt.has("click"),ht=ct.has("click")||ct.has("contextMenu"),dt=Gi(function(){$e||at()});!function(e,t,n,r,i){Be(function(){if(e&&t&&n){var a=n,o=Pp(t),s=Pp(a),l=Dp(a),c=new Set([l].concat(M(o),M(s)));function u(){r(),i()}return c.forEach(function(e){e.addEventListener("scroll",u,{passive:!0})}),l.addEventListener("resize",u,{passive:!0}),r(),function(){c.forEach(function(e){e.removeEventListener("scroll",u),l.removeEventListener("resize",u)})}}},[e,t,n])}(Ae,ge,ue,dt,function(){Ie.current&&j&&ht&&De(!1)}),Be(function(){dt()},[Ge,O]),Be(function(){!Ae||null!=R&&R[O]||dt()},[JSON.stringify(P)]);var pt=e.useMemo(function(){var e=function(e,t,n,r){for(var i=n.points,a=Object.keys(e),o=0;o1?o-1:0),l=1;l1?n-1:0),i=1;i1?n-1:0),i=1;i50?", ...":null)}var nf=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],rf=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],af=function(e){return"tags"===e||"multiple"===e},of=e.forwardRef(function(n,r){var i,a=n.id,o=n.prefixCls,s=n.className,l=n.showSearch,c=n.tagRender,u=n.direction,h=n.omitDomProps,d=n.displayValues,p=n.onDisplayValuesChange,f=n.emptyOptions,g=n.notFoundContent,m=void 0===g?"Not Found":g,y=n.onClear,v=n.mode,b=n.disabled,x=n.loading,w=n.getInputElement,E=n.getRawInputElement,k=n.open,T=n.defaultOpen,_=n.onDropdownVisibleChange,C=n.activeValue,S=n.onActiveValueChange,I=n.activeDescendantId,L=n.searchValue,R=n.autoClearSearchValue,P=n.onSearch,$=n.onSearchSplit,B=n.tokenSeparators,F=n.allowClear,z=n.prefix,j=n.suffixIcon,H=n.clearIcon,U=n.OptionList,G=n.animation,q=n.transitionName,W=n.dropdownStyle,V=n.dropdownClassName,Y=n.dropdownMatchSelectWidth,K=n.dropdownRender,Q=n.dropdownAlign,Z=n.placement,J=n.builtinPlacements,ee=n.getPopupContainer,te=n.showAction,ne=void 0===te?[]:te,re=n.onFocus,ie=n.onBlur,ae=n.onKeyUp,oe=n.onKeyDown,se=n.onMouseDown,le=X(n,nf),ce=af(v),ue=(void 0!==l?l:ce)||"combobox"===v,he=D({},le);rf.forEach(function(e){delete he[e]}),null==h||h.forEach(function(e){delete he[e]});var de=A(e.useState(!1),2),pe=de[0],fe=de[1];e.useEffect(function(){fe(qd())},[]);var ge=e.useRef(null),me=e.useRef(null),ye=e.useRef(null),ve=e.useRef(null),be=e.useRef(null),xe=e.useRef(!1),we=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=A(e.useState(!1),2),r=n[0],i=n[1],a=e.useRef(null),o=function(){window.clearTimeout(a.current)};return e.useEffect(function(){return o},[]),[r,function(e,n){o(),a.current=window.setTimeout(function(){i(e),n&&n()},t)},o]}(),Ee=A(we,3),ke=Ee[0],Te=Ee[1],_e=Ee[2];e.useImperativeHandle(r,function(){var e,t;return{focus:null===(e=ve.current)||void 0===e?void 0:e.focus,blur:null===(t=ve.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=be.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:ge.current||me.current}});var Ce=e.useMemo(function(){var e;if("combobox"!==v)return L;var t=null===(e=d[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[L,v,d]),Se="combobox"===v&&"function"==typeof w&&w()||null,Ae="function"==typeof E&&E(),Ne=On(me,null==Ae||null===(i=Ae.props)||void 0===i?void 0:i.ref),Ie=A(e.useState(!1),2),Oe=Ie[0],Le=Ie[1];Be(function(){Le(!0)},[]);var Me=A(Vi(!1,{defaultValue:T,value:k}),2),Re=Me[0],De=Me[1],Pe=!!Oe&&Re,$e=!m&&f;(b||$e&&Pe&&"combobox"===v)&&(Pe=!1);var Fe=!$e&&Pe,ze=e.useCallback(function(e){var t=void 0!==e?e:!Pe;b||(De(t),Pe!==t&&(null==_||_(t)))},[b,Pe,De,_]),je=e.useMemo(function(){return(B||[]).some(function(e){return["\n","\r\n"].includes(e)})},[B]),He=e.useContext(ef)||{},Ue=He.maxCount,Ge=He.rawValues,qe=function(e,t,n){if(!(ce&&Qp(Ue)&&(null==Ge?void 0:Ge.size)>=Ue)){var r=!0,i=e;null==S||S(null);var a=function(e,t,n){if(!t||!t.length)return null;var r=!1,i=function e(t,n){var i=vr(n),a=i[0],o=i.slice(1);if(!a)return[t];var s=t.split(a);return r=r||s.length>1,s.reduce(function(t,n){return[].concat(M(t),M(e(n,o)))},[]).filter(Boolean)}(e,t);return r?void 0!==n?i.slice(0,n):i:null}(e,B,Qp(Ue)?Ue-Ge.size:void 0),o=n?null:a;return"combobox"!==v&&o&&(i="",null==$||$(o),ze(!1),r=!1),P&&Ce!==i&&P(i,{source:t?"typing":"effect"}),r}};e.useEffect(function(){Pe||ce||"combobox"===v||qe("",!1,!1)},[Pe]),e.useEffect(function(){Re&&b&&De(!1),b&&!xe.current&&Te(!1)},[b]);var We=A(Yd(),2),Ve=We[0],Ye=We[1],Ke=e.useRef(!1),Qe=e.useRef(!1),Ze=[];e.useEffect(function(){return function(){Ze.forEach(function(e){return clearTimeout(e)}),Ze.splice(0,Ze.length)}},[]);var Je,et=A(e.useState({}),2)[1];Ae&&(Je=function(e){ze(e)}),function(t,n,r,i){var a=e.useRef(null);a.current={open:n,triggerOpen:r,customizedTrigger:i},e.useEffect(function(){function e(e){var n;if(null===(n=a.current)||void 0===n||!n.customizedTrigger){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),a.current.open&&t().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&a.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[])}(function(){var e;return[ge.current,null===(e=ye.current)||void 0===e?void 0:e.getPopupElement()]},Fe,ze,!!Ae);var tt,nt=e.useMemo(function(){return D(D({},n),{},{notFoundContent:m,open:Pe,triggerOpen:Fe,id:a,showSearch:ue,multiple:ce,toggleOpen:ze})},[n,m,Fe,Pe,a,ue,ce,ze]),rt=!!j||x;rt&&(tt=e.createElement(Wd,{className:en("".concat(o,"-arrow"),O({},"".concat(o,"-arrow-loading"),x)),customizeIcon:j,customizeIconProps:{loading:x,searchValue:Ce,open:Pe,focused:ke,showSearch:ue}}));var it,at=function(e,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=t.useMemo(function(){return"object"===N(i)?i.clearIcon:a||void 0},[i,a]);return{allowClear:t.useMemo(function(){return!(o||!i||!r.length&&!s||"combobox"===l&&""===s)},[i,o,r.length,s,l]),clearIcon:t.createElement(Wd,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:c},"×")}}(o,function(){var e;null==y||y(),null===(e=ve.current)||void 0===e||e.focus(),p([],{type:"clear",values:d}),qe("",!1,!1)},d,F,H,b,Ce,v),ot=at.allowClear,st=at.clearIcon,lt=e.createElement(U,{ref:be}),ct=en(o,s,O(O(O(O(O(O(O(O(O(O({},"".concat(o,"-focused"),ke),"".concat(o,"-multiple"),ce),"".concat(o,"-single"),!ce),"".concat(o,"-allow-clear"),F),"".concat(o,"-show-arrow"),rt),"".concat(o,"-disabled"),b),"".concat(o,"-loading"),x),"".concat(o,"-open"),Pe),"".concat(o,"-customize-input"),Se),"".concat(o,"-show-search"),ue)),ut=e.createElement(Xp,{ref:ye,disabled:b,prefixCls:o,visible:Fe,popupElement:lt,animation:G,transitionName:q,dropdownStyle:W,dropdownClassName:V,direction:u,dropdownMatchSelectWidth:Y,dropdownRender:K,dropdownAlign:Q,placement:Z,builtinPlacements:J,getPopupContainer:ee,empty:f,getTriggerDOMNode:function(e){return me.current||e},onPopupVisibleChange:Je,onPopupMouseEnter:function(){et({})}},Ae?e.cloneElement(Ae,{ref:Ne}):e.createElement(_p,Xe({},n,{domRef:me,prefixCls:o,inputElement:Se,ref:ve,id:a,prefix:z,showSearch:ue,autoClearSearchValue:R,mode:v,activeDescendantId:I,tagRender:c,values:d,open:Pe,onToggleOpen:ze,activeValue:C,searchValue:Ce,onSearch:qe,onSearchSubmit:function(e){e&&e.trim()&&P(e,{source:"submit"})},onRemove:function(e){var t=d.filter(function(t){return t!==e});p(t,{type:"remove",values:[e]})},tokenWithEnter:je,onInputBlur:function(){Ke.current=!1}})));return it=Ae?ut:e.createElement("div",Xe({className:ct},he,{ref:ge,onMouseDown:function(e){var t,n=e.target,r=null===(t=ye.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var i=setTimeout(function(){var e,t=Ze.indexOf(i);-1!==t&&Ze.splice(t,1),_e(),pe||r.contains(document.activeElement)||null===(e=ve.current)||void 0===e||e.focus()});Ze.push(i)}for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s=0;s-=1){var l=a[s];if(!l.disabled){a.splice(s,1),o=l;break}}o&&p(a,{type:"remove",values:[o]})}for(var c=arguments.length,u=new Array(c>1?c-1:0),h=1;h1?t-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2],r=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return n&&r?(clearTimeout(a.current),i.current=!1):r&&!i.current||(clearTimeout(a.current),i.current=!0,a.current=setTimeout(function(){i.current=!1},50)),!i.current&&r}};function ff(e,t,n,r,i,a,s){var l=o(0),c=o(null),u=o(null),h=o(!1),d=pf(t,n,r,i);var p=o(null),f=o(null);return[function(t){if(e){mr.cancel(f.current),f.current=mr(function(){p.current=null},2);var n=t.deltaX,r=t.deltaY,i=t.shiftKey,o=n,g=r;("sx"===p.current||!p.current&&i&&r&&!n)&&(o=r,g=0,p.current="sx");var m=Math.abs(o),y=Math.abs(g);null===p.current&&(p.current=a&&m>y?"x":"y"),"y"===p.current?function(e,t){if(mr.cancel(c.current),!d(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,l.current+=t,u.current=t,df||n.preventDefault(),c.current=mr(function(){var e=h.current?10:1;s(l.current*e,!1),l.current=0}))}}(t,g):function(e,t){s(t,!0),df||e.preventDefault()}(t,o)}},function(t){e&&(h.current=t.detail===u.current)}]}var gf=function(){function e(){re(this,e),O(this,"maps",void 0),O(this,"id",0),O(this,"diffRecords",new Map),this.maps=Object.create(null)}return ae(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function mf(e){var t=parseFloat(e);return isNaN(t)?0:t}var yf=14/15;function vf(e){return Math.floor(Math.pow(e,.5))}function bf(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var xf=e.forwardRef(function(t,n){var r=t.prefixCls,i=t.rtl,a=t.scrollOffset,o=t.scrollRange,s=t.onStartMove,l=t.onStopMove,c=t.onScroll,u=t.horizontal,h=t.spinSize,d=t.containerSize,p=t.style,f=t.thumbStyle,g=t.showScrollBar,m=A(e.useState(!1),2),y=m[0],v=m[1],b=A(e.useState(null),2),x=b[0],w=b[1],E=A(e.useState(null),2),k=E[0],T=E[1],_=!i,C=e.useRef(),S=e.useRef(),N=A(e.useState(g),2),I=N[0],L=N[1],M=e.useRef(),R=function(){!0!==g&&!1!==g&&(clearTimeout(M.current),L(!0),M.current=setTimeout(function(){L(!1)},3e3))},P=o-d||0,$=d-h||0,B=e.useMemo(function(){return 0===a||0===P?0:a/P*$},[a,P,$]),F=e.useRef({top:B,dragging:y,pageY:x,startTop:k});F.current={top:B,dragging:y,pageY:x,startTop:k};var z=function(e){v(!0),w(bf(e,u)),T(F.current.top),s(),e.stopPropagation(),e.preventDefault()};e.useEffect(function(){var e=function(e){e.preventDefault()},t=C.current,n=S.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",z,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",z)}},[]);var j=e.useRef();j.current=P;var H=e.useRef();H.current=$,e.useEffect(function(){if(y){var e,t=function(t){var n=F.current,r=n.dragging,i=n.pageY,a=n.startTop;mr.cancel(e);var o=C.current.getBoundingClientRect(),s=d/(u?o.width:o.height);if(r){var l=(bf(t,u)-i)*s,h=a;!_&&u?h-=l:h+=l;var p=j.current,f=H.current,g=f?h/f:0,m=Math.ceil(g*p);m=Math.max(m,0),m=Math.min(m,p),e=mr(function(){c(m,u)})}},n=function(){v(!1),l()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),mr.cancel(e)}}},[y]),e.useEffect(function(){return R(),function(){clearTimeout(M.current)}},[a]),e.useImperativeHandle(n,function(){return{delayHidden:R}});var U="".concat(r,"-scrollbar"),G={position:"absolute",visibility:I?null:"hidden"},q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return u?(Object.assign(G,{height:8,left:0,right:0,bottom:0}),Object.assign(q,O({height:"100%",width:h},_?"left":"right",B))):(Object.assign(G,O({width:8,top:0,bottom:0},_?"right":"left",0)),Object.assign(q,{width:"100%",height:h,top:B})),e.createElement("div",{ref:C,className:en(U,O(O(O({},"".concat(U,"-horizontal"),u),"".concat(U,"-vertical"),!u),"".concat(U,"-visible"),I)),style:D(D({},G),p),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:R},e.createElement("div",{ref:S,className:en("".concat(U,"-thumb"),O({},"".concat(U,"-thumb-moving"),y)),style:D(D({},q),f),onMouseDown:z}))});function wf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)*e;return isNaN(t)&&(t=0),t=Math.max(t,20),Math.floor(t)}var Ef=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],kf=[],Tf={overflowY:"auto",overflowAnchor:"none"};function _f(t,n){var r=t.prefixCls,i=void 0===r?"rc-virtual-list":r,a=t.className,s=t.height,c=t.itemHeight,u=t.fullHeight,h=void 0===u||u,p=t.style,f=t.data,g=t.children,m=t.itemKey,y=t.virtual,v=t.direction,b=t.scrollWidth,x=t.component,w=void 0===x?"div":x,E=t.onScroll,T=t.onVirtualScroll,_=t.onVisibleChange,C=t.innerProps,S=t.extraRender,I=t.styles,L=t.showScrollBar,M=void 0===L?"optional":L,R=X(t,Ef),P=e.useCallback(function(e){return"function"==typeof m?m(e):null==e?void 0:e[m]},[m]),$=function(t){var n=A(e.useState(0),2),r=n[0],i=n[1],a=o(new Map),s=o(new gf),c=o(0);function u(){c.current+=1}function h(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u();var t=function(){var e=!1;a.current.forEach(function(t,n){if(t&&t.offsetParent){var r=t.offsetHeight,i=getComputedStyle(t),a=i.marginTop,o=i.marginBottom,l=r+mf(a)+mf(o);s.current.get(n)!==l&&(s.current.set(n,l),e=!0)}}),e&&i(function(e){return e+1})};if(e)t();else{c.current+=1;var n=c.current;Promise.resolve().then(function(){n===c.current&&t()})}}return l(function(){return u},[]),[function(e,n){var r=t(e);a.current.get(r),n?(a.current.set(r,n),h()):a.current.delete(r)},h,s.current,r]}(P),B=A($,4),F=B[0],z=B[1],j=B[2],H=B[3],U=!(!1===y||!s||!c),G=e.useMemo(function(){return Object.values(j.maps).reduce(function(e,t){return e+t},0)},[j.id,j.maps]),q=U&&f&&(Math.max(c*f.length,G)>s||!!b),W="rtl"===v,V=en(i,O({},"".concat(i,"-rtl"),W),a),Y=f||kf,K=o(),Q=o(),Z=o(),J=A(d(0),2),ee=J[0],te=J[1],ne=A(d(0),2),re=ne[0],ie=ne[1],ae=A(d(!1),2),oe=ae[0],se=ae[1],le=function(){se(!0)},ce=function(){se(!1)},ue={getKey:P};function he(e){te(function(t){var n=function(e){var t=e;Number.isNaN(Ae.current)||(t=Math.min(t,Ae.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return K.current.scrollTop=n,n})}var de=o({start:0,end:Y.length}),pe=o(),fe=A(hf(Y,P),1)[0];pe.current=fe;var ge=e.useMemo(function(){if(!U)return{scrollHeight:void 0,start:0,end:Y.length-1,offset:void 0};var e;if(!q)return{scrollHeight:(null===(e=Q.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:Y.length-1,offset:void 0};for(var t,n,r,i=0,a=Y.length,o=0;o=ee&&void 0===t&&(t=o,n=i),d>ee+s&&void 0===r&&(r=o),i=d}return void 0===t&&(t=0,n=0,r=Math.ceil(s/c)),void 0===r&&(r=Y.length-1),{scrollHeight:i,start:t,end:r=Math.min(r+1,Y.length-1),offset:n}},[q,U,ee,Y,H,s]),me=ge.scrollHeight,ye=ge.start,ve=ge.end,be=ge.offset;de.current.start=ye,de.current.end=ve,e.useLayoutEffect(function(){var e=j.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),r=Y[ye];if(r&&void 0===n)if(P(r)===t){var i=j.get(t)-c;he(function(e){return e+i})}}j.resetRecord()},[me]);var xe=A(e.useState({width:0,height:s}),2),we=xe[0],Ee=xe[1],ke=o(),Te=o(),_e=e.useMemo(function(){return wf(we.width,b)},[we.width,b]),Ce=e.useMemo(function(){return wf(we.height,me)},[we.height,me]),Se=me-s,Ae=o(Se);Ae.current=Se;var Ne=ee<=0,Ie=ee>=Se,Oe=re<=0,Le=re>=b,Me=pf(Ne,Ie,Oe,Le),Re=function(){return{x:W?-re:re,y:ee}},De=o(Re()),Pe=Gi(function(e){if(T){var t=D(D({},Re()),e);De.current.x===t.x&&De.current.y===t.y||(T(t),De.current=t)}});function $e(e,t){var n=e;t?(k(function(){ie(n)}),Pe()):he(n)}var Fe=function(e){var t=e,n=b?b-we.width:0;return t=Math.max(t,0),t=Math.min(t,n)},ze=Gi(function(e,t){t?(k(function(){ie(function(t){return Fe(t+(W?-e:e))})}),Pe()):he(function(t){return t+e})}),je=A(ff(U,Ne,Ie,Oe,Le,!!b,ze),2),He=je[0],Ue=je[1];!function(e,t,n){var r,i=o(!1),a=o(0),s=o(0),l=o(null),c=o(null),u=function(e){if(i.current){var t=Math.ceil(e.touches[0].pageX),r=Math.ceil(e.touches[0].pageY),o=a.current-t,l=s.current-r,u=Math.abs(o)>Math.abs(l);u?a.current=t:s.current=r;var h=n(u,u?o:l,!1,e);h&&e.preventDefault(),clearInterval(c.current),h&&(c.current=setInterval(function(){u?o*=yf:l*=yf;var e=Math.floor(u?o:l);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(c.current)},16))}},h=function(){i.current=!1,r()},d=function(e){r(),1!==e.touches.length||i.current||(i.current=!0,a.current=Math.ceil(e.touches[0].pageX),s.current=Math.ceil(e.touches[0].pageY),l.current=e.target,l.current.addEventListener("touchmove",u,{passive:!1}),l.current.addEventListener("touchend",h,{passive:!0}))};r=function(){l.current&&(l.current.removeEventListener("touchmove",u),l.current.removeEventListener("touchend",h))},Be(function(){return e&&t.current.addEventListener("touchstart",d,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",d),r(),clearInterval(c.current)}},[e])}(U,K,function(e,t,n,r){var i=r;return!Me(e,t,n)&&((!i||!i._virtualHandled)&&(i&&(i._virtualHandled=!0),He({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))}),function(t,n,r){e.useEffect(function(){var e=n.current;if(t&&e){var i,a,o=!1,s=function(){mr.cancel(i)},l=function e(){s(),i=mr(function(){r(a),e()})},c=function(){o=!1,s()},u=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,o=!0)}},h=function(t){if(o){var n=bf(t,!1),r=e.getBoundingClientRect(),i=r.top,c=r.bottom;n<=i?(a=-vf(i-n),l()):n>=c?(a=vf(n-c),l()):s()}};return e.addEventListener("mousedown",u),e.ownerDocument.addEventListener("mouseup",c),e.ownerDocument.addEventListener("mousemove",h),e.ownerDocument.addEventListener("dragend",c),function(){e.removeEventListener("mousedown",u),e.ownerDocument.removeEventListener("mouseup",c),e.ownerDocument.removeEventListener("mousemove",h),e.ownerDocument.removeEventListener("dragend",c),s()}}},[t])}(q,K,function(e){he(function(t){return t+e})}),Be(function(){function e(e){var t=Ne&&e.detail<0,n=Ie&&e.detail>0;!U||t||n||e.preventDefault()}var t=K.current;return t.addEventListener("wheel",He,{passive:!1}),t.addEventListener("DOMMouseScroll",Ue,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",He),t.removeEventListener("DOMMouseScroll",Ue),t.removeEventListener("MozMousePixelScroll",e)}},[U,Ne,Ie]),Be(function(){if(b){var e=Fe(re);ie(e),Pe({x:e})}},[we.width,b]);var Ge=function(){var e,t;null===(e=ke.current)||void 0===e||e.delayHidden(),null===(t=Te.current)||void 0===t||t.delayHidden()},qe=function(t,n,r,i,a,o,s,l){var c=e.useRef(),u=A(e.useState(null),2),h=u[0],d=u[1];return Be(function(){if(h&&h.times<10){if(!t.current)return void d(function(e){return D({},e)});o();var e=h.targetAlign,l=h.originAlign,c=h.index,u=h.offset,p=t.current.clientHeight,f=!1,g=e,m=null;if(p){for(var y=e||l,v=0,b=0,x=0,w=Math.min(n.length-1,c),E=0;E<=w;E+=1){var k=a(n[E]);b=v;var T=r.get(k);v=x=b+(void 0===T?i:T)}for(var _="top"===y?u:p-u,C=w;C>=0;C-=1){var S=a(n[C]),A=r.get(S);if(void 0===A){f=!0;break}if((_-=A)<=0)break}switch(y){case"top":m=b-u;break;case"bottom":m=x-p+u;break;default:var N=t.current.scrollTop;bN+p&&(g="bottom")}null!==m&&s(m),m!==h.lastTop&&(f=!0)}f&&d(D(D({},h),{},{times:h.times+1,targetAlign:g,lastTop:m}))}},[h,t.current]),function(e){if(null!=e){if(mr.cancel(c.current),"number"==typeof e)s(e);else if(e&&"object"===N(e)){var t,r=e.align;t="index"in e?e.index:n.findIndex(function(t){return a(t)===e.key});var i=e.offset;d({times:0,index:t,offset:void 0===i?0:i,originAlign:r})}}else l()}}(K,Y,j,c,P,function(){return z(!0)},he,Ge);e.useImperativeHandle(n,function(){return{nativeElement:Z.current,getScrollInfo:Re,scrollTo:function(e){var t;(t=e)&&"object"===N(t)&&("left"in t||"top"in t)?(void 0!==e.left&&ie(Fe(e.left)),qe(e.top)):qe(e)}}}),Be(function(){if(_){var e=Y.slice(ye,ve+1);_(e,Y)}},[ye,ve,Y]);var We=function(t,n,r,i){var a=A(e.useMemo(function(){return[new Map,[]]},[t,r.id,i]),2),o=a[0],s=a[1];return function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=o.get(e),c=o.get(a);if(void 0===l||void 0===c)for(var u=t.length,h=s.length;hs&&e.createElement(xf,{ref:ke,prefixCls:i,scrollOffset:ee,scrollRange:me,rtl:W,onScroll:$e,onStartMove:le,onStopMove:ce,spinSize:Ce,containerSize:we.height,style:null==I?void 0:I.verticalScrollBar,thumbStyle:null==I?void 0:I.verticalScrollBarThumb,showScrollBar:M}),q&&b>we.width&&e.createElement(xf,{ref:Te,prefixCls:i,scrollOffset:re,scrollRange:b,rtl:W,onScroll:$e,onStartMove:le,onStopMove:ce,spinSize:_e,containerSize:we.width,horizontal:!0,style:null==I?void 0:I.horizontalScrollBar,thumbStyle:null==I?void 0:I.horizontalScrollBarThumb,showScrollBar:M}))}var Cf=e.forwardRef(_f);Cf.displayName="List";var Sf=["disabled","title","children","style","className"];function Af(e){return"string"==typeof e||"number"==typeof e}var Nf=function(t,n){var r=e.useContext(Vd),i=r.prefixCls,a=r.id,o=r.open,s=r.multiple,c=r.mode,u=r.searchValue,h=r.toggleOpen,d=r.notFoundContent,p=r.onPopupScroll,f=e.useContext(ef),g=f.maxCount,m=f.flattenOptions,y=f.onActiveValue,v=f.defaultActiveFirstOption,b=f.onSelect,x=f.menuItemSelectedIcon,w=f.rawValues,E=f.fieldNames,k=f.virtual,T=f.direction,_=f.listHeight,C=f.listItemHeight,S=f.optionRender,N="".concat(i,"-item"),I=K(function(){return m},[o,m],function(e,t){return t[0]&&e[1]!==t[1]}),L=e.useRef(null),R=e.useMemo(function(){return s&&Qp(g)&&(null==w?void 0:w.size)>=g},[s,g,null==w?void 0:w.size]),D=function(e){e.preventDefault()},P=function(e){var t;null===(t=L.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},$=e.useCallback(function(e){return"combobox"!==c&&w.has(e)},[c,M(w).toString(),w.size]),B=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=I.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];j(e);var n={source:t?"keyboard":"mouse"},r=I[e];r?y(r.value,e,n):y(null,-1,n)};l(function(){H(!1!==v?B(0):-1)},[I.length,u]);var U=e.useCallback(function(e){return"combobox"===c?String(e).toLowerCase()===u.toLowerCase():w.has(e)},[c,u,M(w).toString(),w.size]);l(function(){var e,t=setTimeout(function(){if(!s&&o&&1===w.size){var e=Array.from(w)[0],t=I.findIndex(function(t){var n=t.data;return u?String(n.value).startsWith(u):n.value===e});-1!==t&&(H(t),P(t))}});o&&(null===(e=L.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}},[o,u]);var G=function(e){void 0!==e&&b(e,{selected:!w.has(e)}),s||h(!1)};if(e.useImperativeHandle(n,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case ds.N:case ds.P:case ds.UP:case ds.DOWN:var r=0;if(t===ds.UP?r=-1:t===ds.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===ds.N?r=1:t===ds.P&&(r=-1)),0!==r){var i=B(z+r,r);P(i),H(i,!0)}break;case ds.TAB:case ds.ENTER:var a,s=I[z];!s||null!=s&&null!==(a=s.data)&&void 0!==a&&a.disabled||R?G(void 0):G(s.value),o&&e.preventDefault();break;case ds.ESC:h(!1),o&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){P(e)}}}),0===I.length)return e.createElement("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(N,"-empty"),onMouseDown:D},d);var q=Object.keys(E).map(function(e){return E[e]}),W=function(e){return e.label};function V(e,t){return{role:e.group?"presentation":"option",id:"".concat(a,"_list_").concat(t)}}var Y=function(t){var n=I[t];if(!n)return null;var r=n.data||{},i=r.value,a=n.group,o=ss(r,!0),s=W(n);return n?e.createElement("div",Xe({"aria-label":"string"!=typeof s||a?null:s},o,{key:t},V(n,t),{"aria-selected":U(i)}),i):null},Q={role:"listbox",id:"".concat(a,"_list")};return e.createElement(e.Fragment,null,k&&e.createElement("div",Xe({},Q,{style:{height:0,width:0,overflow:"hidden"}}),Y(z-1),Y(z),Y(z+1)),e.createElement(Cf,{itemKey:"key",ref:L,data:I,height:_,itemHeight:C,fullHeight:!1,onMouseDown:D,onScroll:p,virtual:k,direction:T,innerProps:k?null:Q},function(t,n){var r=t.group,i=t.groupOption,a=t.data,o=t.label,s=t.value,l=a.key;if(r){var c,u=null!==(c=a.title)&&void 0!==c?c:Af(o)?o.toString():void 0;return e.createElement("div",{className:en(N,"".concat(N,"-group"),a.className),title:u},void 0!==o?o:l)}var h=a.disabled,d=a.title;a.children;var p=a.style,f=a.className,g=Zs(X(a,Sf),q),m=$(s),y=h||!m&&R,v="".concat(N,"-option"),b=en(N,v,f,O(O(O(O({},"".concat(v,"-grouped"),i),"".concat(v,"-active"),z===n&&!y),"".concat(v,"-disabled"),y),"".concat(v,"-selected"),m)),w=W(t),E=!x||"function"==typeof x||m,T="number"==typeof w?w:w||s,_=Af(T)?T.toString():void 0;return void 0!==d&&(_=d),e.createElement("div",Xe({},ss(g),k?{}:V(t,n),{"aria-selected":U(s),className:b,title:_,onMouseMove:function(){z===n||y||H(n)},onClick:function(){y||G(s)},style:p}),e.createElement("div",{className:"".concat(v,"-content")},"function"==typeof S?S(t,{index:n}):T),e.isValidElement(x)||m,E&&e.createElement(Wd,{className:"".concat(N,"-option-state"),customizeIcon:x,customizeIconProps:{value:s,disabled:y,isSelected:m}},m?"✓":null))}))},If=e.forwardRef(Nf);function Of(e,t){return mp(e).join("").toUpperCase().includes(t)}var Lf=0,Mf=$();function Rf(t){var n=A(e.useState(),2),r=n[0],i=n[1];return e.useEffect(function(){var e;i("rc_select_".concat((Mf?(e=Lf,Lf+=1):e="TEST_OR_SSR",e)))},[]),t||r}var Df=["children","value"],Pf=["children"];function $f(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return on(t).map(function(t,r){if(!e.isValidElement(t)||!t.type)return null;var i=t,a=i.type.isSelectOptGroup,o=i.key,s=i.props,l=s.children,c=X(s,Pf);return n||!a?function(e){var t=e,n=t.key,r=t.props,i=r.children,a=r.value;return D({key:n,value:void 0!==a?a:n,children:i},X(r,Df))}(t):D(D({key:"__RC_SELECT_GRP__".concat(null===o?r:o,"__"),label:o},c),{},{options:$f(l)})}).filter(function(e){return e})}function Bf(t){var n=e.useRef();n.current=t;var r=e.useCallback(function(){return n.current.apply(n,arguments)},[]);return r}var Ff=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],zf=["inputValue"];var jf=e.forwardRef(function(t,n){var r=t.id,i=t.mode,a=t.prefixCls,o=void 0===a?"rc-select":a,s=t.backfill,l=t.fieldNames,c=t.inputValue,u=t.searchValue,h=t.onSearch,d=t.autoClearSearchValue,p=void 0===d||d,f=t.onSelect,g=t.onDeselect,m=t.dropdownMatchSelectWidth,y=void 0===m||m,v=t.filterOption,b=t.filterSort,x=t.optionFilterProp,w=t.optionLabelProp,E=t.options,k=t.optionRender,T=t.children,_=t.defaultActiveFirstOption,C=t.menuItemSelectedIcon,S=t.virtual,I=t.direction,L=t.listHeight,R=void 0===L?200:L,P=t.listItemHeight,$=void 0===P?20:P,B=t.labelRender,F=t.value,z=t.defaultValue,j=t.labelInValue,H=t.onChange,U=t.maxCount,G=X(t,Ff),q=Rf(r),W=af(i),V=!(E||!T),Y=e.useMemo(function(){return(void 0!==v||"combobox"!==i)&&v},[v,i]),K=e.useMemo(function(){return Zp(l,V)},[JSON.stringify(l),V]),Q=Vi("",{value:void 0!==u?u:c,postState:function(e){return e||""}}),Z=A(Q,2),J=Z[0],ee=Z[1],te=function(t,n,r,i,a){return e.useMemo(function(){var e=t;!t&&(e=$f(n));var o=new Map,s=new Map,l=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c0?e(t.options):t.options}):t})},we=e.useMemo(function(){return b?xe(be):be},[be,b,J]),Ee=e.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],a=Zp(n,!1),o=a.label,s=a.value,l=a.options,c=a.groupLabel;return function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(n||!(l in t)){var a=t[s];i.push({key:Kp(t,i.length),groupOption:n,data:t,label:t[o],value:a})}else{var u=t[c];void 0===u&&r&&(u=t.label),i.push({key:Kp(t,i.length),group:!0,data:t,label:u}),e(t[l],!0)}})}(e,!1),i}(we,{fieldNames:K,childrenAsData:V})},[we,K,V]),ke=function(e){var t=ae(e);if(le(t),H&&(t.length!==de.length||t.some(function(e,t){var n;return(null===(n=de[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=j?t:t.map(function(e){return e.value}),r=t.map(function(e){return Jp(pe(e.value))});H(W?n:n[0],W?r:r[0])}},Te=A(e.useState(null),2),_e=Te[0],Ce=Te[1],Se=A(e.useState(0),2),Ae=Se[0],Ne=Se[1],Ie=void 0!==_?_:"combobox"!==i,Oe=e.useCallback(function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).source,r=void 0===n?"keyboard":n;Ne(t),s&&"combobox"===i&&null!==e&&"keyboard"===r&&Ce(String(e))},[s,i]),Le=function(e,t,n){var r=function(){var t,n=pe(e);return[j?{label:null==n?void 0:n[K.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,Jp(n)]};if(t&&f){var i=A(r(),2),a=i[0],o=i[1];f(a,o)}else if(!t&&g&&"clear"!==n){var s=A(r(),2),l=s[0],c=s[1];g(l,c)}},Me=Bf(function(e,t){var n,r=!W||t.selected;n=r?W?[].concat(M(de),[e]):[e]:de.filter(function(t){return t.value!==e}),ke(n),Le(e,r),"combobox"===i?Ce(""):af&&!p||(ee(""),Ce(""))}),Re=e.useMemo(function(){var e=!1!==S&&!1!==y;return D(D({},te),{},{flattenOptions:Ee,onActiveValue:Oe,defaultActiveFirstOption:Ie,onSelect:Me,menuItemSelectedIcon:C,rawValues:ge,fieldNames:K,virtual:e,direction:I,listHeight:R,listItemHeight:$,childrenAsData:V,maxCount:U,optionRender:k})},[U,te,Ee,Oe,Ie,Me,C,ge,K,S,y,I,R,$,V,k]);return e.createElement(ef.Provider,{value:Re},e.createElement(of,Xe({},G,{id:q,prefixCls:o,ref:n,omitDomProps:zf,mode:i,displayValues:fe,onDisplayValuesChange:function(e,t){ke(e);var n=t.type,r=t.values;"remove"!==n&&"clear"!==n||r.forEach(function(e){Le(e.value,!1,n)})},direction:I,searchValue:J,onSearch:function(e,t){if(ee(e),Ce(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===i&&ke(e),null==h||h(e));else{var n=(e||"").trim();if(n){var r=Array.from(new Set([].concat(M(ge),[n])));ke(r),Le(n,!0),ee("")}}},autoClearSearchValue:p,onSearchSplit:function(e){var t=e;"tags"!==i&&(t=e.map(function(e){var t=re.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat(M(ge),M(t))));ke(n),n.forEach(function(e){Le(e,!0)})},dropdownMatchSelectWidth:y,OptionList:If,emptyOptions:!Ee.length,activeValue:_e,activeDescendantId:"".concat(q,"_list_").concat(Ae)})))}),Hf=jf;function Uf(e,t,n){return en({[`${e}-status-success`]:"success"===t,[`${e}-status-warning`]:"warning"===t,[`${e}-status-error`]:"error"===t,[`${e}-status-validating`]:"validating"===t,[`${e}-has-feedback`]:n})}Hf.Option=lf,Hf.OptGroup=sf;const Gf=(e,t)=>t||e,qf=()=>{const[,t]=fa(),[n]=zr("Empty"),r=new Yr(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return e.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,(null==n?void 0:n.description)||"Empty"),e.createElement("g",{fill:"none",fillRule:"evenodd"},e.createElement("g",{transform:"translate(24 31.67)"},e.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),e.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),e.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),e.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),e.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),e.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),e.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},e.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),e.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},Wf=()=>{const[,t]=fa(),[n]=zr("Empty"),{colorFill:r,colorFillTertiary:i,colorFillQuaternary:a,colorBgContainer:o}=t,{borderColor:s,shadowColor:l,contentColor:c}=h(()=>({borderColor:new Yr(r).onBackground(o).toHexString(),shadowColor:new Yr(i).onBackground(o).toHexString(),contentColor:new Yr(a).onBackground(o).toHexString()}),[r,i,a,o]);return e.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,(null==n?void 0:n.description)||"Empty"),e.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},e.createElement("ellipse",{fill:l,cx:"32",cy:"33",rx:"32",ry:"7"}),e.createElement("g",{fillRule:"nonzero",stroke:s},e.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:c}))))};var Vf=wa("Empty",e=>{const{componentCls:t,controlHeightLG:n,calc:r}=e;return(e=>{const{componentCls:t,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:o}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:o,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}})(Qi(e,{emptyImgCls:`${t}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))}),Yf=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var n;const{className:r,rootClassName:i,prefixCls:a,image:o,description:s,children:l,imageStyle:c,style:u,classNames:h,styles:d}=t,p=Yf(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:f,direction:g,className:m,style:y,classNames:v,styles:b,image:x}=Ii("empty"),w=f("empty",a),[E,k,T]=Vf(w),[_]=zr("Empty"),C=void 0!==s?s:null==_?void 0:_.description,S="string"==typeof C?C:"empty",A=null!==(n=null!=o?o:x)&&void 0!==n?n:Xf;let N=null;return N="string"==typeof A?e.createElement("img",{draggable:!1,alt:S,src:A}):A,E(e.createElement("div",Object.assign({className:en(k,T,w,m,{[`${w}-normal`]:A===Kf,[`${w}-rtl`]:"rtl"===g},r,i,v.root,null==h?void 0:h.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},b.root),y),null==d?void 0:d.root),u)},p),e.createElement("div",{className:en(`${w}-image`,v.image,null==h?void 0:h.image),style:Object.assign(Object.assign(Object.assign({},c),b.image),null==d?void 0:d.image)},N),C&&e.createElement("div",{className:en(`${w}-description`,v.description,null==h?void 0:h.description),style:Object.assign(Object.assign({},b.description),null==d?void 0:d.description)},C),l&&e.createElement("div",{className:en(`${w}-footer`,v.footer,null==h?void 0:h.footer),style:Object.assign(Object.assign({},b.footer),null==d?void 0:d.footer)},l)))};Qf.PRESENTED_IMAGE_DEFAULT=Xf,Qf.PRESENTED_IMAGE_SIMPLE=Kf;const Zf=e=>{const{componentName:r}=e,{getPrefixCls:i}=n(Si),a=i("empty");switch(r){case"Table":case"List":return t.createElement(Qf,{image:Qf.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return t.createElement(Qf,{image:Qf.PRESENTED_IMAGE_SIMPLE,className:`${a}-small`});case"Table.filter":return null;default:return t.createElement(Qf,null)}},Jf=(t,n,r)=>{var i,a;const{variant:o,[t]:s}=e.useContext(Si),l=e.useContext(Lh),c=null==s?void 0:s.variant;let u;u=void 0!==n?n:!1===r?"borderless":null!==(a=null!==(i=null!=l?l:c)&&void 0!==i?i:o)&&void 0!==a?a:"outlined";return[u,Ci.includes(u)]};function eg(e,t){return e||(e=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}})(t)}const tg=e=>{const{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:i}=e;return{position:"relative",display:"block",minHeight:t,padding:i,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},ng=e=>{const{antCls:t,componentCls:n}=e,r=`${n}-item`,i=`&${t}-slide-up-enter${t}-slide-up-enter-active`,a=`&${t}-slide-up-appear${t}-slide-up-appear-active`,o=`&${t}-slide-up-leave${t}-slide-up-leave-active`,s=`${n}-dropdown-placement-`,l=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},ma(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[`\n ${i}${s}bottomLeft,\n ${a}${s}bottomLeft\n `]:{animationName:Xl},[`\n ${i}${s}topLeft,\n ${a}${s}topLeft,\n ${i}${s}topRight,\n ${a}${s}topRight\n `]:{animationName:Ql},[`${o}${s}bottomLeft`]:{animationName:Kl},[`\n ${o}${s}topLeft,\n ${o}${s}topRight\n `]:{animationName:Zl},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},tg(e)),{cursor:"pointer",transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},ga),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},tg(e)),{color:e.colorTextDisabled})}),[`${l}:has(+ ${l})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${l}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},ic(e,"slide-up"),ic(e,"slide-down"),Yl(e,"move-up"),Yl(e,"move-down")]},rg=e=>{const{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:s,colorIcon:l,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=e,h=`${t}-selection-overflow`;return{[h]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),[`${t}-disabled&`]:{color:o,borderColor:s,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},ig=(e,t)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,i=`${n}-selection-overflow`,a=e.multipleSelectItemHeight,o=(e=>{const{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()})(e),s=t?`${n}-${t}`:"",l=(e=>{const{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=e,a=e.max(e.calc(n).sub(r).equal(),0);return{basePadding:a,containerPadding:e.max(e.calc(a).sub(i).equal(),0),itemHeight:Le(t),itemLineHeight:Le(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}})(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},rg(e)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Le(r)} 0`,lineHeight:Le(a),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:l.itemHeight,lineHeight:Le(l.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Le(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal()},[`${i}-item + ${i}-item,\n ${n}-prefix + ${n}-selection-wrap\n `]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:l.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(o).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:Le(a),transition:`all ${e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${e.motionDurationSlow}`}})}};function ag(e,t){const{componentCls:n}=e,r=t?`${n}-${t}`:"",i={[`${n}-multiple${r}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[`\n &${n}-show-arrow ${n}-selector,\n &${n}-allow-clear ${n}-selector\n `]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[ig(e,t),i]}const og=e=>{const{componentCls:t}=e,n=Qi(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=Qi(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[ag(e),ag(n,"sm"),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},ag(r,"lg")]};function sg(e,t){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),o=t?`${n}-${t}`:"";return{[`${n}-single${o}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},ma(e,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-wrap:after`]:{lineHeight:Le(a)},[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[`\n ${n}-selection-item,\n ${n}-selection-placeholder\n `]:{display:"block",padding:0,lineHeight:Le(a),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`\n &${n}-show-arrow ${n}-selection-item,\n &${n}-show-arrow ${n}-selection-search,\n &${n}-show-arrow ${n}-selection-placeholder\n `]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Le(r)}`,[`${n}-selection-search-input`]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:Le(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Le(r)}`,"&:after":{display:"none"}}}}}}}function lg(e){const{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[sg(e),sg(Qi(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${Le(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`\n &${t}-show-arrow ${t}-selection-item,\n &${t}-show-arrow ${t}-selection-placeholder\n `]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},sg(Qi(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}const cg=(e,t)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Le(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${Le(i)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},ug=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},cg(e,t))}),hg=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},cg(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),ug(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),ug(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),dg=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${Le(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},pg=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},dg(e,t))}),fg=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},dg(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),pg(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),pg(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),gg=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),mg=(e,t)=>{const{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Le(e.lineWidth)} 0`,borderStyle:`none none ${e.lineType} none`,borderColor:t.borderColor,background:e.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,outline:0},[`${n}-prefix`]:{color:t.color}}}},yg=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},mg(e,t))}),vg=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},mg(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),yg(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),yg(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),bg=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},hg(e)),fg(e)),gg(e)),vg(e))}),xg=e=>{const{componentCls:t}=e;return{position:"relative",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:"pointer"},[`${t}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${t}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},wg=e=>{const{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},Eg=e=>{const{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=e,a={[`${n}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},ma(e)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},xg(e)),wg(e)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},ga),{[`> ${t}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},ga),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${e.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:e.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":a,"&:hover":a}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},kg=e=>{const{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:"100%"}}},Eg(e),lg(e),og(e),ng(e),{[`${t}-rtl`]:{direction:"rtl"}},Hc(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]};var Tg=wa("Select",(e,{rootPrefixCls:t})=>{const n=Qi(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[kg(n),bg(n)]},e=>{const{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:o,paddingXXS:s,controlPaddingHorizontal:l,zIndexPopupBase:c,colorText:u,fontWeightStrong:h,controlItemBgActive:d,controlItemBgHover:p,colorBgContainer:f,colorFillSecondary:g,colorBgContainerDisabled:m,colorTextDisabled:y,colorPrimaryHover:v,colorPrimary:b,controlOutline:x}=e,w=2*s,E=2*r,k=Math.min(i-w,i-E),T=Math.min(a-w,a-E),_=Math.min(o-w,o-E);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:h,optionSelectedBg:d,optionActiveBg:p,optionPadding:`${(i-t*n)/2}px ${l}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:f,clearBg:f,singleItemHeightLG:o,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:k,multipleItemHeightSM:T,multipleItemHeightLG:_,multipleSelectorBgDisabled:m,multipleItemColorDisabled:y,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize),hoverBorderColor:v,activeBorderColor:b,activeOutlineColor:x,selectAffixPadding:s}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),_g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},Cg=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:_g}))},Sg=e.forwardRef(Cg),Ag={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},Ng=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Ag}))},Ig=e.forwardRef(Ng),Og={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},Lg=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Og}))},Mg=e.forwardRef(Lg);var Rg=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i,a,o,s,l;const{prefixCls:c,bordered:u,className:h,rootClassName:d,getPopupContainer:p,popupClassName:f,dropdownClassName:g,listHeight:m=256,placement:y,listItemHeight:v,size:b,disabled:x,notFoundContent:w,status:E,builtinPlacements:k,dropdownMatchSelectWidth:T,popupMatchSelectWidth:_,direction:C,style:S,allowClear:A,variant:N,dropdownStyle:I,transitionName:O,tagRender:L,maxCount:M,prefix:R,dropdownRender:D,popupRender:P,onDropdownVisibleChange:$,onOpenChange:B,styles:F,classNames:z}=n,j=Rg(n,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:H,getPrefixCls:U,renderEmpty:G,direction:q,virtual:W,popupMatchSelectWidth:V,popupOverflow:Y}=e.useContext(Si),{showSearch:X,style:K,styles:Q,className:Z,classNames:J}=Ii("select"),[,ee]=fa(),te=null!=v?v:null==ee?void 0:ee.controlHeight,ne=U("select",c),re=U(),ie=null!=C?C:q,{compactSize:ae,compactItemClassnames:oe}=ul(ne,ie),[se,le]=Jf("select",N,u),ce=hs(ne),[ue,he,de]=Tg(ne,ce),pe=e.useMemo(()=>{const{mode:e}=n;if("combobox"!==e)return e===Dg?"combobox":e},[n.mode]),fe="multiple"===pe||"tags"===pe,ge=function(e,t){return void 0!==t?t:null!==e}(n.suffixIcon,n.showArrow),me=null!==(i=null!=_?_:T)&&void 0!==i?i:V,ye=(null===(a=null==F?void 0:F.popup)||void 0===a?void 0:a.root)||(null===(o=Q.popup)||void 0===o?void 0:o.root)||I,ve=(be=P||D,t.useMemo(()=>{if(be)return(...e)=>t.createElement(Mh,{space:!0},be.apply(void 0,e))},[be]));var be;const xe=B||$,{status:we,hasFeedback:Ee,isFormItemInput:ke,feedbackIcon:Te}=e.useContext(Ih),_e=Gf(we,E);let Ce;Ce=void 0!==w?w:"combobox"===pe?null:(null==G?void 0:G("Select"))||e.createElement(Zf,{componentName:"Select"});const{suffixIcon:Se,itemIcon:Ae,removeIcon:Ne,clearIcon:Ie}=function({suffixIcon:t,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:a,multiple:o,hasFeedback:s,prefixCls:l,showSuffixIcon:c,feedbackIcon:u,showArrow:h,componentName:d}){const p=null!=n?n:e.createElement(Xo,null),f=n=>null!==t||s||h?e.createElement(e.Fragment,null,!1!==c&&n,s&&u):null;let g=null;if(void 0!==t)g=f(t);else if(a)g=f(e.createElement(gs,{spin:!0}));else{const t=`${l}-suffix`;g=({open:n,showSearch:r})=>f(n&&r?e.createElement(Mg,{className:t}):e.createElement(Ig,{className:t}))}let m=null;m=void 0!==r?r:o?e.createElement(Sg,null):null;let y=null;return y=void 0!==i?i:e.createElement(Zo,null),{clearIcon:p,suffixIcon:g,itemIcon:m,removeIcon:y}}(Object.assign(Object.assign({},j),{multiple:fe,hasFeedback:Ee,feedbackIcon:Te,showSuffixIcon:ge,prefixCls:ne,componentName:"Select"})),Oe=!0===A?{clearIcon:Ie}:A,Le=Zs(j,["suffixIcon","itemIcon"]),Me=en((null===(s=null==z?void 0:z.popup)||void 0===s?void 0:s.root)||(null===(l=null==J?void 0:J.popup)||void 0===l?void 0:l.root)||f||g,{[`${ne}-dropdown-${ie}`]:"rtl"===ie},d,J.root,null==z?void 0:z.root,de,ce,he),Re=ll(e=>{var t;return null!==(t=null!=b?b:ae)&&void 0!==t?t:e}),De=e.useContext(Mi),Pe=null!=x?x:De,$e=en({[`${ne}-lg`]:"large"===Re,[`${ne}-sm`]:"small"===Re,[`${ne}-rtl`]:"rtl"===ie,[`${ne}-${se}`]:le,[`${ne}-in-form-item`]:ke},Uf(ne,_e,Ee),oe,Z,h,J.root,null==z?void 0:z.root,d,de,ce,he),Be=e.useMemo(()=>void 0!==y?y:"rtl"===ie?"bottomRight":"bottomLeft",[y,ie]),[Fe]=_s("SelectLike",null==ye?void 0:ye.zIndex);return ue(e.createElement(Hf,Object.assign({ref:r,virtual:W,showSearch:X},Le,{style:Object.assign(Object.assign(Object.assign(Object.assign({},Q.root),null==F?void 0:F.root),K),S),dropdownMatchSelectWidth:me,transitionName:Qs(re,"slide-up",O),builtinPlacements:eg(k,Y),listHeight:m,listItemHeight:te,mode:pe,prefixCls:ne,placement:Be,direction:ie,prefix:R,suffixIcon:Se,menuItemSelectedIcon:Ae,removeIcon:Ne,allowClear:Oe,notFoundContent:Ce,className:$e,getPopupContainer:p||H,dropdownClassName:Me,disabled:Pe,dropdownStyle:Object.assign(Object.assign({},ye),{zIndex:Fe}),maxCount:fe?M:void 0,tagRender:fe?L:void 0,dropdownRender:ve,onDropdownVisibleChange:xe})))},$g=e.forwardRef(Pg),Bg=((t,n)=>Gd(r=>{const{prefixCls:i,style:a}=r,o=e.useRef(null),[s,l]=e.useState(0),[c,u]=e.useState(0),[h,d]=Vi(!1,{value:r.open}),{getPrefixCls:p}=e.useContext(Si),f=p("select",i);e.useEffect(()=>{if(d(!0),"undefined"!=typeof ResizeObserver){const e=new ResizeObserver(e=>{const t=e[0].target;l(t.offsetHeight+8),u(t.offsetWidth)}),t=setInterval(()=>{var n;const r=`.${f}-dropdown`,i=null===(n=o.current)||void 0===n?void 0:n.querySelector(r);i&&(clearInterval(t),e.observe(i))},10);return()=>{clearInterval(t),e.disconnect()}}},[f]);let g=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:h,visible:h,getPopupContainer:()=>o.current});Object.assign(g,{[n]:{overflow:{adjustX:!1,adjustY:!1}}});const m={paddingBottom:s,position:"relative",minWidth:c};return e.createElement("div",{ref:o,style:m},e.createElement(t,Object.assign({},g)))}))($g,"dropdownAlign");$g.SECRET_COMBOBOX_MODE_DO_NOT_USE=Dg,$g.Option=lf,$g.OptGroup=sf,$g._InternalPanelDoNotUseOrYouWillBeFired=Bg;const Fg=(e,t)=>{void 0!==(null==e?void 0:e.addEventListener)?e.addEventListener("change",t):void 0!==(null==e?void 0:e.addListener)&&e.addListener(t)},zg=(e,t)=>{void 0!==(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",t):void 0!==(null==e?void 0:e.removeListener)&&e.removeListener(t)},jg=["xxl","xl","lg","md","sm","xs"],Hg=(e,t)=>{if(t)for(const n of jg)if(e[n]&&void 0!==(null==t?void 0:t[n]))return t[n]},Ug=()=>{const[,e]=fa(),n=(e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`}))((e=>{const t=e,n=[].concat(jg).reverse();return n.forEach((e,r)=>{const i=e.toUpperCase(),a=`screen${i}Min`,o=`screen${i}`;if(!(t[a]<=t[o]))throw new Error(`${a}<=${o} fails : !(${t[a]}<=${t[o]})`);if(r{const e=new Map;let t=-1,r={};return{responsiveMap:n,matchHandlers:{},dispatch:t=>(r=t,e.forEach(e=>e(r)),e.size>=1),subscribe(n){return e.size||this.register(),t+=1,e.set(t,n),n(r),t},unsubscribe(t){e.delete(t),e.size||this.unregister()},register(){Object.entries(n).forEach(([e,t])=>{const n=({matches:t})=>{this.dispatch(Object.assign(Object.assign({},r),{[e]:t}))},i=window.matchMedia(t);Fg(i,n),this.matchHandlers[t]={mql:i,listener:n},n(i)})},unregister(){Object.values(n).forEach(e=>{const t=this.matchHandlers[e];zg(null==t?void 0:t.mql,null==t?void 0:t.listener)}),e.clear()}}},[n])};function Gg(e=!0,n={}){const r=o(n),[,i]=t.useReducer(e=>e+1,0),a=Ug();return Be(()=>{const t=a.subscribe(t=>{r.current=t,e&&i()});return()=>a.unsubscribe(t)},[]),r.current}function qg(t){var n=t.children,r=t.prefixCls,i=t.id,a=t.overlayInnerStyle,o=t.bodyClassName,s=t.className,l=t.style;return e.createElement("div",{className:en("".concat(r,"-content"),s),style:l},e.createElement("div",{className:en("".concat(r,"-inner"),o),id:i,role:"tooltip",style:a},"function"==typeof n?n():n))}var Wg={shiftX:64,adjustY:1},Vg={adjustX:1,shiftY:!0},Yg=[0,0],Xg={left:{points:["cr","cl"],overflow:Vg,offset:[-4,0],targetOffset:Yg},right:{points:["cl","cr"],overflow:Vg,offset:[4,0],targetOffset:Yg},top:{points:["bc","tc"],overflow:Wg,offset:[0,-4],targetOffset:Yg},bottom:{points:["tc","bc"],overflow:Wg,offset:[0,4],targetOffset:Yg},topLeft:{points:["bl","tl"],overflow:Wg,offset:[0,-4],targetOffset:Yg},leftTop:{points:["tr","tl"],overflow:Vg,offset:[-4,0],targetOffset:Yg},topRight:{points:["br","tr"],overflow:Wg,offset:[0,-4],targetOffset:Yg},rightTop:{points:["tl","tr"],overflow:Vg,offset:[4,0],targetOffset:Yg},bottomRight:{points:["tr","br"],overflow:Wg,offset:[0,4],targetOffset:Yg},rightBottom:{points:["bl","br"],overflow:Vg,offset:[4,0],targetOffset:Yg},bottomLeft:{points:["tl","bl"],overflow:Wg,offset:[0,4],targetOffset:Yg},leftBottom:{points:["br","bl"],overflow:Vg,offset:[-4,0],targetOffset:Yg}},Kg=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Qg=function(t,n){var r=t.overlayClassName,i=t.trigger,a=void 0===i?["hover"]:i,s=t.mouseEnterDelay,l=void 0===s?0:s,c=t.mouseLeaveDelay,u=void 0===c?.1:c,h=t.overlayStyle,d=t.prefixCls,p=void 0===d?"rc-tooltip":d,f=t.children,m=t.onVisibleChange,y=t.afterVisibleChange,v=t.transitionName,b=t.animation,x=t.motion,w=t.placement,E=void 0===w?"right":w,k=t.align,T=void 0===k?{}:k,_=t.destroyTooltipOnHide,C=void 0!==_&&_,S=t.defaultVisible,A=t.getTooltipContainer,N=t.overlayInnerStyle;t.arrowContent;var I=t.overlay,O=t.id,L=t.showArrow,M=void 0===L||L,R=t.classNames,P=t.styles,$=X(t,Kg),B=fu(O),F=o(null);g(n,function(){return F.current});var z=D({},$);"visible"in t&&(z.popupVisible=t.visible);var j,H;return e.createElement(Wp,Xe({popupClassName:en(r,null==R?void 0:R.root),prefixCls:p,popup:function(){return e.createElement(qg,{key:"content",prefixCls:p,id:B,bodyClassName:null==R?void 0:R.body,overlayInnerStyle:D(D({},N),null==P?void 0:P.body)},I)},action:a,builtinPlacements:Xg,popupPlacement:E,ref:F,popupAlign:T,getPopupContainer:A,onPopupVisibleChange:m,afterPopupVisibleChange:y,popupTransitionName:v,popupAnimation:b,popupMotion:x,defaultPopupVisible:S,autoDestroy:C,mouseLeaveDelay:u,popupStyle:D(D({},h),null==P?void 0:P.root),mouseEnterDelay:l,arrow:M},z),(j=e.Children.only(f),H=D(D({},(null==j?void 0:j.props)||{}),{},{"aria-describedby":I?B:null}),e.cloneElement(f,H)))},Zg=u(Qg);const Jg=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:o,borderRadiusXS:s,calc:l}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:l(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:o,height:o,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Le(s)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}};function em(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?8:r}}function tm(e,t){return e?t:{}}function nm(e,t,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:o}=e,{arrowDistance:s=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},Jg(e,t,i)),{"&:before":{background:t}})]},tm(!!l.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:s,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Le(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),tm(!!l.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:s,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Le(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),tm(!!l.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:s},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),tm(!!l.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:s},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}const rm={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},im={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},am=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function om(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=e,o=t/2,s={},l=em({contentRadius:a,limitVerticalRadius:!0});return Object.keys(rm).forEach(e=>{const a=r&&im[e]||rm[e],c=Object.assign(Object.assign({},a),{offset:[0,0],dynamicInset:!0});switch(s[e]=c,am.has(e)&&(c.autoArrow=!1),e){case"top":case"topLeft":case"topRight":c.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":c.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":c.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":c.offset[0]=o+i}if(r)switch(e){case"topLeft":case"bottomLeft":c.offset[0]=-l.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":c.offset[0]=l.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":c.offset[1]=2*-l.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":c.offset[1]=2*l.arrowOffsetHorizontal-o}c.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+n,a.shiftX=!0,a.adjustX=!0}const o=Object.assign(Object.assign({},a),i);return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}(e,l,t,n),c.htmlRegion="visibleFirst"}),s}const sm=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:o,zIndexPopup:s,controlHeight:l,boxShadowSecondary:c,paddingSM:u,paddingXS:h,arrowOffsetHorizontal:d,sizePopupArrow:p}=e,f=t(o).add(p).add(d).equal(),g=t(o).mul(2).add(p).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:g,minHeight:l,padding:`${Le(e.calc(u).div(2).equal())} ${Le(h)}`,color:`var(--ant-tooltip-color, ${i})`,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:o,boxShadow:c,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:f},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(o,8)}},[`${n}-content`]:{position:"relative"}}),Ta(e,(e,{darkColor:t})=>({[`&${n}-${e}`]:{[`${n}-inner`]:{backgroundColor:t},[`${n}-arrow`]:{"--antd-arrow-background-color":t}}}))),{"&-rtl":{direction:"rtl"}})},nm(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},lm=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},em({contentRadius:e.borderRadius,limitVerticalRadius:!0})),function(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,i=t/2,a=i,o=1*r/Math.sqrt(2),s=i-r*(1-1/Math.sqrt(2)),l=i-n*(1/Math.sqrt(2)),c=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),u=2*i-l,h=c,d=2*i-o,p=s,f=2*i-0,g=a,m=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),y=r*(Math.sqrt(2)-1);return{arrowShadowWidth:m,arrowPath:`path('M 0 ${a} A ${r} ${r} 0 0 0 ${o} ${s} L ${l} ${c} A ${n} ${n} 0 0 1 ${u} ${h} L ${d} ${p} A ${r} ${r} 0 0 0 ${f} ${g} Z')`,arrowPolygon:`polygon(${y}px 100%, 50% ${y}px, ${2*i-y}px 100%, ${y}px 100%)`}}(Qi(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));var cm=(e,t=!0)=>{const n=wa("Tooltip",e=>{const{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e,i=Qi(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r});return[sm(i),dc(e,"zoom-big-fast")]},lm,{resetStyle:!1,injectStyle:t});return n(e)};const um=ia.map(e=>`${e}-inverse`),hm=["success","processing","error","default","warning"];function dm(e,t=!0){return t?[].concat(M(um),M(ia)).includes(e):ia.includes(e)}function pm(e,t){const n=dm(t),r=en({[`${e}-${t}`]:t&&n}),i={},a={},o=(e=>e instanceof Ol?e:new Ol(e))(t).toRgb(),s=(.299*o.r+.587*o.g+.114*o.b)/255<.5?"#FFF":"#000";return t&&!n&&(i.background=t,i["--ant-tooltip-color"]=s,a["--antd-arrow-background-color"]=t),{className:r,overlayStyle:i,arrowStyle:a}}var fm=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r,i;const{prefixCls:a,openClassName:o,getTooltipContainer:s,color:l,overlayInnerStyle:c,children:u,afterOpenChange:h,afterVisibleChange:d,destroyTooltipOnHide:p,destroyOnHidden:f,arrow:g=!0,title:m,overlay:y,builtinPlacements:v,arrowPointAtCenter:b=!1,autoAdjustOverflow:x=!0,motion:w,getPopupContainer:E,placement:k="top",mouseEnterDelay:T=.1,mouseLeaveDelay:_=.1,overlayStyle:C,rootClassName:S,overlayClassName:A,styles:N,classNames:I}=t,O=fm(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),L=!!g,[,M]=fa(),{getPopupContainer:R,getPrefixCls:D,direction:P,className:$,style:B,classNames:F,styles:z}=Ii("tooltip"),j=Sr(),H=e.useRef(null),U=()=>{var e;null===(e=H.current)||void 0===e||e.forceAlign()};e.useImperativeHandle(n,()=>{var e,t;return{forceAlign:U,forcePopupAlign:()=>{j.deprecated(!1,"forcePopupAlign","forceAlign"),U()},nativeElement:null===(e=H.current)||void 0===e?void 0:e.nativeElement,popupElement:null===(t=H.current)||void 0===t?void 0:t.popupElement}});const[G,q]=Vi(!1,{value:null!==(r=t.open)&&void 0!==r?r:t.visible,defaultValue:null!==(i=t.defaultOpen)&&void 0!==i?i:t.defaultVisible}),W=!m&&!y&&0!==m,V=e.useMemo(()=>{var e,t;let n=b;return"object"==typeof g&&(n=null!==(t=null!==(e=g.pointAtCenter)&&void 0!==e?e:g.arrowPointAtCenter)&&void 0!==t?t:b),v||om({arrowPointAtCenter:n,autoAdjustOverflow:x,arrowWidth:L?M.sizePopupArrow:0,borderRadius:M.borderRadius,offset:M.marginXXS})},[b,g,v,M]),Y=e.useMemo(()=>0===m?m:y||m||"",[y,m]),X=e.createElement(Mh,{space:!0},"function"==typeof Y?Y():Y),K=D("tooltip",a),Q=D(),Z=t["data-popover-inject"];let J=G;"open"in t||"visible"in t||!W||(J=!1);const ee=e.isValidElement(u)&&!ls(u)?u:e.createElement("span",null,u),te=ee.props,ne=te.className&&"string"!=typeof te.className?te.className:en(te.className,o||`${K}-open`),[re,ie,ae]=cm(K,!Z),oe=pm(K,l),se=oe.arrowStyle,le=en(A,{[`${K}-rtl`]:"rtl"===P},oe.className,S,ie,ae,$,F.root,null==I?void 0:I.root),ce=en(F.body,null==I?void 0:I.body),[ue,he]=_s("Tooltip",O.zIndex),de=e.createElement(Zg,Object.assign({},O,{zIndex:ue,showArrow:L,placement:k,mouseEnterDelay:T,mouseLeaveDelay:_,prefixCls:K,classNames:{root:le,body:ce},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},se),z.root),B),C),null==N?void 0:N.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},z.body),c),null==N?void 0:N.body),oe.overlayStyle)},getTooltipContainer:E||s||R,ref:H,builtinPlacements:V,overlay:X,visible:J,onVisibleChange:e=>{var n,r;q(!W&&e),W||(null===(n=t.onOpenChange)||void 0===n||n.call(t,e),null===(r=t.onVisibleChange)||void 0===r||r.call(t,e))},afterVisibleChange:null!=h?h:d,arrowContent:e.createElement("span",{className:`${K}-arrow-content`}),motion:{motionName:Qs(Q,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:null!=f?f:!!p}),J?us(ee,{className:ne}):ee);return re(e.createElement(ws.Provider,{value:he},de))}),mm=gm;mm._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:n,className:r,placement:i="top",title:a,color:o,overlayInnerStyle:s}=t,{getPrefixCls:l}=e.useContext(Si),c=l("tooltip",n),[u,h,d]=cm(c),p=pm(c,o),f=p.arrowStyle,g=Object.assign(Object.assign({},s),p.overlayStyle),m=en(h,d,c,`${c}-pure`,`${c}-placement-${i}`,r,p.className);return u(e.createElement("div",{className:m,style:f},e.createElement("div",{className:`${c}-arrow`}),e.createElement(qg,Object.assign({},t,{className:h,prefixCls:c,overlayInnerStyle:g}),a)))};var ym={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},vm=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:ym}))},bm=e.forwardRef(vm),xm={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},wm=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:xm}))},Em=e.forwardRef(wm);const km=e.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),Tm=e=>{const{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:i,controlHeightSM:a,marginXXS:o,colorTextLightSolid:s,colorBgContainer:l}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:`0 ${c}px`,headerColor:i,footerPadding:`${a}px ${c}px`,footerBg:t,siderBg:"#001529",triggerHeight:r+2*o,triggerBg:"#002140",triggerColor:s,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:l,lightTriggerBg:l,lightTriggerColor:i}},_m=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];var Cm=wa("Layout",e=>{const{antCls:t,componentCls:n,colorText:r,footerBg:i,headerHeight:a,headerPadding:o,headerColor:s,footerPadding:l,fontSize:c,bodyBg:u,headerBg:h}=e;return{[n]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:u,"&, *":{boxSizing:"border-box"},[`&${n}-has-sider`]:{flexDirection:"row",[`> ${n}, > ${n}-content`]:{width:0}},[`${n}-header, &${n}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${n}-header`]:{height:a,padding:o,color:s,lineHeight:Le(a),background:h,[`${t}-menu`]:{lineHeight:"inherit"}},[`${n}-footer`]:{padding:l,color:r,fontSize:c,background:i},[`${n}-content`]:{flex:"auto",color:r,minHeight:0}}},Tm,{deprecatedTokens:_m});var Sm=wa(["Layout","Sider"],e=>{const{componentCls:t,siderBg:n,motionDurationMid:r,motionDurationSlow:i,antCls:a,triggerHeight:o,triggerColor:s,triggerBg:l,headerHeight:c,zeroTriggerWidth:u,zeroTriggerHeight:h,borderRadiusLG:d,lightSiderBg:p,lightTriggerColor:f,lightTriggerBg:g,bodyBg:m}=e;return{[t]:{position:"relative",minWidth:0,background:n,transition:`all ${r}, background 0s`,"&-has-trigger":{paddingBottom:o},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${a}-menu${a}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:o,color:s,lineHeight:Le(o),textAlign:"center",background:l,cursor:"pointer",transition:`all ${r}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:c,insetInlineEnd:e.calc(u).mul(-1).equal(),zIndex:1,width:u,height:h,color:s,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:n,borderRadius:`0 ${Le(d)} ${Le(d)} 0`,cursor:"pointer",transition:`background ${i} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${i}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(u).mul(-1).equal(),borderRadius:`${Le(d)} 0 0 ${Le(d)}`}},"&-light":{background:p,[`${t}-trigger`]:{color:f,background:g},[`${t}-zero-width-trigger`]:{color:f,background:g,border:`1px solid ${m}`,borderInlineStart:0}}}}},Tm,{deprecatedTokens:_m}),Am=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),Lm=e.forwardRef((t,r)=>{const{prefixCls:i,className:a,trigger:s,children:c,defaultCollapsed:u=!1,theme:h="dark",style:p={},collapsible:f=!1,reverseArrow:g=!1,width:m=200,collapsedWidth:y=80,zeroWidthTriggerStyle:v,breakpoint:b,onCollapse:x,onBreakpoint:w}=t,E=Am(t,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:k}=n(km),[T,_]=d("collapsed"in t?t.collapsed:u),[C,S]=d(!1);l(()=>{"collapsed"in t&&_(t.collapsed)},[t.collapsed]);const A=(e,n)=>{"collapsed"in t||_(e),null==x||x(e,n)},{getPrefixCls:N,direction:I}=n(Si),O=N("layout-sider",i),[L,M,R]=Sm(O),D=o(null);D.current=e=>{S(e.matches),null==w||w(e.matches),T!==e.matches&&A(e.matches,"responsive")},l(()=>{function e(e){var t;return null===(t=D.current)||void 0===t?void 0:t.call(D,e)}let t;return void 0!==(null===window||void 0===window?void 0:window.matchMedia)&&b&&b in Nm&&(t=window.matchMedia(`screen and (max-width: ${Nm[b]})`),Fg(t,e),e(t)),()=>{zg(t,e)}},[b]),l(()=>{const e=Om("ant-sider-");return k.addSider(e),()=>k.removeSider(e)},[]);const P=()=>{A(!T,"clickTrigger")},$=Zs(E,["collapsed"]),B=T?y:m,F=(z=B,!Number.isNaN(Number.parseFloat(z))&&Number.isFinite(Number(z))?`${B}px`:String(B));var z;const j=0===Number.parseFloat(String(y||0))?e.createElement("span",{onClick:P,className:en(`${O}-zero-width-trigger`,`${O}-zero-width-trigger-${g?"right":"left"}`),style:v},s||e.createElement(Em,null)):null,H="rtl"===I==!g,U={expanded:H?e.createElement(Rl,null):e.createElement(bm,null),collapsed:H?e.createElement(bm,null):e.createElement(Rl,null)}[T?"collapsed":"expanded"],G=null!==s?j||e.createElement("div",{className:`${O}-trigger`,onClick:P,style:{width:F}},s||U):null,q=Object.assign(Object.assign({},p),{flex:`0 0 ${F}`,maxWidth:F,minWidth:F,width:F}),W=en(O,`${O}-${h}`,{[`${O}-collapsed`]:!!T,[`${O}-has-trigger`]:f&&null!==s&&!j,[`${O}-below`]:!!C,[`${O}-zero-width`]:0===Number.parseFloat(F)},a,M,R),V=e.useMemo(()=>({siderCollapsed:T}),[T]);return L(e.createElement(Im.Provider,{value:V},e.createElement("aside",Object.assign({className:W},$,{style:q,ref:r}),e.createElement("div",{className:`${O}-children`},c),f||C&&j?G:null)))});var Mm={exports:{}};Mm.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",a="minute",o="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|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,m={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 t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;x[s]=t,i=s}return!r&&i&&(b=i),i||!r&&b},T=function(e,t){if(E(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},_=v;_.l=k,_.i=E,_.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function m(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var y=m.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(f);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return _},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return T(e)68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},h=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[a,function(e){this.afternoon=h(e,!1)}],a:[a,function(e){this.afternoon=h(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,l("seconds")],ss:[i,l("seconds")],m:[i,l("minutes")],mm:[i,l("minutes")],H:[i,l("hours")],h:[i,l("hours")],HH:[i,l("hours")],hh:[i,l("hours")],D:[i,l("day")],DD:[r,l("day")],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[i,l("week")],ww:[r,l("week")],M:[i,l("month")],MM:[r,l("month")],MMM:[a,function(e){var t=u("months"),n=(u("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function p(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),s=a.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,l=i.hours,c=i.minutes,u=i.seconds,h=i.milliseconds,d=i.zone,f=i.week,g=new Date,m=s||(a||o?1:g.getDate()),y=a||g.getFullYear(),v=0;a&&!o||(v=o>0?o-1:g.getMonth());var b,x=l||0,w=c||0,E=u||0,k=h||0;return d?new Date(Date.UTC(y,v,m,x,w,E,k+60*d.offset*1e3)):n?new Date(Date.UTC(y,v,m,x,w,E,k)):(b=new Date(y,v,m,x,w,E,k),f&&(b=r(b).week(f).toDate()),b)}catch(e){return new Date("")}}(t,s,r,n),this.init(),h&&!0!==h&&(this.$L=this.locale(h).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var d=s.length,f=1;f<=d;f+=1){a[1]=s[f-1];var g=n.apply(this,a);if(g.isValid()){this.$d=g.$d,this.$L=g.$L,this.init();break}f===d&&(this.$d=new Date(""))}else i.call(this,e)}}}();var Bm=Zt($m.exports),Fm=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],zm=u(function(t,n){var r=t.prefixCls,i=void 0===r?"rc-checkbox":r,a=t.className,s=t.style,l=t.checked,c=t.disabled,u=t.defaultChecked,h=void 0!==u&&u,d=t.type,p=void 0===d?"checkbox":d,f=t.title,m=t.onChange,y=X(t,Fm),v=o(null),b=o(null),x=A(Vi(h,{value:l}),2),w=x[0],E=x[1];g(n,function(){return{focus:function(e){var t;null===(t=v.current)||void 0===t||t.focus(e)},blur:function(){var e;null===(e=v.current)||void 0===e||e.blur()},input:v.current,nativeElement:b.current}});var k=en(i,a,O(O({},"".concat(i,"-checked"),w),"".concat(i,"-disabled"),c));return e.createElement("span",{className:k,title:f,style:s,ref:b},e.createElement("input",Xe({},y,{className:"".concat(i,"-input"),ref:v,onChange:function(e){c||("checked"in t||E(e.target.checked),null==m||m({target:D(D({},t),{},{type:p,checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},disabled:c,checked:!!w,type:p})),e.createElement("span",{className:"".concat(i,"-inner")}))});function jm(e){return Qi(e,{inputAffixPadding:e.paddingXXS})}const Hm=e=>{const{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:i,controlHeightSM:a,controlHeightLG:o,fontSizeLG:s,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:h,colorFillAlter:d,colorPrimaryHover:p,colorPrimary:f,controlOutlineWidth:g,controlOutline:m,colorErrorOutline:y,colorWarningOutline:v,colorBgContainer:b,inputFontSize:x,inputFontSizeLG:w,inputFontSizeSM:E}=e,k=x||n,T=E||k,_=w||s,C=Math.round((t-k*r)/2*10)/10-i,S=Math.round((a-T*r)/2*10)/10-i,A=Math.ceil((o-_*l)/2*10)/10-i;return{paddingBlock:Math.max(C,0),paddingBlockSM:Math.max(S,0),paddingBlockLG:Math.max(A,0),paddingInline:c-i,paddingInlineSM:u-i,paddingInlineLG:h-i,addonBg:d,activeBorderColor:f,hoverBorderColor:p,activeShadow:`0 0 0 ${g}px ${m}`,errorActiveShadow:`0 0 0 ${g}px ${y}`,warningActiveShadow:`0 0 0 ${g}px ${v}`,hoverBg:b,activeBg:b,inputFontSize:k,inputFontSizeLG:_,inputFontSizeSM:T}},Um=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),Gm=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},Um(Qi(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),qm=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),Wm=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},qm(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),Vm=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},qm(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gm(e))}),Wm(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),Wm(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),Ym=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),Xm=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},Ym(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),Ym(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:Object.assign({},Gm(e))}})}),Km=(e,t)=>{const{componentCls:n}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${n}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${n}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},Qm=(e,t)=>{var n;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null!==(n=null==t?void 0:t.inputColor)&&void 0!==n?n:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},Zm=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},Qm(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}})}),Jm=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Qm(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gm(e))}),Zm(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),Zm(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),ey=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),ty=e=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},ey(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),ey(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}})}),ny=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Le(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.borderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),ry=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},ny(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),iy=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ny(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),ry(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),ry(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),ay=e=>{const{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:r,paddingInlineLG:i}=e;return{padding:`${Le(t)} ${Le(i)}`,fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:r}},oy=e=>({padding:`${Le(e.paddingBlockSM)} ${Le(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),sy=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Le(e.paddingBlock)} ${Le(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},(e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}))(e.colorTextPlaceholder)),{"&-lg":Object.assign({},ay(e)),"&-sm":Object.assign({},oy(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),ly=e=>{const{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Object.assign({},ay(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Object.assign({},oy(e)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Le(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Le(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Le(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}}},[`${n}-cascader-picker`]:{margin:`-9px ${Le(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Object.assign(Object.assign({display:"block"},{"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`\n & > ${t}-affix-wrapper,\n & > ${t}-number-affix-wrapper,\n & > ${n}-picker-range\n `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},[`& > ${n}-select > ${n}-select-selector,\n & > ${n}-select-auto-complete ${t},\n & > ${n}-cascader-picker ${t},\n & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,\n & > ${n}-select:first-child > ${n}-select-selector,\n & > ${n}-select-auto-complete:first-child ${t},\n & > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,\n & > ${n}-select:last-child > ${n}-select-selector,\n & > ${n}-cascader-picker:last-child ${t},\n & > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:"top"},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},cy=e=>{const{componentCls:t,controlHeightSM:n,lineWidth:r,calc:i}=e,a=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),sy(e)),Vm(e)),Jm(e)),Km(e)),iy(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},uy=e=>{const{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${e.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Le(e.inputAffixPadding)}`}}}},hy=e=>{const{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e,l=`${t}-affix-wrapper`,c=`${t}-affix-wrapper-disabled`;return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},sy(e)),{display:"inline-flex",[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),uy(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:"pointer",transition:`all ${i}`,"&:hover":{color:o}}}),[`${t}-underlined`]:{borderRadius:0},[c]:{[`${s}${t}-password-icon`]:{color:a,cursor:"not-allowed","&:hover":{color:a}}}}},dy=e=>{const{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},ma(e)),ly(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},Xm(e)),ty(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},py=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${t}-compact-item`]:{[`&:not(${t}-compact-last-item)`]:{[`${t}-group-addon`]:{[`${t}-search-button`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${t}-compact-first-item)`]:{[`${t},${t}-affix-wrapper`]:{borderRadius:0}},[`> ${t}-group-addon ${t}-search-button,\n > ${t},\n ${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},fy=e=>{const{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},gy=wa(["Input","Shared"],e=>{const t=Qi(e,jm(e));return[cy(t),hy(t)]},Hm,{resetFont:!1});var my=wa(["Input","Component"],e=>{const t=Qi(e,jm(e));return[dy(t),py(t),fy(t),Hc(t)]},Hm,{resetFont:!1});function yy(e,t,n){var r={}.atBegin;return function(e,t,n){var r,i=n||{},a=i.noTrailing,o=void 0!==a&&a,s=i.noLeading,l=void 0!==s&&s,c=i.debounceMode,u=void 0===c?void 0:c,h=!1,d=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,i=new Array(n),a=0;ae?l?(d=Date.now(),o||(r=setTimeout(u?g:f,e))):f():!0!==o&&(r=setTimeout(u?g:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),h=!n},f}(e,t,{debounceMode:!1!==(void 0!==r&&r)})}function vy(e,t){return(e=>{const{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},ma(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},ma(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},ma(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:ya(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${Le(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`\n ${n}:not(${n}-disabled),\n ${t}:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`\n ${n}-checked:not(${n}-disabled),\n ${t}-checked:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]})(Qi(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}var by=wa("Checkbox",(e,{prefixCls:t})=>[vy(t,e)]);const xy=t.createContext(null);var wy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i;const{prefixCls:a,className:o,rootClassName:s,children:l,indeterminate:c=!1,style:u,onMouseEnter:h,onMouseLeave:d,skipGroup:p=!1,disabled:f}=n,g=wy(n,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:m,direction:y,checkbox:v}=e.useContext(Si),b=e.useContext(xy),{isFormItemInput:x}=e.useContext(Ih),w=e.useContext(Mi),E=null!==(i=(null==b?void 0:b.disabled)||f)&&void 0!==i?i:w,k=e.useRef(g.value),T=e.useRef(null),_=In(r,T);e.useEffect(()=>{null==b||b.registerValue(g.value)},[]),e.useEffect(()=>{if(!p)return g.value!==k.current&&(null==b||b.cancelValue(k.current),null==b||b.registerValue(g.value),k.current=g.value),()=>null==b?void 0:b.cancelValue(g.value)},[g.value]),e.useEffect(()=>{var e;(null===(e=T.current)||void 0===e?void 0:e.input)&&(T.current.input.indeterminate=c)},[c]);const C=m("checkbox",a),S=hs(C),[A,N,I]=by(C,S),O=Object.assign({},g);b&&!p&&(O.onChange=(...e)=>{g.onChange&&g.onChange.apply(g,e),b.toggleOption&&b.toggleOption({label:l,value:g.value})},O.name=b.name,O.checked=b.value.includes(g.value));const L=en(`${C}-wrapper`,{[`${C}-rtl`]:"rtl"===y,[`${C}-wrapper-checked`]:O.checked,[`${C}-wrapper-disabled`]:E,[`${C}-wrapper-in-form-item`]:x},null==v?void 0:v.className,o,s,I,S,N),M=en({[`${C}-indeterminate`]:c},tl,N),[R,D]=function(e){const n=t.useRef(null),r=()=>{mr.cancel(n.current),n.current=null};return[()=>{r(),n.current=mr(()=>{n.current=null})},t=>{n.current&&(t.stopPropagation(),r()),null==e||e(t)}]}(O.onClick);return A(e.createElement(sl,{component:"Checkbox",disabled:E},e.createElement("label",{className:L,style:Object.assign(Object.assign({},null==v?void 0:v.style),u),onMouseEnter:h,onMouseLeave:d,onClick:R},e.createElement(zm,Object.assign({},O,{onClick:D,prefixCls:C,className:M,disabled:E,ref:_})),null!=l&&e.createElement("span",{className:`${C}-label`},l))))},ky=e.forwardRef(Ey);var Ty=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{defaultValue:r,children:i,options:a=[],prefixCls:o,className:s,rootClassName:l,style:c,onChange:u}=t,h=Ty(t,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:d,direction:p}=e.useContext(Si),[f,g]=e.useState(h.value||r||[]),[m,y]=e.useState([]);e.useEffect(()=>{"value"in h&&g(h.value||[])},[h.value]);const v=e.useMemo(()=>a.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[a]),b=e=>{y(t=>t.filter(t=>t!==e))},x=e=>{y(t=>[].concat(M(t),[e]))},w=e=>{const t=f.indexOf(e.value),n=M(f);-1===t?n.push(e.value):n.splice(t,1),"value"in h||g(n),null==u||u(n.filter(e=>m.includes(e)).sort((e,t)=>v.findIndex(t=>t.value===e)-v.findIndex(e=>e.value===t)))},E=d("checkbox",o),k=`${E}-group`,T=hs(E),[_,C,S]=by(E,T),A=Zs(h,["value","disabled"]),N=a.length?v.map(t=>e.createElement(ky,{prefixCls:E,key:t.value.toString(),disabled:"disabled"in t?t.disabled:h.disabled,value:t.value,checked:f.includes(t.value),onChange:t.onChange,className:en(`${k}-item`,t.className),style:t.style,title:t.title,id:t.id,required:t.required},t.label)):i,I=e.useMemo(()=>({toggleOption:w,value:f,disabled:h.disabled,name:h.name,registerValue:x,cancelValue:b}),[w,f,h.disabled,h.name,x,b]),O=en(k,{[`${k}-rtl`]:"rtl"===p},s,l,S,T,C);return _(e.createElement("div",Object.assign({className:O,style:c},A,{ref:n}),e.createElement(xy.Provider,{value:I},N)))}),Cy=ky;Cy.Group=_y,Cy.__ANT_CHECKBOX=!0;const Sy=a({});var Ay=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{getPrefixCls:r,direction:i}=e.useContext(Si),{gutter:a,wrap:o}=e.useContext(Sy),{prefixCls:s,span:l,order:c,offset:u,push:h,pull:d,className:p,children:f,flex:g,style:m}=t,y=Ay(t,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),v=r("col",s),[b,x,w]=hd(v),E={};let k={};Iy.forEach(e=>{let n={};const r=t[e];"number"==typeof r?n.span=r:"object"==typeof r&&(n=r||{}),delete y[e],k=Object.assign(Object.assign({},k),{[`${v}-${e}-${n.span}`]:void 0!==n.span,[`${v}-${e}-order-${n.order}`]:n.order||0===n.order,[`${v}-${e}-offset-${n.offset}`]:n.offset||0===n.offset,[`${v}-${e}-push-${n.push}`]:n.push||0===n.push,[`${v}-${e}-pull-${n.pull}`]:n.pull||0===n.pull,[`${v}-rtl`]:"rtl"===i}),n.flex&&(k[`${v}-${e}-flex`]=!0,E[`--${v}-${e}-flex`]=Ny(n.flex))});const T=en(v,{[`${v}-${l}`]:void 0!==l,[`${v}-order-${c}`]:c,[`${v}-offset-${u}`]:u,[`${v}-push-${h}`]:h,[`${v}-pull-${d}`]:d},p,k,x,w),_={};if(null==a?void 0:a[0]){const e="number"==typeof a[0]?a[0]/2+"px":`calc(${a[0]} / 2)`;_.paddingLeft=e,_.paddingRight=e}return g&&(_.flex=Ny(g),!1!==o||_.minWidth||(_.minWidth=0)),b(e.createElement("div",Object.assign({},y,{style:Object.assign(Object.assign(Object.assign({},_),m),E),className:T,ref:n}),f))});var Ly=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{(()=>{if("string"==typeof t&&i(t),"object"==typeof t)for(let e=0;e{const{prefixCls:r,justify:i,align:a,className:o,style:s,children:l,gutter:c=0,wrap:u}=t,h=Ly(t,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:p}=e.useContext(Si),f=Gg(!0,null),g=My(a,f),m=My(i,f),y=d("row",r),[v,b,x]=cd(y),w=function(e,t){const n=[void 0,void 0],r=Array.isArray(e)?e:[e,void 0],i=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return r.forEach((e,t)=>{if("object"==typeof e&&null!==e)for(let r=0;r({gutter:[T,_],wrap:u}),[T,_,u]);return v(e.createElement(Sy.Provider,{value:C},e.createElement("div",Object.assign({},h,{className:E,style:Object.assign(Object.assign({},k),s),ref:n}),l)))});function Dy(e,t,n){var r=t.cloneNode(!0),i=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},i}function Py(e,t,n,r){if(n){var i=t;"click"!==t.type?"file"===e.type||void 0===r?n(i):n(i=Dy(t,e,r)):n(i=Dy(t,e,""))}}function $y(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}var By=t.forwardRef(function(e,n){var r,i,a,s=e.inputElement,l=e.children,c=e.prefixCls,u=e.prefix,h=e.suffix,d=e.addonBefore,p=e.addonAfter,f=e.className,g=e.style,y=e.disabled,v=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,E=e.value,k=e.handleReset,T=e.hidden,_=e.classes,C=e.classNames,S=e.dataAttrs,A=e.styles,I=e.components,L=e.onClear,M=null!=l?l:s,R=(null==I?void 0:I.affixWrapper)||"span",P=(null==I?void 0:I.groupWrapper)||"span",$=(null==I?void 0:I.wrapper)||"span",B=(null==I?void 0:I.groupAddon)||"span",F=o(null),z=function(e){return!!(e.prefix||e.suffix||e.allowClear)}(e),j=m(M,{value:E,className:en(null===(r=M.props)||void 0===r?void 0:r.className,!z&&(null==C?void 0:C.variant))||null}),H=o(null);if(t.useImperativeHandle(n,function(){return{nativeElement:H.current||F.current}}),z){var U=null;if(w){var G=!y&&!v&&E,q="".concat(c,"-clear-icon"),W="object"===N(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";U=t.createElement("button",{type:"button",tabIndex:-1,onClick:function(e){null==k||k(e),null==L||L()},onMouseDown:function(e){return e.preventDefault()},className:en(q,O(O({},"".concat(q,"-hidden"),!G),"".concat(q,"-has-suffix"),!!h))},W)}var V="".concat(c,"-affix-wrapper"),Y=en(V,O(O(O(O(O({},"".concat(c,"-disabled"),y),"".concat(V,"-disabled"),y),"".concat(V,"-focused"),b),"".concat(V,"-readonly"),v),"".concat(V,"-input-with-clear-btn"),h&&w&&E),null==_?void 0:_.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),X=(h||w)&&t.createElement("span",{className:en("".concat(c,"-suffix"),null==C?void 0:C.suffix),style:null==A?void 0:A.suffix},U,h);j=t.createElement(R,Xe({className:Y,style:null==A?void 0:A.affixWrapper,onClick:function(e){var t;null!==(t=F.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==S?void 0:S.affixWrapper,{ref:F}),u&&t.createElement("span",{className:en("".concat(c,"-prefix"),null==C?void 0:C.prefix),style:null==A?void 0:A.prefix},u),j,X)}if(function(e){return!(!e.addonBefore&&!e.addonAfter)}(e)){var K="".concat(c,"-group"),Q="".concat(K,"-addon"),Z="".concat(K,"-wrapper"),J=en("".concat(c,"-wrapper"),K,null==_?void 0:_.wrapper,null==C?void 0:C.wrapper),ee=en(Z,O({},"".concat(Z,"-disabled"),y),null==_?void 0:_.group,null==C?void 0:C.groupWrapper);j=t.createElement(P,{className:ee,ref:H},t.createElement($,{className:J},d&&t.createElement(B,{className:Q},d),j,p&&t.createElement(B,{className:Q},p)))}return t.cloneElement(j,{className:en(null===(i=j.props)||void 0===i?void 0:i.className,f)||null,style:D(D({},null===(a=j.props)||void 0===a?void 0:a.style),g),hidden:T})}),Fy=["show"];function zy(t,n){return e.useMemo(function(){var e={};n&&(e.show="object"===N(n)&&n.formatter?n.formatter:!!n);var r=e=D(D({},e),t),i=r.show,a=X(r,Fy);return D(D({},a),{},{show:!!i,showFormatter:"function"==typeof i?i:void 0,strategy:a.strategy||function(e){return e.length}})},[t,n])}var jy=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Hy=u(function(e,n){var r=e.autoComplete,i=e.onChange,a=e.onFocus,s=e.onBlur,c=e.onPressEnter,u=e.onKeyDown,h=e.onKeyUp,p=e.prefixCls,f=void 0===p?"rc-input":p,m=e.disabled,y=e.htmlSize,v=e.className,b=e.maxLength,x=e.suffix,w=e.showCount,E=e.count,k=e.type,T=void 0===k?"text":k,_=e.classes,C=e.classNames,S=e.styles,N=e.onCompositionStart,I=e.onCompositionEnd,L=X(e,jy),R=A(d(!1),2),P=R[0],$=R[1],B=o(!1),F=o(!1),z=o(null),j=o(null),H=function(e){z.current&&$y(z.current,e)},U=A(Vi(e.defaultValue,{value:e.value}),2),G=U[0],q=U[1],W=null==G?"":String(G),V=A(d(null),2),Y=V[0],K=V[1],Q=zy(E,w),Z=Q.max||b,J=Q.strategy(W),ee=!!Z&&J>Z;g(n,function(){var e;return{focus:H,blur:function(){var e;null===(e=z.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=z.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=z.current)||void 0===e||e.select()},input:z.current,nativeElement:(null===(e=j.current)||void 0===e?void 0:e.nativeElement)||z.current}}),l(function(){F.current&&(F.current=!1),$(function(e){return(!e||!m)&&e})},[m]);var te=function(e,t,n){var r,a,o=t;if(!B.current&&Q.exceedFormatter&&Q.max&&Q.strategy(t)>Q.max)t!==(o=Q.exceedFormatter(t,{max:Q.max}))&&K([(null===(r=z.current)||void 0===r?void 0:r.selectionStart)||0,(null===(a=z.current)||void 0===a?void 0:a.selectionEnd)||0]);else if("compositionEnd"===n.source)return;q(o),z.current&&Py(z.current,e,i,o)};l(function(){var e;Y&&(null===(e=z.current)||void 0===e||e.setSelectionRange.apply(e,M(Y)))},[Y]);var ne,re=function(e){te(e,e.target.value,{source:"change"})},ie=function(e){B.current=!1,te(e,e.currentTarget.value,{source:"compositionEnd"}),null==I||I(e)},ae=function(e){c&&"Enter"===e.key&&!F.current&&(F.current=!0,c(e)),null==u||u(e)},oe=function(e){"Enter"===e.key&&(F.current=!1),null==h||h(e)},se=function(e){$(!0),null==a||a(e)},le=function(e){F.current&&(F.current=!1),$(!1),null==s||s(e)},ce=ee&&"".concat(f,"-out-of-range");return t.createElement(By,Xe({},L,{prefixCls:f,className:en(v,ce),handleReset:function(e){q(""),H(),z.current&&Py(z.current,e,i)},value:W,focused:P,triggerFocus:H,suffix:function(){var e=Number(Z)>0;if(x||Q.show){var n=Q.showFormatter?Q.showFormatter({value:W,count:J,maxLength:Z}):"".concat(J).concat(e?" / ".concat(Z):"");return t.createElement(t.Fragment,null,Q.show&&t.createElement("span",{className:en("".concat(f,"-show-count-suffix"),O({},"".concat(f,"-show-count-has-suffix"),!!x),null==C?void 0:C.count),style:D({},null==S?void 0:S.count)},n),x)}return null}(),disabled:m,classes:_,classNames:C,styles:S,ref:j}),(ne=Zs(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),t.createElement("input",Xe({autoComplete:r},ne,{onChange:re,onFocus:se,onBlur:le,onKeyDown:ae,onKeyUp:oe,className:en(f,O({},"".concat(f,"-disabled"),m),null==C?void 0:C.input),style:null==S?void 0:S.input,ref:z,size:y,type:T,onCompositionStart:function(e){B.current=!0,null==N||N(e)},onCompositionEnd:ie}))))});const Uy=e=>{let n;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?n=e:e&&(n={clearIcon:t.createElement(Xo,null)}),n};function Gy(e,t){const n=o([]),r=()=>{n.current.push(setTimeout(()=>{var t,n,r,i;(null===(t=e.current)||void 0===t?void 0:t.input)&&"password"===(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(i=e.current)||void 0===i||i.input.removeAttribute("value"))}))};return l(()=>(t&&r(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),r}var qy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:i,bordered:a=!0,status:s,size:l,disabled:c,onBlur:u,onFocus:h,suffix:d,allowClear:p,addonAfter:f,addonBefore:g,className:m,style:y,styles:v,rootClassName:b,onChange:x,classNames:w,variant:E}=e,k=qy(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:T,direction:_,allowClear:C,autoComplete:S,className:A,style:N,classNames:I,styles:O}=Ii("input"),L=T("input",i),M=o(null),R=hs(L),[D,P,$]=gy(L,b),[B]=my(L,R),{compactSize:F,compactItemClassnames:z}=ul(L,_),j=ll(e=>{var t;return null!==(t=null!=l?l:F)&&void 0!==t?t:e}),H=t.useContext(Mi),U=null!=c?c:H,{status:G,hasFeedback:q,feedbackIcon:W}=n(Ih),V=Gf(G,s),Y=function(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}(e)||!!q;o(Y);const X=Gy(M,!0),K=(q||d)&&t.createElement(t.Fragment,null,d,q&&W),Q=Uy(null!=p?p:C),[Z,J]=Jf("input",E,a);return D(B(t.createElement(Hy,Object.assign({ref:In(r,M),prefixCls:L,autoComplete:S},k,{disabled:U,onBlur:e=>{X(),null==u||u(e)},onFocus:e=>{X(),null==h||h(e)},style:Object.assign(Object.assign({},N),y),styles:Object.assign(Object.assign({},O),v),suffix:K,allowClear:Q,className:en(m,b,$,R,z,A),onChange:e=>{X(),null==x||x(e)},addonBefore:g&&t.createElement(Mh,{form:!0,space:!0},g),addonAfter:f&&t.createElement(Mh,{form:!0,space:!0},f),classNames:Object.assign(Object.assign(Object.assign({},w),I),{input:en({[`${L}-sm`]:"small"===j,[`${L}-lg`]:"large"===j,[`${L}-rtl`]:"rtl"===_},null==w?void 0:w.input,I.input,P),variant:en({[`${L}-${Z}`]:J},Uf(L,V)),affixWrapper:en({[`${L}-affix-wrapper-sm`]:"small"===j,[`${L}-affix-wrapper-lg`]:"large"===j,[`${L}-affix-wrapper-rtl`]:"rtl"===_},P),wrapper:en({[`${L}-group-rtl`]:"rtl"===_},P),groupWrapper:en({[`${L}-group-wrapper-sm`]:"small"===j,[`${L}-group-wrapper-lg`]:"large"===j,[`${L}-group-wrapper-rtl`]:"rtl"===_,[`${L}-group-wrapper-${Z}`]:J},Uf(`${L}-group-wrapper`,V,q),P)})}))))}),Vy={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},Yy=t.createContext({});var Xy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);in||on(r).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key})),[n,r]);return e.useMemo(()=>i.map(e=>{var{span:n}=e,r=Xy(e,["span"]);return"filled"===n?Object.assign(Object.assign({},r),{filled:!0}):Object.assign(Object.assign({},r),{span:"number"==typeof n?n:Hg(t,n)})}),[i,t])}var Qy=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const[n,r]=h(()=>function(e,t){let n=[],r=[],i=!1,a=0;return e.filter(e=>e).forEach(e=>{const{filled:o}=e,s=Qy(e,["filled"]);if(o)return r.push(s),n.push(r),r=[],void(a=0);const l=t-a;a+=e.span||1,a>=t?(a>t?(i=!0,r.push(Object.assign(Object.assign({},s),{span:l}))):r.push(s),n.push(r),r=[],a=0):r.push(s)}),r.length>0&&n.push(r),n=n.map(e=>{const n=e.reduce((e,t)=>e+(t.span||1),0);if(n{const{itemPrefixCls:n,component:r,span:i,className:a,style:o,labelStyle:s,contentStyle:l,bordered:c,label:u,content:h,colon:d,type:p,styles:f}=t,g=r,m=e.useContext(Yy),{classNames:y}=m;return c?e.createElement(g,{className:en({[`${n}-item-label`]:"label"===p,[`${n}-item-content`]:"content"===p,[`${null==y?void 0:y.label}`]:"label"===p,[`${null==y?void 0:y.content}`]:"content"===p},a),style:o,colSpan:i},Jy(u)&&e.createElement("span",{style:Object.assign(Object.assign({},s),null==f?void 0:f.label)},u),Jy(h)&&e.createElement("span",{style:Object.assign(Object.assign({},s),null==f?void 0:f.content)},h)):e.createElement(g,{className:en(`${n}-item`,a),style:o,colSpan:i},e.createElement("div",{className:`${n}-item-container`},(u||0===u)&&e.createElement("span",{className:en(`${n}-item-label`,null==y?void 0:y.label,{[`${n}-item-no-colon`]:!d}),style:Object.assign(Object.assign({},s),null==f?void 0:f.label)},u),(h||0===h)&&e.createElement("span",{className:en(`${n}-item-content`,null==y?void 0:y.content),style:Object.assign(Object.assign({},l),null==f?void 0:f.content)},h)))};function tv(t,{colon:n,prefixCls:r,bordered:i},{component:a,type:o,showLabel:s,showContent:l,labelStyle:c,contentStyle:u,styles:h}){return t.map(({label:t,children:d,prefixCls:p=r,className:f,style:g,labelStyle:m,contentStyle:y,span:v=1,key:b,styles:x},w)=>"string"==typeof a?e.createElement(ev,{key:`${o}-${b||w}`,className:f,style:g,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},c),null==h?void 0:h.label),m),null==x?void 0:x.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},u),null==h?void 0:h.content),y),null==x?void 0:x.content)},span:v,colon:n,component:a,itemPrefixCls:p,bordered:i,label:s?t:null,content:l?d:null,type:o}):[e.createElement(ev,{key:`label-${b||w}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),null==h?void 0:h.label),g),m),null==x?void 0:x.label),span:1,colon:n,component:a[0],itemPrefixCls:p,bordered:i,label:t,type:"label"}),e.createElement(ev,{key:`content-${b||w}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),null==h?void 0:h.content),g),y),null==x?void 0:x.content),span:2*v-1,component:a[1],itemPrefixCls:p,bordered:i,content:d,type:"content"})])}const nv=t=>{const n=e.useContext(Yy),{prefixCls:r,vertical:i,row:a,index:o,bordered:s}=t;return i?e.createElement(e.Fragment,null,e.createElement("tr",{key:`label-${o}`,className:`${r}-row`},tv(a,t,Object.assign({component:"th",type:"label",showLabel:!0},n))),e.createElement("tr",{key:`content-${o}`,className:`${r}-row`},tv(a,t,Object.assign({component:"td",type:"content",showContent:!0},n)))):e.createElement("tr",{key:o,className:`${r}-row`},tv(a,t,Object.assign({component:s?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},n)))},rv=e=>{const{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.padding)} ${Le(e.paddingLG)}`,borderInlineEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.paddingSM)} ${Le(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Le(e.paddingXS)} ${Le(e.padding)}`}}}}}};var iv=wa("Descriptions",e=>(e=>{const{componentCls:t,extraColor:n,itemPaddingBottom:r,itemPaddingEnd:i,colonMarginRight:a,colonMarginLeft:o,titleMarginBottom:s}=e;return{[t]:Object.assign(Object.assign(Object.assign({},ma(e)),rv(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:s},[`${t}-title`]:Object.assign(Object.assign({},ga),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:r,paddingInlineEnd:i},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${Le(o)} ${Le(a)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}})(Qi(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText})),av=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:n,title:r,extra:i,column:a,colon:o=!0,bordered:s,layout:l,children:c,className:u,rootClassName:h,style:d,size:p,labelStyle:f,contentStyle:g,styles:m,items:y,classNames:v}=t,b=av(t,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:x,direction:w,className:E,style:k,classNames:T,styles:_}=Ii("descriptions"),C=x("descriptions",n),S=Gg(),A=e.useMemo(()=>{var e;return"number"==typeof a?a:null!==(e=Hg(S,Object.assign(Object.assign({},Vy),a)))&&void 0!==e?e:3},[S,a]),N=Ky(S,y,c),I=ll(p),O=Zy(A,N),[L,M,R]=iv(C),D=e.useMemo(()=>({labelStyle:f,contentStyle:g,styles:{content:Object.assign(Object.assign({},_.content),null==m?void 0:m.content),label:Object.assign(Object.assign({},_.label),null==m?void 0:m.label)},classNames:{label:en(T.label,null==v?void 0:v.label),content:en(T.content,null==v?void 0:v.content)}}),[f,g,m,v,T,_]);return L(e.createElement(Yy.Provider,{value:D},e.createElement("div",Object.assign({className:en(C,E,T.root,null==v?void 0:v.root,{[`${C}-${I}`]:I&&"default"!==I,[`${C}-bordered`]:!!s,[`${C}-rtl`]:"rtl"===w},u,h,M,R),style:Object.assign(Object.assign(Object.assign(Object.assign({},k),_.root),null==m?void 0:m.root),d)},b),(r||i)&&e.createElement("div",{className:en(`${C}-header`,T.header,null==v?void 0:v.header),style:Object.assign(Object.assign({},_.header),null==m?void 0:m.header)},r&&e.createElement("div",{className:en(`${C}-title`,T.title,null==v?void 0:v.title),style:Object.assign(Object.assign({},_.title),null==m?void 0:m.title)},r),i&&e.createElement("div",{className:en(`${C}-extra`,T.extra,null==v?void 0:v.extra),style:Object.assign(Object.assign({},_.extra),null==m?void 0:m.extra)},i)),e.createElement("div",{className:`${C}-view`},e.createElement("table",null,e.createElement("tbody",null,O.map((t,n)=>e.createElement(nv,{key:n,index:n,colon:o,prefixCls:C,vertical:"vertical"===l,bordered:s,row:t}))))))))};ov.Item=({children:e})=>e;var sv=e.createContext(null),lv=e.createContext({}),cv=["prefixCls","className","containerRef"],uv=function(t){var n=t.prefixCls,r=t.className,i=t.containerRef,a=X(t,cv),o=e.useContext(lv).panel,s=On(o,i);return e.createElement("div",Xe({className:en("".concat(n,"-content"),r),role:"dialog",ref:s},ss(t,{aria:!0}),{"aria-modal":"true"},a))};function hv(e){return"string"==typeof e&&String(Number(e))===e?(te(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var dv={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function pv(t,n){var r,i,a,o=t.prefixCls,s=t.open,l=t.placement,c=t.inline,u=t.push,h=t.forceRender,d=t.autoFocus,p=t.keyboard,f=t.classNames,g=t.rootClassName,m=t.rootStyle,y=t.zIndex,v=t.className,b=t.id,x=t.style,w=t.motion,E=t.width,k=t.height,T=t.children,_=t.mask,C=t.maskClosable,S=t.maskMotion,N=t.maskClassName,I=t.maskStyle,L=t.afterOpenChange,M=t.onClose,R=t.onMouseEnter,P=t.onMouseOver,$=t.onMouseLeave,B=t.onClick,F=t.onKeyDown,z=t.onKeyUp,j=t.styles,H=t.drawerRender,U=e.useRef(),G=e.useRef(),q=e.useRef();e.useImperativeHandle(n,function(){return U.current});e.useEffect(function(){var e;s&&d&&(null===(e=U.current)||void 0===e||e.focus({preventScroll:!0}))},[s]);var W=A(e.useState(!1),2),V=W[0],Y=W[1],X=e.useContext(sv),K=null!==(r=null!==(i=null===(a="boolean"==typeof u?u?{}:{distance:0}:u||{})||void 0===a?void 0:a.distance)&&void 0!==i?i:null==X?void 0:X.pushDistance)&&void 0!==r?r:180,Q=e.useMemo(function(){return{pushDistance:K,push:function(){Y(!0)},pull:function(){Y(!1)}}},[K]);e.useEffect(function(){var e,t;s?null==X||null===(e=X.push)||void 0===e||e.call(X):null==X||null===(t=X.pull)||void 0===t||t.call(X)},[s]),e.useEffect(function(){return function(){var e;null==X||null===(e=X.pull)||void 0===e||e.call(X)}},[]);var Z=e.createElement(so,Xe({key:"mask"},S,{visible:_&&s}),function(t,n){var r=t.className,i=t.style;return e.createElement("div",{className:en("".concat(o,"-mask"),r,null==f?void 0:f.mask,N),style:D(D(D({},i),I),null==j?void 0:j.mask),onClick:C&&s?M:void 0,ref:n})}),J="function"==typeof w?w(l):w,ee={};if(V&&K)switch(l){case"top":ee.transform="translateY(".concat(K,"px)");break;case"bottom":ee.transform="translateY(".concat(-K,"px)");break;case"left":ee.transform="translateX(".concat(K,"px)");break;default:ee.transform="translateX(".concat(-K,"px)")}"left"===l||"right"===l?ee.width=hv(E):ee.height=hv(k);var te={onMouseEnter:R,onMouseOver:P,onMouseLeave:$,onClick:B,onKeyDown:F,onKeyUp:z},ne=e.createElement(so,Xe({key:"panel"},J,{visible:s,forceRender:h,onVisibleChanged:function(e){null==L||L(e)},removeOnLeave:!1,leavedClassName:"".concat(o,"-content-wrapper-hidden")}),function(n,r){var i=n.className,a=n.style,s=e.createElement(uv,Xe({id:b,containerRef:r,prefixCls:o,className:en(v,null==f?void 0:f.content),style:D(D({},x),null==j?void 0:j.content)},ss(t,{aria:!0}),te),T);return e.createElement("div",Xe({className:en("".concat(o,"-content-wrapper"),null==f?void 0:f.wrapper,i),style:D(D(D({},ee),a),null==j?void 0:j.wrapper)},ss(t,{data:!0})),H?H(s):s)}),re=D({},m);return y&&(re.zIndex=y),e.createElement(sv.Provider,{value:Q},e.createElement("div",{className:en(o,"".concat(o,"-").concat(l),g,O(O({},"".concat(o,"-open"),s),"".concat(o,"-inline"),c)),style:re,tabIndex:-1,ref:U,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case ds.TAB:var r;if(t===ds.TAB)if(n||document.activeElement!==q.current){if(n&&document.activeElement===G.current){var i;null===(i=q.current)||void 0===i||i.focus({preventScroll:!0})}}else null===(r=G.current)||void 0===r||r.focus({preventScroll:!0});break;case ds.ESC:M&&p&&(e.stopPropagation(),M(e))}}},Z,e.createElement("div",{tabIndex:0,ref:G,style:dv,"aria-hidden":"true","data-sentinel":"start"}),ne,e.createElement("div",{tabIndex:0,ref:q,style:dv,"aria-hidden":"true","data-sentinel":"end"})))}var fv=e.forwardRef(pv),gv=function(t){var n=t.open,r=void 0!==n&&n,i=t.prefixCls,a=void 0===i?"rc-drawer":i,o=t.placement,s=void 0===o?"right":o,l=t.autoFocus,c=void 0===l||l,u=t.keyboard,h=void 0===u||u,d=t.width,p=void 0===d?378:d,f=t.mask,g=void 0===f||f,m=t.maskClosable,y=void 0===m||m,v=t.getContainer,b=t.forceRender,x=t.afterOpenChange,w=t.destroyOnClose,E=t.onMouseEnter,k=t.onMouseOver,T=t.onMouseLeave,_=t.onClick,C=t.onKeyDown,S=t.onKeyUp,N=t.panelRef,I=A(e.useState(!1),2),O=I[0],L=I[1],M=A(e.useState(!1),2),R=M[0],P=M[1];Be(function(){P(!0)},[]);var $=!!R&&r,B=e.useRef(),F=e.useRef();Be(function(){$&&(F.current=document.activeElement)},[$]);var z=e.useMemo(function(){return{panel:N}},[N]);if(!b&&!O&&!$&&w)return null;var j={onMouseEnter:E,onMouseOver:k,onMouseLeave:T,onClick:_,onKeyDown:C,onKeyUp:S},H=D(D({},t),{},{open:$,prefixCls:a,placement:s,autoFocus:c,keyboard:h,width:p,mask:g,maskClosable:y,inline:!1===v,afterOpenChange:function(e){var t,n;(L(e),null==x||x(e),e||!F.current||null!==(t=B.current)&&void 0!==t&&t.contains(F.current))||(null===(n=F.current)||void 0===n||n.focus({preventScroll:!0}))},ref:B},j);return e.createElement(lv.Provider,{value:z},e.createElement(uu,{open:$||b||O,autoDestroy:!1,getContainer:v,autoLock:g&&($||O)},e.createElement(fv,H)))};const mv=t=>{var n,r;const{prefixCls:i,title:a,footer:o,extra:s,closable:l,loading:c,onClose:u,headerStyle:h,bodyStyle:d,footerStyle:p,children:f,classNames:g,styles:m}=t,y=Ii("drawer");let v;v=!1===l?void 0:void 0===l||!0===l?"start":"end"===(null==l?void 0:l.placement)?"end":"start";const b=e.useCallback(t=>e.createElement("button",{type:"button",onClick:u,className:en(`${i}-close`,{[`${i}-close-${v}`]:"end"===v})},t),[u,i,v]),[x,w]=xs(ys(t),ys(y),{closable:!0,closeIconRender:b});return e.createElement(e.Fragment,null,(()=>{var t,n;return a||x?e.createElement("div",{style:Object.assign(Object.assign(Object.assign({},null===(t=y.styles)||void 0===t?void 0:t.header),h),null==m?void 0:m.header),className:en(`${i}-header`,{[`${i}-header-close-only`]:x&&!a&&!s},null===(n=y.classNames)||void 0===n?void 0:n.header,null==g?void 0:g.header)},e.createElement("div",{className:`${i}-header-title`},"start"===v&&w,a&&e.createElement("div",{className:`${i}-title`},a)),s&&e.createElement("div",{className:`${i}-extra`},s),"end"===v&&w):null})(),e.createElement("div",{className:en(`${i}-body`,null==g?void 0:g.body,null===(n=y.classNames)||void 0===n?void 0:n.body),style:Object.assign(Object.assign(Object.assign({},null===(r=y.styles)||void 0===r?void 0:r.body),d),null==m?void 0:m.body)},c?e.createElement(Jh,{active:!0,title:!1,paragraph:{rows:5},className:`${i}-body-skeleton`}):f),(()=>{var t,n;if(!o)return null;const r=`${i}-footer`;return e.createElement("div",{className:en(r,null===(t=y.classNames)||void 0===t?void 0:t.footer,null==g?void 0:g.footer),style:Object.assign(Object.assign(Object.assign({},null===(n=y.styles)||void 0===n?void 0:n.footer),p),null==m?void 0:m.footer)},o)})())},yv=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},vv=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),bv=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},vv({opacity:e},{opacity:1})),xv=(e,t)=>[bv(.7,t),vv({transform:yv(e)},{transform:"none"})],wv=e=>{const{componentCls:t,motionDurationSlow:n}=e;return{[t]:{[`${t}-mask-motion`]:bv(0,n),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((e,t)=>Object.assign(Object.assign({},e),{[`&-${t}`]:xv(t,n)}),{})}}},Ev=e=>{const{borderRadiusSM:t,componentCls:n,zIndexPopup:r,colorBgMask:i,colorBgElevated:a,motionDurationSlow:o,motionDurationMid:s,paddingXS:l,padding:c,paddingLG:u,fontSizeLG:h,lineHeightLG:d,lineWidth:p,lineType:f,colorSplit:g,marginXS:m,colorIcon:y,colorIconHover:v,colorBgTextHover:b,colorBgTextActive:x,colorText:w,fontWeightStrong:E,footerPaddingBlock:k,footerPaddingInline:T,calc:_}=e,C=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:r,pointerEvents:"none",color:w,"&-pure":{position:"relative",background:a,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:r,background:i,pointerEvents:"auto"},[C]:{position:"absolute",zIndex:r,maxWidth:"100vw",transition:`all ${o}`,"&-hidden":{display:"none"}},[`&-left > ${C}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${C}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${C}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${C}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:a,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Le(c)} ${Le(u)}`,fontSize:h,lineHeight:d,borderBottom:`${Le(p)} ${f} ${g}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:_(h).add(l).equal(),height:_(h).add(l).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",color:y,fontWeight:E,fontSize:h,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${s}`,textRendering:"auto",[`&${n}-close-end`]:{marginInlineStart:m},[`&:not(${n}-close-end)`]:{marginInlineEnd:m},"&:hover":{color:v,backgroundColor:b,textDecoration:"none"},"&:active":{backgroundColor:x}},va(e)),[`${n}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:h,lineHeight:d},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:u,overflow:"auto",[`${n}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${n}-footer`]:{flexShrink:0,padding:`${Le(k)} ${Le(T)}`,borderTop:`${Le(p)} ${f} ${g}`},"&-rtl":{direction:"rtl"}}}};var kv=wa("Drawer",e=>{const t=Qi(e,{});return[Ev(t),wv(t)]},e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding})),Tv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{rootClassName:n,width:r,height:i,size:a="default",mask:o=!0,push:s=_v,open:l,afterOpenChange:c,onClose:u,prefixCls:h,getContainer:d,panelRef:p=null,style:f,className:g,visible:m,afterVisibleChange:y,maskStyle:v,drawerStyle:b,contentWrapperStyle:x,destroyOnClose:w,destroyOnHidden:E}=t,k=Tv(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),{getPopupContainer:T,getPrefixCls:_,direction:C,className:S,style:A,classNames:N,styles:I}=Ii("drawer"),O=_("drawer",h),[L,M,R]=kv(O),D=void 0===d&&T?()=>T(document.body):d,P=en({"no-mask":!o,[`${O}-rtl`]:"rtl"===C},n,M,R),$=e.useMemo(()=>null!=r?r:"large"===a?736:378,[r,a]),B=e.useMemo(()=>null!=i?i:"large"===a?736:378,[i,a]),F={motionName:Qs(O,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},z=nd(),j=In(p,z),[H,U]=_s("Drawer",k.zIndex),{classNames:G={},styles:q={}}=k;return L(e.createElement(Mh,{form:!0,space:!0},e.createElement(ws.Provider,{value:U},e.createElement(gv,Object.assign({prefixCls:O,onClose:u,maskMotion:F,motion:e=>({motionName:Qs(O,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},k,{classNames:{mask:en(G.mask,N.mask),content:en(G.content,N.content),wrapper:en(G.wrapper,N.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},q.mask),v),I.mask),content:Object.assign(Object.assign(Object.assign({},q.content),b),I.content),wrapper:Object.assign(Object.assign(Object.assign({},q.wrapper),x),I.wrapper)},open:null!=l?l:m,mask:o,push:s,width:$,height:B,style:Object.assign(Object.assign({},A),f),className:en(S,g),rootClassName:P,getContainer:D,afterOpenChange:null!=c?c:y,panelRef:j,zIndex:H,destroyOnClose:null!=E?E:w}),e.createElement(mv,Object.assign({prefixCls:O},k,{onClose:u}))))))};Cv._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:n,style:r,className:i,placement:a="right"}=t,o=Tv(t,["prefixCls","style","className","placement"]),{getPrefixCls:s}=e.useContext(Si),l=s("drawer",n),[c,u,h]=kv(l),d=en(l,`${l}-pure`,`${l}-${a}`,u,h,i);return c(e.createElement("div",{className:d,style:r},e.createElement(mv,Object.assign({prefixCls:l},o))))};var Sv={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Av=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Sv}))},Nv=e.forwardRef(Av);var Iv=wa(["Input","OTP"],e=>(e=>{const{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,[`${t}-input-wrapper`]:{position:"relative",[`${t}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${t}-mask-input`]:{color:"transparent",caretColor:e.colorText},[`${t}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${t}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${t}-input`]:{textAlign:"center",paddingInline:e.paddingXXS},[`&${t}-sm ${t}-input`]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},[`&${t}-lg ${t}-input`]:{paddingInline:e.paddingXS}}}})(Qi(e,jm(e))),Hm),Ov=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{className:r,value:i,onChange:a,onActiveChange:o,index:s,mask:l}=t,c=Ov(t,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:u}=e.useContext(Si),h=u("otp"),d="string"==typeof l?l:i,p=e.useRef(null);e.useImperativeHandle(n,()=>p.current);const f=()=>{mr(()=>{var e;const t=null===(e=p.current)||void 0===e?void 0:e.input;document.activeElement===t&&t&&t.select()})};return e.createElement("span",{className:`${h}-input-wrapper`,role:"presentation"},l&&""!==i&&void 0!==i&&e.createElement("span",{className:`${h}-mask-icon`,"aria-hidden":"true"},d),e.createElement(Wy,Object.assign({"aria-label":`OTP Input ${s+1}`,type:!0===l?"password":"text"},c,{ref:p,value:i,onInput:e=>{a(s,e.target.value)},onFocus:f,onKeyDown:e=>{const{key:t,ctrlKey:n,metaKey:r}=e;"ArrowLeft"===t?o(s-1):"ArrowRight"===t?o(s+1):"z"===t&&(n||r)?e.preventDefault():"Backspace"!==t||i||o(s-1),f()},onMouseDown:f,onMouseUp:f,className:en(r,{[`${h}-mask-input`]:l})})))});var Mv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{index:n,prefixCls:r,separator:i}=t,a="function"==typeof i?i(n):i;return a?e.createElement("span",{className:`${r}-separator`},a):null},Pv=e.forwardRef((t,n)=>{const{prefixCls:r,length:i=6,size:a,defaultValue:o,value:s,onChange:l,formatter:c,separator:u,variant:h,disabled:d,status:p,autoFocus:f,mask:g,type:m,onInput:y,inputMode:v}=t,b=Mv(t,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:x,direction:w}=e.useContext(Si),E=x("otp",r),k=ss(b,{aria:!0,data:!0,attr:!0}),[T,_,C]=Iv(E),S=ll(e=>null!=a?a:e),A=e.useContext(Ih),N=Gf(A.status,p),I=e.useMemo(()=>Object.assign(Object.assign({},A),{status:N,hasFeedback:!1,feedbackIcon:null}),[A,N]),O=e.useRef(null),L=e.useRef({});e.useImperativeHandle(n,()=>({focus:()=>{var e;null===(e=L.current[0])||void 0===e||e.focus()},blur:()=>{var e;for(let t=0;tc?c(e):e,[D,P]=e.useState(()=>Rv(R(o||"")));e.useEffect(()=>{void 0!==s&&P(Rv(s))},[s]);const $=Gi(e=>{P(e),y&&y(e),l&&e.length===i&&e.every(e=>e)&&e.some((e,t)=>D[t]!==e)&&l(e.join(""))}),B=Gi((e,t)=>{let n=M(D);for(let t=0;t=0&&!n[e];e-=1)n.pop();const r=R(n.map(e=>e||" ").join(""));return n=Rv(r).map((e,t)=>" "!==e||n[t]?e:n[t]),n}),F=(e,t)=>{var n;const r=B(e,t),a=Math.min(e+t.length,i-1);a!==e&&void 0!==r[e]&&(null===(n=L.current[a])||void 0===n||n.focus()),$(r)},z=e=>{var t;null===(t=L.current[e])||void 0===t||t.focus()},j={variant:h,disabled:d,status:N,mask:g,type:m,inputMode:v};return T(e.createElement("div",Object.assign({},k,{ref:O,className:en(E,{[`${E}-sm`]:"small"===S,[`${E}-lg`]:"large"===S,[`${E}-rtl`]:"rtl"===w},C,_),role:"group"}),e.createElement(Ih.Provider,{value:I},Array.from({length:i}).map((t,n)=>{const r=`otp-${n}`,a=D[n]||"";return e.createElement(e.Fragment,{key:r},e.createElement(Lv,Object.assign({ref:e=>{L.current[n]=e},index:n,size:S,htmlSize:1,className:`${E}-input`,onChange:F,value:a,onActiveChange:z,autoFocus:0===n&&f},j)),nt?e.createElement(Nv,null):e.createElement(Fv,null),Hv={click:"onClick",hover:"onMouseOver"},Uv=e.forwardRef((t,n)=>{const{disabled:r,action:i="click",visibilityToggle:a=!0,iconRender:s=jv,suffix:l}=t,c=e.useContext(Mi),u=null!=r?r:c,h="object"==typeof a&&void 0!==a.visible,[p,f]=d(()=>!!h&&a.visible),g=o(null);e.useEffect(()=>{h&&f(a.visible)},[h,a]);const m=Gy(g),y=()=>{var e;if(u)return;p&&m();const t=!p;f(t),"object"==typeof a&&(null===(e=a.onVisibleChange)||void 0===e||e.call(a,t))},{className:v,prefixCls:b,inputPrefixCls:x,size:w}=t,E=zv(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:k}=e.useContext(Si),T=k("input",x),_=k("input-password",b),C=a&&(t=>{const n=Hv[i]||"",r=s(p),a={[n]:y,className:`${t}-icon`,key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}};return e.cloneElement(e.isValidElement(r)?r:e.createElement("span",null,r),a)})(_),S=en(_,v,{[`${_}-${w}`]:!!w}),A=Object.assign(Object.assign({},Zs(E,["suffix","iconRender","visibilityToggle"])),{type:p?"text":"password",className:S,prefixCls:T,suffix:e.createElement(e.Fragment,null,C,l)});return w&&(A.size=w),e.createElement(Wy,Object.assign({ref:In(n,g)},A))});var Gv=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,inputPrefixCls:i,className:a,size:o,suffix:s,enterButton:l=!1,addonAfter:c,loading:u,disabled:h,onSearch:d,onChange:p,onCompositionStart:f,onCompositionEnd:g,variant:m,onPressEnter:y}=t,v=Gv(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:b,direction:x}=e.useContext(Si),w=e.useRef(!1),E=b("input-search",r),k=b("input",i),{compactSize:T}=ul(E,x),_=ll(e=>{var t;return null!==(t=null!=o?o:T)&&void 0!==t?t:e}),C=e.useRef(null),S=e=>{var t;document.activeElement===(null===(t=C.current)||void 0===t?void 0:t.input)&&e.preventDefault()},A=e=>{var t,n;d&&d(null===(n=null===(t=C.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},N="boolean"==typeof l?e.createElement(Mg,null):null,I=`${E}-button`;let O;const L=l||{},M=L.type&&!0===L.type.__ANT_BUTTON;O=M||"button"===L.type?us(L,Object.assign({onMouseDown:S,onClick:e=>{var t,n;null===(n=null===(t=null==L?void 0:L.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),A(e)},key:"enterButton"},M?{className:I,size:_}:{})):e.createElement(Kc,{className:I,color:l?"primary":"default",size:_,disabled:h,key:"enterButton",onMouseDown:S,onClick:A,loading:u,icon:N,variant:"borderless"===m||"filled"===m||"underlined"===m?"text":l?"solid":void 0},l),c&&(O=[O,us(c,{key:"addonAfter"})]);const R=en(E,{[`${E}-rtl`]:"rtl"===x,[`${E}-${_}`]:!!_,[`${E}-with-button`]:!!l},a),D=Object.assign(Object.assign({},v),{className:R,prefixCls:k,type:"search",size:_,variant:m,onPressEnter:e=>{w.current||u||(null==y||y(e),A(e))},onCompositionStart:e=>{w.current=!0,null==f||f(e)},onCompositionEnd:e=>{w.current=!1,null==g||g(e)},addonAfter:O,suffix:s,onChange:e=>{(null==e?void 0:e.target)&&"click"===e.type&&d&&d(e.target.value,e,{source:"clear"}),null==p||p(e)},disabled:h});return e.createElement(Wy,Object.assign({ref:In(C,n)},D))});var Wv,Vv=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Yv={};function Xv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Wv||((Wv=document.createElement("textarea")).setAttribute("tab-index","-1"),Wv.setAttribute("aria-hidden","true"),Wv.setAttribute("name","hiddenTextarea"),document.body.appendChild(Wv)),e.getAttribute("wrap")?Wv.setAttribute("wrap",e.getAttribute("wrap")):Wv.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Yv[n])return Yv[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=Vv.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),l={sizingStyle:s,paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(Yv[n]=l),l}(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,l=i.sizingStyle;Wv.setAttribute("style","".concat(l,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),Wv.value=e.value||e.placeholder||"";var c,u=void 0,h=void 0,d=Wv.scrollHeight;if("border-box"===s?d+=o:"content-box"===s&&(d-=a),null!==n||null!==r){Wv.value=" ";var p=Wv.scrollHeight-a;null!==n&&(u=p*n,"border-box"===s&&(u=u+a+o),d=Math.max(u,d)),null!==r&&(h=p*r,"border-box"===s&&(h=h+a+o),c=d>h?"":"hidden",d=Math.min(h,d))}var f={height:d,overflowY:c,resize:"none"};return u&&(f.minHeight=u),h&&(f.maxHeight=h),f}var Kv=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Qv=e.forwardRef(function(t,n){var r=t,i=r.prefixCls,a=r.defaultValue,o=r.value,s=r.autoSize,l=r.onResize,c=r.className,u=r.style,h=r.disabled,d=r.onChange;r.onInternalAutoSize;var p=X(r,Kv),f=A(Vi(a,{value:o,postState:function(e){return null!=e?e:""}}),2),g=f[0],m=f[1],y=e.useRef();e.useImperativeHandle(n,function(){return{textArea:y.current}});var v=A(e.useMemo(function(){return s&&"object"===N(s)?[s.minRows,s.maxRows]:[]},[s]),2),b=v[0],x=v[1],w=!!s,E=A(e.useState(2),2),k=E[0],T=E[1],_=A(e.useState(),2),C=_[0],S=_[1],I=function(){T(0)};Be(function(){w&&I()},[o,b,x,w]),Be(function(){if(0===k)T(1);else if(1===k){var e=Xv(y.current,!1,b,x);T(2),S(e)}},[k]);var L=e.useRef(),M=function(){mr.cancel(L.current)};e.useEffect(function(){return M},[]);var R=w?C:null,P=D(D({},u),R);return 0!==k&&1!==k||(P.overflowY="hidden",P.overflowX="hidden"),e.createElement(ur,{onResize:function(e){2===k&&(null==l||l(e),s&&(M(),L.current=mr(function(){I()})))},disabled:!(s||l)},e.createElement("textarea",Xe({},p,{ref:y,style:P,className:en(i,c,O({},"".concat(i,"-disabled"),h)),disabled:h,value:g,onChange:function(e){m(e.target.value),null==d||d(e)}})))}),Zv=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],Jv=t.forwardRef(function(e,n){var r,i=e.defaultValue,a=e.value,s=e.onFocus,c=e.onBlur,u=e.onChange,h=e.allowClear,d=e.maxLength,p=e.onCompositionStart,f=e.onCompositionEnd,m=e.suffix,y=e.prefixCls,v=void 0===y?"rc-textarea":y,b=e.showCount,x=e.count,w=e.className,E=e.style,k=e.disabled,T=e.hidden,_=e.classNames,C=e.styles,S=e.onResize,N=e.onClear,I=e.onPressEnter,L=e.readOnly,R=e.autoSize,P=e.onKeyDown,$=X(e,Zv),B=A(Vi(i,{value:a,defaultValue:i}),2),F=B[0],z=B[1],j=null==F?"":String(F),H=A(t.useState(!1),2),U=H[0],G=H[1],q=t.useRef(!1),W=A(t.useState(null),2),V=W[0],Y=W[1],K=o(null),Q=o(null),Z=function(){var e;return null===(e=Q.current)||void 0===e?void 0:e.textArea},J=function(){Z().focus()};g(n,function(){var e;return{resizableTextArea:Q.current,focus:J,blur:function(){Z().blur()},nativeElement:(null===(e=K.current)||void 0===e?void 0:e.nativeElement)||Z()}}),l(function(){G(function(e){return!k&&e})},[k]);var ee=A(t.useState(null),2),te=ee[0],ne=ee[1];t.useEffect(function(){var e;te&&(e=Z()).setSelectionRange.apply(e,M(te))},[te]);var re,ie=zy(x,b),ae=null!==(r=ie.max)&&void 0!==r?r:d,oe=Number(ae)>0,se=ie.strategy(j),le=!!ae&&se>ae,ce=function(e,t){var n=t;!q.current&&ie.exceedFormatter&&ie.max&&ie.strategy(t)>ie.max&&t!==(n=ie.exceedFormatter(t,{max:ie.max}))&&ne([Z().selectionStart||0,Z().selectionEnd||0]),z(n),Py(e.currentTarget,e,u,n)},ue=m;ie.show&&(re=ie.showFormatter?ie.showFormatter({value:j,count:se,maxLength:ae}):"".concat(se).concat(oe?" / ".concat(ae):""),ue=t.createElement(t.Fragment,null,ue,t.createElement("span",{className:en("".concat(v,"-data-count"),null==_?void 0:_.count),style:null==C?void 0:C.count},re)));var he=!R&&!b&&!h;return t.createElement(By,{ref:K,value:j,allowClear:h,handleReset:function(e){z(""),J(),Py(Z(),e,u)},suffix:ue,prefixCls:v,classNames:D(D({},_),{},{affixWrapper:en(null==_?void 0:_.affixWrapper,O(O({},"".concat(v,"-show-count"),b),"".concat(v,"-textarea-allow-clear"),h))}),disabled:k,focused:U,className:en(w,le&&"".concat(v,"-out-of-range")),style:D(D({},E),V&&!he?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof re?re:void 0}},hidden:T,readOnly:L,onClear:N},t.createElement(Qv,Xe({},$,{autoSize:R,maxLength:d,onKeyDown:function(e){"Enter"===e.key&&I&&I(e),null==P||P(e)},onChange:function(e){ce(e,e.target.value)},onFocus:function(e){G(!0),null==s||s(e)},onBlur:function(e){G(!1),null==c||c(e)},onCompositionStart:function(e){q.current=!0,null==p||p(e)},onCompositionEnd:function(e){q.current=!1,ce(e,e.currentTarget.value),null==f||f(e)},className:en(null==_?void 0:_.textarea),style:D(D({},null==C?void 0:C.textarea),{},{resize:null==E?void 0:E.resize}),disabled:k,prefixCls:v,onResize:function(e){var t;null==S||S(e),null!==(t=Z())&&void 0!==t&&t.style.height&&Y(!0)},ref:Q,readOnly:L})))});var eb=wa(["Input","TextArea"],e=>(e=>{const{componentCls:t,paddingLG:n}=e,r=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[r]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`\n &-allow-clear > ${t},\n &-affix-wrapper${r}-has-feedback ${t}\n `]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}})(Qi(e,jm(e))),Hm,{resetFont:!1}),tb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;const{prefixCls:i,bordered:a=!0,size:o,disabled:s,status:l,allowClear:c,classNames:u,rootClassName:h,className:d,style:p,styles:f,variant:g,showCount:m,onMouseDown:y,onResize:v}=t,b=tb(t,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:x,direction:w,allowClear:E,autoComplete:k,className:T,style:_,classNames:C,styles:S}=Ii("textArea"),A=e.useContext(Mi),N=null!=s?s:A,{status:I,hasFeedback:O,feedbackIcon:L}=e.useContext(Ih),M=Gf(I,l),R=e.useRef(null);e.useImperativeHandle(n,()=>{var e;return{resizableTextArea:null===(e=R.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;$y(null===(n=null===(t=R.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=R.current)||void 0===e?void 0:e.blur()}}});const D=x("input",i),P=hs(D),[$,B,F]=gy(D,h),[z]=eb(D,P),{compactSize:j,compactItemClassnames:H}=ul(D,w),U=ll(e=>{var t;return null!==(t=null!=o?o:j)&&void 0!==t?t:e}),[G,q]=Jf("textArea",g,a),W=Uy(null!=c?c:E),[V,Y]=e.useState(!1),[X,K]=e.useState(!1);return $(z(e.createElement(Jv,Object.assign({autoComplete:k},b,{style:Object.assign(Object.assign({},_),p),styles:Object.assign(Object.assign({},S),f),disabled:N,allowClear:W,className:en(F,P,d,h,H,T,X&&`${D}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},u),C),{textarea:en({[`${D}-sm`]:"small"===U,[`${D}-lg`]:"large"===U},B,null==u?void 0:u.textarea,C.textarea,V&&`${D}-mouse-active`),variant:en({[`${D}-${G}`]:q},Uf(D,M)),affixWrapper:en(`${D}-textarea-affix-wrapper`,{[`${D}-affix-wrapper-rtl`]:"rtl"===w,[`${D}-affix-wrapper-sm`]:"small"===U,[`${D}-affix-wrapper-lg`]:"large"===U,[`${D}-textarea-show-count`]:m||(null===(r=t.count)||void 0===r?void 0:r.show)},B)}),prefixCls:D,suffix:O&&e.createElement("span",{className:`${D}-textarea-suffix`},L),showCount:m,ref:R,onResize:e=>{var t,n;if(null==v||v(e),V&&"function"==typeof getComputedStyle){const e=null===(n=null===(t=R.current)||void 0===t?void 0:t.nativeElement)||void 0===n?void 0:n.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&K(!0)}},onMouseDown:e=>{Y(!0),null==y||y(e);const t=()=>{Y(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}}))))}),rb=Wy;rb.Group=t=>{const{getPrefixCls:r,direction:i}=n(Si),{prefixCls:a,className:o}=t,s=r("input-group",a),l=r("input"),[c,u,d]=my(l),p=en(s,d,{[`${s}-lg`]:"large"===t.size,[`${s}-sm`]:"small"===t.size,[`${s}-compact`]:t.compact,[`${s}-rtl`]:"rtl"===i},u,o),f=n(Ih),g=h(()=>Object.assign(Object.assign({},f),{isFormItemInput:!1}),[f]);return c(e.createElement("span",{className:p,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},e.createElement(Ih.Provider,{value:g},t.children)))},rb.Search=qv,rb.TextArea=nb,rb.Password=Uv,rb.OTP=Pv;var ib=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.forwardRef((i,a)=>e.createElement(r,Object.assign({ref:a,suffixCls:t,tagName:n},i)))}const ob=e.forwardRef((t,n)=>{const{prefixCls:r,suffixCls:i,className:a,tagName:o}=t,s=ib(t,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:l}=e.useContext(Si),c=l("layout",r),[u,h,d]=Cm(c),p=i?`${c}-${i}`:c;return u(e.createElement(o,Object.assign({className:en(r||p,a,h,d),ref:n},s)))}),sb=e.forwardRef((t,n)=>{const{direction:r}=e.useContext(Si),[i,a]=e.useState([]),{prefixCls:o,className:s,rootClassName:l,children:c,hasSider:u,tagName:h,style:d}=t,p=Zs(ib(t,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),["suffixCls"]),{getPrefixCls:f,className:g,style:m}=Ii("layout"),y=f("layout",o),v=function(e,t,n){return"boolean"==typeof n?n:!!e.length||on(t).some(e=>e.type===Lm)}(i,c,u),[b,x,w]=Cm(y),E=en(y,{[`${y}-has-sider`]:v,[`${y}-rtl`]:"rtl"===r},g,s,l,x,w),k=e.useMemo(()=>({siderHook:{addSider:e=>{a(t=>[].concat(M(t),[e]))},removeSider:e=>{a(t=>t.filter(t=>t!==e))}}}),[]);return b(e.createElement(km.Provider,{value:k},e.createElement(h,Object.assign({ref:n,className:E,style:Object.assign(Object.assign({},m),d)},p),c)))}),lb=ab({tagName:"div",displayName:"Layout"})(sb),cb=ab({suffixCls:"header",tagName:"header",displayName:"Header"})(ob),ub=ab({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(ob),hb=ab({suffixCls:"content",tagName:"main",displayName:"Content"})(ob),db=lb;db.Header=cb,db.Footer=ub,db.Content=hb,db.Sider=Lm,db._InternalSiderContext=Im;var pb={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},fb=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:pb}))},gb=e.forwardRef(fb),mb={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},yb=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:mb}))},vb=e.forwardRef(yb),bb={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},xb=[10,20,50,100],wb=function(e){var n=e.pageSizeOptions,r=void 0===n?xb:n,i=e.locale,a=e.changeSize,o=e.pageSize,s=e.goButton,l=e.quickGo,c=e.rootPrefixCls,u=e.disabled,h=e.buildOptionText,d=e.showSizeChanger,p=e.sizeChangerRender,f=A(t.useState(""),2),g=f[0],m=f[1],y=function(){return!g||Number.isNaN(g)?void 0:Number(g)},v="function"==typeof h?h:function(e){return"".concat(e," ").concat(i.items_per_page)},b=function(e){""!==g&&(e.keyCode!==ds.ENTER&&"click"!==e.type||(m(""),null==l||l(y())))},x="".concat(c,"-options");if(!d&&!l)return null;var w=null,E=null,k=null;return d&&p&&(w=p({disabled:u,size:o,onSizeChange:function(e){null==a||a(Number(e))},"aria-label":i.page_size,className:"".concat(x,"-size-changer"),options:(r.some(function(e){return e.toString()===o.toString()})?r:r.concat([o]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e){return{label:v(e),value:e}})})),l&&(s&&(k="boolean"==typeof s?t.createElement("button",{type:"button",onClick:b,onKeyUp:b,disabled:u,className:"".concat(x,"-quick-jumper-button")},i.jump_to_confirm):t.createElement("span",{onClick:b,onKeyUp:b},s)),E=t.createElement("div",{className:"".concat(x,"-quick-jumper")},i.jump_to,t.createElement("input",{disabled:u,type:"text",value:g,onChange:function(e){m(e.target.value)},onKeyUp:b,onBlur:function(e){s||""===g||(m(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(c,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(c,"-item"))>=0)||null==l||l(y()))},"aria-label":i.page}),i.page,k)),t.createElement("li",{className:x},w,E)},Eb=function(e){var n=e.rootPrefixCls,r=e.page,i=e.active,a=e.className,o=e.showTitle,s=e.onClick,l=e.onKeyPress,c=e.itemRender,u="".concat(n,"-item"),h=en(u,"".concat(u,"-").concat(r),O(O({},"".concat(u,"-active"),i),"".concat(u,"-disabled"),!r),a),d=c(r,"page",t.createElement("a",{rel:"nofollow"},r));return d?t.createElement("li",{title:o?String(r):null,className:h,onClick:function(){s(r)},onKeyDown:function(e){l(e,s,r)},tabIndex:0},d):null},kb=function(e,t,n){return n};function Tb(){}function _b(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function Cb(e,t,n){var r=void 0===e?t:e;return Math.floor((n-1)/r)+1}var Sb=function(e){var n=e.prefixCls,r=void 0===n?"rc-pagination":n,i=e.selectPrefixCls,a=void 0===i?"rc-select":i,o=e.className,s=e.current,c=e.defaultCurrent,u=void 0===c?1:c,h=e.total,d=void 0===h?0:h,p=e.pageSize,f=e.defaultPageSize,g=void 0===f?10:f,m=e.onChange,y=void 0===m?Tb:m,v=e.hideOnSinglePage,b=e.align,x=e.showPrevNextJumpers,w=void 0===x||x,E=e.showQuickJumper,k=e.showLessItems,T=e.showTitle,_=void 0===T||T,C=e.onShowSizeChange,S=void 0===C?Tb:C,I=e.locale,L=void 0===I?bb:I,M=e.style,R=e.totalBoundaryShowSizeChanger,P=void 0===R?50:R,$=e.disabled,B=e.simple,F=e.showTotal,z=e.showSizeChanger,j=void 0===z?d>P:z,H=e.sizeChangerRender,U=e.pageSizeOptions,G=e.itemRender,q=void 0===G?kb:G,W=e.jumpPrevIcon,V=e.jumpNextIcon,Y=e.prevIcon,X=e.nextIcon,K=t.useRef(null),Q=A(Vi(10,{value:p,defaultValue:g}),2),Z=Q[0],J=Q[1],ee=A(Vi(1,{value:s,defaultValue:u,postState:function(e){return Math.max(1,Math.min(e,Cb(void 0,Z,d)))}}),2),te=ee[0],ne=ee[1],re=A(t.useState(te),2),ie=re[0],ae=re[1];l(function(){ae(te)},[te]);var oe=Math.max(1,te-(k?3:5)),se=Math.min(Cb(void 0,Z,d),te+(k?3:5));function le(n,i){var a=n||t.createElement("button",{type:"button","aria-label":i,className:"".concat(r,"-item-link")});return"function"==typeof n&&(a=t.createElement(n,D({},e))),a}function ce(e){var t=e.target.value,n=Cb(void 0,Z,d);return""===t?t:Number.isNaN(Number(t))?ie:t>=n?n:Number(t)}var ue=d>Z&&E;function he(e){var t=ce(e);switch(t!==ie&&ae(t),e.keyCode){case ds.ENTER:de(t);break;case ds.UP:de(t-1);break;case ds.DOWN:de(t+1)}}function de(e){if(function(e){return _b(e)&&e!==te&&_b(d)&&d>0}(e)&&!$){var t=Cb(void 0,Z,d),n=e;return e>t?n=t:e<1&&(n=1),n!==ie&&ae(n),ne(n),null==y||y(n,Z),n}return te}var pe=te>1,fe=te2?n-2:0),i=2;id?d:te*Z])),Te=null,_e=Cb(void 0,Z,d);if(v&&d<=Z)return null;var Ce=[],Se={rootPrefixCls:r,onClick:de,onKeyPress:be,showTitle:_,itemRender:q,page:-1},Ae=te-1>0?te-1:0,Ne=te+1<_e?te+1:_e,Ie=E&&E.goButton,Oe="object"===N(B)?B.readOnly:!B,Le=Ie,Me=null;B&&(Ie&&(Le="boolean"==typeof Ie?t.createElement("button",{type:"button",onClick:xe,onKeyUp:xe},L.jump_to_confirm):t.createElement("span",{onClick:xe,onKeyUp:xe},Ie),Le=t.createElement("li",{title:_?"".concat(L.jump_to).concat(te,"/").concat(_e):null,className:"".concat(r,"-simple-pager")},Le)),Me=t.createElement("li",{title:_?"".concat(te,"/").concat(_e):null,className:"".concat(r,"-simple-pager")},Oe?ie:t.createElement("input",{type:"text","aria-label":L.jump_to,value:ie,disabled:$,onKeyDown:function(e){e.keyCode!==ds.UP&&e.keyCode!==ds.DOWN||e.preventDefault()},onKeyUp:he,onChange:he,onBlur:function(e){de(ce(e))},size:3}),t.createElement("span",{className:"".concat(r,"-slash")},"/"),_e));var Re=k?1:2;if(_e<=3+2*Re){_e||Ce.push(t.createElement(Eb,Xe({},Se,{key:"noPager",page:1,className:"".concat(r,"-item-disabled")})));for(var De=1;De<=_e;De+=1)Ce.push(t.createElement(Eb,Xe({},Se,{key:De,page:De,active:te===De})))}else{var Pe=k?L.prev_3:L.prev_5,$e=k?L.next_3:L.next_5,Be=q(oe,"jump-prev",le(W,"prev page")),Fe=q(se,"jump-next",le(V,"next page"));w&&(we=Be?t.createElement("li",{title:_?Pe:null,key:"prev",onClick:ye,tabIndex:0,onKeyDown:function(e){be(e,ye)},className:en("".concat(r,"-jump-prev"),O({},"".concat(r,"-jump-prev-custom-icon"),!!W))},Be):null,Te=Fe?t.createElement("li",{title:_?$e:null,key:"next",onClick:ve,tabIndex:0,onKeyDown:function(e){be(e,ve)},className:en("".concat(r,"-jump-next"),O({},"".concat(r,"-jump-next-custom-icon"),!!V))},Fe):null);var ze=Math.max(1,te-Re),je=Math.min(te+Re,_e);te-1<=Re&&(je=1+2*Re),_e-te<=Re&&(ze=_e-2*Re);for(var He=ze;He<=je;He+=1)Ce.push(t.createElement(Eb,Xe({},Se,{key:He,page:He,active:te===He})));if(te-1>=2*Re&&3!==te&&(Ce[0]=t.cloneElement(Ce[0],{className:en("".concat(r,"-item-after-jump-prev"),Ce[0].props.className)}),Ce.unshift(we)),_e-te>=2*Re&&te!==_e-2){var Ue=Ce[Ce.length-1];Ce[Ce.length-1]=t.cloneElement(Ue,{className:en("".concat(r,"-item-before-jump-next"),Ue.props.className)}),Ce.push(Te)}1!==ze&&Ce.unshift(t.createElement(Eb,Xe({},Se,{key:1,page:1}))),je!==_e&&Ce.push(t.createElement(Eb,Xe({},Se,{key:_e,page:_e})))}var Ge=function(e){var n=q(e,"prev",le(Y,"prev page"));return t.isValidElement(n)?t.cloneElement(n,{disabled:!pe}):n}(Ae);if(Ge){var qe=!pe||!_e;Ge=t.createElement("li",{title:_?L.prev_page:null,onClick:ge,tabIndex:qe?null:0,onKeyDown:function(e){be(e,ge)},className:en("".concat(r,"-prev"),O({},"".concat(r,"-disabled"),qe)),"aria-disabled":qe},Ge)}var We,Ve,Ye=function(e){var n=q(e,"next",le(X,"next page"));return t.isValidElement(n)?t.cloneElement(n,{disabled:!fe}):n}(Ne);Ye&&(B?(We=!fe,Ve=pe?0:null):Ve=(We=!fe||!_e)?null:0,Ye=t.createElement("li",{title:_?L.next_page:null,onClick:me,tabIndex:Ve,onKeyDown:function(e){be(e,me)},className:en("".concat(r,"-next"),O({},"".concat(r,"-disabled"),We)),"aria-disabled":We},Ye));var Ke=en(r,o,O(O(O(O(O({},"".concat(r,"-start"),"start"===b),"".concat(r,"-center"),"center"===b),"".concat(r,"-end"),"end"===b),"".concat(r,"-simple"),B),"".concat(r,"-disabled"),$));return t.createElement("ul",Xe({className:Ke,style:M,ref:K},Ee),ke,Ge,B?Me:Ce,Ye,t.createElement(wb,{locale:L,rootPrefixCls:r,disabled:$,selectPrefixCls:a,changeSize:function(e){var t=Cb(e,Z,d),n=te>t&&0!==t?t:te;J(e),ae(n),null==S||S(te,e),ne(n),null==y||y(n,e)},pageSize:Z,pageSizeOptions:U,quickGo:ue?de:null,goButton:Le,showSizeChanger:j,sizeChangerRender:H}))};const Ab=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Nb=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:Le(e.calc(e.itemSizeSM).sub(2).equal())},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`\n &${t}-mini ${t}-prev ${t}-item-link,\n &${t}-mini ${t}-next ${t}-item-link\n `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:Le(e.itemSizeSM)},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM),input:Object.assign(Object.assign({},oy(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},Ib=e=>{const{componentCls:t}=e;return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSize,lineHeight:Le(e.itemSize),verticalAlign:"top",[`${t}-item-link`]:{height:e.itemSize,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSize,lineHeight:Le(e.itemSize)}}},[`${t}-simple-pager`]:{display:"inline-flex",alignItems:"center",height:e.itemSize,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",width:e.quickJumperInputWidth,padding:`0 ${Le(e.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${Le(e.inputOutlineOffset)} 0 ${Le(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}},[`&${t}-mini`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM),[`${t}-item-link`]:{height:e.itemSizeSM,"&::after":{height:e.itemSizeSM,lineHeight:Le(e.itemSizeSM)}}},[`${t}-simple-pager`]:{height:e.itemSizeSM,input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},Ob=e=>{const{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`\n ${t}-prev,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{marginInlineEnd:e.marginXS},[`\n ${t}-prev,\n ${t}-next,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:Le(e.itemSize),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Le(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:Le(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},sy(e)),qm(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},Gm(e)),width:e.quickJumperInputWidth,height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},Lb=e=>{const{componentCls:t}=e;return{[`${t}-item`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:Le(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:e.itemBg,border:`${Le(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Le(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.itemActiveColor},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.itemActiveColorHover}}}}},Mb=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ma(e)),{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"&-start":{justifyContent:"start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"end"},"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:Le(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),Lb(e)),Ob(e)),Ib(e)),Nb(e)),Ab(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}}),[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},Rb=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},va(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},ya(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:ya(e)}}}},Db=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemActiveColor:e.colorPrimary,itemActiveColorHover:e.colorPrimaryHover,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},Hm(e)),Pb=e=>Qi(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},jm(e));var $b=wa("Pagination",e=>{const t=Pb(e);return[Mb(t),Rb(t)]},Db);var Bb=ka(["Pagination","bordered"],e=>(e=>{const{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}${t}-bordered:not(${t}-mini)`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}})(Pb(e)),Db);function Fb(e){return h(()=>"boolean"==typeof e?[e,{}]:e&&"object"==typeof e?[!0,e]:[void 0,void 0],[e])}var zb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{align:n,prefixCls:r,selectPrefixCls:i,className:a,rootClassName:o,style:s,size:l,locale:c,responsive:u,showSizeChanger:h,selectComponentClass:d,pageSizeOptions:p}=t,f=zb(t,["align","prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","responsive","showSizeChanger","selectComponentClass","pageSizeOptions"]),{xs:g}=Gg(u),[,m]=fa(),{getPrefixCls:y,direction:v,showSizeChanger:b,className:x,style:w}=Ii("pagination"),E=y("pagination",r),[k,T,_]=$b(E),C=ll(l),S="small"===C||!(!g||C||!u),[A]=zr("Pagination",Nr),N=Object.assign(Object.assign({},A),c),[I,O]=Fb(h),[L,M]=Fb(b),R=null!=I?I:L,D=null!=O?O:M,P=d||$g,$=e.useMemo(()=>p?p.map(e=>Number(e)):void 0,[p]),B=e.useMemo(()=>{const t=e.createElement("span",{className:`${E}-item-ellipsis`},"•••");return{prevIcon:e.createElement("button",{className:`${E}-item-link`,type:"button",tabIndex:-1},"rtl"===v?e.createElement(Rl,null):e.createElement(bm,null)),nextIcon:e.createElement("button",{className:`${E}-item-link`,type:"button",tabIndex:-1},"rtl"===v?e.createElement(bm,null):e.createElement(Rl,null)),jumpPrevIcon:e.createElement("a",{className:`${E}-item-link`},e.createElement("div",{className:`${E}-item-container`},"rtl"===v?e.createElement(vb,{className:`${E}-item-link-icon`}):e.createElement(gb,{className:`${E}-item-link-icon`}),t)),jumpNextIcon:e.createElement("a",{className:`${E}-item-link`},e.createElement("div",{className:`${E}-item-container`},"rtl"===v?e.createElement(gb,{className:`${E}-item-link-icon`}):e.createElement(vb,{className:`${E}-item-link-icon`}),t))}},[v,E]),F=y("select",i),z=en({[`${E}-${n}`]:!!n,[`${E}-mini`]:S,[`${E}-rtl`]:"rtl"===v,[`${E}-bordered`]:m.wireframe},x,a,o,T,_),j=Object.assign(Object.assign({},w),s);return k(e.createElement(e.Fragment,null,m.wireframe&&e.createElement(Bb,{prefixCls:E}),e.createElement(Sb,Object.assign({},B,f,{style:j,prefixCls:E,selectPrefixCls:F,className:z,locale:N,pageSizeOptions:$,showSizeChanger:R,sizeChangerRender:t=>{var n;const{disabled:r,size:i,onSizeChange:a,"aria-label":o,className:s,options:l}=t,{className:c,onChange:u}=D||{},h=null===(n=l.find(e=>String(e.value)===String(i)))||void 0===n?void 0:n.value;return e.createElement(P,Object.assign({disabled:r,showSearch:!0,popupMatchSelectWidth:!1,getPopupContainer:e=>e.parentNode,"aria-label":o,options:l},D,{value:h,onChange:(e,t)=>{null==a||a(e),null==u||u(e,t)},size:S?"small":"middle",className:en(s,c)}))}}))))},Hb=80*Math.PI,Ub=t=>{const{dotClassName:n,style:r,hasCircleCls:i}=t;return e.createElement("circle",{className:en(`${n}-circle`,{[`${n}-circle-bg`]:i}),r:40,cx:50,cy:50,strokeWidth:20,style:r})},Gb=({percent:t,prefixCls:n})=>{const r=`${n}-dot`,i=`${r}-holder`,a=`${i}-hidden`,[o,s]=e.useState(!1);Be(()=>{0!==t&&s(!0)},[0!==t]);const l=Math.max(Math.min(t,100),0);if(!o)return null;const c={strokeDashoffset:""+Hb/4,strokeDasharray:`${Hb*l/100} ${Hb*(100-l)/100}`};return e.createElement("span",{className:en(i,`${r}-progress`,l<=0&&a)},e.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":l},e.createElement(Ub,{dotClassName:r,hasCircleCls:!0}),e.createElement(Ub,{dotClassName:r,style:c})))};function qb(t){const{prefixCls:n,percent:r=0}=t,i=`${n}-dot`,a=`${i}-holder`,o=`${a}-hidden`;return e.createElement(e.Fragment,null,e.createElement("span",{className:en(a,r>0&&o)},e.createElement("span",{className:en(i,`${n}-dot-spin`)},[1,2,3,4].map(t=>e.createElement("i",{className:`${n}-dot-item`,key:t})))),e.createElement(Gb,{prefixCls:n,percent:r}))}function Wb(t){var n;const{prefixCls:r,indicator:i,percent:a}=t,o=`${r}-dot`;return i&&e.isValidElement(i)?us(i,{className:en(null===(n=i.props)||void 0===n?void 0:n.className,o),percent:a}):e.createElement(qb,{prefixCls:r,percent:a})}const Vb=new Xt("antSpinMove",{to:{opacity:1}}),Yb=new Xt("antRotate",{to:{transform:"rotate(405deg)"}});var Xb=wa("Spin",e=>(e=>{const{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},ma(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Vb,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Yb,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})(Qi(e,{spinDotDefault:e.colorTextDescription})),e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}});const Kb=[[30,.05],[70,.03],[96,.01]];var Qb=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var n;const{prefixCls:r,spinning:i=!0,delay:a=0,className:o,rootClassName:s,size:l="default",tip:c,wrapperClassName:u,style:h,children:d,fullscreen:p=!1,indicator:f,percent:g}=t,m=Qb(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:y,direction:v,className:b,style:x,indicator:w}=Ii("spin"),E=y("spin",r),[k,T,_]=Xb(E),[C,S]=e.useState(()=>i&&!function(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}(i,a)),A=function(t,n){const[r,i]=e.useState(0),a=e.useRef(null),o="auto"===n;return e.useEffect(()=>(o&&t&&(i(0),a.current=setInterval(()=>{i(e=>{const t=100-e;for(let n=0;n{a.current&&(clearInterval(a.current),a.current=null)}),[o,t]),o?r:n}(C,g);e.useEffect(()=>{if(i){const e=yy(a,()=>{S(!0)});return e(),()=>{var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}}S(!1)},[a,i]);const N=e.useMemo(()=>void 0!==d&&!p,[d,p]),I=en(E,b,{[`${E}-sm`]:"small"===l,[`${E}-lg`]:"large"===l,[`${E}-spinning`]:C,[`${E}-show-text`]:!!c,[`${E}-rtl`]:"rtl"===v},o,!p&&s,T,_),O=en(`${E}-container`,{[`${E}-blur`]:C}),L=null!==(n=null!=f?f:w)&&void 0!==n?n:Zb,M=Object.assign(Object.assign({},x),h),R=e.createElement("div",Object.assign({},m,{style:M,className:I,"aria-live":"polite","aria-busy":C}),e.createElement(Wb,{prefixCls:E,indicator:L,percent:A}),c&&(N||p)?e.createElement("div",{className:`${E}-text`},c):null);return k(N?e.createElement("div",Object.assign({},m,{className:en(`${E}-nested-loading`,u,T,_)}),C&&e.createElement("div",{key:"loading"},R),e.createElement("div",{className:O,key:"container"},d)):p?e.createElement("div",{className:en(`${E}-fullscreen`,{[`${E}-fullscreen-show`]:C},s,T,_)},R):R)};Jb.setDefaultIndicator=e=>{Zb=e};const ex=t.createContext({});ex.Consumer;var tx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:i,children:a,actions:o,extra:s,styles:l,className:c,classNames:u,colStyle:h}=e,d=tx(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:f,itemLayout:g}=n(ex),{getPrefixCls:m,list:y}=n(Si),v=e=>{var t,n;return en(null===(n=null===(t=null==y?void 0:y.item)||void 0===t?void 0:t.classNames)||void 0===n?void 0:n[e],null==u?void 0:u[e])},b=e=>{var t,n;return Object.assign(Object.assign({},null===(n=null===(t=null==y?void 0:y.item)||void 0===t?void 0:t.styles)||void 0===n?void 0:n[e]),null==l?void 0:l[e])},x=m("list",i),w=o&&o.length>0&&t.createElement("ul",{className:en(`${x}-item-action`,v("actions")),key:"actions",style:b("actions")},o.map((e,n)=>t.createElement("li",{key:`${x}-item-action-${n}`},e,n!==o.length-1&&t.createElement("em",{className:`${x}-item-action-split`})))),E=f?"div":"li",k=t.createElement(E,Object.assign({},d,f?{}:{ref:r},{className:en(`${x}-item`,{[`${x}-item-no-flex`]:!("vertical"===g?s:!(()=>{let e=!1;return p.forEach(a,t=>{"string"==typeof t&&(e=!0)}),e&&p.count(a)>1})())},c)}),"vertical"===g&&s?[t.createElement("div",{className:`${x}-item-main`,key:"content"},a,w),t.createElement("div",{className:en(`${x}-item-extra`,v("extra")),key:"extra",style:b("extra")},s)]:[a,w,us(s,{key:"extra"})]);return f?t.createElement(Oy,{ref:r,flex:1,style:h},k):k}),rx=nx;rx.Meta=e=>{var{prefixCls:r,className:i,avatar:a,title:o,description:s}=e,l=tx(e,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:c}=n(Si),u=c("list",r),h=en(`${u}-item-meta`,i),d=t.createElement("div",{className:`${u}-item-meta-content`},o&&t.createElement("h4",{className:`${u}-item-meta-title`},o),s&&t.createElement("div",{className:`${u}-item-meta-description`},s));return t.createElement("div",Object.assign({},l,{className:h}),a&&t.createElement("div",{className:`${u}-item-meta-avatar`},a),(o||s)&&d)};const ix=e=>{const{listBorderedCls:t,componentCls:n,paddingLG:r,margin:i,itemPaddingSM:a,itemPaddingLG:o,marginLG:s,borderRadiusLG:l}=e,c=Le(e.calc(l).sub(e.lineWidth).equal());return{[t]:{border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:l,[`${n}-header`]:{borderRadius:`${c} ${c} 0 0`},[`${n}-footer`]:{borderRadius:`0 0 ${c} ${c}`},[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:r},[`${n}-pagination`]:{margin:`${Le(i)} ${Le(s)}`}},[`${t}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:a}},[`${t}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:o}}}},ax=e=>{const{componentCls:t,screenSM:n,screenMD:r,marginLG:i,marginSM:a,margin:o}=e;return{[`@media screen and (max-width:${r}px)`]:{[t]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:i}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:i}}}},[`@media screen and (max-width: ${n}px)`]:{[t]:{[`${t}-item`]:{flexWrap:"wrap",[`${t}-action`]:{marginInlineStart:a}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:"wrap-reverse",[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${Le(o)}`}}}}}},ox=e=>{const{componentCls:t,antCls:n,controlHeight:r,minHeight:i,paddingSM:a,marginLG:o,padding:s,itemPadding:l,colorPrimary:c,itemPaddingSM:u,itemPaddingLG:h,paddingXS:d,margin:p,colorText:f,colorTextDescription:g,motionDurationSlow:m,lineWidth:y,headerBg:v,footerBg:b,emptyTextPadding:x,metaMarginBottom:w,avatarMarginRight:E,titleMarginBottom:k,descriptionFontSize:T}=e;return{[t]:Object.assign(Object.assign({},ma(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},[`${t}-header`]:{background:v},[`${t}-footer`]:{background:b},[`${t}-header, ${t}-footer`]:{paddingBlock:a},[`${t}-pagination`]:{marginBlockStart:o,[`${n}-pagination-options`]:{textAlign:"start"}},[`${t}-spin`]:{minHeight:i,textAlign:"center"},[`${t}-items`]:{margin:0,padding:0,listStyle:"none"},[`${t}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:l,color:f,[`${t}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${t}-item-meta-avatar`]:{marginInlineEnd:E},[`${t}-item-meta-content`]:{flex:"1 0",width:0,color:f},[`${t}-item-meta-title`]:{margin:`0 0 ${Le(e.marginXXS)} 0`,color:f,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:f,transition:`all ${m}`,"&:hover":{color:c}}},[`${t}-item-meta-description`]:{color:g,fontSize:T,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${Le(d)}`,color:g,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:y,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${Le(s)} 0`,color:g,fontSize:e.fontSizeSM,textAlign:"center"},[`${t}-empty-text`]:{padding:x,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},[`${t}-item-no-flex`]:{display:"block"}}),[`${t}-grid ${n}-col > ${t}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},[`${t}-vertical ${t}-item`]:{alignItems:"initial",[`${t}-item-main`]:{display:"block",flex:1},[`${t}-item-extra`]:{marginInlineStart:o},[`${t}-item-meta`]:{marginBlockEnd:w,[`${t}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:k,color:f,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:s,marginInlineStart:"auto","> li":{padding:`0 ${Le(s)}`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:r},[`${t}-split${t}-something-after-last-item ${n}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${Le(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:h},[`${t}-sm ${t}-item`]:{padding:u},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:"right"}}}}};var sx=wa("List",e=>{const t=Qi(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG});return[ox(t),ix(t),ax(t)]},e=>({contentWidth:220,itemPadding:`${Le(e.paddingContentVertical)} 0`,itemPaddingSM:`${Le(e.paddingContentVerticalSM)} ${Le(e.paddingContentHorizontal)}`,itemPaddingLG:`${Le(e.paddingContentVerticalLG)} ${Le(e.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize})),lx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(t,n)=>{var i;_(t),S(n),r&&(null===(i=null==r?void 0:r[e])||void 0===i||i.call(r,t,n))},D=R("onChange"),P=R("onShowSizeChange"),$=(t,n)=>{if(!x)return null;let r;return r="function"==typeof b?b(t):b?t[b]:t.key,r||(r=`list-item-${n}`),e.createElement(e.Fragment,{key:r},x(t,n))},B=!!(d||r||y),F=A("list",i),[z,j,H]=sx(F);let U=v;"boolean"==typeof U&&(U={spinning:U});const G=!!(null==U?void 0:U.spinning);let q="";switch(ll(g)){case"large":q="lg";break;case"small":q="sm"}const W=en(F,{[`${F}-vertical`]:"vertical"===h,[`${F}-${q}`]:q,[`${F}-split`]:o,[`${F}-bordered`]:a,[`${F}-loading`]:G,[`${F}-grid`]:!!p,[`${F}-something-after-last-item`]:B,[`${F}-rtl`]:"rtl"===N},I,s,l,j,H),V=ms({current:1,total:0,position:"bottom"},{total:f.length,current:T,pageSize:C},r||{}),Y=Math.ceil(V.total/V.pageSize);V.current=Math.min(V.current,Y);const X=r&&e.createElement("div",{className:en(`${F}-pagination`)},e.createElement(jb,Object.assign({align:"end"},V,{onChange:D,onShowSizeChange:P})));let K=M(f);r&&f.length>(V.current-1)*V.pageSize&&(K=M(f).splice((V.current-1)*V.pageSize,V.pageSize));const Q=Gg(Object.keys(p||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e))),Z=e.useMemo(()=>{for(let e=0;e{if(!p)return;const e=Z&&p[Z]?p[Z]:p.column;return e?{width:100/e+"%",maxWidth:100/e+"%"}:void 0},[JSON.stringify(p),Z]);let ee=G&&e.createElement("div",{style:{minHeight:53}});if(K.length>0){const t=K.map($);ee=p?e.createElement(Ry,{gutter:p.gutter},e.Children.map(t,t=>e.createElement("div",{key:null==t?void 0:t.key,style:J},t))):e.createElement("ul",{className:`${F}-items`},t)}else u||G||(ee=e.createElement("div",{className:`${F}-empty-text`},(null==w?void 0:w.emptyText)||(null==L?void 0:L("List"))||e.createElement(Zf,{componentName:"List"})));const te=V.position,ne=e.useMemo(()=>({grid:p,itemLayout:h}),[JSON.stringify(p),h]);return z(e.createElement(ex.Provider,{value:ne},e.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},O),c),className:W},E),("top"===te||"both"===te)&&X,m&&e.createElement("div",{className:`${F}-header`},m),e.createElement(Jb,Object.assign({},U),ee,u),y&&e.createElement("div",{className:`${F}-footer`},y),d||("bottom"===te||"both"===te)&&X)))}const ux=e.forwardRef(cx);ux.Item=rx;var hx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:n,className:r,closeIcon:i,closable:a,type:o,title:s,children:l,footer:c}=t,u=hx(t,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:h}=e.useContext(Si),d=h(),p=n||h("modal"),f=hs(d),[g,m,y]=bd(p,f),v=`${p}-confirm`;let b={};return b=o?{closable:null!=a&&a,title:"",footer:"",children:e.createElement(Cd,Object.assign({},t,{prefixCls:p,confirmPrefixCls:v,rootPrefixCls:d,content:l}))}:{closable:null==a||a,title:s,footer:null!==c&&e.createElement(od,Object.assign({},t)),children:l},g(e.createElement(xu,Object.assign({prefixCls:p,className:en(m,`${p}-pure-panel`,o&&v,o&&`${v}-${o}`,r,y,f)},u,{closeIcon:ad(p,i),closable:a},b)))});function px(e){return Md(Rd(e))}const fx=kd;fx.useModal=function(){const t=e.useRef(null),[n,r]=e.useState([]);e.useEffect(()=>{if(n.length){M(n).forEach(e=>{e()}),r([])}},[n]);const i=e.useCallback(n=>function(i){var a;Hd+=1;const o=e.createRef();let s;const l=new Promise(e=>{s=e});let c,u=!1;const h=e.createElement(jd,{key:`modal-${Hd}`,config:n(i),ref:o,afterClose:()=>{null==c||c()},isSilent:()=>u,onConfirm:e=>{s(e)}});c=null===(a=t.current)||void 0===a?void 0:a.patchElement(h),c&&Nd.push(c);const d={destroy:()=>{function e(){var e;null===(e=o.current)||void 0===e||e.destroy()}o.current?e():r(t=>[].concat(M(t),[e]))},update:e=>{function t(){var t;null===(t=o.current)||void 0===t||t.update(e)}o.current?t():r(e=>[].concat(M(e),[t]))},then:e=>(u=!0,l.then(e))};return d},[]);return[e.useMemo(()=>({info:i(Dd),success:i(Pd),error:i($d),warning:i(Rd),confirm:i(Bd)}),[i]),e.createElement(Ud,{key:"modal-holder",ref:t})]},fx.info=function(e){return Md(Dd(e))},fx.success=function(e){return Md(Pd(e))},fx.error=function(e){return Md($d(e))},fx.warning=px,fx.warn=px,fx.confirm=function(e){return Md(Bd(e))},fx.destroyAll=function(){for(;Nd.length;){const e=Nd.pop();e&&e()}},fx.config=function({rootPrefixCls:e}){Id=e},fx._InternalPanelDoNotUseOrYouWillBeFired=dx;const gx=e=>{const{lineWidth:t,fontSizeIcon:n,calc:r}=e,i=e.fontSizeSM;return Qi(e,{tagFontSize:i,tagLineHeight:Le(r(e.lineHeightSM).mul(i).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},mx=e=>({defaultBg:new Yr(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var yx=wa("Tag",e=>(e=>{const{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:i,calc:a}=e,o=a(r).sub(n).equal(),s=a(t).sub(n).equal();return{[i]:Object.assign(Object.assign({},ma(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:o,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${Le(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${i}-close-icon`]:{marginInlineStart:s,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${i}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:o}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(gx(e)),mx),vx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,style:i,className:a,checked:o,children:s,icon:l,onChange:c,onClick:u}=t,h=vx(t,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:d,tag:p}=e.useContext(Si),f=d("tag",r),[g,m,y]=yx(f),v=en(f,`${f}-checkable`,{[`${f}-checkable-checked`]:o},null==p?void 0:p.className,a,m,y);return g(e.createElement("span",Object.assign({},h,{ref:n,style:Object.assign(Object.assign({},i),null==p?void 0:p.style),className:v,onClick:e=>{null==c||c(!o),null==u||u(e)}}),l,e.createElement("span",null,s)))});var xx=ka(["Tag","preset"],e=>(e=>Ta(e,(t,{textColor:n,lightBorderColor:r,lightColor:i,darkColor:a})=>({[`${e.componentCls}${e.componentCls}-${t}`]:{color:n,background:i,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}})))(gx(e)),mx);const wx=(e,t,n)=>{const r=function(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}(n);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var Ex=ka(["Tag","status"],e=>{const t=gx(e);return[wx(t,"success","Success"),wx(t,"processing","Info"),wx(t,"error","Error"),wx(t,"warning","Warning")]},mx),kx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,className:i,rootClassName:a,style:o,children:s,icon:l,color:c,onClose:u,bordered:h=!0,visible:d}=t,p=kx(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:f,direction:g,tag:m}=e.useContext(Si),[y,v]=e.useState(!0),b=Zs(p,["closeIcon","closable"]);e.useEffect(()=>{void 0!==d&&v(d)},[d]);const x=dm(c),w=function(e){return hm.includes(e)}(c),E=x||w,k=Object.assign(Object.assign({backgroundColor:c&&!E?c:void 0},null==m?void 0:m.style),o),T=f("tag",r),[_,C,S]=yx(T),A=en(T,null==m?void 0:m.className,{[`${T}-${c}`]:E,[`${T}-has-color`]:c&&!E,[`${T}-hidden`]:!y,[`${T}-rtl`]:"rtl"===g,[`${T}-borderless`]:!h},i,a,C,S),N=e=>{e.stopPropagation(),null==u||u(e),e.defaultPrevented||v(!1)},[,I]=xs(ys(t),ys(m),{closable:!1,closeIconRender:t=>cs(t,e.createElement("span",{className:`${T}-close-icon`,onClick:N},t),e=>({onClick:t=>{var n;null===(n=null==e?void 0:e.onClick)||void 0===n||n.call(e,t),N(t)},className:en(null==e?void 0:e.className,`${T}-close-icon`)}))}),O="function"==typeof p.onClick||s&&"a"===s.type,L=l||null,M=L?e.createElement(e.Fragment,null,L,s&&e.createElement("span",null,s)):s,R=e.createElement("span",Object.assign({},b,{ref:n,className:A,style:k}),M,I,x&&e.createElement(xx,{key:"preset",prefixCls:T}),w&&e.createElement(Ex,{key:"status",prefixCls:T}));return _(O?e.createElement(sl,{component:"Tag"},R):R)}),_x=Tx;_x.CheckableTag=bx;var Cx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Sx=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Cx}))},Ax=e.forwardRef(Sx),Nx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},Ix=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Nx}))},Ox=e.forwardRef(Ix);const Lx=e=>{const t={};return[1,2,3,4,5].forEach(n=>{t[`\n h${n}&,\n div&-h${n},\n div&-h${n} > textarea,\n h${n}\n `]=((e,t,n,r)=>{const{titleMarginBottom:i,fontWeightStrong:a}=r;return{marginBottom:i,color:n,fontWeight:a,fontSize:e,lineHeight:t}})(e[`fontSizeHeading${n}`],e[`lineHeightHeading${n}`],e.colorTextHeading,e)}),t},Mx=e=>{const{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},xa(e)),{userSelect:"text",[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},Rx=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:ii[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),Dx=e=>{const{componentCls:t,paddingSM:n}=e,r=n;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(r).div(-2).add(1).equal(),marginBottom:e.calc(r).div(2).sub(2).equal()},[`${t}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},Px=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}});var $x=wa("Typography",e=>{const{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccessText},[`&${t}-warning`]:{color:e.colorWarningText},[`&${t}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},Lx(e)),{[`\n & + h1${t},\n & + h2${t},\n & + h3${t},\n & + h4${t},\n & + h5${t}\n `]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),Rx(e)),Mx(e)),{[`\n ${t}-expand,\n ${t}-collapse,\n ${t}-edit,\n ${t}-copy\n `]:Object.assign(Object.assign({},xa(e)),{marginInlineStart:e.marginXXS})}),Dx(e)),Px(e)),{"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-ellipsis-single-line":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),{"&-rtl":{direction:"rtl"}})}},()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}));const Bx=t=>{const{prefixCls:n,"aria-label":r,className:i,style:a,direction:o,maxLength:s,autoSize:l=!0,value:c,onSave:u,onCancel:h,onEnd:d,component:p,enterIcon:f=e.createElement(Ox,null)}=t,g=e.useRef(null),m=e.useRef(!1),y=e.useRef(null),[v,b]=e.useState(c);e.useEffect(()=>{b(c)},[c]),e.useEffect(()=>{var e;if(null===(e=g.current)||void 0===e?void 0:e.resizableTextArea){const{textArea:e}=g.current.resizableTextArea;e.focus();const{length:t}=e.value;e.setSelectionRange(t,t)}},[]);const x=()=>{u(v.trim())},[w,E,k]=$x(n),T=en(n,`${n}-edit-content`,{[`${n}-rtl`]:"rtl"===o,[`${n}-${p}`]:!!p},i,E,k);return w(e.createElement("div",{className:T,style:a},e.createElement(nb,{ref:g,maxLength:s,value:v,onChange:({target:e})=>{b(e.value.replace(/[\n\r]/g,""))},onKeyDown:({keyCode:e})=>{m.current||(y.current=e)},onKeyUp:({keyCode:e,ctrlKey:t,altKey:n,metaKey:r,shiftKey:i})=>{y.current!==e||m.current||t||n||r||i||(e===ds.ENTER?(x(),null==d||d()):e===ds.ESC&&h())},onCompositionStart:()=>{m.current=!0},onCompositionEnd:()=>{m.current=!1},onBlur:()=>{x()},"aria-label":r,rows:1,autoSize:l}),null!==f?us(f,{className:`${n}-edit-content-confirm`}):null))};var Fx=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r{const[r,i]=e.useState(!1),[a,o]=e.useState(!1),s=e.useRef(null),l=()=>{s.current&&clearTimeout(s.current)},c={};t.format&&(c.format=t.format),e.useEffect(()=>l,[]);const u=Gi(e=>Ux(void 0,void 0,void 0,function*(){var r;null==e||e.preventDefault(),null==e||e.stopPropagation(),o(!0);try{const a="function"==typeof t.text?yield t.text():t.text;Hx(a||((e,t=!1)=>t&&null==e?[]:Array.isArray(e)?e:[e])(n,!0).join("")||"",c),o(!1),i(!0),l(),s.current=setTimeout(()=>{i(!1)},3e3),null===(r=t.onCopy)||void 0===r||r.call(t,e)}catch(e){throw o(!1),e}}));return{copied:r,copyLoading:a,onClick:u}};function qx(t,n){return e.useMemo(()=>{const e=!!t;return[e,Object.assign(Object.assign({},n),e&&"object"==typeof t?t:null)]},[t])}var Wx=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{prefixCls:r,component:i="article",className:a,rootClassName:o,setContentRef:s,children:l,direction:c,style:u}=t,h=Wx(t,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:p,className:f,style:g}=Ii("typography"),m=null!=c?c:p,y=s?In(n,s):n,v=d("typography",r),[b,x,w]=$x(v),E=en(v,f,{[`${v}-rtl`]:"rtl"===m},a,o,x,w),k=Object.assign(Object.assign({},g),u);return b(e.createElement(i,Object.assign({className:E,style:k,ref:y},h),l))});var Yx={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},Xx=function(t,n){return e.createElement(Go,Xe({},t,{ref:n,icon:Yx}))},Kx=e.forwardRef(Xx);function Qx(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}function Zx(e,t,n){return!0===e||void 0===e?t:e||n&&t}const Jx=e=>["string","number"].includes(typeof e),ew=({prefixCls:t,copied:n,locale:r,iconOnly:i,tooltips:a,icon:o,tabIndex:s,onCopy:l,loading:c})=>{const u=Qx(a),h=Qx(o),{copied:d,copy:p}=null!=r?r:{},f=n?d:p,g=Zx(u[n?1:0],f),m="string"==typeof g?g:f;return e.createElement(mm,{title:g},e.createElement("button",{type:"button",className:en(`${t}-copy`,{[`${t}-copy-success`]:n,[`${t}-copy-icon-only`]:i}),onClick:l,"aria-label":m,tabIndex:s},n?Zx(h[1],e.createElement(Sg,null),!0):Zx(h[0],c?e.createElement(gs,null):e.createElement(Kx,null),!0)))},tw=e.forwardRef(({style:t,children:n},r)=>{const i=e.useRef(null);return e.useImperativeHandle(r,()=>({isExceed:()=>{const e=i.current;return e.scrollHeight>e.clientHeight},getHeight:()=>i.current.clientHeight})),e.createElement("span",{"aria-hidden":!0,ref:i,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},t)},n)});function nw(e,t){let n=0;const r=[];for(let i=0;it){const e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=o}return e}const rw=0,iw=4,aw={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function ow(t){const{enableMeasure:n,width:r,text:i,children:a,rows:o,expanded:s,miscDeps:l,onEllipsis:c}=t,u=e.useMemo(()=>on(i),[i]),h=e.useMemo(()=>(e=>e.reduce((e,t)=>e+(Jx(t)?String(t).length:1),0))(u),[i]),d=e.useMemo(()=>a(u,!1),[i]),[p,f]=e.useState(null),g=e.useRef(null),m=e.useRef(null),y=e.useRef(null),v=e.useRef(null),b=e.useRef(null),[x,w]=e.useState(!1),[E,k]=e.useState(rw),[T,_]=e.useState(0),[C,S]=e.useState(null);Be(()=>{k(n&&r&&h?1:rw)},[r,i,o,n,u]),Be(()=>{var e,t,n,r;if(1===E){k(2);const e=m.current&&getComputedStyle(m.current).whiteSpace;S(e)}else if(2===E){const i=!!(null===(e=y.current)||void 0===e?void 0:e.isExceed());k(i?3:iw),f(i?[0,h]:null),w(i);const a=(null===(t=y.current)||void 0===t?void 0:t.getHeight())||0,s=1===o?0:(null===(n=v.current)||void 0===n?void 0:n.getHeight())||0,l=(null===(r=b.current)||void 0===r?void 0:r.getHeight())||0,u=Math.max(a,s+l);_(u+1),c(i)}},[E]);const A=p?Math.ceil((p[0]+p[1])/2):0;Be(()=>{var e;const[t,n]=p||[0,0];if(t!==n){const r=((null===(e=g.current)||void 0===e?void 0:e.getHeight())||0)>T;let i=A;n-t===1&&(i=r?t:n),f(r?[t,i]:[i,n])}},[p,A]);const N=e.useMemo(()=>{if(!n)return a(u,!1);if(3!==E||!p||p[0]!==p[1]){const t=a(u,!1);return[iw,rw].includes(E)?t:e.createElement("span",{style:Object.assign(Object.assign({},aw),{WebkitLineClamp:o})},t)}return a(s?u:nw(u,p[0]),x)},[s,E,p,u].concat(M(l))),I={width:r,margin:0,padding:0,whiteSpace:"nowrap"===C?"normal":"inherit"};return e.createElement(e.Fragment,null,N,2===E&&e.createElement(e.Fragment,null,e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:o}),ref:y},d),e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:o-1}),ref:v},d),e.createElement(tw,{style:Object.assign(Object.assign(Object.assign({},I),aw),{WebkitLineClamp:1}),ref:b},a([],!0))),3===E&&p&&p[0]!==p[1]&&e.createElement(tw,{style:Object.assign(Object.assign({},I),{top:400}),ref:g},a(nw(u,A),!0)),1===E&&e.createElement("span",{style:{whiteSpace:"inherit"},ref:m}))}const sw=({enableEllipsis:t,isEllipsis:n,children:r,tooltipProps:i})=>(null==i?void 0:i.title)&&t?e.createElement(mm,Object.assign({open:!!n&&void 0},i),r):r;var lw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var i;const{prefixCls:a,className:s,style:c,type:u,disabled:d,children:p,ellipsis:f,editable:g,copyable:m,component:y,title:v}=t,b=lw(t,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:x,direction:w}=e.useContext(Si),[E]=zr("Text"),k=e.useRef(null),T=e.useRef(null),_=x("typography",a),C=Zs(b,cw),[S,A]=qx(g),[N,I]=Vi(!1,{value:A.editing}),{triggerType:O=["icon"]}=A,L=e=>{var t;e&&(null===(t=A.onStart)||void 0===t||t.call(A)),I(e)},R=(e=>{const t=o(void 0);return l(()=>{t.current=e}),t.current})(N);Be(()=>{var e;!N&&R&&(null===(e=T.current)||void 0===e||e.focus())},[N]);const D=e=>{null==e||e.preventDefault(),L(!0)},P=e=>{var t;null===(t=A.onChange)||void 0===t||t.call(A,e),L(!1)},$=()=>{var e;null===(e=A.onCancel)||void 0===e||e.call(A),L(!1)},[B,F]=qx(m),{copied:z,copyLoading:j,onClick:H}=Gx({copyConfig:F,children:p}),[U,G]=e.useState(!1),[q,W]=e.useState(!1),[V,Y]=e.useState(!1),[X,K]=e.useState(!1),[Q,Z]=e.useState(!0),[J,ee]=qx(f,{expandable:!1,symbol:e=>e?null==E?void 0:E.collapse:null==E?void 0:E.expand}),[te,ne]=Vi(ee.defaultExpanded||!1,{value:ee.expanded}),re=J&&(!te||"collapsible"===ee.expandable),{rows:ie=1}=ee,ae=e.useMemo(()=>re&&(void 0!==ee.suffix||ee.onEllipsis||ee.expandable||S||B),[re,ee,S,B]);Be(()=>{J&&!ae&&(G(Rh("webkitLineClamp")),W(Rh("textOverflow")))},[ae,J]);const[oe,se]=e.useState(re),le=e.useMemo(()=>!ae&&(1===ie?q:U),[ae,q,U]);Be(()=>{se(le&&re)},[le,re]);const ce=re&&(oe?X:V),ue=re&&1===ie&&oe,he=re&&ie>1&&oe,[de,pe]=e.useState(0),fe=e=>{var t;Y(e),V!==e&&(null===(t=ee.onEllipsis)||void 0===t||t.call(ee,e))};e.useEffect(()=>{const e=k.current;if(J&&oe&&e){const t=function(e){const t=document.createElement("em");e.appendChild(t);const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.removeChild(t),n.left>r.left||r.right>n.right||n.top>r.top||r.bottom>n.bottom}(e);X!==t&&K(t)}},[J,oe,p,he,Q,de]),e.useEffect(()=>{const e=k.current;if("undefined"==typeof IntersectionObserver||!e||!oe||!re)return;const t=new IntersectionObserver(()=>{Z(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[oe,re]);const ge=((e,t,n)=>h(()=>!0===e?{title:null!=t?t:n}:r(e)?{title:e}:"object"==typeof e?Object.assign({title:null!=t?t:n},e):{title:e},[e,t,n]))(ee.tooltip,A.text,p),me=e.useMemo(()=>{if(J&&!oe)return[A.text,p,v,ge.title].find(Jx)},[J,oe,v,ge.title,ce]);if(N)return e.createElement(Bx,{value:null!==(i=A.text)&&void 0!==i?i:"string"==typeof p?p:"",onSave:P,onCancel:$,onEnd:A.onEnd,prefixCls:_,className:s,style:c,direction:w,component:y,maxLength:A.maxLength,autoSize:A.autoSize,enterIcon:A.enterIcon});const ye=()=>{const{expandable:t,symbol:n}=ee;return t?e.createElement("button",{type:"button",key:"expand",className:`${_}-${te?"collapse":"expand"}`,onClick:e=>((e,t)=>{var n;ne(t.expanded),null===(n=ee.onExpand)||void 0===n||n.call(ee,e,t)})(e,{expanded:!te}),"aria-label":te?E.collapse:null==E?void 0:E.expand},"function"==typeof n?n(te):n):null},ve=()=>{if(!S)return;const{icon:t,tooltip:n,tabIndex:r}=A,i=on(n)[0]||(null==E?void 0:E.edit),a="string"==typeof i?i:"";return O.includes("icon")?e.createElement(mm,{key:"edit",title:!1===n?"":i},e.createElement("button",{type:"button",ref:T,className:`${_}-edit`,onClick:D,"aria-label":a,tabIndex:r},t||e.createElement(Ax,{role:"button"}))):null},be=t=>[t&&ye(),ve(),B?e.createElement(ew,Object.assign({key:"copy"},F,{prefixCls:_,copied:z,locale:E,onCopy:H,loading:j,iconOnly:null==p})):null];return e.createElement(ur,{onResize:({offsetWidth:e})=>{pe(e)},disabled:!re},r=>e.createElement(sw,{tooltipProps:ge,enableEllipsis:re,isEllipsis:ce},e.createElement(Vx,Object.assign({className:en({[`${_}-${u}`]:u,[`${_}-disabled`]:d,[`${_}-ellipsis`]:J,[`${_}-ellipsis-single-line`]:ue,[`${_}-ellipsis-multiple-line`]:he},s),prefixCls:a,style:Object.assign(Object.assign({},c),{WebkitLineClamp:he?ie:void 0}),component:y,ref:In(r,k,n),direction:w,onClick:O.includes("text")?D:void 0,"aria-label":null==me?void 0:me.toString(),title:v},C),e.createElement(ow,{enableMeasure:re&&!oe,text:p,rows:ie,width:de,onEllipsis:fe,expanded:te,miscDeps:[z,te,j,S,B,E].concat(M(cw.map(e=>t[e])))},(n,r)=>function({mark:t,code:n,underline:r,delete:i,strong:a,keyboard:o,italic:s},l){let c=l;function u(t,n){n&&(c=e.createElement(t,{},c))}return u("strong",a),u("u",r),u("del",i),u("code",n),u("mark",t),u("kbd",o),u("i",s),c}(t,e.createElement(e.Fragment,null,n.length>0&&r&&!te&&me?e.createElement("span",{key:"show-content","aria-hidden":!0},n):n,(t=>[t&&!te&&e.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),ee.suffix,be(t)])(r)))))))});var hw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{ellipsis:r,rel:i,children:a,navigate:o}=t,s=hw(t,["ellipsis","rel","children","navigate"]),l=Object.assign(Object.assign({},s),{rel:void 0===i&&"_blank"===s.target?"noopener noreferrer":i});return e.createElement(uw,Object.assign({},l,{ref:n,ellipsis:!!r,component:"a"}),a)});var pw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{children:r}=t,i=pw(t,["children"]);return e.createElement(uw,Object.assign({ref:n},i,{component:"div"}),r)});var gw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{ellipsis:r,children:i}=t,a=gw(t,["ellipsis","children"]),o=e.useMemo(()=>r&&"object"==typeof r?Zs(r,["expandable","rows"]):r,[r]);return e.createElement(uw,Object.assign({ref:n},a,{ellipsis:o,component:"span"}),i)};var yw=e.forwardRef(mw),vw=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{level:r=1,children:i}=t,a=vw(t,["level","children"]),o=bw.includes(r)?`h${r}`:"h1";return e.createElement(uw,Object.assign({ref:n},a,{component:o}),i)}),ww=Vx;ww.Text=yw,ww.Link=dw,ww.Title=xw,ww.Paragraph=fw;var Ew={exports:{}},kw={},Tw=t,_w=Symbol.for("react.element"),Cw=Symbol.for("react.fragment"),Sw=Object.prototype.hasOwnProperty,Aw=Tw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nw={key:!0,ref:!0,__self:!0,__source:!0};function Iw(e,t,n){var r,i={},a=null,o=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(o=t.ref),t)Sw.call(t,r)&&!Nw.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:_w,type:e,key:a,ref:o,props:i,_owner:Aw.current}}kw.Fragment=Cw,kw.jsx=Iw,kw.jsxs=Iw,Ew.exports=kw;var Ow=Ew.exports;const{Header:Lw,Content:Mw}=db,Rw=e=>{const{rootID:t,isFirst:n,loading:r,logo:i,welcome:a,searchbox:o,rightMenuWidth:s,aggregations:l,resultHeader:c,aiOverview:u,resultList:h,widgets:d,isMobile:p}=e;return Ow.jsx(Jb,{spinning:r,children:Ow.jsx(db,{id:t,children:n?Ow.jsxs(Mw,{className:"bg-[rgba(250,250,250,1)] min-h-[calc(100vh)] flex flex-col items-center justify-center",children:[Ow.jsx("div",{className:"mb-24px w-200px",children:i}),a&&Ow.jsx("div",{className:(p?"w-full px-32px":"w-627px")+" mb-60px",children:a}),Ow.jsx("div",{className:""+(p?"w-full px-24px":"w-664px"),children:o})]}):Ow.jsxs(Ow.Fragment,{children:[Ow.jsx(Lw,{className:"bg-white position-sticky top-0 z-1 w-full h-72px shadow-md px-0",children:Ow.jsxs("div",{className:"px-12px m-auto h-full flex items-center justify-"+(p?"left":"center"),children:[Ow.jsx("div",{className:"h-full "+(p?"w-40px mr-8px":"w-200px"),children:i}),Ow.jsx("div",{style:p&&s?{paddingRight:s}:{},className:"h-full "+(p?"w-[calc(100%-48px)]":"w-[calc(100%-500px)] max-w-724px pl-12 pr-10"),children:o}),!p&&Ow.jsx("div",{className:"w-300px h-full"})]})}),Ow.jsx(Mw,{className:"bg-[rgba(250,250,250,1)] h-[calc(100vh-72px)] overflow-auto",children:Ow.jsxs("div",{className:"px-12px py-24px w-full m-auto "+(p?"":"flex justify-center"),children:[!p&&Ow.jsx("div",{className:"w-200px",children:l}),Ow.jsxs("div",{className:""+(p?"mb-40px w-full":"w-[calc(100%-500px)] max-w-724px px-40px"),children:[Ow.jsx("div",{className:"mb-12px",children:c}),u&&Ow.jsx("div",{className:"mb-16px",children:u}),Ow.jsx("div",{className:"mb-24px",children:h})]}),Ow.jsx("div",{className:(p?"w-full":"w-300px mt-28px")+" flex flex-col gap-16px",children:d})]})})]})})})};var Dw="index-module__searchbox___Dj4nM"; /** * @license lucide-react v0.525.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pw=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},$w=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Bw=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0}; + */const Pw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$w=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Bw=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Fw=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0}; /** * @license lucide-react v0.525.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -var Fw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}; +var zw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}; /** * @license lucide-react v0.525.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zw=u(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},l)=>y("svg",{ref:l,...Fw,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:$w("lucide",i),...!a&&!Bw(s)&&{"aria-hidden":"true"},...s},[...o.map(([e,t])=>y(e,t)),...Array.isArray(a)?a:[a]])),jw=(e,t)=>{const n=u(({className:n,...r},i)=>y(zw,{ref:i,iconNode:t,className:$w(`lucide-${Dw(Pw(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Pw(e),n},Hw=jw("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),Uw=jw("brush-cleaning",[["path",{d:"m16 22-1-4",key:"1ow2iv"}],["path",{d:"M19 13.99a1 1 0 0 0 1-1V12a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v.99a1 1 0 0 0 1 1",key:"iw8jdu"}],["path",{d:"M5 14h14l1.973 6.767A1 1 0 0 1 20 22H4a1 1 0 0 1-.973-1.233z",key:"1soew8"}],["path",{d:"m8 22 1-4",key:"s3unb"}]]),Gw=jw("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),qw=jw("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Ww=jw("corner-down-left",[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]),Vw=jw("list-filter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),Yw=jw("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Xw=jw("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Kw=jw("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),Qw=jw("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),Zw=jw("tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]),Jw=jw("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),eE=jw("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]); + */const jw=u(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},l)=>y("svg",{ref:l,...zw,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Bw("lucide",i),...!a&&!Fw(s)&&{"aria-hidden":"true"},...s},[...o.map(([e,t])=>y(e,t)),...Array.isArray(a)?a:[a]])),Hw=(e,t)=>{const n=u(({className:n,...r},i)=>y(jw,{ref:i,iconNode:t,className:Bw(`lucide-${Pw($w(e))}`,`lucide-${e}`,n),...r}));return n.displayName=$w(e),n},Uw=Hw("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),Gw=Hw("brush-cleaning",[["path",{d:"m16 22-1-4",key:"1ow2iv"}],["path",{d:"M19 13.99a1 1 0 0 0 1-1V12a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v.99a1 1 0 0 0 1 1",key:"iw8jdu"}],["path",{d:"M5 14h14l1.973 6.767A1 1 0 0 1 20 22H4a1 1 0 0 1-.973-1.233z",key:"1soew8"}],["path",{d:"m8 22 1-4",key:"s3unb"}]]),qw=Hw("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ww=Hw("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Vw=Hw("corner-down-left",[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]),Yw=Hw("list-filter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),Xw=Hw("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Kw=Hw("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Qw=Hw("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),Zw=Hw("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),Jw=Hw("tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]),eE=Hw("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),tE=Hw("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]); /** * @license lucide-react v0.525.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */function tE(e){const{placeholder:t,query:n,onSearch:r}=e,[i,a]=d(n);return l(()=>{a(n)},[n]),Iw.jsx("div",{className:`flex w-full h-full items-center justify-center bg-#fff ${Rw}`,children:Iw.jsx("div",{className:"w-full h-48px px-12px py-4px border border-solid border-[rgba(235,235,235,1)] rounded-8px",children:Iw.jsx(rb.Search,{value:i,addonBefore:Iw.jsx(Xw,{className:"w-16px h-16px"}),enterButton:Iw.jsx(Ww,{className:"w-14px h-14px"}),size:"large",onChange:e=>a(e.target.value),onSearch:e=>r&&r(e),suffix:Iw.jsx(Yw,{className:"w-16px h-14px"}),placeholder:t,autoFocus:!0})})})}function nE(e){const{isFirst:t,isMobile:n}=e;return Iw.jsx("div",{className:"w-full h-full flex items-center justify-left",children:Iw.jsx("img",{src:n&&!t?e["light-mobile"]:e.light,className:"w-full"})})}var rE={exports:{}}; + */function nE(e){const{placeholder:t,query:n,onSearch:r}=e,[i,a]=d(n);return l(()=>{a(n)},[n]),Ow.jsx("div",{className:`flex w-full h-full items-center justify-center bg-#fff ${Dw}`,children:Ow.jsx("div",{className:"w-full h-48px px-12px py-4px border border-solid border-[rgba(235,235,235,1)] rounded-8px",children:Ow.jsx(rb.Search,{value:i,addonBefore:Ow.jsx(Kw,{className:"w-16px h-16px"}),enterButton:Ow.jsx(Vw,{className:"w-14px h-14px"}),size:"large",onChange:e=>a(e.target.value),onSearch:e=>r&&r(e),suffix:Ow.jsx(Xw,{className:"w-16px h-14px"}),placeholder:t,autoFocus:!0})})})}function rE(e){const{isFirst:t,isMobile:n,onLogoClick:r}=e;return Ow.jsx("div",{className:"w-full h-full flex items-center justify-left",children:Ow.jsx("img",{src:n&&!t?e["light-mobile"]:e.light,className:"w-full cursor-pointer",onClick:r,alt:"Logo"})})}var iE={exports:{}}; /** * @license * Lodash @@ -39,17 +39,17 @@ var Fw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24 * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",o=32,s=128,l=256,c=1/0,u=9007199254740991,h=NaN,d=4294967295,p=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",o],["partialRight",64],["rearg",l]],f="[object Arguments]",g="[object Array]",m="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",x="[object GeneratorFunction]",w="[object Map]",E="[object Number]",k="[object Object]",T="[object Promise]",_="[object RegExp]",C="[object Set]",S="[object String]",A="[object Symbol]",N="[object WeakMap]",I="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",P="[object Int32Array]",$="[object Uint8Array]",B="[object Uint8ClampedArray]",F="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,W=RegExp(G.source),V=RegExp(q.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",ke="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Se="['’]",Ae="["+xe+"]",Ne="["+Ce+"]",Ie="["+we+"]",Oe="\\d+",Le="["+Ee+"]",Me="["+ke+"]",Re="[^"+xe+Ce+Oe+Ee+ke+Te+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+xe+"]",$e="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Te+"]",ze="\\u200d",je="(?:"+Me+"|"+Re+")",He="(?:"+Fe+"|"+Re+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Ie+"|"+De+")"+"?",We="["+_e+"]?",Ve=We+qe+("(?:"+ze+"(?:"+[Pe,$e,Be].join("|")+")"+We+qe+")*"),Ye="(?:"+[Le,$e,Be].join("|")+")"+Ve,Xe="(?:"+[Pe+Ie+"?",Ie,$e,Be,Ae].join("|")+")",Ke=RegExp(Se,"g"),Qe=RegExp(Ie,"g"),Ze=RegExp(De+"(?="+De+")|"+Xe+Ve,"g"),Je=RegExp([Fe+"?"+Me+"+"+Ue+"(?="+[Ne,Fe,"$"].join("|")+")",He+"+"+Ge+"(?="+[Ne,Fe+je,"$"].join("|")+")",Fe+"?"+je+"+"+Ue,Fe+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+ze+xe+we+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[L]=it[M]=it[R]=it[D]=it[P]=it[$]=it[B]=it[F]=it[z]=!0,it[f]=it[g]=it[I]=it[m]=it[O]=it[y]=it[v]=it[b]=it[w]=it[E]=it[k]=it[_]=it[C]=it[S]=it[N]=!1;var at={};at[f]=at[g]=at[I]=at[O]=at[m]=at[y]=at[L]=at[M]=at[R]=at[D]=at[P]=at[w]=at[E]=at[k]=at[_]=at[C]=at[S]=at[A]=at[$]=at[B]=at[F]=at[z]=!0,at[v]=at[b]=at[N]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,pt=dt&&e&&!e.nodeType&&e,ft=pt&&pt.exports===dt,gt=ft&&ct.process,mt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,bt=mt&&mt.isMap,xt=mt&&mt.isRegExp,wt=mt&&mt.isSet,Et=mt&&mt.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function en(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var tn=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(e){return"\\"+ot[e]}function an(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function sn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var gn=function e(t){var re,xe=(t=null==t?ht:gn.defaults(ht.Object(),t,gn.pick(ht,nt))).Array,we=t.Date,Ee=t.Error,ke=t.Function,Te=t.Math,_e=t.Object,Ce=t.RegExp,Se=t.String,Ae=t.TypeError,Ne=xe.prototype,Ie=ke.prototype,Oe=_e.prototype,Le=t["__core-js_shared__"],Me=Ie.toString,Re=Oe.hasOwnProperty,De=0,Pe=(re=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",$e=Oe.toString,Be=Me.call(_e),Fe=ht._,ze=Ce("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=ft?t.Buffer:n,He=t.Symbol,Ue=t.Uint8Array,Ge=je?je.allocUnsafe:n,qe=sn(_e.getPrototypeOf,_e),We=_e.create,Ve=Oe.propertyIsEnumerable,Ye=Ne.splice,Xe=He?He.isConcatSpreadable:n,Ze=He?He.iterator:n,et=He?He.toStringTag:n,ot=function(){try{var e=ua(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ht.Date.now&&we.now,dt=t.setTimeout!==ht.setTimeout&&t.setTimeout,pt=Te.ceil,gt=Te.floor,mt=_e.getOwnPropertySymbols,Pt=je?je.isBuffer:n,Gt=t.isFinite,Qt=Ne.join,mn=sn(_e.keys,_e),yn=Te.max,vn=Te.min,bn=we.now,xn=t.parseInt,wn=Te.random,En=Ne.reverse,kn=ua(t,"DataView"),Tn=ua(t,"Map"),_n=ua(t,"Promise"),Cn=ua(t,"Set"),Sn=ua(t,"WeakMap"),An=ua(_e,"create"),Nn=Sn&&new Sn,In={},On=Pa(kn),Ln=Pa(Tn),Mn=Pa(_n),Rn=Pa(Cn),Dn=Pa(Sn),Pn=He?He.prototype:n,$n=Pn?Pn.valueOf:n,Bn=Pn?Pn.toString:n;function Fn(e){if(es(e)&&!Uo(e)&&!(e instanceof Un)){if(e instanceof Hn)return e;if(Re.call(e,"__wrapped__"))return $a(e)}return new Hn(e)}var zn=function(){function e(){}return function(t){if(!Jo(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function jn(){}function Hn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,r,i,a,o){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!Jo(e))return e;var h=Uo(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Re.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ai(e,s)}else{var d=pa(e),p=d==b||d==x;if(Vo(e))return Ei(e,l);if(d==k||d==f||p&&!a){if(s=c||p?{}:ga(e),!l)return c?function(e,t){return Ni(e,da(e),t)}(e,function(e,t){return e&&Ni(t,Os(t),e)}(s,e)):function(e,t){return Ni(e,ha(e),t)}(e,rr(s,e))}else{if(!at[d])return a?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return ki(e);case m:case y:return new r(+e);case O:return function(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case R:case D:case P:case $:case B:case F:case z:return Ti(e,n);case w:return new r;case E:case S:return new r(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case A:return i=e,$n?_e($n.call(i)):{}}var i}(e,d,l)}}o||(o=new Yn);var g=o.get(e);if(g)return g;o.set(e,s),as(e)?e.forEach(function(n){s.add(sr(n,t,r,n,e,o))}):ts(e)&&e.forEach(function(n,i){s.set(i,sr(n,t,r,i,e,o))});var v=h?n:(u?c?ra:na:c?Os:Is)(e);return _t(v||e,function(n,i){v&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,o))}),s}function lr(e,t,r){var i=r.length;if(null==e)return!i;for(e=_e(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Ae(r);return Na(function(){e.apply(n,i)},t)}function ur(e,t,n,r){var i=-1,a=Nt,o=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Ot(t,Xt(n))),r?(a=It,o=!1):t.length>=200&&(a=Zt,o=!1,t=new Vn(t));e:for(;++i-1},qn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Tn||qn),string:new Gn}},Wn.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return la(this,e).get(e)},Wn.prototype.has=function(e){return la(this,e).has(e)},Wn.prototype.set=function(e,t){var n=la(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(e){return this.__data__.set(e,i),this},Vn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Tn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var hr=Li(br),dr=Li(xr,!0);function pr(e,t){var n=!0;return hr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function fr(e,t,r){for(var i=-1,a=e.length;++i0&&n(s)?t>1?mr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var yr=Mi(),vr=Mi(!0);function br(e,t){return e&&yr(e,t,Is)}function xr(e,t){return e&&vr(e,t,Is)}function wr(e,t){return At(t,function(t){return Ko(e[t])})}function Er(e,t){for(var r=0,i=(t=vi(t,e)).length;null!=e&&rt}function Cr(e,t){return null!=e&&Re.call(e,t)}function Sr(e,t){return null!=e&&t in _e(e)}function Ar(e,t,r){for(var i=r?It:Nt,a=e[0].length,o=e.length,s=o,l=xe(o),c=1/0,u=[];s--;){var h=e[s];s&&t&&(h=Ot(h,Xt(t))),c=vn(h.length,c),l[s]=!r&&(t||a>=120&&h.length>=120)?new Vn(s&&h):n}h=e[0];var d=-1,p=l[0];e:for(;++d=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Gr(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ya(i)?Ye.call(e,i,1):ui(e,i)}}return e}function Vr(e,t){return e+gt(wn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Ia(_a(e,t,nl),e+"")}function Kr(e){return Kn(Fs(e))}function Qr(e,t){var n=Fs(e);return Ma(n,or(t,0,n.length))}function Zr(e,t,r,i){if(!Jo(e))return e;for(var a=-1,o=(t=vi(t,e)).length,s=o-1,l=e;null!=l&&++ai?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=xe(i);++r>>1,o=e[a];null!==o&&!ss(o)&&(n?o<=t:o=200){var c=t?null:Yi(e);if(c)return cn(c);o=!1,i=Zt,l=new Vn}else l=t?[]:s;e:for(;++r=i?e:ni(e,t,r)}var wi=ct||function(e){return ht.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function ki(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ti(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _i(e,t){if(e!==t){var r=e!==n,i=null===e,a=e==e,o=ss(e),s=t!==n,l=null===t,c=t==t,u=ss(t);if(!l&&!u&&!o&&e>t||o&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!a)return 1;if(!i&&!o&&!u&&e1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(a--,o):n,s&&va(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_e(t);++i-1?a[o?t[s]:s]:n}}function Bi(e){return ta(function(t){var i=t.length,a=i,o=Hn.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if("function"!=typeof s)throw new Ae(r);if(o&&!l&&"wrapper"==aa(s))var l=new Hn([],!0)}for(a=l?a:i;++a1&&b.reverse(),d&&ul))return!1;var u=o.get(e),h=o.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&r?new Vn:n;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(p,function(n){var r="_."+n[0];t&n[1]&&!Nt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(oe):[]}(r),n)))}function La(e){var t=0,r=0;return function(){var i=bn(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ma(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ro(e,r)});function uo(e){var t=Fn(e);return t.__chain__=!0,t}function ho(e,t){return t(e)}var po=ta(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Un&&ya(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ho,args:[a],thisArg:n}),new Hn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(a)});var fo=Ii(function(e,t,n){Re.call(e,n)?++e[n]:ir(e,n,1)});var go=$i(ja),mo=$i(Ha);function yo(e,t){return(Uo(e)?_t:hr)(e,sa(t,3))}function vo(e,t){return(Uo(e)?Ct:dr)(e,sa(t,3))}var bo=Ii(function(e,t,n){Re.call(e,n)?e[n].push(t):ir(e,n,[t])});var xo=Xr(function(e,t,n){var r=-1,i="function"==typeof t,a=qo(e)?xe(e.length):[];return hr(e,function(e){a[++r]=i?kt(t,e,n):Nr(e,t,n)}),a}),wo=Ii(function(e,t,n){ir(e,n,t)});function Eo(e,t){return(Uo(e)?Ot:Br)(e,sa(t,3))}var ko=Ii(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var To=Xr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&va(e,t[0],t[1])?t=[]:n>2&&va(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,mr(t,1),[])}),_o=ut||function(){return ht.Date.now()};function Co(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ki(e,s,n,n,n,n,t)}function So(e,t){var i;if("function"!=typeof t)throw new Ae(r);return e=ps(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ao=Xr(function(e,t,n){var r=1;if(n.length){var i=ln(n,oa(Ao));r|=o}return Ki(e,r,t,n,i)}),No=Xr(function(e,t,n){var r=3;if(n.length){var i=ln(n,oa(No));r|=o}return Ki(t,r,e,n,i)});function Io(e,t,i){var a,o,s,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Ae(r);function g(t){var r=a,i=o;return a=o=n,h=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||p&&e-h>=s}function y(){var e=_o();if(m(e))return v(e);c=Na(y,function(e){var n=t-(e-u);return p?vn(n,s-(e-h)):n}(e))}function v(e){return c=n,f&&a?g(e):(a=o=n,l)}function b(){var e=_o(),r=m(e);if(a=arguments,o=this,u=e,r){if(c===n)return function(e){return h=e,c=Na(y,t),d?g(e):l}(u);if(p)return wi(c),c=Na(y,t),g(u)}return c===n&&(c=Na(y,t)),l}return t=gs(t)||0,Jo(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(gs(i.maxWait)||0,t):s,f="trailing"in i?!!i.trailing:f),b.cancel=function(){c!==n&&wi(c),h=0,a=u=o=c=n},b.flush=function(){return c===n?l:v(_o())},b}var Oo=Xr(function(e,t){return cr(e,1,t)}),Lo=Xr(function(e,t,n){return cr(e,gs(t)||0,n)});function Mo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Mo.Cache||Wn),n}function Ro(e){if("function"!=typeof e)throw new Ae(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Mo.Cache=Wn;var Do=bi(function(e,t){var n=(t=1==t.length&&Uo(t[0])?Ot(t[0],Xt(sa())):Ot(mr(t,1),Xt(sa()))).length;return Xr(function(r){for(var i=-1,a=vn(r.length,n);++i=t}),Ho=Ir(function(){return arguments}())?Ir:function(e){return es(e)&&Re.call(e,"callee")&&!Ve.call(e,"callee")},Uo=xe.isArray,Go=yt?Xt(yt):function(e){return es(e)&&Tr(e)==I};function qo(e){return null!=e&&Zo(e.length)&&!Ko(e)}function Wo(e){return es(e)&&qo(e)}var Vo=Pt||gl,Yo=vt?Xt(vt):function(e){return es(e)&&Tr(e)==y};function Xo(e){if(!es(e))return!1;var t=Tr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Ko(e){if(!Jo(e))return!1;var t=Tr(e);return t==b||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==ps(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Jo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&pa(e)==w};function ns(e){return"number"==typeof e||es(e)&&Tr(e)==E}function rs(e){if(!es(e)||Tr(e)!=k)return!1;var t=qe(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Be}var is=xt?Xt(xt):function(e){return es(e)&&Tr(e)==_};var as=wt?Xt(wt):function(e){return es(e)&&pa(e)==C};function os(e){return"string"==typeof e||!Uo(e)&&es(e)&&Tr(e)==S}function ss(e){return"symbol"==typeof e||es(e)&&Tr(e)==A}var ls=Et?Xt(Et):function(e){return es(e)&&Zo(e.length)&&!!it[Tr(e)]};var cs=qi($r),us=qi(function(e,t){return e<=t});function hs(e){if(!e)return[];if(qo(e))return os(e)?dn(e):Ai(e);if(Ze&&e[Ze])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ze]());var t=pa(e);return(t==w?on:t==C?cn:Fs)(e)}function ds(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ps(e){var t=ds(e),n=t%1;return t==t?n?t-n:t:0}function fs(e){return e?or(ps(e),0,d):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return h;if(Jo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Jo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var n=pe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?h:+e}function ms(e){return Ni(e,Os(e))}function ys(e){return null==e?"":li(e)}var vs=Oi(function(e,t){if(Ea(t)||qo(t))Ni(t,Is(t),e);else for(var n in t)Re.call(t,n)&&er(e,n,t[n])}),bs=Oi(function(e,t){Ni(t,Os(t),e)}),xs=Oi(function(e,t,n,r){Ni(t,Os(t),e,r)}),ws=Oi(function(e,t,n,r){Ni(t,Is(t),e,r)}),Es=ta(ar);var ks=Xr(function(e,t){e=_e(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&va(t[0],t[1],a)&&(i=1);++r1),t}),Ni(e,ra(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)ui(n,t[i]);return n});var Ds=ta(function(e,t){return null==e?{}:function(e,t){return Gr(e,t,function(t,n){return Cs(e,n)})}(e,t)});function Ps(e,t){if(null==e)return{};var n=Ot(ra(e),function(e){return[e]});return t=sa(t),Gr(e,n,function(e,n){return t(e,n[0])})}var $s=Xi(Is),Bs=Xi(Os);function Fs(e){return null==e?[]:Kt(e,Is(e))}var zs=Di(function(e,t,n){return t=t.toLowerCase(),e+(n?js(t):t)});function js(e){return Xs(ys(e).toLowerCase())}function Hs(e){return(e=ys(e))&&e.replace(ye,tn).replace(Qe,"")}var Us=Di(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Gs=Di(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Ri("toLowerCase");var Ws=Di(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Vs=Di(function(e,t,n){return e+(n?" ":"")+Xs(t)});var Ys=Di(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,r){return e=ys(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Xr(function(e,t){try{return kt(e,n,t)}catch(e){return Xo(e)?e:new Ee(e)}}),Zs=ta(function(e,t){return _t(t,function(t){t=Da(t),ir(e,t,Ao(e[t],e))}),e});function Js(e){return function(){return e}}var el=Bi(),tl=Bi(!0);function nl(e){return e}function rl(e){return Rr("function"==typeof e?e:sr(e,1))}var il=Xr(function(e,t){return function(n){return Nr(n,e,t)}}),al=Xr(function(e,t){return function(n){return Nr(e,n,t)}});function ol(e,t,n){var r=Is(t),i=wr(t,r);null!=n||Jo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Is(t)));var a=!(Jo(n)&&"chain"in n&&!n.chain),o=Ko(e);return _t(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})}),e}function sl(){}var ll=Hi(Ot),cl=Hi(St),ul=Hi(Dt);function hl(e){return ba(e)?Ut(Da(e)):function(e){return function(t){return Er(t,e)}}(e)}var dl=Gi(),pl=Gi(!0);function fl(){return[]}function gl(){return!1}var ml=ji(function(e,t){return e+t},0),yl=Vi("ceil"),vl=ji(function(e,t){return e/t},1),bl=Vi("floor");var xl=ji(function(e,t){return e*t},1),wl=Vi("round"),El=ji(function(e,t){return e-t},0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Ae(r);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=Co,Fn.assign=vs,Fn.assignIn=bs,Fn.assignInWith=xs,Fn.assignWith=ws,Fn.at=Es,Fn.before=So,Fn.bind=Ao,Fn.bindAll=Zs,Fn.bindKey=No,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Uo(e)?e:[e]},Fn.chain=uo,Fn.chunk=function(e,t,r){t=(r?va(e,t,r):t===n)?1:yn(ps(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=xe(pt(i/t));aa?0:a+r),(i=i===n||i>a?a:ps(i))<0&&(i+=a),i=r>i?0:fs(i);r>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&an(e)?xi(dn(e),0,r):e.split(t,r):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Ae(r);return t=null==t?0:yn(ps(t),0),Xr(function(n){var r=n[t],i=xi(n,0,t);return r&&Lt(i,r),kt(e,this,i)})},Fn.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Fn.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:ps(t))<0?0:t):[]},Fn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:ps(t)))<0?0:t,i):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?di(e,sa(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?di(e,sa(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new Ae(r);return Jo(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),Io(e,t,{leading:i,maxWait:t,trailing:a})},Fn.thru=ho,Fn.toArray=hs,Fn.toPairs=$s,Fn.toPairsIn=Bs,Fn.toPath=function(e){return Uo(e)?Ot(e,Da):ss(e)?[e]:Ai(Ra(ys(e)))},Fn.toPlainObject=ms,Fn.transform=function(e,t,n){var r=Uo(e),i=r||Vo(e)||ls(e);if(t=sa(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:Jo(e)&&Ko(a)?zn(qe(e)):{}}return(i?_t:br)(e,function(e,r,i){return t(n,e,r,i)}),n},Fn.unary=function(e){return Co(e,1)},Fn.union=Ja,Fn.unionBy=eo,Fn.unionWith=to,Fn.uniq=function(e){return e&&e.length?ci(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?ci(e,sa(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Fn.unset=function(e,t){return null==e||ui(e,t)},Fn.unzip=no,Fn.unzipWith=ro,Fn.update=function(e,t,n){return null==e?e:hi(e,t,yi(n))},Fn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:hi(e,t,yi(r),i)},Fn.values=Fs,Fn.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Fn.without=io,Fn.words=Ks,Fn.wrap=function(e,t){return Po(yi(t),e)},Fn.xor=ao,Fn.xorBy=oo,Fn.xorWith=so,Fn.zip=lo,Fn.zipObject=function(e,t){return gi(e||[],t||[],er)},Fn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Zr)},Fn.zipWith=co,Fn.entries=$s,Fn.entriesIn=Bs,Fn.extend=bs,Fn.extendWith=xs,ol(Fn,Fn),Fn.add=ml,Fn.attempt=Qs,Fn.camelCase=zs,Fn.capitalize=js,Fn.ceil=yl,Fn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=gs(r))==r?r:0),t!==n&&(t=(t=gs(t))==t?t:0),or(gs(e),t,r)},Fn.clone=function(e){return sr(e,4)},Fn.cloneDeep=function(e){return sr(e,5)},Fn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},Fn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},Fn.conformsTo=function(e,t){return null==t||lr(e,t,Is(t))},Fn.deburr=Hs,Fn.defaultTo=function(e,t){return null==e||e!=e?t:e},Fn.divide=vl,Fn.endsWith=function(e,t,r){e=ys(e),t=li(t);var i=e.length,a=r=r===n?i:or(ps(r),0,i);return(r-=t.length)>=0&&e.slice(r,a)==t},Fn.eq=Fo,Fn.escape=function(e){return(e=ys(e))&&V.test(e)?e.replace(q,nn):e},Fn.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Fn.every=function(e,t,r){var i=Uo(e)?St:pr;return r&&va(e,t,r)&&(t=n),i(e,sa(t,3))},Fn.find=go,Fn.findIndex=ja,Fn.findKey=function(e,t){return $t(e,sa(t,3),br)},Fn.findLast=mo,Fn.findLastIndex=Ha,Fn.findLastKey=function(e,t){return $t(e,sa(t,3),xr)},Fn.floor=bl,Fn.forEach=yo,Fn.forEachRight=vo,Fn.forIn=function(e,t){return null==e?e:yr(e,sa(t,3),Os)},Fn.forInRight=function(e,t){return null==e?e:vr(e,sa(t,3),Os)},Fn.forOwn=function(e,t){return e&&br(e,sa(t,3))},Fn.forOwnRight=function(e,t){return e&&xr(e,sa(t,3))},Fn.get=_s,Fn.gt=zo,Fn.gte=jo,Fn.has=function(e,t){return null!=e&&fa(e,t,Cr)},Fn.hasIn=Cs,Fn.head=Ga,Fn.identity=nl,Fn.includes=function(e,t,n,r){e=qo(e)?e:Fs(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),os(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Fn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=u},Fn.isSet=as,Fn.isString=os,Fn.isSymbol=ss,Fn.isTypedArray=ls,Fn.isUndefined=function(e){return e===n},Fn.isWeakMap=function(e){return es(e)&&pa(e)==N},Fn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Tr(e)},Fn.join=function(e,t){return null==e?"":Qt.call(e,t)},Fn.kebabCase=Us,Fn.last=Ya,Fn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=ps(r))<0?yn(i+a,0):vn(a,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Bt(e,jt,a,!0)},Fn.lowerCase=Gs,Fn.lowerFirst=qs,Fn.lt=cs,Fn.lte=us,Fn.max=function(e){return e&&e.length?fr(e,nl,_r):n},Fn.maxBy=function(e,t){return e&&e.length?fr(e,sa(t,2),_r):n},Fn.mean=function(e){return Ht(e,nl)},Fn.meanBy=function(e,t){return Ht(e,sa(t,2))},Fn.min=function(e){return e&&e.length?fr(e,nl,$r):n},Fn.minBy=function(e,t){return e&&e.length?fr(e,sa(t,2),$r):n},Fn.stubArray=fl,Fn.stubFalse=gl,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xl,Fn.nth=function(e,t){return e&&e.length?Hr(e,ps(t)):n},Fn.noConflict=function(){return ht._===this&&(ht._=Fe),this},Fn.noop=sl,Fn.now=_o,Fn.pad=function(e,t,n){e=ys(e);var r=(t=ps(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(gt(i),n)+e+Ui(pt(i),n)},Fn.padEnd=function(e,t,n){e=ys(e);var r=(t=ps(t))?hn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var a=wn();return vn(e+a*(t-e+st("1e-"+((a+"").length-1))),t)}return Vr(e,t)},Fn.reduce=function(e,t,n){var r=Uo(e)?Mt:qt,i=arguments.length<3;return r(e,sa(t,4),n,i,hr)},Fn.reduceRight=function(e,t,n){var r=Uo(e)?Rt:qt,i=arguments.length<3;return r(e,sa(t,4),n,i,dr)},Fn.repeat=function(e,t,r){return t=(r?va(e,t,r):t===n)?1:ps(t),Yr(ys(e),t)},Fn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,r){var i=-1,a=(t=vi(t,e)).length;for(a||(a=1,e=n);++iu)return[];var n=d,r=vn(e,d);t=sa(t),e-=d;for(var i=Vt(r,t);++n=o)return e;var l=r-hn(i);if(l<1)return i;var c=s?xi(s,0,l).join(""):e.slice(0,l);if(a===n)return c+i;if(s&&(l+=c.length-l),is(a)){if(e.slice(l).search(a)){var u,h=c;for(a.global||(a=Ce(a.source,ys(he.exec(a))+"g")),a.lastIndex=0;u=a.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(e.indexOf(li(a),l)!=l){var p=c.lastIndexOf(a);p>-1&&(c=c.slice(0,p))}return c+i},Fn.unescape=function(e){return(e=ys(e))&&W.test(e)?e.replace(G,fn):e},Fn.uniqueId=function(e){var t=++De;return ys(e)+t},Fn.upperCase=Ys,Fn.upperFirst=Xs,Fn.each=yo,Fn.eachRight=vo,Fn.first=Ga,ol(Fn,function(){var e={};return br(Fn,function(t,n){Re.call(Fn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Fn.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Fn[e].placeholder=Fn}),_t(["drop","take"],function(e,t){Un.prototype[e]=function(r){r=r===n?1:yn(ps(r),0);var i=this.__filtered__&&!t?new Un(this):this.clone();return i.__filtered__?i.__takeCount__=vn(r,i.__takeCount__):i.__views__.push({size:vn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(nl)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Xr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Nr(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Ro(sa(e)))},Un.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(d)},br(Un.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=Fn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);a&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Un,c=s[0],u=l||Uo(t),h=function(e){var t=a.apply(Fn,Lt([e],s));return i&&d?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){t=g?t:new Un(this);var m=e.apply(t,s);return m.__actions__.push({func:ho,args:[h],thisArg:n}),new Hn(m,d)}return f&&g?e.apply(this,s):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ne[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Uo(i)?i:[],e)}return this[n](function(n){return t.apply(Uo(n)?n:[],e)})}}),br(Un.prototype,function(e,t){var n=Fn[t];if(n){var r=n.name+"";Re.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}}),In[Fi(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Uo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,r=this;r instanceof jn;){var i=$a(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:ho,args:[Za],thisArg:n}),new Hn(t,this.__chain__)}return this.thru(Za)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Ze&&(Fn.prototype[Ze]=function(){return this}),Fn}();pt?((pt.exports=gn)._=gn,dt._=gn):ht._=gn}).call(Qt)}(rE,rE.exports);var iE=rE.exports;function aE(e){const{config:t={},aggregations:n=[],filter:r={},onSearch:i}=e,[a,o]=d(r);return Iw.jsx("div",{children:n.map(e=>{let n=0;e.list.forEach(e=>n+=e.count);const r=a[e.key]||[],s=e.list?.length>0&&e.list.every(e=>r.includes(e.key));return Iw.jsxs("div",{className:"mb-24px",children:[Iw.jsxs("div",{className:"mb-12px flex justify-between items-center",children:[Iw.jsx("div",{className:"text-[#999] uppercase",children:t?.[e.key]?.displayName||e.key}),Iw.jsx("div",{className:"cursor-pointer",children:Iw.jsx(Uw,{className:"w-14px h-14px text-[#bbb]",onClick:()=>(e=>{const t=iE.cloneDeep(a);delete t[e.key],o(t),i(t)})(e)})})]}),Iw.jsxs("div",{children:[Iw.jsxs("div",{className:"color-[rgba(102,102,102,1)] flex mb-16px",children:[Iw.jsx(Cy,{className:"mr-8px",checked:s,onChange:t=>((e,t)=>{const n=iE.cloneDeep(a);e?n[t.key]=t.list.map(e=>e.key):delete n[t.key],o(n),i(n)})(t.target.checked,e)}),Iw.jsxs("div",{className:"flex items-center justify-between w-[calc(100%-24px)] text-[#666]",children:[Iw.jsxs("div",{className:"flex-1 flex items-center",children:[Iw.jsx("img",{className:"w-4 h-4 mr-2",src:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22128px%22%20height%3D%22128.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M102.4%20238.933A136.533%20136.533%200%200%201%20238.933%20102.4h102.4a136.533%20136.533%200%200%201%20136.534%20136.533v102.4a136.533%20136.533%200%200%201-136.534%20136.534h-102.4A136.533%20136.533%200%200%201%20102.4%20341.333v-102.4z%20m0%20443.734a136.533%20136.533%200%200%201%20136.533-136.534h102.4a136.533%20136.533%200%200%201%20136.534%20136.534v102.4A136.533%20136.533%200%200%201%20341.333%20921.6h-102.4A136.533%20136.533%200%200%201%20102.4%20785.067v-102.4z%20m580.267-136.534a136.533%20136.533%200%200%200-136.534%20136.534v102.4A136.533%20136.533%200%200%200%20682.667%20921.6h102.4A136.533%20136.533%200%200%200%20921.6%20785.067v-102.4a136.533%20136.533%200%200%200-136.533-136.534h-102.4z%22%20fill%3D%22%23FF7744%22%20%2F%3E%3Cpath%20d%3D%22M546.133%20238.933A136.533%20136.533%200%200%201%20682.667%20102.4h102.4A136.533%20136.533%200%200%201%20921.6%20238.933v102.4a136.533%20136.533%200%200%201-136.533%20136.534h-102.4a136.533%20136.533%200%200%201-136.534-136.534v-102.4z%22%20fill%3D%22%23FFAA44%22%20%2F%3E%3C%2Fsvg%3E"}),"All"]}),Iw.jsx("div",{children:n||0})]})]}),e.list.map((t,n)=>Iw.jsxs("div",{className:"color-[rgba(102,102,102,1)] flex mb-16px",children:[Iw.jsx(Cy,{className:"mr-8px",checked:r?.some(e=>e===t.key),onChange:n=>((e,t,n)=>{const r=iE.cloneDeep(a);if(e)r[t.key]||(r[t.key]=[]),r[t.key].push(n.key);else{const e=r[t.key]?.findIndex(e=>e===n.key);-1!==e&&r[t.key].splice(e,1),0===r[t.key]?.length&&delete r[t.key]}o(r),i(r)})(n.target.checked,e,t)}),Iw.jsxs("div",{className:"flex items-center justify-between w-[calc(100%-24px)] gap-6px text-[#666]",children:[Iw.jsxs("div",{className:"flex-1 flex items-center truncate",children:[Iw.jsx("img",{className:"w-4 h-4 mr-2",src:t.icon||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22128px%22%20height%3D%22128.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M512%200c282.7776%200%20512%20229.2224%20512%20512s-229.2224%20512-512%20512S0%20794.7776%200%20512%20229.2224%200%20512%200z%20m102.4%20716.8H409.6a51.2%2051.2%200%200%200%200%20102.4h204.8a51.2%2051.2%200%200%200%200-102.4z%20m51.2-204.8H358.4a51.2%2051.2%200%200%200%200%20102.4h307.2a51.2%2051.2%200%200%200%200-102.4z%20m51.2-204.8H307.2a51.2%2051.2%200%201%200%200%20102.4h409.6a51.2%2051.2%200%200%200%200-102.4z%22%20fill%3D%22%230080FF%22%20%2F%3E%3C%2Fsvg%3E"}),t.name||t.key]}),Iw.jsx("div",{className:"flex-shrink-0",children:t.count})]})]},n))]})]},e.key)})})}function oE(e){const{hits:t,isMobile:n}=e;return Iw.jsxs("div",{className:"flex justify-between items-center w-full text-[#999]",children:[Iw.jsxs("div",{className:"text-12px",children:["Found ",t?.total||0," records (",t?.took||0," millisecond)"]}),n?Iw.jsx(Vw,{className:"w-14px h-14px"}):null]})}var sE="index-module__detail___InBmd",lE={exports:{}};lE.exports=function(e,t,n){e=e||{};var r=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var l,c,u,h=a.$locale().relativeTime||i,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=d.length,f=0;f0,m<=g.r||!g.r){m<=1&&f>0&&(g=d[f-1]);var y=h[g.l];s&&(m=s(""+m)),c="string"==typeof y?y.replace("%d",m):y(m,r,g.l,u);break}}if(r)return c;var v=u?h.future:h.past;return"function"==typeof v?v(c):v.replace("%s",c)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}};var cE=Zt(lE.exports);Rm.extend(cE);const uE=e=>{const t=Rm(e);return Rm().diff(t)<=6048e5},hE=e=>{const t=Rm(e);return uE(e)?t.fromNow():t.format("YYYY-MM-DD HH:mm:ss")};function dE(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function UE(e,t){return t in e?e[t]:t}function GE(e,t){return UE(e,t.toLowerCase())}const qE=jE({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:RE,acceptCharset:ME,accessKey:ME,action:null,allow:null,allowFullScreen:NE,allowPaymentRequest:NE,allowUserMedia:NE,alt:null,as:null,async:NE,autoCapitalize:null,autoComplete:ME,autoFocus:NE,autoPlay:NE,blocking:ME,capture:null,charSet:null,checked:NE,cite:null,className:ME,cols:LE,colSpan:null,content:null,contentEditable:IE,controls:NE,controlsList:ME,coords:LE|RE,crossOrigin:null,data:null,dateTime:null,decoding:null,default:NE,defer:NE,dir:null,dirName:null,disabled:NE,download:OE,draggable:IE,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:NE,formTarget:null,headers:ME,height:LE,hidden:OE,high:LE,href:null,hrefLang:null,htmlFor:ME,httpEquiv:ME,id:null,imageSizes:null,imageSrcSet:null,inert:NE,inputMode:null,integrity:null,is:null,isMap:NE,itemId:null,itemProp:ME,itemRef:ME,itemScope:NE,itemType:ME,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:NE,low:LE,manifest:null,max:null,maxLength:LE,media:null,method:null,min:null,minLength:LE,multiple:NE,muted:NE,name:null,nonce:null,noModule:NE,noValidate:NE,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:NE,optimum:LE,pattern:null,ping:ME,placeholder:null,playsInline:NE,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:NE,referrerPolicy:null,rel:ME,required:NE,reversed:NE,rows:LE,rowSpan:LE,sandbox:ME,scope:null,scoped:NE,seamless:NE,selected:NE,shadowRootClonable:NE,shadowRootDelegatesFocus:NE,shadowRootMode:null,shape:null,size:LE,sizes:null,slot:null,span:LE,spellCheck:IE,src:null,srcDoc:null,srcLang:null,srcSet:null,start:LE,step:null,style:null,tabIndex:LE,target:null,title:null,translate:null,type:null,typeMustMatch:NE,useMap:null,value:IE,width:LE,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ME,axis:null,background:null,bgColor:null,border:LE,borderColor:null,bottomMargin:LE,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:NE,declare:NE,event:null,face:null,frame:null,frameBorder:null,hSpace:LE,leftMargin:LE,link:null,longDesc:null,lowSrc:null,marginHeight:LE,marginWidth:LE,noResize:NE,noHref:NE,noShade:NE,noWrap:NE,object:null,profile:null,prompt:null,rev:null,rightMargin:LE,rules:null,scheme:null,scrolling:IE,standby:null,summary:null,text:null,topMargin:LE,valueType:null,version:null,vAlign:null,vLink:null,vSpace:LE,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:NE,disableRemotePlayback:NE,prefix:null,property:null,results:LE,security:null,unselectable:null},space:"html",transform:GE}),WE=jE({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:DE,accentHeight:LE,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:LE,amplitude:LE,arabicForm:null,ascent:LE,attributeName:null,attributeType:null,azimuth:LE,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:LE,by:null,calcMode:null,capHeight:LE,className:ME,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:LE,diffuseConstant:LE,direction:null,display:null,dur:null,divisor:LE,dominantBaseline:null,download:NE,dx:null,dy:null,edgeMode:null,editable:null,elevation:LE,enableBackground:null,end:null,event:null,exponent:LE,externalResourcesRequired:null,fill:null,fillOpacity:LE,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:RE,g2:RE,glyphName:RE,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:LE,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:LE,horizOriginX:LE,horizOriginY:LE,id:null,ideographic:LE,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:LE,k:LE,k1:LE,k2:LE,k3:LE,k4:LE,kernelMatrix:DE,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:LE,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:LE,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:LE,overlineThickness:LE,paintOrder:null,panose1:null,path:null,pathLength:LE,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ME,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:LE,pointsAtY:LE,pointsAtZ:LE,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:DE,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:DE,rev:DE,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:DE,requiredFeatures:DE,requiredFonts:DE,requiredFormats:DE,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:LE,specularExponent:LE,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:LE,strikethroughThickness:LE,string:null,stroke:null,strokeDashArray:DE,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:LE,strokeOpacity:LE,strokeWidth:null,style:null,surfaceScale:LE,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:DE,tabIndex:LE,tableValues:null,target:null,targetX:LE,targetY:LE,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:DE,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:LE,underlineThickness:LE,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:LE,values:null,vAlphabetic:LE,vMathematical:LE,vectorEffect:null,vHanging:LE,vIdeographic:LE,version:null,vertAdvY:LE,vertOriginX:LE,vertOriginY:LE,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:LE,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:UE}),VE=jE({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),YE=jE({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:GE}),XE=jE({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),KE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},QE=/[A-Z]/g,ZE=/-[a-z]/g,JE=/^data[-\w.:]+$/i;function ek(e,t){const n=CE(t);let r=t,i=SE;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&JE.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(ZE,nk);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!ZE.test(e)){let n=e.replace(QE,tk);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=FE}return new i(r,t)}function tk(e){return"-"+e.toLowerCase()}function nk(e){return e.charAt(1).toUpperCase()}const rk=_E([HE,qE,VE,YE,XE],"html"),ik=_E([HE,WE,VE,YE,XE],"svg");function ak(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ok(e){return e.join(" ").trim()}var sk={},lk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ck=/\n/g,uk=/^\s*/,hk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dk=/^:\s*/,pk=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fk=/^[;\s]*/,gk=/^\s+|\s+$/g,mk="";function yk(e){return e?e.replace(gk,mk):mk}var vk=Qt&&Qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sk,"__esModule",{value:!0}),sk.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,bk.default)(e),i="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,a=e.value;i?t(r,a,e):a&&((n=n||{})[r]=a)}}),n};var bk=vk(function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(e){var t=e.match(ck);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),c(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(i){var a=new Error(t.source+":"+n+":"+r+": "+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function l(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function c(){l(uk)}function u(e){var t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;mk!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,mk===e.charAt(n-1))return s("End of comment missing");var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:"comment",comment:o})}}function d(){var e=a(),t=l(hk);if(t){if(h(),!l(dk))return s("property missing ':'");var n=l(pk),r=e({type:"declaration",property:yk(t[0].replace(lk,mk)),value:n?yk(n[0].replace(lk,mk)):mk});return l(fk),r}}return o.prototype.content=e,c(),function(){var e,t=[];for(u(t);e=d();)!1!==e&&(t.push(e),u(t));return t}()});var xk={};Object.defineProperty(xk,"__esModule",{value:!0}),xk.camelCase=void 0;var wk=/^--[a-zA-Z0-9_-]+$/,Ek=/-([a-z])/g,kk=/^[^-]+$/,Tk=/^-(webkit|moz|ms|o|khtml)-/,_k=/^-(ms)-/,Ck=function(e,t){return t.toUpperCase()},Sk=function(e,t){return"".concat(t,"-")};xk.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||kk.test(e)||wk.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(_k,Sk):e.replace(Tk,Sk)).replace(Ek,Ck))};var Ak=(Qt&&Qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(sk),Nk=xk;function Ik(e,t){var n={};return e&&"string"==typeof e?((0,Ak.default)(e,function(e,r){e&&r&&(n[(0,Nk.camelCase)(e,t)]=r)}),n):n}Ik.default=Ik;var Ok=Zt(Ik);const Lk=Rk("end"),Mk=Rk("start");function Rk(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Dk(e){return e&&"object"==typeof e?"position"in e||"type"in e?$k(e.position):"start"in e||"end"in e?$k(e):"line"in e||"column"in e?Pk(e):"":""}function Pk(e){return Bk(e&&e.line)+":"+Bk(e&&e.column)}function $k(e){return Pk(e&&e.start)+"-"+Pk(e&&e.end)}function Bk(e){return e&&"number"==typeof e?e:1}class Fk extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=Dk(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Fk.prototype.file="",Fk.prototype.name="",Fk.prototype.reason="",Fk.prototype.message="",Fk.prototype.stack="",Fk.prototype.column=void 0,Fk.prototype.line=void 0,Fk.prototype.ancestors=void 0,Fk.prototype.cause=void 0,Fk.prototype.fatal=void 0,Fk.prototype.place=void 0,Fk.prototype.ruleId=void 0,Fk.prototype.source=void 0;const zk={}.hasOwnProperty,jk=new Map,Hk=/[A-Z]/g,Uk=new Set(["table","tbody","thead","tfoot","tr"]),Gk=new Set(["td","th"]),qk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wk(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,i,a){const o=Array.isArray(i.children),s=Mk(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,i,a){const o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}(0,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ik:rk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=Vk(i,e,void 0);return a&&"string"!=typeof a?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Vk(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=ik,e.schema=i);e.ancestors.push(t);const a=Zk(e,t.tagName,!1),o=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&zk.call(t.properties,i)){const a=Qk(e,i,t.properties[i]);if(a){const[i,o]=a;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof o&&Gk.has(t.tagName)?r=o:n[i]=o}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Kk(e,t);Uk.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&kE(t.value):kE(t));var t}));return Yk(e,o,a,t),Xk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Jk(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=ik,e.schema=i);e.ancestors.push(t);const a=null===t.name?e.Fragment:Zk(e,t.name,!0),o=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];fE(t.type);const i=t.expression;fE(i.type);const a=i.properties[0];fE(a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Jk(e,t.position);else{const i=r.name;let a;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];fE(t.type),a=e.evaluater.evaluateExpression(t.expression)}else Jk(e,t.position);else a=null===r.value||r.value;n[i]=a}return n}(e,t),s=Kk(e,t);return Yk(e,o,a,t),Xk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jk(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Xk(r,Kk(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Yk(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Kk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jk;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(cT(e,e.length,0,t),e):t}const hT={}.hasOwnProperty;function dT(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function mT(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yT=NT(/[A-Za-z]/),vT=NT(/[\dA-Za-z]/),bT=NT(/[#-'*+\--9=?A-Z^-~]/);function xT(e){return null!==e&&(e<32||127===e)}const wT=NT(/\d/),ET=NT(/[\dA-Fa-f]/),kT=NT(/[!-/:-@[-`{-~]/);function TT(e){return null!==e&&e<-2}function _T(e){return null!==e&&(e<0||32===e)}function CT(e){return-2===e||-1===e||32===e}const ST=NT(/\p{P}|\p{S}/u),AT=NT(/\s/);function NT(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function IT(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function OT(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){if(CT(r))return e.enter(n),o(r);return t(r)};function o(r){return CT(r)&&a++a))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(y(o),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},RT={tokenize:function(e,t,n){return OT(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function DT(e){return null===e||_T(e)||AT(e)?1:ST(e)?2:void 0}function PT(e,t,n){const r=[];let i=-1;for(;++i1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const h={...e[n][1].end},d={...e[u][1].start};BT(h,-s),BT(d,s),a={type:s>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[n][1].end={...a.start},e[u][1].start={...o.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=uT(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=uT(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=uT(l,PT(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=uT(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=uT(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,cT(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u=s?(e.exit("codeFencedFenceSequence"),CT(t)?OT(e,h,"whitespace")(t):h(t)):n(t)}function h(r){return null===r||TT(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,o=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===a?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),CT(t)?OT(e,c,"whitespace")(t):c(t))}function c(n){return null===n||TT(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(GT,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||TT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):CT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),OT(e,h,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function h(t){return null===t||TT(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||TT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?n(t):(e.consume(t),d)}function p(t){return e.attempt(i,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return o>0&&CT(t)?OT(e,m,"linePrefix",o+1)(t):m(t)}function m(t){return null===t||TT(t)?e.check(GT,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||TT(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}};const WT={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),OT(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?a(e):n(e)}function a(t){return null===t?s(t):TT(t)?e.attempt(VT,a,s)(t):(e.enter("codeFlowValue"),o(t))}function o(t){return null===t||TT(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),o)}function s(n){return e.exit("codeIndented"),t(n)}}},VT={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):TT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):OT(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):TT(e)?i(e):n(e)}}};const YT={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&KT(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),KT(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),KT(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}};function t_(e,t,n,r,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),h;if(null===t||32===t||41===t||xT(t))return n(t);return e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function h(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),h(t)):null===t||60===t||TT(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(i){return u||null!==i&&41!==i&&!_T(i)?u999||null===h||91===h||93===h&&!s||94===h&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):93===h?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):TT(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||TT(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!CT(t)),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function r_(e,t,n,r,i,a){let o;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=40===t?41:t,s;return n(t)};function s(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),s(o)):null===t?n(t):TT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),OT(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||TT(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function i_(e,t){let n;return function r(i){if(TT(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(CT(i))return OT(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}const a_={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return n_.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return i=mT(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):n(t)}function o(t){return _T(t)?i_(e,s)(t):s(t)}function s(t){return t_(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(o_,c,c)(t)}function c(t){return CT(t)?OT(e,u,"whitespace")(t):u(t)}function u(a){return null===a||TT(a)?(e.exit("definition"),r.parser.defined.push(i),t(a)):n(a)}}},o_={partial:!0,tokenize:function(e,t,n){return function(t){return _T(t)?i_(e,r)(t):n(t)};function r(t){return r_(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return CT(t)?OT(e,a,"whitespace")(t):a(t)}function a(e){return null===e||TT(e)?t(e):n(e)}}};const s_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return TT(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const l_={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;"whitespace"===e[a][1].type&&(a+=2);i-2>a&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4);i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},cT(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||_T(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),o(n)):null===n||TT(n)?(e.exit("atxHeading"),t(n)):CT(n)?OT(e,a,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function o(t){return 35===t?(e.consume(t),o):(e.exit("atxHeadingSequence"),a(t))}function s(t){return null===t||35===t||_T(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),s)}}};const c_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],u_=["pre","script","style","textarea"],h_={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let i,a,o,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),a=!0,p):63===s?(e.consume(s),i=3,r.interrupt?t:R):yT(s)?(e.consume(s),o=String.fromCharCode(s),f):n(s)}function u(a){return 45===a?(e.consume(a),i=2,h):91===a?(e.consume(a),i=5,s=0,d):yT(a)?(e.consume(a),i=4,r.interrupt?t:R):n(a)}function h(i){return 45===i?(e.consume(i),r.interrupt?t:R):n(i)}function d(i){const a="CDATA[";return i===a.charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:C:d):n(i)}function p(t){return yT(t)?(e.consume(t),o=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||_T(s)){const l=47===s,c=o.toLowerCase();return l||a||!u_.includes(c)?c_.includes(o.toLowerCase())?(i=6,l?(e.consume(s),g):r.interrupt?t(s):C(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?m(s):y(s)):(i=1,r.interrupt?t(s):C(s))}return 45===s||vT(s)?(e.consume(s),o+=String.fromCharCode(s),f):n(s)}function g(i){return 62===i?(e.consume(i),r.interrupt?t:C):n(i)}function m(t){return CT(t)?(e.consume(t),m):T(t)}function y(t){return 47===t?(e.consume(t),T):58===t||95===t||yT(t)?(e.consume(t),v):CT(t)?(e.consume(t),y):T(t)}function v(t){return 45===t||46===t||58===t||95===t||vT(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),x):CT(t)?(e.consume(t),b):y(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):CT(t)?(e.consume(t),x):E(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||TT(t)?n(t):(e.consume(t),w)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||_T(t)?b(t):(e.consume(t),E)}function k(e){return 47===e||62===e||CT(e)?y(e):n(e)}function T(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||TT(t)?C(t):CT(t)?(e.consume(t),_):n(t)}function C(t){return 45===t&&2===i?(e.consume(t),I):60===t&&1===i?(e.consume(t),O):62===t&&4===i?(e.consume(t),D):63===t&&3===i?(e.consume(t),R):93===t&&5===i?(e.consume(t),M):!TT(t)||6!==i&&7!==i?null===t||TT(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(d_,P,S)(t))}function S(t){return e.check(p_,A,P)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||TT(t)?S(t):(e.enter("htmlFlowData"),C(t))}function I(t){return 45===t?(e.consume(t),R):C(t)}function O(t){return 47===t?(e.consume(t),o="",L):C(t)}function L(t){if(62===t){const n=o.toLowerCase();return u_.includes(n)?(e.consume(t),D):C(t)}return yT(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),L):C(t)}function M(t){return 93===t?(e.consume(t),R):C(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===i?(e.consume(t),R):C(t)}function D(t){return null===t||TT(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),D)}function P(n){return e.exit("htmlFlow"),t(n)}}},d_={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zT,t,n)}}},p_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(TT(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const f_={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,a,o;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),v):yT(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,p):yT(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):TT(t)?(o=u,L(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?O(e):45===e?h(e):u(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),6===a?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),g):TT(t)?(o=f,L(t)):(e.consume(t),f)}function g(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?O(t):93===t?(e.consume(t),m):f(t)}function y(t){return null===t||62===t?O(t):TT(t)?(o=y,L(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):TT(t)?(o=v,L(t)):(e.consume(t),v)}function b(e){return 62===e?O(e):v(e)}function x(t){return yT(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||vT(t)?(e.consume(t),w):E(t)}function E(t){return TT(t)?(o=E,L(t)):CT(t)?(e.consume(t),E):O(t)}function k(t){return 45===t||vT(t)?(e.consume(t),k):47===t||62===t||_T(t)?T(t):n(t)}function T(t){return 47===t?(e.consume(t),O):58===t||95===t||yT(t)?(e.consume(t),_):TT(t)?(o=T,L(t)):CT(t)?(e.consume(t),T):O(t)}function _(t){return 45===t||46===t||58===t||95===t||vT(t)?(e.consume(t),_):C(t)}function C(t){return 61===t?(e.consume(t),S):TT(t)?(o=C,L(t)):CT(t)?(e.consume(t),C):T(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,A):TT(t)?(o=S,L(t)):CT(t)?(e.consume(t),S):(e.consume(t),N)}function A(t){return t===i?(e.consume(t),i=void 0,I):null===t?n(t):TT(t)?(o=A,L(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||_T(t)?T(t):(e.consume(t),N)}function I(e){return 47===e||62===e||_T(e)?T(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function L(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return CT(t)?OT(e,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),o(t)}}};const g_={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t=3&&(null===a||TT(a))?(e.exit("thematicBreak"),t(a)):n(a)}function o(t){return t===r?(e.consume(t),i++,o):(e.exit("thematicBreakSequence"),CT(t)?OT(e,a,"whitespace")(t):a(t))}}};const k_={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zT,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,OT(e,t,"listItemIndent",r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!CT(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(__,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,OT(e,e.attempt(k_,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,o=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:wT(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(E_,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return wT(t)&&++o<10?(e.consume(t),s):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(zT,r.interrupt?n:c,e.attempt(T_,h,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,h(e)}function u(t){return CT(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),h):n(t)}function h(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},T_={partial:!0,tokenize:function(e,t,n){const r=this;return OT(e,function(e){const i=r.events[r.events.length-1];return!CT(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},__={partial:!0,tokenize:function(e,t,n){const r=this;return OT(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const C_={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=o;return e.push(["exit",o,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let o,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){o="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||o))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t);return n(t)};function a(t){return t===i?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),CT(t)?OT(e,o,"lineSuffix")(t):o(t))}function o(r){return null===r||TT(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const S_={tokenize:function(e){const t=this,n=e.attempt(zT,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,OT(e,e.attempt(this.parser.constructs.flow,r,e.attempt(JT,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const A_={resolveAll:L_()},N_=O_("string"),I_=O_("text");function O_(e){return{resolveAll:L_("text"===e?M_:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return l(e)?i(e):o(e)}function o(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i-1){const e=o[0];"string"==typeof e?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}(o,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(){let e;for(;r._index0){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||Q_).call(a,void 0,e[0])}for(r.position={start:Y_(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Y_(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h1:t}function tC(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(nC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(nC(t.slice(i),i>0,!1)),a.join("")}function nC(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const rC={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=IT(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J_(e,t);const i={src:IT(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:IT(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J_(e,t);const i={href:IT(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:IT(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Mk(t.children[1]),o=Lk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,o=a?a.length:t.children.length;let s=-1;const l=[];for(;++s((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{const e=n([],i);for(const t of o)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{const{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of o)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of o)e.add(r(t));return e}case 7:{const{name:e,message:t}=o;return n(new aC[e](t),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new aC[a](o),i)};return r})(new Map,e)(0),sC="",{toString:lC}={},{keys:cC}=Object,uC=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=lC.call(e).slice(8,-1);switch(n){case"Array":return[1,sC];case"Object":return[2,sC];case"Date":return[3,sC];case"RegExp":return[4,sC];case"Map":return[5,sC];case"Set":return[6,sC];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},hC=([e,t])=>0===e&&("function"===t||"symbol"===t),dC=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=uC(r);switch(o){case 0:{let t=r;switch(s){case"bigint":o=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),i([s,[...e]],r)}const e=[],t=i([o,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],l=i([o,n],r);for(const t of cC(r))!e&&hC(uC(r[t]))||n.push([a(t),a(r[t])]);return l}case 3:return i([o,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{const t=[],n=i([o,t],r);for(const[n,i]of r)(e||!hC(uC(n))&&!hC(uC(i)))&&t.push([a(n),a(i)]);return n}case 6:{const t=[],n=i([o,t],r);for(const n of r)!e&&hC(uC(n))||t.push(a(n));return n}}const{message:l}=r;return i([o,{name:s,message:l}],r)};return a})(!(t||n),!!t,new Map,r)(e),r};var pC="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?oC(dC(e,t)):structuredClone(e):(e,t)=>oC(dC(e,t));function fC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const mC=function(e){if(null==e)return vC;if("function"==typeof e)return yC(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n":"")+")"})}return u;function u(){let c,u,h,d=bC;if((!t||a(i,s,l[l.length-1]||void 0))&&(d=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[xC,e];return null==e?bC:[e]}(n(i,l)),d[0]===wC))return d;if("children"in i&&i.children){const t=i;if(t.children&&d[0]!==EC)for(u=(r?t.children.length:-1)+o,h=l.concat(t);u>-1&&u0&&n.push({type:"text",value:"\n"}),n}function OC(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function LC(e,t){const n=function(e,t){const n=t||CC,r=new Map,i=new Map,a=new Map,o={...rC,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r0&&h.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...h)}else a.push(...h);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...pC(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:"\n"},i),a}function MC(e,t){return e&&"run"in e?async function(n,r){const i=LC(n,{file:r,...t});await e.run(i,r)}:function(n,r){return LC(n,{file:r,...e||t})}}function RC(e){if(e)throw e}var DC=Object.prototype.hasOwnProperty,PC=Object.prototype.toString,$C=Object.defineProperty,BC=Object.getOwnPropertyDescriptor,FC=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===PC.call(e)},zC=function(e){if(!e||"[object Object]"!==PC.call(e))return!1;var t,n=DC.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&DC.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||DC.call(e,t)},jC=function(e,t){$C&&"__proto__"===t.name?$C(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},HC=function(e,t){if("__proto__"===t){if(!DC.call(e,t))return;if(BC)return BC(e,t).value}return e[t]},UC=function e(){var t,n,r,i,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});lt.length;let o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(o&&o.then&&"function"==typeof o.then?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}(s,i)(...o):r(null,...o)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const VC={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');YC(e);let n,r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(i=a):(s=-1,i=o));r===i?i=o:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(YC(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){YC(e);let t,n=e.length,r=-1,i=0,a=-1,o=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==o&&(o=1):a>-1&&(o=-1);else if(t){i=n+1;break}}if(a<0||r<0||0===o||1===o&&a===r-1&&a===i+1)return"";return e.slice(a,r)},join:function(...e){let t,n=-1;for(;++n2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",a=0):(i=i.slice(0,r),a=i.length-1-i.lastIndexOf("/")),o=l,s=0;continue}}else if(i.length>0){i="",a=0,o=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,l):i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function YC(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const XC={cwd:function(){return"/"}};function KC(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function QC(e){if("string"==typeof e)e=new URL(e);else if(!KC(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("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n0){let[r,...a]=t;const o=n[i][1];qC(o)&&qC(r)&&(r=GC(!0,o,r)),n[i]=[e,r,...a]}}}}const oS=(new aS).freeze();function sS(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function lS(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function cS(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uS(e){if(!qC(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function hS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function dS(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new JC(e)}const pS=[],fS={allowDangerousHtml:!0},gS=/^(https?|ircs?|mailto|xmpp)$/i,mS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yS(e){const t=function(e){const t=e.rehypePlugins||pS,n=e.remarkPlugins||pS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fS}:fS,i=oS().use(Z_).use(n).use(MC,r).use(t);return i}(e),n=function(e){const t=e.children||"",n=new JC;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||vS;for(const e of mS)Object.hasOwn(t,e.from)&&gE((e.from,e.to&&e.to,e.id));return TC(e,c),Wk(e,{Fragment:Iw.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Iw.jsx,jsxs:Iw.jsxs,passKeys:!0,passNode:!0});function c(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return o?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in nT)if(Object.hasOwn(nT,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=nT[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let o=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!o&&r&&"number"==typeof t&&(o=!r(e,t,i)),o&&i&&"number"==typeof t)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function vS(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||gS.test(e.slice(0,t))?e:""}function bS(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}const xS={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),s(t)};function s(t){return 36===t?(e.consume(t),o++,s):o<2?n(t):(e.exit("mathFlowFenceSequence"),OT(e,l,"whitespace")(t))}function l(t){return null===t||TT(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||TT(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(wS,h,g)(n)}function h(t){return e.attempt({tokenize:m,partial:!0},g,d)(t)}function d(t){return(a?OT(e,p,"linePrefix",a+1):p)(t)}function p(t){return null===t?g(t):TT(t)?e.attempt(wS,h,g)(t):(e.enter("mathFlowValue"),f(t))}function f(t){return null===t||TT(t)?(e.exit("mathFlowValue"),p(t)):(e.consume(t),f)}function g(n){return e.exit("mathFlow"),t(n)}function m(e,t,n){let i=0;return OT(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function a(t){return 36===t?(i++,e.consume(t),a):i15?"…"+o.slice(n-15,n):o.slice(0,n))+s+(r+15":">","<":"<",'"':""","'":"'"},IS=/[&><"']/g;var OS=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},LS={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(IS,e=>NS[e])},hyphenate:function(e){return e.replace(AS,"-$1").toLowerCase()},getBaseElem:OS,isCharacterBox:function(e){var t=OS(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},MS={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function RS(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class DS{constructor(e){for(var t in 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||{},MS)if(MS.hasOwnProperty(t)){var n=MS[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:RS(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new SS("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=LS.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class PS{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return $S[BS[this.id]]}sub(){return $S[FS[this.id]]}fracNum(){return $S[zS[this.id]]}fracDen(){return $S[jS[this.id]]}cramp(){return $S[HS[this.id]]}text(){return $S[US[this.id]]}isTight(){return this.size>=2}}var $S=[new PS(0,0,!1),new PS(1,0,!0),new PS(2,1,!1),new PS(3,1,!0),new PS(4,2,!1),new PS(5,2,!0),new PS(6,3,!1),new PS(7,3,!0)],BS=[4,5,4,5,6,7,6,7],FS=[5,5,5,5,7,7,7,7],zS=[2,3,4,5,6,7,6,7],jS=[3,3,5,5,7,7,7,7],HS=[1,1,3,3,5,5,7,7],US=[0,1,2,3,2,3,2,3],GS={DISPLAY:$S[0],TEXT:$S[2],SCRIPT:$S[4],SCRIPTSCRIPT:$S[6]},qS=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var WS=[];function VS(e){for(var t=0;t=WS[t]&&e<=WS[t+1])return!0;return!1}qS.forEach(e=>e.blocks.forEach(e=>WS.push(...e)));var YS=80,XS={doubleleftarrow:"M262 157\nl10-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\n 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\n 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\nc2 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\n 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\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-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\n 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\n-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\n-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\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-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\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 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\n-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\nc-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\n 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\n 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\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 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\n 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\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 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\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-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\n-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\n-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\n 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\n-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\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 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\n-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\n 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\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-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\n-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\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.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\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-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\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 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\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.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\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 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\n-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\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.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\n60.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\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 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\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.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\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 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\n-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\n 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\n 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\n-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\n-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\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-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\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.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\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-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\n 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\n 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\n-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\n-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\n 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\n-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\n 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\nm0 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\n 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\n-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\n-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\n 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\n 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\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-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\n 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\n-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\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-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\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 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\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 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\nc-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\n 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\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 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\n-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\n 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\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-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\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 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\n 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\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -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\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-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\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-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\n-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\n-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\n-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,\n-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,\n-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,\n-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,\n-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\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-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\ns-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\n121.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\ns2.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\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-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\n13.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\n-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\n-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\n-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\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,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\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM0 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\nc1.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,\n1c0,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,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 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\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class KS{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 LS.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;te.toText()).join("")}}var QS={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ZS={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},JS={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function eA(e,t){QS[e]=t}function tA(e,t,n){if(!QS[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=QS[t][r];if(!i&&e[0]in JS&&(r=JS[e[0]].charCodeAt(0),i=QS[t][r]),i||"text"!==n||VS(r)&&(i=QS[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nA={};var rA=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],iA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],aA=function(e,t){return t.size<2?e:rA[e-1][t.size-1]};class oA{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||oA.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=iA[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new oA(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:aA(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:iA[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=aA(oA.BASESIZE,e);return this.size===t&&this.textSize===oA.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==oA.BASESIZE?["sizing","reset-size"+this.size,"size"+oA.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!nA[t=e>=5?0:e>=3?1:2]){var n=nA[t]={cssEmPerMu:ZS.quad[t]/18};for(var r in ZS)ZS.hasOwnProperty(r)&&(n[r]=ZS[r][t])}return nA[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}oA.BASESIZE=6;var sA={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},lA={ex:!0,em:!0,mu:!0},cA=function(e){return"string"!=typeof e&&(e=e.unit),e in sA||e in lA||"ex"===e},uA=function(e,t){var n;if(e.unit in sA)n=sA[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new SS("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},hA=function(e){return+e.toFixed(4)+"em"},dA=function(e){return e.filter(e=>e).join(" ")},pA=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},fA=function(e){var t=document.createElement(e);for(var n in t.className=dA(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,mA=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+LS.escape(dA(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=LS.hyphenate(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+LS.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(gA.test(i))throw new SS("Invalid attribute name '"+i+"'");t+=" "+i+'="'+LS.escape(this.attributes[i])+'"'}t+=">";for(var a=0;a"};class yA{constructor(e,t,n,r){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,pA.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return LS.contains(this.classes,e)}toNode(){return fA.call(this,"span")}toMarkup(){return mA.call(this,"span")}}class vA{constructor(e,t,n,r){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,pA.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return LS.contains(this.classes,e)}toNode(){return fA.call(this,"a")}toMarkup(){return mA.call(this,"a")}}class bA{constructor(e,t,n){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.style=n}hasClass(e){return LS.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=''+LS.escape(this.alt)+'=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=xA[this.text])}hasClass(e){return LS.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=hA(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=dA(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=LS.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+LS.escape(n)+'"');var i=LS.escape(this.text);return e?(t+=">",t+=i,t+=""):i}}class EA{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n':''}}class TA{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="","\\gt",!0),NA(IA,LA,HA,"∈","\\in",!0),NA(IA,LA,HA,"","\\@not"),NA(IA,LA,HA,"⊂","\\subset",!0),NA(IA,LA,HA,"⊃","\\supset",!0),NA(IA,LA,HA,"⊆","\\subseteq",!0),NA(IA,LA,HA,"⊇","\\supseteq",!0),NA(IA,MA,HA,"⊈","\\nsubseteq",!0),NA(IA,MA,HA,"⊉","\\nsupseteq",!0),NA(IA,LA,HA,"⊨","\\models"),NA(IA,LA,HA,"←","\\leftarrow",!0),NA(IA,LA,HA,"≤","\\le"),NA(IA,LA,HA,"≤","\\leq",!0),NA(IA,LA,HA,"<","\\lt",!0),NA(IA,LA,HA,"→","\\rightarrow",!0),NA(IA,LA,HA,"→","\\to"),NA(IA,MA,HA,"≱","\\ngeq",!0),NA(IA,MA,HA,"≰","\\nleq",!0),NA(IA,LA,UA," ","\\ "),NA(IA,LA,UA," ","\\space"),NA(IA,LA,UA," ","\\nobreakspace"),NA(OA,LA,UA," ","\\ "),NA(OA,LA,UA," "," "),NA(OA,LA,UA," ","\\space"),NA(OA,LA,UA," ","\\nobreakspace"),NA(IA,LA,UA,null,"\\nobreak"),NA(IA,LA,UA,null,"\\allowbreak"),NA(IA,LA,jA,",",","),NA(IA,LA,jA,";",";"),NA(IA,MA,DA,"⊼","\\barwedge",!0),NA(IA,MA,DA,"⊻","\\veebar",!0),NA(IA,LA,DA,"⊙","\\odot",!0),NA(IA,LA,DA,"⊕","\\oplus",!0),NA(IA,LA,DA,"⊗","\\otimes",!0),NA(IA,LA,GA,"∂","\\partial",!0),NA(IA,LA,DA,"⊘","\\oslash",!0),NA(IA,MA,DA,"⊚","\\circledcirc",!0),NA(IA,MA,DA,"⊡","\\boxdot",!0),NA(IA,LA,DA,"△","\\bigtriangleup"),NA(IA,LA,DA,"▽","\\bigtriangledown"),NA(IA,LA,DA,"†","\\dagger"),NA(IA,LA,DA,"⋄","\\diamond"),NA(IA,LA,DA,"⋆","\\star"),NA(IA,LA,DA,"◃","\\triangleleft"),NA(IA,LA,DA,"▹","\\triangleright"),NA(IA,LA,zA,"{","\\{"),NA(OA,LA,GA,"{","\\{"),NA(OA,LA,GA,"{","\\textbraceleft"),NA(IA,LA,PA,"}","\\}"),NA(OA,LA,GA,"}","\\}"),NA(OA,LA,GA,"}","\\textbraceright"),NA(IA,LA,zA,"{","\\lbrace"),NA(IA,LA,PA,"}","\\rbrace"),NA(IA,LA,zA,"[","\\lbrack",!0),NA(OA,LA,GA,"[","\\lbrack",!0),NA(IA,LA,PA,"]","\\rbrack",!0),NA(OA,LA,GA,"]","\\rbrack",!0),NA(IA,LA,zA,"(","\\lparen",!0),NA(IA,LA,PA,")","\\rparen",!0),NA(OA,LA,GA,"<","\\textless",!0),NA(OA,LA,GA,">","\\textgreater",!0),NA(IA,LA,zA,"⌊","\\lfloor",!0),NA(IA,LA,PA,"⌋","\\rfloor",!0),NA(IA,LA,zA,"⌈","\\lceil",!0),NA(IA,LA,PA,"⌉","\\rceil",!0),NA(IA,LA,GA,"\\","\\backslash"),NA(IA,LA,GA,"∣","|"),NA(IA,LA,GA,"∣","\\vert"),NA(OA,LA,GA,"|","\\textbar",!0),NA(IA,LA,GA,"∥","\\|"),NA(IA,LA,GA,"∥","\\Vert"),NA(OA,LA,GA,"∥","\\textbardbl"),NA(OA,LA,GA,"~","\\textasciitilde"),NA(OA,LA,GA,"\\","\\textbackslash"),NA(OA,LA,GA,"^","\\textasciicircum"),NA(IA,LA,HA,"↑","\\uparrow",!0),NA(IA,LA,HA,"⇑","\\Uparrow",!0),NA(IA,LA,HA,"↓","\\downarrow",!0),NA(IA,LA,HA,"⇓","\\Downarrow",!0),NA(IA,LA,HA,"↕","\\updownarrow",!0),NA(IA,LA,HA,"⇕","\\Updownarrow",!0),NA(IA,LA,FA,"∐","\\coprod"),NA(IA,LA,FA,"⋁","\\bigvee"),NA(IA,LA,FA,"⋀","\\bigwedge"),NA(IA,LA,FA,"⨄","\\biguplus"),NA(IA,LA,FA,"⋂","\\bigcap"),NA(IA,LA,FA,"⋃","\\bigcup"),NA(IA,LA,FA,"∫","\\int"),NA(IA,LA,FA,"∫","\\intop"),NA(IA,LA,FA,"∬","\\iint"),NA(IA,LA,FA,"∭","\\iiint"),NA(IA,LA,FA,"∏","\\prod"),NA(IA,LA,FA,"∑","\\sum"),NA(IA,LA,FA,"⨂","\\bigotimes"),NA(IA,LA,FA,"⨁","\\bigoplus"),NA(IA,LA,FA,"⨀","\\bigodot"),NA(IA,LA,FA,"∮","\\oint"),NA(IA,LA,FA,"∯","\\oiint"),NA(IA,LA,FA,"∰","\\oiiint"),NA(IA,LA,FA,"⨆","\\bigsqcup"),NA(IA,LA,FA,"∫","\\smallint"),NA(OA,LA,$A,"…","\\textellipsis"),NA(IA,LA,$A,"…","\\mathellipsis"),NA(OA,LA,$A,"…","\\ldots",!0),NA(IA,LA,$A,"…","\\ldots",!0),NA(IA,LA,$A,"⋯","\\@cdots",!0),NA(IA,LA,$A,"⋱","\\ddots",!0),NA(IA,LA,GA,"⋮","\\varvdots"),NA(OA,LA,GA,"⋮","\\varvdots"),NA(IA,LA,RA,"ˊ","\\acute"),NA(IA,LA,RA,"ˋ","\\grave"),NA(IA,LA,RA,"¨","\\ddot"),NA(IA,LA,RA,"~","\\tilde"),NA(IA,LA,RA,"ˉ","\\bar"),NA(IA,LA,RA,"˘","\\breve"),NA(IA,LA,RA,"ˇ","\\check"),NA(IA,LA,RA,"^","\\hat"),NA(IA,LA,RA,"⃗","\\vec"),NA(IA,LA,RA,"˙","\\dot"),NA(IA,LA,RA,"˚","\\mathring"),NA(IA,LA,BA,"","\\@imath"),NA(IA,LA,BA,"","\\@jmath"),NA(IA,LA,GA,"ı","ı"),NA(IA,LA,GA,"ȷ","ȷ"),NA(OA,LA,GA,"ı","\\i",!0),NA(OA,LA,GA,"ȷ","\\j",!0),NA(OA,LA,GA,"ß","\\ss",!0),NA(OA,LA,GA,"æ","\\ae",!0),NA(OA,LA,GA,"œ","\\oe",!0),NA(OA,LA,GA,"ø","\\o",!0),NA(OA,LA,GA,"Æ","\\AE",!0),NA(OA,LA,GA,"Œ","\\OE",!0),NA(OA,LA,GA,"Ø","\\O",!0),NA(OA,LA,RA,"ˊ","\\'"),NA(OA,LA,RA,"ˋ","\\`"),NA(OA,LA,RA,"ˆ","\\^"),NA(OA,LA,RA,"˜","\\~"),NA(OA,LA,RA,"ˉ","\\="),NA(OA,LA,RA,"˘","\\u"),NA(OA,LA,RA,"˙","\\."),NA(OA,LA,RA,"¸","\\c"),NA(OA,LA,RA,"˚","\\r"),NA(OA,LA,RA,"ˇ","\\v"),NA(OA,LA,RA,"¨",'\\"'),NA(OA,LA,RA,"˝","\\H"),NA(OA,LA,RA,"◯","\\textcircled");var qA={"--":!0,"---":!0,"``":!0,"''":!0};NA(OA,LA,GA,"–","--",!0),NA(OA,LA,GA,"–","\\textendash"),NA(OA,LA,GA,"—","---",!0),NA(OA,LA,GA,"—","\\textemdash"),NA(OA,LA,GA,"‘","`",!0),NA(OA,LA,GA,"‘","\\textquoteleft"),NA(OA,LA,GA,"’","'",!0),NA(OA,LA,GA,"’","\\textquoteright"),NA(OA,LA,GA,"“","``",!0),NA(OA,LA,GA,"“","\\textquotedblleft"),NA(OA,LA,GA,"”","''",!0),NA(OA,LA,GA,"”","\\textquotedblright"),NA(IA,LA,GA,"°","\\degree",!0),NA(OA,LA,GA,"°","\\degree"),NA(OA,LA,GA,"°","\\textdegree",!0),NA(IA,LA,GA,"£","\\pounds"),NA(IA,LA,GA,"£","\\mathsterling",!0),NA(OA,LA,GA,"£","\\pounds"),NA(OA,LA,GA,"£","\\textsterling",!0),NA(IA,MA,GA,"✠","\\maltese"),NA(OA,MA,GA,"✠","\\maltese");for(var WA='0123456789/@."',VA=0;VA<14;VA++){var YA=WA.charAt(VA);NA(IA,LA,GA,YA,YA)}for(var XA='0123456789!@*()-=+";:?/.,',KA=0;KA<25;KA++){var QA=XA.charAt(KA);NA(OA,LA,GA,QA,QA)}for(var ZA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",JA=0;JA<52;JA++){var eN=ZA.charAt(JA);NA(IA,LA,BA,eN,eN),NA(OA,LA,GA,eN,eN)}NA(IA,MA,GA,"C","ℂ"),NA(OA,MA,GA,"C","ℂ"),NA(IA,MA,GA,"H","ℍ"),NA(OA,MA,GA,"H","ℍ"),NA(IA,MA,GA,"N","ℕ"),NA(OA,MA,GA,"N","ℕ"),NA(IA,MA,GA,"P","ℙ"),NA(OA,MA,GA,"P","ℙ"),NA(IA,MA,GA,"Q","ℚ"),NA(OA,MA,GA,"Q","ℚ"),NA(IA,MA,GA,"R","ℝ"),NA(OA,MA,GA,"R","ℝ"),NA(IA,MA,GA,"Z","ℤ"),NA(OA,MA,GA,"Z","ℤ"),NA(IA,LA,BA,"h","ℎ"),NA(OA,LA,BA,"h","ℎ");for(var tN="",nN=0;nN<52;nN++){var rN=ZA.charAt(nN);NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56320+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56372+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56424+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56580+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56684+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56736+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56788+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56840+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56944+nN)),NA(OA,LA,GA,rN,tN),nN<26&&(NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56632+nN)),NA(OA,LA,GA,rN,tN),NA(IA,LA,BA,rN,tN=String.fromCharCode(55349,56476+nN)),NA(OA,LA,GA,rN,tN))}NA(IA,LA,BA,"k",tN=String.fromCharCode(55349,56668)),NA(OA,LA,GA,"k",tN);for(var iN=0;iN<10;iN++){var aN=iN.toString();NA(IA,LA,BA,aN,tN=String.fromCharCode(55349,57294+iN)),NA(OA,LA,GA,aN,tN),NA(IA,LA,BA,aN,tN=String.fromCharCode(55349,57314+iN)),NA(OA,LA,GA,aN,tN),NA(IA,LA,BA,aN,tN=String.fromCharCode(55349,57324+iN)),NA(OA,LA,GA,aN,tN),NA(IA,LA,BA,aN,tN=String.fromCharCode(55349,57334+iN)),NA(OA,LA,GA,aN,tN)}for(var oN="ÐÞþ",sN=0;sN<3;sN++){var lN=oN.charAt(sN);NA(IA,LA,BA,lN,lN),NA(OA,LA,GA,lN,lN)}var cN=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],uN=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],hN=function(e,t,n){return AA[n][e]&&AA[n][e].replace&&(e=AA[n][e].replace),{value:e,metrics:tA(e,t,n)}},dN=function(e,t,n,r,i){var a,o=hN(e,t,n),s=o.metrics;if(e=o.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),a=new wA(e,s.height,s.depth,l,s.skew,s.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),a=new wA(e,0,0,0,0,0,i);if(r){a.maxFontSize=r.sizeMultiplier,r.style.isTight()&&a.classes.push("mtight");var c=r.getColor();c&&(a.style.color=c)}return a},pN=(e,t)=>{if(dA(e.classes)!==dA(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},fN=function(e){for(var t=0,n=0,r=0,i=0;it&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},gN=function(e,t,n,r){var i=new yA(e,t,n,r);return fN(i),i},mN=(e,t,n,r)=>new yA(e,t,n,r),yN=function(e){var t=new KS(e);return fN(t),t},vN=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},bN={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},xN={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},wN={fontMap:bN,makeSymbol:dN,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&hN(e,"Main-Bold",t).metrics?dN(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===AA[t][e].font?dN(e,"Main-Regular",t,n,r):dN(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:gN,makeSvgSpan:mN,makeLineSpan:function(e,t,n){var r=gN([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=hA(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new vA(e,t,n,r);return fN(i),i},makeFragment:yN,wrapFragment:function(e,t){return e instanceof KS?gN([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a0)return dN(i,l,r,t,a.concat(c));if(s){var u,h;if("boldsymbol"===s){var d=function(e,t,n,r,i){return"textord"!==i&&hN(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);u=d.fontName,h=[d.fontClass]}else o?(u=bN[s].fontName,h=[s]):(u=vN(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(hN(i,u,r).metrics)return dN(i,u,r,t,a.concat(h));if(qA.hasOwnProperty(i)&&"Typewriter"===u.slice(0,10)){for(var p=[],f=0;f{var n=gN(["mspace"],[],t),r=uA(e,t);return n.style.marginRight=hA(r),n},staticSvg:function(e,t){var[n,r,i]=xN[e],a=new kA(n),o=new EA([a],{width:hA(r),height:hA(i),style:"width:"+hA(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),s=mN(["overlay"],[o],t);return s.height=i,s.style.height=hA(i),s.style.width=hA(r),s},svgData:xN,tryCombineChars:e=>{for(var t=0;t{var n=t.classes[0],r=e.classes[0];"mbin"===n&&LS.contains(PN,r)?t.classes[0]="mord":"mbin"===r&&LS.contains(DN,n)&&(e.classes[0]="mord")},{node:u},h,d),zN(i,(e,t)=>{var n=UN(t),r=UN(e),i=n&&r?e.hasClass("mtight")?CN[n][r]:_N[n][r]:null;if(i)return wN.makeGlue(i,l)},{node:u},h,d),i},zN=function e(t,n,r,i,a){i&&t.push(i);for(var o=0;on=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},jN=function(e){return e instanceof KS||e instanceof vA||e instanceof yA&&e.hasClass("enclosing")?e:null},HN=function e(t,n){var r=jN(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},UN=function(e,t){return e?(t&&(e=HN(e,t)),BN[e.classes[0]]||null):null},GN=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return RN(t.concat(n))},qN=function(e,t,n){if(!e)return RN();if(AN[e.type]){var r=AN[e.type](e,t);if(n&&t.size!==n.size){r=RN(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new SS("Got group of unknown type: '"+e.type+"'")};function WN(e,t){var n=RN(["base"],e,t),r=RN(["strut"]);return r.style.height=hA(n.height+n.depth),n.depth&&(r.style.verticalAlign=hA(-n.depth)),n.children.unshift(r),n}function VN(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=FN(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var a,o=[],s=[],l=0;l0&&(o.push(WN(s,t)),s=[]),o.push(i[l]));s.length>0&&o.push(WN(s,t)),n?((a=WN(FN(n,t,!0))).classes=["tag"],o.push(a)):r&&o.push(r);var u=RN(["katex-html"],o);if(u.setAttribute("aria-hidden","true"),a){var h=a.children[0];h.style.height=hA(u.height+u.depth),u.depth&&(h.style.verticalAlign=hA(-u.depth))}return u}function YN(e){return new KS(e)}class XN{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=dA(this.classes));for(var n=0;n0&&(e+=' class ="'+LS.escape(dA(this.classes))+'"'),e+=">";for(var n=0;n"}toText(){return this.children.map(e=>e.toText()).join("")}}class KN{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return LS.escape(this.toText())}toText(){return this.text}}var QN={MathNode:XN,TextNode:KN,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",hA(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},newDocumentFragment:YN},ZN=function(e,t,n){return!AA[t][e]||!AA[t][e].replace||55349===e.charCodeAt(0)||qA.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=AA[t][e].replace),new QN.TextNode(e)},JN=function(e){return 1===e.length?e[0]:new QN.MathNode("mrow",e)},eI=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=e.text;return LS.contains(["\\imath","\\jmath"],i)?null:(AA[r][i]&&AA[r][i].replace&&(i=AA[r][i].replace),tA(i,wN.fontMap[n].fontName,r)?wN.fontMap[n].variant:null)};function tI(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof KN&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof KN&&","===n.text}return!1}var nI=function(e,t,n){if(1===e.length){var r=iI(e[0],t);return n&&r instanceof XN&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,a=[],o=0;o=1&&("mn"===i.type||tI(i))){var l=s.children[0];l instanceof XN&&"mn"===l.type&&(l.children=[...i.children,...l.children],a.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof KN&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof KN&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),a.pop())}}}a.push(s),i=s}return a},rI=function(e,t,n){return JN(nI(e,t,n))},iI=function(e,t){if(!e)return new QN.MathNode("mrow");if(NN[e.type])return NN[e.type](e,t);throw new SS("Got group of unknown type: '"+e.type+"'")};function aI(e,t,n,r,i){var a,o=nI(e,n);a=1===o.length&&o[0]instanceof XN&&LS.contains(["mrow","mtable"],o[0].type)?o[0]:new QN.MathNode("mrow",o);var s=new QN.MathNode("annotation",[new QN.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new QN.MathNode("semantics",[a,s]),c=new QN.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return wN.makeSpan([u],[c])}var oI=function(e){return new oA({style:e.displayMode?GS.DISPLAY:GS.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},sI=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=wN.makeSpan(n,[e])}return e},lI={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},cI={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},uI=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=wN.makeSpan(["stretchy",t],[],i),"fbox"===t){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new TA({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new TA({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new EA(l,{width:"100%",height:hA(o)});a=wN.makeSvgSpan([],[c],i)}return a.height=o,a.style.height=hA(o),a},hI=function(e){var t=new QN.MathNode("mo",[new QN.TextNode(lI[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},dI=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(LS.contains(["widehat","widecheck","widetilde","utilde"],r)){var i,a,o,s="ordgroup"===(p=e.base).type?p.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,a=r+"4"):(i=312,n=2340,o=.34,a="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],a=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new kA(a),u=new EA([c],{width:"100%",height:hA(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:wN.makeSvgSpan([],[u],t),minWidth:0,height:o}}var h,d,p,f=[],g=cI[r],[m,y,v]=g,b=v/1e3,x=m.length;if(1===x)h=["hide-tail"],d=[g[3]];else if(2===x)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w0&&(n.style.minWidth=hA(r)),n};function pI(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function fI(e){var t=gI(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function gI(e){return e&&("atom"===e.type||SA.hasOwnProperty(e.type))?e:null}var mI=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=pI(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof yA)return e;throw new Error("Expected span but got "+String(e)+".")}(qN(e,t)),e.base=r):n=(r=pI(e,"accent")).base;var a=qN(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&LS.isCharacterBox(n)){var s=LS.getBaseElem(n);o=_A(qN(s,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight);if(r.isStretchy)l=dI(r,t),l=wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+hA(2*o)+")",marginLeft:hA(2*o)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=wN.staticSvg("vec",t),d=wN.svgData.vec[1]):((h=_A(h=wN.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=wN.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=a.height);var f=o;p||(f-=d/2),l.style.left=hA(f),"\\textcircled"===r.label&&(l.style.top=".2em"),l=wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var g=wN.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=g,i.height=Math.max(g.height,i.height),i.classes[0]="mord",i):g},yI=(e,t)=>{var n=e.isStretchy?hI(e.label):new QN.MathNode("mo",[ZN(e.label,e.mode)]),r=new QN.MathNode("mover",[iI(e.base,t),n]);return r.setAttribute("accent","true"),r},vI=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));IN({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=LN(t[0]),r=!vI.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:mI,mathmlBuilder:yI}),IN({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:mI,mathmlBuilder:yI}),IN({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=qN(e.base,t),r=dI(e,t),i="\\utilde"===e.label?.12:0,a=wN.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return wN.makeSpan(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=hI(e.label),r=new QN.MathNode("munder",[iI(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var bI=e=>{var t=new QN.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};IN({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),a=wN.wrapFragment(qN(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";a.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=wN.wrapFragment(qN(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var s,l=dI(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((a.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=a.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=wN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else s=wN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),wN.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=hI(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=bI(iI(e.body,t));if(e.below){var a=bI(iI(e.below,t));n=new QN.MathNode("munderover",[r,a,i])}else n=new QN.MathNode("mover",[r,i])}else if(e.below){var o=bI(iI(e.below,t));n=new QN.MathNode("munder",[r,o])}else n=bI(),n=new QN.MathNode("mover",[r,n]);return n}});var xI=wN.makeSpan;function wI(e,t){var n=FN(e.body,t,!0);return xI([e.mclass],n,t)}function EI(e,t){var n,r=nI(e.body,t);return"minner"===e.mclass?n=new QN.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new QN.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new QN.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}IN({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:MN(i),isCharacterBox:LS.isCharacterBox(i)}},htmlBuilder:wI,mathmlBuilder:EI});var kI=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};IN({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:kI(t[0]),body:MN(t[1]),isCharacterBox:LS.isCharacterBox(t[1])}}}),IN({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,a=t[1],o=t[0];n="\\stackrel"!==i?kI(a):"mrel";var s={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:MN(a)},l={type:"supsub",mode:o.mode,base:s,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:LS.isCharacterBox(l)}},htmlBuilder:wI,mathmlBuilder:EI}),IN({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:kI(t[0]),body:MN(t[0])}},htmlBuilder(e,t){var n=FN(e.body,t,!0),r=wN.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=nI(e.body,t),r=new QN.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var TI={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},_I=()=>({type:"styling",body:[],mode:"math",style:"display"}),CI=e=>"textord"===e.type&&"@"===e.text,SI=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function AI(e,t,n){var r=TI[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}IN({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=wN.wrapFragment(qN(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=hA(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new QN.MathNode("mrow",[iI(e.label,t)]);return(n=new QN.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new QN.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),IN({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=wN.wrapFragment(qN(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new QN.MathNode("mrow",[iI(e.fragment,t)])}),IN({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=pI(t[0],"ordgroup").body,i="",a=0;a=1114111)throw new SS("\\@char with invalid code point "+i);return s<=65535?o=String.fromCharCode(s):(s-=65536,o=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:o}}});var NI=(e,t)=>{var n=FN(e.body,t.withColor(e.color),!1);return wN.makeFragment(n)},II=(e,t)=>{var n=nI(e.body,t.withColor(e.color)),r=new QN.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};IN({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=pI(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:MN(i)}},htmlBuilder:NI,mathmlBuilder:II}),IN({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=pI(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:NI,mathmlBuilder:II}),IN({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&pI(i,"size").value}},htmlBuilder(e,t){var n=wN.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=hA(uA(e.size,t)))),n},mathmlBuilder(e,t){var n=new QN.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",hA(uA(e.size,t)))),n}});var OI={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},LI=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new SS("Expected a control sequence",e);return t},MI=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};IN({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(OI[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=OI[r.text]),pI(t.parseFunction(),"internal");throw new SS("Invalid token after macro prefix",r)}}),IN({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new SS("Expected a control sequence",r);for(var a,o=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){a=t.gullet.future(),s[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new SS('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new SS('Argument number "'+r.text+'" out of order');o++,s.push([])}else{if("EOF"===r.text)throw new SS("Expected a macro definition");s[o].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:s},n===OI[n]),{type:"internal",mode:t.mode}}}),IN({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=LI(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return MI(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),IN({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=LI(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return MI(t,r,a,"\\\\globalfuture"===n),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var RI=function(e,t,n){var r=tA(AA.math[e]&&AA.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},DI=function(e,t,n,r){var i=n.havingBaseStyle(t),a=wN.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},PI=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=hA(i),e.height-=i,e.depth+=i},$I=function(e,t,n,r,i,a){var o=function(e,t,n,r){return wN.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),s=DI(wN.makeSpan(["delimsizing","size"+t],[o],r),GS.TEXT,r,a);return n&&PI(s,r,GS.TEXT),s},BI=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:wN.makeSpan(["delimsizinginner",r],[wN.makeSpan([],[wN.makeSymbol(e,t,n)])])}},FI=function(e,t,n){var r=QS["Size4-Regular"][e.charCodeAt(0)]?QS["Size4-Regular"][e.charCodeAt(0)][4]:QS["Size1-Regular"][e.charCodeAt(0)][4],i=new kA("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),a=new EA([i],{width:hA(r),height:hA(t),style:"width:"+hA(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=wN.makeSvgSpan([],[a],n);return o.height=t,o.style.height=hA(t),o.style.width=hA(r),{type:"elem",elem:o}},zI={type:"kern",size:-.008},jI=["|","\\lvert","\\rvert","\\vert"],HI=["\\|","\\lVert","\\rVert","\\Vert"],UI=function(e,t,n,r,i,a){var o,s,l,c,u="",h=0;o=l=c=e,s=null;var d="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):LS.contains(jI,e)?(l="∣",u="vert",h=333):LS.contains(HI,e)?(l="∥",u="doublevert",h=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",d="Size4-Regular",u="lbrack",h=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",d="Size4-Regular",u="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",d="Size4-Regular",u="lfloor",h=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",d="Size4-Regular",u="lceil",h=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",d="Size4-Regular",u="rfloor",h=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",d="Size4-Regular",u="rceil",h=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",d="Size4-Regular",u="lparen",h=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",d="Size4-Regular",u="rparen",h=875):"\\{"===e||"\\lbrace"===e?(o="⎧",s="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",s="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=RI(o,d,i),f=p.height+p.depth,g=RI(l,d,i),m=g.height+g.depth,y=RI(c,d,i),v=y.height+y.depth,b=0,x=1;if(null!==s){var w=RI(s,d,i);b=w.height+w.depth,x=2}var E=f+v+b,k=E+Math.max(0,Math.ceil((t-E)/(x*m)))*x*m,T=r.fontMetrics().axisHeight;n&&(T*=r.sizeMultiplier);var _=k/2-T,C=[];if(u.length>0){var S=k-f-v,A=Math.round(1e3*k),N=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 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\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-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\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-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\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 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\nc-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,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.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\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-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,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-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\nc-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\nc0,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\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-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.")}}(u,Math.round(1e3*S)),I=new kA(u,N),O=(h/1e3).toFixed(3)+"em",L=(A/1e3).toFixed(3)+"em",M=new EA([I],{width:O,height:L,viewBox:"0 0 "+h+" "+A}),R=wN.makeSvgSpan([],[M],r);R.height=A/1e3,R.style.width=O,R.style.height=L,C.push({type:"elem",elem:R})}else{if(C.push(BI(c,d,i)),C.push(zI),null===s){var D=k-f-v+.016;C.push(FI(l,D,r))}else{var P=(k-f-v-b)/2+.016;C.push(FI(l,P,r)),C.push(zI),C.push(BI(s,d,i)),C.push(zI),C.push(FI(l,P,r))}C.push(zI),C.push(BI(o,d,i))}var $=r.havingBaseStyle(GS.TEXT),B=wN.makeVList({positionType:"bottom",positionData:_,children:C},$);return DI(wN.makeSpan(["delimsizing","mult"],[B],$),GS.TEXT,r,a)},GI=.08,qI=function(e,t,n,r,i){var a=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.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\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,YS);break;case"sqrtSize1":r=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,YS);break;case"sqrtSize2":r=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,YS);break;case"sqrtSize3":r=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-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\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,YS);break;case"sqrtSize4":r=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-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\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,YS);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"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\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,YS,n)}return r}(e,r,n),o=new kA(e,a),s=new EA([o],{width:"400em",height:hA(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return wN.makeSvgSpan(["hide-tail"],[s],i)},WI=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],VI=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],YI=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],XI=[0,1.2,1.8,2.4,3],KI=[{type:"small",style:GS.SCRIPTSCRIPT},{type:"small",style:GS.SCRIPT},{type:"small",style:GS.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],QI=[{type:"small",style:GS.SCRIPTSCRIPT},{type:"small",style:GS.SCRIPT},{type:"small",style:GS.TEXT},{type:"stack"}],ZI=[{type:"small",style:GS.SCRIPTSCRIPT},{type:"small",style:GS.SCRIPT},{type:"small",style:GS.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],JI=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},eO=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);it)return n[i]}return n[n.length-1]},tO=function(e,t,n,r,i,a){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=LS.contains(YI,e)?KI:LS.contains(WI,e)?ZI:QI;var s=eO(e,t,o,r);return"small"===s.type?function(e,t,n,r,i,a){var o=wN.makeSymbol(e,"Main-Regular",i,r),s=DI(o,t,r,a);return n&&PI(s,r,t),s}(e,s.style,n,r,i,a):"large"===s.type?$I(e,s.size,n,r,i,a):UI(e,t,n,r,i,a)},nO={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),a=eO("\\surd",e*i.sizeMultiplier,ZI,i),o=i.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===a.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+s)/o,(n=qI("sqrtMain",l=(1+s+GI)/o,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/o):"large"===a.type?(u=1080*XI[a.size],c=(XI[a.size]+s)/o,l=(XI[a.size]+s+GI)/o,(n=qI("sqrtSize"+a.size,l,u,s,t)).style.minWidth="1.02em",r=1/o):(l=e+s+GI,c=e+s,u=Math.floor(1e3*e+s)+80,(n=qI("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=hA(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),LS.contains(WI,e)||LS.contains(YI,e))return $I(e,t,!1,n,r,i);if(LS.contains(VI,e))return UI(e,XI[t],!1,n,r,i);throw new SS("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:XI,customSizedDelim:tO,leftRightDelim:function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-s);return tO(e,c,!0,r,i,a)}},rO={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},iO=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function aO(e,t){var n=gI(e);if(n&&LS.contains(iO,n.text))return n;throw new SS(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function oO(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}IN({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=aO(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:rO[e.funcName].size,mclass:rO[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?wN.makeSpan([e.mclass]):nO.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(ZN(e.delim,e.mode));var n=new QN.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=hA(nO.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),IN({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new SS("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:aO(t[0],e).text,color:n}}}),IN({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=aO(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=pI(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{oO(e);for(var n,r,i=FN(e.body,t,!0,["mopen","mclose"]),a=0,o=0,s=!1,l=0;l{oO(e);var n=nI(e.body,t);if("."!==e.left){var r=new QN.MathNode("mo",[ZN(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new QN.MathNode("mo",[ZN(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return JN(n)}}),IN({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=aO(t[0],e);if(!e.parser.leftrightDepth)throw new SS("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=GN(t,[]);else{n=nO.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?ZN("|","text"):ZN(e.delim,e.mode),r=new QN.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var sO=(e,t)=>{var n,r,i=wN.wrapFragment(qN(e.body,t),t),a=e.label.slice(1),o=t.sizeMultiplier,s=0,l=LS.isCharacterBox(e.body);if("sout"===a)(n=wN.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/o,s=-.5*t.fontMetrics().xHeight;else if("phase"===a){var c=uA({number:.6,unit:"pt"},t),u=uA({number:.35,unit:"ex"},t);o/=t.havingBaseSizing().sizeMultiplier;var h=i.height+i.depth+c+u;i.style.paddingLeft=hA(h/2+c);var d=Math.floor(1e3*h*o),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),f=new EA([new kA("phase",p)],{width:"400em",height:hA(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=wN.makeSvgSpan(["hide-tail"],[f],t)).style.height=hA(h),s=i.depth+c+u}else{/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var g=0,m=0,y=0;/box/.test(a)?(y=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),m=g=t.fontMetrics().fboxsep+("colorbox"===a?0:y)):"angl"===a?(g=4*(y=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),m=Math.max(0,.25-i.depth)):m=g=l?.2:0,n=uI(i,a,g,m,t),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=hA(y)):"angl"===a&&.049!==y&&(n.style.borderTopWidth=hA(y),n.style.borderRightWidth=hA(y)),s=i.depth+m,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=wN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:i,shift:0}]},t);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];r=wN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:v}]},t)}return/cancel/.test(a)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(a)&&!l?wN.makeSpan(["mord","cancel-lap"],[r],t):wN.makeSpan(["mord"],[r],t)},lO=(e,t)=>{var n=0,r=new QN.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[iI(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};IN({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=pI(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:sO,mathmlBuilder:lO}),IN({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=pI(t[0],"color-token").color,o=pI(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:sO,mathmlBuilder:lO}),IN({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),IN({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:sO,mathmlBuilder:lO}),IN({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var cO={};function uO(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{if(!e.parser.settings.displayMode)throw new SS("{"+e.envName+"} can be used only in display mode.")};function gO(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function mO(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new SS("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],g=[f],m=[],y=[],v=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function x(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new CS("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),y.push(pO(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),f.push(w);var E=e.fetch().text;if("&"===E){if(h&&f.length===h){if(c||s)throw new SS("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===E){x(),1===f.length&&"styling"===w.type&&0===w.body[0].body.length&&(g.length>1||!u)&&g.pop(),y.length0&&(y+=.25),l.push({pos:y,isDashed:e[t]})}for(v(a[0]),n=0;n0&&(w<(_+=m)&&(w=_),_=0),e.addJot&&(w+=p),E.height=x,E.depth=w,y+=x,E.pos=y,y+=w+_,s[n]=E,v(a[n+1])}var C,S,A=y/2+t.fontMetrics().axisHeight,N=e.cols||[],I=[],O=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=LS.deflt(P.pregap,h))&&((C=wN.makeSpan(["arraycolsep"],[])).style.width=hA(j),I.push(C));var H=[];for(n=0;n0){for(var W=wN.makeLineSpan("hline",t,c),V=wN.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:s,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-A;X.isDashed?Y.push({type:"elem",elem:V,shift:K}):Y.push({type:"elem",elem:W,shift:K})}s=wN.makeVList({positionType:"individualShift",children:Y},t)}if(0===O.length)return wN.makeSpan(["mord"],[s],t);var Q=wN.makeVList({positionType:"individualShift",children:O},t);return Q=wN.makeSpan(["tag"],[Q],t),wN.makeFragment([s,Q])},bO={c:"center ",l:"left ",r:"right "},xO=function(e,t){for(var n=[],r=new QN.MathNode("mtd",[],["mtr-glue"]),i=new QN.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var p=e.cols,f="",g=!1,m=0,y=p.length;"separator"===p[0].type&&(h+="top ",m=1),"separator"===p[p.length-1].type&&(h+="bottom ",y-=1);for(var v=m;v0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var T=1;T-1?"alignat":"align",a="split"===e.envName,o=mO(e.parser,{cols:r,addJot:!0,autoTag:a?void 0:gO(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u0&&h&&(f=1),r[d]={type:"align",align:p,pregap:f,postgap:0}}return o.colSeparationType=h?"align":"alignat",o};uO({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(gI(t[0])?[t[0]]:pI(t[0],"ordgroup").body).map(function(e){var t=fI(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new SS("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return mO(e.parser,r,yO(e.envName))},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new SS("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=mO(e.parser,r,yO(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=mO(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(gI(t[0])?[t[0]]:pI(t[0],"ordgroup").body).map(function(e){var t=fI(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new SS("Unknown column alignment: "+t,e)});if(n.length>1)throw new SS("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=mO(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new SS("{subarray} can contain only one column");return r},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=mO(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},yO(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:wO,htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){LS.contains(["gather","gather*"],e.envName)&&fO(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:gO(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return mO(e.parser,t,"display")},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:wO,htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){fO(e);var t={autoTag:gO(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return mO(e.parser,t,"display")},htmlBuilder:vO,mathmlBuilder:xO}),uO({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(fO(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new SS("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],a=0;a-1);else{if(!("<>AV".indexOf(c)>-1))throw new SS('Expected one of "<>AV=|." after @',o[l]);for(var h=0;h<2;h++){for(var d=!0,p=l+1;p{var n=e.font,r=t.withFont(n);return qN(e.body,r)},TO=(e,t)=>{var n=e.font,r=t.withFont(n);return iI(e.body,r)},_O={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};IN({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=LN(t[0]),a=r;return a in _O&&(a=_O[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:kO,mathmlBuilder:TO}),IN({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=LS.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:kI(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),IN({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:kO,mathmlBuilder:TO});var CO=(e,t)=>{var n=t;return"display"===e?n=n.id>=GS.SCRIPT.id?n.text():GS.DISPLAY:"text"===e&&n.size===GS.DISPLAY.size?n=GS.TEXT:"script"===e?n=GS.SCRIPT:"scriptscript"===e&&(n=GS.SCRIPTSCRIPT),n},SO=(e,t)=>{var n,r=CO(e.size,t.style),i=r.fracNum(),a=r.fracDen();n=t.havingStyle(i);var o=qN(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*h:7*h,f=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),f=t.fontMetrics().denom2),c){var x=t.fontMetrics().axisHeight;d-o.depth-(x+.5*u){var n=new QN.MathNode("mfrac",[iI(e.numer,t),iI(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=uA(e.barSize,t);n.setAttribute("linethickness",hA(r))}}else n.setAttribute("linethickness","0px");var i=CO(e.size,t.style);if(i.size!==t.style.size){n=new QN.MathNode("mstyle",[n]);var a=i.size===GS.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var s=new QN.MathNode("mo",[new QN.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(n),null!=e.rightDelim){var l=new QN.MathNode("mo",[new QN.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return JN(o)}return n};IN({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,a=t[0],o=t[1],s=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:a,denom:o,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:SO,mathmlBuilder:AO}),IN({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),IN({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var NO=["display","text","script","scriptscript"],IO=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};IN({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],a=t[5],o=LN(t[0]),s="atom"===o.type&&"open"===o.family?IO(o.text):null,l=LN(t[1]),c="atom"===l.type&&"close"===l.family?IO(l.text):null,u=pI(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=pI(p.body[0],"textord");d=NO[Number(f.text)]}}else p=pI(p,"textord"),d=NO[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:SO,mathmlBuilder:AO}),IN({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:pI(t[0],"size").value,token:i}}}),IN({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(pI(t[1],"infix").size),o=t[2],s=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:SO,mathmlBuilder:AO});var OO=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?qN(e.sup,t.havingStyle(i.sup()),t):qN(e.sub,t.havingStyle(i.sub()),t),r=pI(e.base,"horizBrace")):r=pI(e,"horizBrace");var a,o=qN(r.base,t.havingBaseStyle(GS.DISPLAY)),s=dI(r,t);if(r.isOver?(a=wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(a=wN.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=wN.makeSpan(["mord",r.isOver?"mover":"munder"],[a],t);a=r.isOver?wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):wN.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return wN.makeSpan(["mord",r.isOver?"mover":"munder"],[a],t)};IN({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:OO,mathmlBuilder:(e,t)=>{var n=hI(e.label);return new QN.MathNode(e.isOver?"mover":"munder",[iI(e.base,t),n])}}),IN({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=pI(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:MN(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=FN(e.body,t,!1);return wN.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=rI(e.body,t);return n instanceof XN||(n=new XN("mrow",[n])),n.setAttribute("href",e.href),n}}),IN({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=pI(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;anew QN.MathNode("mrow",nI(e.body,t))}),IN({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:a}=e,o=pI(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),u=0;u{var n=FN(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=wN.makeSpan(r,n,t);for(var a in e.attributes)"class"!==a&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>rI(e.body,t)}),IN({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:MN(t[0]),mathml:MN(t[1])}},htmlBuilder:(e,t)=>{var n=FN(e.html,t,!1);return wN.makeFragment(n)},mathmlBuilder:(e,t)=>rI(e.mathml,t)});var LO=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new SS("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!cA(n))throw new SS("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};IN({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(n[0])for(var l=pI(n[0],"raw").string.split(","),c=0;c{var n=uA(e.height,t),r=0;e.totalheight.number>0&&(r=uA(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=uA(e.width,t));var a={height:hA(n+r)};i>0&&(a.width=hA(i)),r>0&&(a.verticalAlign=hA(-r));var o=new bA(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new QN.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=uA(e.height,t),i=0;if(e.totalheight.number>0&&(i=uA(e.totalheight,t)-r,n.setAttribute("valign",hA(-i))),n.setAttribute("height",hA(r+i)),e.width.number>0){var a=uA(e.width,t);n.setAttribute("width",hA(a))}return n.setAttribute("src",e.src),n}}),IN({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=pI(t[0],"size");if(n.settings.strict){var a="m"===r[1],o="mu"===i.value.unit;a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>wN.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=uA(e.dimension,t);return new QN.SpaceNode(n)}}),IN({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=wN.makeSpan([],[qN(e.body,t)]),n=wN.makeSpan(["inner"],[n],t)):n=wN.makeSpan(["inner"],[qN(e.body,t)]);var r=wN.makeSpan(["fix"],[]),i=wN.makeSpan([e.alignment],[n,r],t),a=wN.makeSpan(["strut"]);return a.style.height=hA(i.height+i.depth),i.depth&&(a.style.verticalAlign=hA(-i.depth)),i.children.unshift(a),i=wN.makeSpan(["thinbox"],[i],t),wN.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new QN.MathNode("mpadded",[iI(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),IN({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a="\\("===n?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),IN({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new SS("Mismatched "+e.funcName)}});var MO=(e,t)=>{switch(t.style.size){case GS.DISPLAY.size:return e.display;case GS.TEXT.size:return e.text;case GS.SCRIPT.size:return e.script;case GS.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};IN({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:MN(t[0]),text:MN(t[1]),script:MN(t[2]),scriptscript:MN(t[3])}},htmlBuilder:(e,t)=>{var n=MO(e,t),r=FN(n,t,!1);return wN.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=MO(e,t);return rI(n,t)}});var RO=(e,t,n,r,i,a,o)=>{e=wN.makeSpan([],[e]);var s,l,c,u=n&&LS.isCharacterBox(n);if(t){var h=qN(t,r.havingStyle(i.sup()),r);l={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=qN(n,r.havingStyle(i.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+o;c=wN.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:hA(-a)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:hA(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var f=e.height-o;c=wN.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:hA(-a)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var g=e.depth+o;c=wN.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:hA(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var m=[c];if(s&&0!==a&&!u){var y=wN.makeSpan(["mspace"],[],r);y.style.marginRight=hA(a),m.unshift(y)}return wN.makeSpan(["mop","op-limits"],m,r)},DO=["\\smallint"],PO=(e,t)=>{var n,r,i,a=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=pI(e.base,"op"),a=!0):i=pI(e,"op");var o,s=t.style,l=!1;if(s.size===GS.DISPLAY.size&&i.symbol&&!LS.contains(DO,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(u=i.name.slice(1),i.name="oiint"===u?"\\iint":"\\iiint"),o=wN.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=o.italic,d=wN.staticSvg(u+"Size"+(l?"2":"1"),t);o=wN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),i.name="\\"+u,o.classes.unshift("mop"),o.italic=h}}else if(i.body){var p=FN(i.body,t,!0);1===p.length&&p[0]instanceof wA?(o=p[0]).classes[0]="mop":o=wN.makeSpan(["mop"],p,t)}else{for(var f=[],g=1;g{var n;if(e.symbol)n=new XN("mo",[ZN(e.name,e.mode)]),LS.contains(DO,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new XN("mo",nI(e.body,t));else{n=new XN("mi",[new KN(e.name.slice(1))]);var r=new XN("mo",[ZN("⁡","text")]);n=e.parentIsSupSub?new XN("mrow",[n,r]):YN([n,r])}return n},BO={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};IN({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=BO[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:PO,mathmlBuilder:$O}),IN({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:MN(r)}},htmlBuilder:PO,mathmlBuilder:$O});var FO={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};IN({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:PO,mathmlBuilder:$O}),IN({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:PO,mathmlBuilder:$O}),IN({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=FO[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:PO,mathmlBuilder:$O});var zO=(e,t)=>{var n,r,i,a,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=pI(e.base,"operatorname"),o=!0):i=pI(e,"operatorname"),i.body.length>0){for(var s=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=FN(s,t.withFont("mathrm"),!0),c=0;c{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:MN(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:zO,mathmlBuilder:(e,t)=>{for(var n=nI(e.body,t.withFont("mathrm")),r=!0,i=0;ie.toText()).join("");n=[new QN.TextNode(s)]}var l=new QN.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new QN.MathNode("mo",[ZN("⁡","text")]);return e.parentIsSupSub?new QN.MathNode("mrow",[l,c]):QN.newDocumentFragment([l,c])}}),dO("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ON({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?wN.makeFragment(FN(e.body,t,!1)):wN.makeSpan(["mord"],FN(e.body,t,!0),t),mathmlBuilder:(e,t)=>rI(e.body,t,!0)}),IN({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=qN(e.body,t.havingCrampedStyle()),r=wN.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return wN.makeSpan(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new QN.MathNode("mo",[new QN.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new QN.MathNode("mover",[iI(e.body,t),n]);return r.setAttribute("accent","true"),r}}),IN({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:MN(r)}},htmlBuilder:(e,t)=>{var n=FN(e.body,t.withPhantom(),!1);return wN.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=nI(e.body,t);return new QN.MathNode("mphantom",n)}}),IN({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=wN.makeSpan([],[qN(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=nI(MN(e.body),t),r=new QN.MathNode("mphantom",n),i=new QN.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),IN({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=wN.makeSpan(["inner"],[qN(e.body,t.withPhantom())]),r=wN.makeSpan(["fix"],[]);return wN.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=nI(MN(e.body),t),r=new QN.MathNode("mphantom",n),i=new QN.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),IN({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=pI(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=qN(e.body,t),r=uA(e.dy,t);return wN.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new QN.MathNode("mpadded",[iI(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),IN({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),IN({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=pI(t[0],"size"),o=pI(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&pI(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=wN.makeSpan(["mord","rule"],[],t),r=uA(e.width,t),i=uA(e.height,t),a=e.shift?uA(e.shift,t):0;return n.style.borderRightWidth=hA(r),n.style.borderTopWidth=hA(i),n.style.bottom=hA(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=uA(e.width,t),r=uA(e.height,t),i=e.shift?uA(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new QN.MathNode("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",hA(n)),o.setAttribute("height",hA(r));var s=new QN.MathNode("mpadded",[o]);return i>=0?s.setAttribute("height",hA(i)):(s.setAttribute("height",hA(i)),s.setAttribute("depth",hA(-i))),s.setAttribute("voffset",hA(i)),s}});var HO=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];IN({type:"sizing",names:HO,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:HO.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return jO(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=nI(e.body,n),i=new QN.MathNode("mstyle",r);return i.setAttribute("mathsize",hA(n.sizeMultiplier)),i}}),IN({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&pI(n[0],"ordgroup");if(o)for(var s="",l=0;l{var n=wN.makeSpan([],[qN(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new QN.MathNode("mpadded",[iI(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),IN({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=qN(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=wN.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var h=s.height-n.height-a-l;n.style.paddingLeft=hA(c);var d=wN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(GS.SCRIPTSCRIPT),f=qN(e.index,p,t),g=.6*(d.height-d.depth),m=wN.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),y=wN.makeSpan(["root"],[m]);return wN.makeSpan(["mord","sqrt"],[y,d],t)}return wN.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new QN.MathNode("mroot",[iI(n,t),iI(r,t)]):new QN.MathNode("msqrt",[iI(n,t)])}});var UO={display:GS.DISPLAY,text:GS.TEXT,script:GS.SCRIPT,scriptscript:GS.SCRIPTSCRIPT};IN({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=UO[e.style],r=t.havingStyle(n).withFont("");return jO(e.body,r,t)},mathmlBuilder(e,t){var n=UO[e.style],r=t.havingStyle(n),i=nI(e.body,r),a=new QN.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});ON({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===GS.DISPLAY.size||n.alwaysHandleSupSub)?PO:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===GS.DISPLAY.size||n.limits)?zO:null:"accent"===n.type?LS.isCharacterBox(n.base)?mI:null:"horizBrace"===n.type&&!e.sub===n.isOver?OO:null:null}(e,t);if(n)return n(e,t);var r,i,a,{base:o,sup:s,sub:l}=e,c=qN(o,t),u=t.fontMetrics(),h=0,d=0,p=o&&LS.isCharacterBox(o);if(s){var f=t.havingStyle(t.style.sup());r=qN(s,f,t),p||(h=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var g=t.havingStyle(t.style.sub());i=qN(l,g,t),p||(d=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}a=t.style===GS.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var m,y=t.sizeMultiplier,v=hA(.5/u.ptPerEm/y),b=null;if(i){var x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof wA||x)&&(b=hA(-c.italic))}if(r&&i){h=Math.max(h,a,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var w=4*u.defaultRuleThickness;if(h-r.depth-(i.height-d)0&&(h+=E,d-=E)}var k=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:b},{type:"elem",elem:r,shift:-h,marginRight:v}];m=wN.makeVList({positionType:"individualShift",children:k},t)}else if(i){d=Math.max(d,u.sub1,i.height-.8*u.xHeight);var T=[{type:"elem",elem:i,marginLeft:b,marginRight:v}];m=wN.makeVList({positionType:"shift",positionData:d,children:T},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,a,r.depth+.25*u.xHeight),m=wN.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:v}]},t)}var _=UN(c,"right")||"mord";return wN.makeSpan([_],[c,wN.makeSpan(["msupsub"],[m])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,a=[iI(e.base,t)];if(e.sub&&a.push(iI(e.sub,t)),e.sup&&a.push(iI(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===GS.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===GS.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;i=s&&"op"===s.type&&s.limits&&(t.style===GS.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===GS.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===GS.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===GS.DISPLAY)?"mover":"msup"}return new QN.MathNode(i,a)}}),ON({type:"atom",htmlBuilder:(e,t)=>wN.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new QN.MathNode("mo",[ZN(e.text,e.mode)]);if("bin"===e.family){var r=eI(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var GO={mi:"italic",mn:"normal",mtext:"normal"};ON({type:"mathord",htmlBuilder:(e,t)=>wN.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new QN.MathNode("mi",[ZN(e.text,e.mode,t)]),r=eI(e,t)||"italic";return r!==GO[n.type]&&n.setAttribute("mathvariant",r),n}}),ON({type:"textord",htmlBuilder:(e,t)=>wN.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=ZN(e.text,e.mode,t),i=eI(e,t)||"normal";return n="text"===e.mode?new QN.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new QN.MathNode("mn",[r]):"\\prime"===e.text?new QN.MathNode("mo",[r]):new QN.MathNode("mi",[r]),i!==GO[n.type]&&n.setAttribute("mathvariant",i),n}});var qO={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},WO={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ON({type:"spacing",htmlBuilder(e,t){if(WO.hasOwnProperty(e.text)){var n=WO[e.text].className||"";if("text"===e.mode){var r=wN.makeOrd(e,t,"textord");return r.classes.push(n),r}return wN.makeSpan(["mspace",n],[wN.mathsym(e.text,e.mode,t)],t)}if(qO.hasOwnProperty(e.text))return wN.makeSpan(["mspace",qO[e.text]],[],t);throw new SS('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!WO.hasOwnProperty(e.text)){if(qO.hasOwnProperty(e.text))return new QN.MathNode("mspace");throw new SS('Unknown type of space "'+e.text+'"')}return new QN.MathNode("mtext",[new QN.TextNode(" ")])}});var VO=()=>{var e=new QN.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ON({type:"tag",mathmlBuilder(e,t){var n=new QN.MathNode("mtable",[new QN.MathNode("mtr",[VO(),new QN.MathNode("mtd",[rI(e.body,t)]),VO(),new QN.MathNode("mtd",[rI(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var YO={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},XO={"\\textbf":"textbf","\\textmd":"textmd"},KO={"\\textit":"textit","\\textup":"textup"},QO=(e,t)=>{var n=e.font;return n?YO[n]?t.withTextFontFamily(YO[n]):XO[n]?t.withTextFontWeight(XO[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(KO[n]):t};IN({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:MN(i),font:r}},htmlBuilder(e,t){var n=QO(e,t),r=FN(e.body,n,!0);return wN.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=QO(e,t);return rI(e.body,n)}}),IN({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=qN(e.body,t),r=wN.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=wN.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return wN.makeSpan(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new QN.MathNode("mo",[new QN.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new QN.MathNode("munder",[iI(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),IN({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=qN(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return wN.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new QN.MathNode("mpadded",[iI(e.body,t)],["vcenter"])}),IN({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new SS("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ZO(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),JO=SN,eL="[ \r\n\t]",tL="(\\\\[a-zA-Z@]+)"+eL+"*",nL="[̀-ͯ]",rL=new RegExp(nL+"+$"),iL="("+eL+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]"+nL+"*|[\ud800-\udbff][\udc00-\udfff]"+nL+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+tL+"|\\\\[^\ud800-\udfff])";let aL=class{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(iL,"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 CS("EOF",new _S(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new SS("Unexpected character: '"+e[t]+"'",new CS(e[t],new _S(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(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=i+1,this.lex()}return new CS(r,new _S(this,t,this.tokenRegex.lastIndex))}};class oL{constructor(e,t){void 0===e&&(e={}),void 0===t&&(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(0===this.undefStack.length)throw new SS("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)&&(null==e[t]?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,n){if(void 0===n&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var sL=hO;dO("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),dO("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),dO("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),dO("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),dO("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),dO("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),dO("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var lL={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};dO("\\char",function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new SS("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=lL[n.text])||r>=t)throw new SS("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=lL[e.future().text])&&i{var i=e.consumeArg().tokens;if(1!==i.length)throw new SS("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new SS("\\newcommand{"+a+"} attempting to redefine "+a+"; use \\renewcommand");if(!o&&!n)throw new SS("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new SS("Invalid number of arguments: "+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),""};dO("\\newcommand",e=>cL(e,!1,!0,!1)),dO("\\renewcommand",e=>cL(e,!0,!1,!1)),dO("\\providecommand",e=>cL(e,!0,!0,!0)),dO("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),dO("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),dO("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),JO[n],AA.math[n],AA.text[n]),""}),dO("\\bgroup","{"),dO("\\egroup","}"),dO("~","\\nobreakspace"),dO("\\lq","`"),dO("\\rq","'"),dO("\\aa","\\r a"),dO("\\AA","\\r A"),dO("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),dO("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),dO("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),dO("ℬ","\\mathscr{B}"),dO("ℰ","\\mathscr{E}"),dO("ℱ","\\mathscr{F}"),dO("ℋ","\\mathscr{H}"),dO("ℐ","\\mathscr{I}"),dO("ℒ","\\mathscr{L}"),dO("ℳ","\\mathscr{M}"),dO("ℛ","\\mathscr{R}"),dO("ℭ","\\mathfrak{C}"),dO("ℌ","\\mathfrak{H}"),dO("ℨ","\\mathfrak{Z}"),dO("\\Bbbk","\\Bbb{k}"),dO("·","\\cdotp"),dO("\\llap","\\mathllap{\\textrm{#1}}"),dO("\\rlap","\\mathrlap{\\textrm{#1}}"),dO("\\clap","\\mathclap{\\textrm{#1}}"),dO("\\mathstrut","\\vphantom{(}"),dO("\\underbar","\\underline{\\text{#1}}"),dO("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),dO("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),dO("\\ne","\\neq"),dO("≠","\\neq"),dO("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),dO("∉","\\notin"),dO("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),dO("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),dO("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),dO("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),dO("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),dO("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),dO("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),dO("⟂","\\perp"),dO("‼","\\mathclose{!\\mkern-0.8mu!}"),dO("∌","\\notni"),dO("⌜","\\ulcorner"),dO("⌝","\\urcorner"),dO("⌞","\\llcorner"),dO("⌟","\\lrcorner"),dO("©","\\copyright"),dO("®","\\textregistered"),dO("️","\\textregistered"),dO("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),dO("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),dO("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),dO("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),dO("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),dO("⋮","\\vdots"),dO("\\varGamma","\\mathit{\\Gamma}"),dO("\\varDelta","\\mathit{\\Delta}"),dO("\\varTheta","\\mathit{\\Theta}"),dO("\\varLambda","\\mathit{\\Lambda}"),dO("\\varXi","\\mathit{\\Xi}"),dO("\\varPi","\\mathit{\\Pi}"),dO("\\varSigma","\\mathit{\\Sigma}"),dO("\\varUpsilon","\\mathit{\\Upsilon}"),dO("\\varPhi","\\mathit{\\Phi}"),dO("\\varPsi","\\mathit{\\Psi}"),dO("\\varOmega","\\mathit{\\Omega}"),dO("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),dO("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),dO("\\boxed","\\fbox{$\\displaystyle{#1}$}"),dO("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),dO("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),dO("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),dO("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),dO("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var uL={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};dO("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in uL?t=uL[n]:("\\not"===n.slice(0,4)||n in AA.math&&LS.contains(["bin","rel"],AA.math[n].group))&&(t="\\dotsb"),t});var hL={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};dO("\\dotso",function(e){return e.future().text in hL?"\\ldots\\,":"\\ldots"}),dO("\\dotsc",function(e){var t=e.future().text;return t in hL&&","!==t?"\\ldots\\,":"\\ldots"}),dO("\\cdots",function(e){return e.future().text in hL?"\\@cdots\\,":"\\@cdots"}),dO("\\dotsb","\\cdots"),dO("\\dotsm","\\cdots"),dO("\\dotsi","\\!\\cdots"),dO("\\dotsx","\\ldots\\,"),dO("\\DOTSI","\\relax"),dO("\\DOTSB","\\relax"),dO("\\DOTSX","\\relax"),dO("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),dO("\\,","\\tmspace+{3mu}{.1667em}"),dO("\\thinspace","\\,"),dO("\\>","\\mskip{4mu}"),dO("\\:","\\tmspace+{4mu}{.2222em}"),dO("\\medspace","\\:"),dO("\\;","\\tmspace+{5mu}{.2777em}"),dO("\\thickspace","\\;"),dO("\\!","\\tmspace-{3mu}{.1667em}"),dO("\\negthinspace","\\!"),dO("\\negmedspace","\\tmspace-{4mu}{.2222em}"),dO("\\negthickspace","\\tmspace-{5mu}{.277em}"),dO("\\enspace","\\kern.5em "),dO("\\enskip","\\hskip.5em\\relax"),dO("\\quad","\\hskip1em\\relax"),dO("\\qquad","\\hskip2em\\relax"),dO("\\tag","\\@ifstar\\tag@literal\\tag@paren"),dO("\\tag@paren","\\tag@literal{({#1})}"),dO("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new SS("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),dO("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),dO("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),dO("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),dO("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),dO("\\newline","\\\\\\relax"),dO("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var dL=hA(QS["Main-Regular"]["T".charCodeAt(0)][1]-.7*QS["Main-Regular"]["A".charCodeAt(0)][1]);dO("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+dL+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),dO("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+dL+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),dO("\\hspace","\\@ifstar\\@hspacer\\@hspace"),dO("\\@hspace","\\hskip #1\\relax"),dO("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),dO("\\ordinarycolon",":"),dO("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),dO("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),dO("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),dO("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),dO("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),dO("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),dO("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),dO("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),dO("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),dO("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),dO("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),dO("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),dO("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),dO("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),dO("∷","\\dblcolon"),dO("∹","\\eqcolon"),dO("≔","\\coloneqq"),dO("≕","\\eqqcolon"),dO("⩴","\\Coloneqq"),dO("\\ratio","\\vcentcolon"),dO("\\coloncolon","\\dblcolon"),dO("\\colonequals","\\coloneqq"),dO("\\coloncolonequals","\\Coloneqq"),dO("\\equalscolon","\\eqqcolon"),dO("\\equalscoloncolon","\\Eqqcolon"),dO("\\colonminus","\\coloneq"),dO("\\coloncolonminus","\\Coloneq"),dO("\\minuscolon","\\eqcolon"),dO("\\minuscoloncolon","\\Eqcolon"),dO("\\coloncolonapprox","\\Colonapprox"),dO("\\coloncolonsim","\\Colonsim"),dO("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),dO("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),dO("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),dO("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),dO("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),dO("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),dO("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),dO("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),dO("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),dO("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),dO("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),dO("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),dO("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),dO("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),dO("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),dO("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),dO("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),dO("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),dO("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),dO("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),dO("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),dO("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),dO("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),dO("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),dO("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),dO("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),dO("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),dO("\\imath","\\html@mathml{\\@imath}{ı}"),dO("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),dO("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),dO("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),dO("⟦","\\llbracket"),dO("⟧","\\rrbracket"),dO("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),dO("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),dO("⦃","\\lBrace"),dO("⦄","\\rBrace"),dO("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),dO("⦵","\\minuso"),dO("\\darr","\\downarrow"),dO("\\dArr","\\Downarrow"),dO("\\Darr","\\Downarrow"),dO("\\lang","\\langle"),dO("\\rang","\\rangle"),dO("\\uarr","\\uparrow"),dO("\\uArr","\\Uparrow"),dO("\\Uarr","\\Uparrow"),dO("\\N","\\mathbb{N}"),dO("\\R","\\mathbb{R}"),dO("\\Z","\\mathbb{Z}"),dO("\\alef","\\aleph"),dO("\\alefsym","\\aleph"),dO("\\Alpha","\\mathrm{A}"),dO("\\Beta","\\mathrm{B}"),dO("\\bull","\\bullet"),dO("\\Chi","\\mathrm{X}"),dO("\\clubs","\\clubsuit"),dO("\\cnums","\\mathbb{C}"),dO("\\Complex","\\mathbb{C}"),dO("\\Dagger","\\ddagger"),dO("\\diamonds","\\diamondsuit"),dO("\\empty","\\emptyset"),dO("\\Epsilon","\\mathrm{E}"),dO("\\Eta","\\mathrm{H}"),dO("\\exist","\\exists"),dO("\\harr","\\leftrightarrow"),dO("\\hArr","\\Leftrightarrow"),dO("\\Harr","\\Leftrightarrow"),dO("\\hearts","\\heartsuit"),dO("\\image","\\Im"),dO("\\infin","\\infty"),dO("\\Iota","\\mathrm{I}"),dO("\\isin","\\in"),dO("\\Kappa","\\mathrm{K}"),dO("\\larr","\\leftarrow"),dO("\\lArr","\\Leftarrow"),dO("\\Larr","\\Leftarrow"),dO("\\lrarr","\\leftrightarrow"),dO("\\lrArr","\\Leftrightarrow"),dO("\\Lrarr","\\Leftrightarrow"),dO("\\Mu","\\mathrm{M}"),dO("\\natnums","\\mathbb{N}"),dO("\\Nu","\\mathrm{N}"),dO("\\Omicron","\\mathrm{O}"),dO("\\plusmn","\\pm"),dO("\\rarr","\\rightarrow"),dO("\\rArr","\\Rightarrow"),dO("\\Rarr","\\Rightarrow"),dO("\\real","\\Re"),dO("\\reals","\\mathbb{R}"),dO("\\Reals","\\mathbb{R}"),dO("\\Rho","\\mathrm{P}"),dO("\\sdot","\\cdot"),dO("\\sect","\\S"),dO("\\spades","\\spadesuit"),dO("\\sub","\\subset"),dO("\\sube","\\subseteq"),dO("\\supe","\\supseteq"),dO("\\Tau","\\mathrm{T}"),dO("\\thetasym","\\vartheta"),dO("\\weierp","\\wp"),dO("\\Zeta","\\mathrm{Z}"),dO("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),dO("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),dO("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),dO("\\bra","\\mathinner{\\langle{#1}|}"),dO("\\ket","\\mathinner{|{#1}\\rangle}"),dO("\\braket","\\mathinner{\\langle{#1}\\rangle}"),dO("\\Bra","\\left\\langle#1\\right|"),dO("\\Ket","\\left|#1\\right\\rangle");var pL=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",s));var a=t;!t&&i.length&&("|"===n.future().text&&(n.popToken(),a=!0));return{tokens:a?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...a,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};dO("\\bra@ket",pL(!1)),dO("\\bra@set",pL(!0)),dO("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),dO("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),dO("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),dO("\\angln","{\\angl n}"),dO("\\blue","\\textcolor{##6495ed}{#1}"),dO("\\orange","\\textcolor{##ffa500}{#1}"),dO("\\pink","\\textcolor{##ff00af}{#1}"),dO("\\red","\\textcolor{##df0030}{#1}"),dO("\\green","\\textcolor{##28ae7b}{#1}"),dO("\\gray","\\textcolor{gray}{#1}"),dO("\\purple","\\textcolor{##9d38bd}{#1}"),dO("\\blueA","\\textcolor{##ccfaff}{#1}"),dO("\\blueB","\\textcolor{##80f6ff}{#1}"),dO("\\blueC","\\textcolor{##63d9ea}{#1}"),dO("\\blueD","\\textcolor{##11accd}{#1}"),dO("\\blueE","\\textcolor{##0c7f99}{#1}"),dO("\\tealA","\\textcolor{##94fff5}{#1}"),dO("\\tealB","\\textcolor{##26edd5}{#1}"),dO("\\tealC","\\textcolor{##01d1c1}{#1}"),dO("\\tealD","\\textcolor{##01a995}{#1}"),dO("\\tealE","\\textcolor{##208170}{#1}"),dO("\\greenA","\\textcolor{##b6ffb0}{#1}"),dO("\\greenB","\\textcolor{##8af281}{#1}"),dO("\\greenC","\\textcolor{##74cf70}{#1}"),dO("\\greenD","\\textcolor{##1fab54}{#1}"),dO("\\greenE","\\textcolor{##0d923f}{#1}"),dO("\\goldA","\\textcolor{##ffd0a9}{#1}"),dO("\\goldB","\\textcolor{##ffbb71}{#1}"),dO("\\goldC","\\textcolor{##ff9c39}{#1}"),dO("\\goldD","\\textcolor{##e07d10}{#1}"),dO("\\goldE","\\textcolor{##a75a05}{#1}"),dO("\\redA","\\textcolor{##fca9a9}{#1}"),dO("\\redB","\\textcolor{##ff8482}{#1}"),dO("\\redC","\\textcolor{##f9685d}{#1}"),dO("\\redD","\\textcolor{##e84d39}{#1}"),dO("\\redE","\\textcolor{##bc2612}{#1}"),dO("\\maroonA","\\textcolor{##ffbde0}{#1}"),dO("\\maroonB","\\textcolor{##ff92c6}{#1}"),dO("\\maroonC","\\textcolor{##ed5fa6}{#1}"),dO("\\maroonD","\\textcolor{##ca337c}{#1}"),dO("\\maroonE","\\textcolor{##9e034e}{#1}"),dO("\\purpleA","\\textcolor{##ddd7ff}{#1}"),dO("\\purpleB","\\textcolor{##c6b9fc}{#1}"),dO("\\purpleC","\\textcolor{##aa87ff}{#1}"),dO("\\purpleD","\\textcolor{##7854ab}{#1}"),dO("\\purpleE","\\textcolor{##543b78}{#1}"),dO("\\mintA","\\textcolor{##f5f9e8}{#1}"),dO("\\mintB","\\textcolor{##edf2df}{#1}"),dO("\\mintC","\\textcolor{##e0e5cc}{#1}"),dO("\\grayA","\\textcolor{##f6f7f7}{#1}"),dO("\\grayB","\\textcolor{##f0f1f2}{#1}"),dO("\\grayC","\\textcolor{##e3e5e6}{#1}"),dO("\\grayD","\\textcolor{##d6d8da}{#1}"),dO("\\grayE","\\textcolor{##babec2}{#1}"),dO("\\grayF","\\textcolor{##888d93}{#1}"),dO("\\grayG","\\textcolor{##626569}{#1}"),dO("\\grayH","\\textcolor{##3b3e40}{#1}"),dO("\\grayI","\\textcolor{##21242c}{#1}"),dO("\\kaBlue","\\textcolor{##314453}{#1}"),dO("\\kaGreen","\\textcolor{##71B307}{#1}");var fL={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class gL{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new oL(sL,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new aL(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new CS("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),a=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++a;else if("}"===r.text){if(-1===--a)throw new SS("Extra }",r)}else if("EOF"===r.text)throw new SS("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===a||1===a&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==a||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new SS("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;rthis.settings.maxExpand)throw new SS("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new SS("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var s=i[o];if("#"===s.text){if(0===o)throw new SS("Incomplete placeholder at end of macro body",s);if("#"===(s=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(s.text))throw new SS("Not a valid argument number",s);i.splice(o,2,...a[+s.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new CS(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var a=r.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var o=new aL(r,this.settings),s=[],l=o.lex();"EOF"!==l.text;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||JO.hasOwnProperty(e)||AA.math.hasOwnProperty(e)||AA.text.hasOwnProperty(e)||fL.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:JO.hasOwnProperty(e)&&!JO[e].primitive}}var mL=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,yL=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vL={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},bL={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};let xL=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new gL(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new SS("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new CS("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==e.endOfExpression.indexOf(i.text))break;if(n&&i.text===n)break;if(t&&JO[i.text]&&JO[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;"internal"!==a.type&&r.push(a)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t,n=-1,r=0;r=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,s=AA[this.mode][t].group,l=_S.range(e);if(CA.hasOwnProperty(s)){var c=s;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:s,mode:this.mode,loc:l,text:t};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(VS(t.charCodeAt(0))?"math"===this.mode&&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)),i={type:"textord",mode:"text",loc:_S.range(e),text:t}}if(this.consume(),a)for(var u=0;u0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+h[0].length,c=!0),!r.global)break;h=r.exec(e.value)}c?(sc&&(c=e):e&&(void 0!==c&&c>-1&&l.push("\n".repeat(c)||" "),c=-1,l.push(e))}return l.join("")}function uM(e,t,n){return"element"===e.type?function(e,t,n){const r=pM(e,n),i=e.children||[];let a,o,s=-1,l=[];if(sM(e))return l;rM(e)||oM(e)&&QL(t,e,oM)?o="\n":aM(e)?(a=2,o=2):lM(e)&&(a=1,o=1);for(;++s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=yM(e,"(");let a=yM(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function AM(e,t,n,r){return!(!NM(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function NM(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||AT(n)||ST(n))&&(!t||47!==n)}function IM(){this.buffer()}function OM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LM(){this.buffer()}function MM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DM(e){this.exit(e)}function PM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $M(e){this.exit(e)}function BM(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function FM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const a=r.createTracker(i);let o=a.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");o+=a.move(r.safe(r.associationId(e),{before:o,after:"]"})),l(),o+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,a.current()),t?jM:zM)));return s(),o},footnoteReference:BM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function zM(e,t,n){return 0===t?e:jM(e,t,n)}function jM(e,t,n){return(n?"":" ")+e}BM.peek=function(){return"["};const HM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function UM(e){this.enter({type:"delete",children:[]},e)}function GM(e){this.exit(e)}function qM(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function WM(e){return e.length}function VM(e){return null==e?"":String(e)}function YM(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}qM.peek=function(){return"~"};const XM={}.hasOwnProperty;function KM(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const a=r.handlers;if(t&&XM.call(t,e)){const n=String(t[e]);i=XM.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function QM(e,t,n){return">"+(n?"":" ")+e}function ZM(e,t){return JM(e,t.inConstruct,!0)&&!JM(e,t.notInConstruct,!1)}function JM(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),o(),c}function lR(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(h+"]"),l}function cR(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}function hR(e,t,n,r){const i=nR(n),a='"'===i?"Quote":"Apostrophe",o=n.createTracker(r);let s,l;if(uR(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=o.move("<");return r+=o.move(n.containerPhrasing(e,{before:r,after:">",...o.current()})),r+=o.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),s(),c}function dR(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(h+"]"),l}function pR(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 fR(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}aR.peek=function(e,t,n){return n.options.emphasis||"*"},oR.peek=function(){return"<"},sR.peek=function(){return"!"},lR.peek=function(){return"!"},cR.peek=function(){return"`"},hR.peek=function(e,t,n){return uR(e,n)?"<":"["},dR.peek=function(){return"["};const gR=mC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mR(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),a=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),u=iR(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=rR(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=iR(r.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+rR(h));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+l+p}mR.peek=function(e,t,n){return n.options.strong||"*"};const yR={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),QM);return i(),o},break:eR,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),a=e.value||"",o="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(a,tR);return e(),t}const s=n.createTracker(r),l=i.repeat(Math.max(bS(a,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${o}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),a&&(u+=s.move(a+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const i=nR(n),a='"'===i?"Quote":"Apostrophe",o=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),o(),c},emphasis:aR,hardBreak:eR,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(function(e,t){let n=!1;return TC(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,wC}),Boolean((!e.depth||e.depth<3)&&iT(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),o=n.containerPhrasing(e,{...a.current(),before:"\n",after:"\n"});return r(),t(),o+"\n"+(1===i?"=":"-").repeat(o.length-(Math.max(o.lastIndexOf("\r"),o.lastIndexOf("\n"))+1))}const o="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");a.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...a.current()});return/^[\t ]/.test(c)&&(c=rR(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),s(),c},html:oR,image:sR,imageReference:lR,inlineCode:cR,link:hR,linkReference:dR,list:function(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):pR(n);const s=e.ordered?"."===o?")":".":function(e){const t=pR(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}(n);let l=!(!t||!n.bulletLastUsed)&&o===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==o&&"-"!==o||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),fR(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let o=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));const s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(o))+e;return(n?a:a+" ".repeat(o-a.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o},root:function(e,t,n,r){const i=e.children.some(function(e){return gR(e)});return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:mR,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(fR(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function vR(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function bR(e){this.exit(e),this.data.inTable=void 0}function xR(e){this.enter({type:"tableRow",children:[]},e)}function wR(e){this.exit(e)}function ER(e){this.enter({type:"tableCell",children:[]},e)}function kR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,TR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function TR(e,t){return"|"===t?t:e}function _R(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=yR.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const a=[],o=t.enter("table");for(;++ic&&(c=e[u].length);++al[a])&&(l[a]=e)}t.push(o)}o[u]=t,s[u]=r}let h=-1;if("object"==typeof r&&"length"in r)for(;++hl[h]&&(l[h]=i),p[h]=i),d[h]=o}o.splice(1,0,d),s.splice(1,0,p),u=-1;const f=[];for(;++u0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}$R[43]=PR,$R[45]=PR,$R[46]=PR,$R[95]=PR,$R[72]=[PR,DR],$R[104]=[PR,DR],$R[87]=[PR,RR],$R[119]=[PR,RR];const GR={tokenize:function(e,t,n){const r=this;return OT(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function qR(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const s=mT(r.sliceSerialize({start:o.end,end:r.now()}));if(94!==s.codePointAt(0)||!a.includes(s.slice(1)))return n(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function WR(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function VR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(o>999||93===s&&!a||null===s||91===s||_T(s))return n(s);if(93===s){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(mT(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return _T(s)||(a=!0),o++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function YR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!o||null===t||91===t||_T(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=mT(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return _T(t)||(o=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function h(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),OT(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function XR(e,t,n){return e.check(zT,t,e.attempt(GR,t,n))}function KR(e){e.exit("gfmFootnoteDefinition")}function QR(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let o=0;return function(t){if(126===i&&"characterEscape"!==a[a.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(a){const l=DT(i);if(126===a)return o>1?r(a):(e.consume(a),o++,s);if(o<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=DT(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function JR(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?x:s;if(a===x&&r.parser.lazy[r.now().line])return n(e);return a(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return i=!0,o+=1,l(e)}(t)}function l(t){return null===t?n(t):TT(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h):n(t):CT(t)?OT(e,l,"whitespace")(t):(o+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||_T(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function h(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,CT(t)?OT(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):b(t)}function p(t){return CT(t)?OT(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(o+=1,g(t)):null===t||TT(t)?v(t):b(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),m(t)):b(t)}function m(t){return 45===t?(e.consume(t),m):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return CT(t)?OT(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?d(n):(null===n||TT(n))&&i&&a===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):b(n)}function b(e){return n(e)}function x(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||TT(n)?(e.exit("tableRow"),t(n)):CT(n)?OT(e,w,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||_T(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:E)}function k(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function tD(e,t){let n,r,i,a=-1,o=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,h=0;const d=new ZR;for(;++an[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(a.end=Object.assign({},iD(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function rD(e,t,n,r,i){const a=[],o=iD(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function iD(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const aD={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i};function i(t){return _T(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return TT(r)?t(r):CT(r)?e.check({tokenize:oD},t,n)(r):n(r)}}};function oD(e,t,n){return OT(e,function(e){return null===e?n(e):t(e)},"whitespace")}const sD={};function lD(e){const t=e||sD,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return dT([{text:$R},{document:{91:{name:"gfmFootnoteDefinition",tokenize:YR,continuation:{tokenize:XR},exit:KR}},text:{91:{name:"gfmFootnoteCall",tokenize:VR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qR,resolveTo:WR}}},QR(e),{flow:{null:{name:"table",tokenize:eD,resolveAll:tD}}},{text:{91:aD}}])}(t)),i.push([{transforms:[CM],enter:{literalAutolink:xM,literalAutolinkEmail:wM,literalAutolinkHttp:wM,literalAutolinkWww:wM},exit:{literalAutolink:_M,literalAutolinkEmail:TM,literalAutolinkHttp:EM,literalAutolinkWww:kM}},{enter:{gfmFootnoteCallString:IM,gfmFootnoteCall:OM,gfmFootnoteDefinitionLabelString:LM,gfmFootnoteDefinition:MM},exit:{gfmFootnoteCallString:RM,gfmFootnoteCall:DM,gfmFootnoteDefinitionLabelString:PM,gfmFootnoteDefinition:$M}},{canContainEols:["delete"],enter:{strikethrough:UM},exit:{strikethrough:GM}},{enter:{table:vR,tableData:ER,tableHeader:ER,tableRow:xR},exit:{codeText:kR,table:bR,tableData:wR,tableHeader:wR,tableRow:wR}},{exit:{taskListCheckValueChecked:CR,taskListCheckValueUnchecked:CR,paragraph:SR}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vM,notInConstruct:bM},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vM,notInConstruct:bM},{character:":",before:"[ps]",after:"\\/",inConstruct:vM,notInConstruct:bM}]},FM(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HM}],handlers:{delete:qM}},_R(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AR}}]}}(t))}const cD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],uD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),hD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),dD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var fD="[0-9](_*[0-9])*",gD=`\\.(${fD})`,mD="[0-9a-fA-F](_*[0-9a-fA-F])*",yD={className:"number",variants:[{begin:`(\\b(${fD})((${gD})|\\.)?|(${gD}))[eE][+-]?(${fD})[fFdD]?\\b`},{begin:`\\b(${fD})((${gD})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${gD})[fFdD]?\\b`},{begin:`\\b(${fD})[fFdD]\\b`},{begin:`\\b0[xX]((${mD})\\.?|(${mD})?\\.(${mD}))[pP][+-]?(${fD})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${mD})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vD(e,t,n){return-1===n?"":e.replace(t,r=>vD(e,t,n-1))}const bD="[A-Za-z$_][0-9A-Za-z$_]*",xD=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],wD=["true","false","null","undefined","NaN","Infinity"],ED=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],TD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_D=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],CD=[].concat(TD,ED,kD);var SD="[0-9](_*[0-9])*",AD=`\\.(${SD})`,ND="[0-9a-fA-F](_*[0-9a-fA-F])*",ID={className:"number",variants:[{begin:`(\\b(${SD})((${AD})|\\.)?|(${AD}))[eE][+-]?(${SD})[fFdD]?\\b`},{begin:`\\b(${SD})((${AD})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${AD})[fFdD]?\\b`},{begin:`\\b(${SD})[fFdD]\\b`},{begin:`\\b0[xX]((${ND})\\.?|(${ND})?\\.(${ND}))[pP][+-]?(${SD})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ND})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const OD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],LD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),MD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),PD=MD.concat(RD).sort().reverse();const $D=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],BD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),FD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),zD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function HD(e){return e?"string"==typeof e?e:e.source:null}function UD(e){return GD("(?=",e,")")}function GD(...e){const t=e.map(e=>HD(e)).join("");return t}function qD(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map(e=>HD(e)).join("|")+")";return n}const WD=e=>GD(/\b/,e,/\w$/.test(e)?/\b/:/\B/),VD=["Protocol","Type"].map(WD),YD=["init","self"].map(WD),XD=["Any","Self"],KD=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QD=["false","nil","true"],ZD=["assignment","associativity","higherThan","left","lowerThan","none","right"],JD=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],eP=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],tP=qD(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),nP=qD(tP,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),rP=GD(tP,nP,"*"),iP=qD(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),aP=qD(iP,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oP=GD(iP,aP,"*"),sP=GD(/[A-Z]/,aP,"*"),lP=["attached","autoclosure",GD(/convention\(/,qD("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",GD(/objc\(/,oP,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],cP=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const uP="[A-Za-z$_][0-9A-Za-z$_]*",hP=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],dP=["true","false","null","undefined","NaN","Infinity"],pP=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fP=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gP=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mP=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yP=[].concat(gP,pP,fP);function vP(e){const t=e.regex,n=uP,r="<>",i="",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,f,g,m,{match:/\$\d+/},u,E,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},T,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}}const bP={arduino:function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"",keywords:d,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n},bash:function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},c=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),u={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[c,e.SHEBANG(),u,l,a,o,{match:/(\/[a-z._-]+)+/},s,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},c:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:p.concat([{begin:/\(/,end:/\)/,keywords:d,contains:p.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:d,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:s,keywords:d}}},cpp:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"",keywords:d,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},a=e.inherit(i,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},s=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,s]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]});o.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],s.contains=[u,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const h={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},p=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},h,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+p+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,d],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[h,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}},css:function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+hD.join("|")+")"},{begin:":(:)?("+dD.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pD.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:uD.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cD.join("|")+")\\b"}]}},diff:function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:")?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},a={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,yD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},yD,a]}},javascript:function(e){const t=e.regex,n=bD,r="<>",i="",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,f,g,m,{match:/\$\d+/},u,E,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},T,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}},json:function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},kotlin:function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},s={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},l=ID,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=u;return h.variants[1].contains=[u],u.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,o,s,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,o,s,a,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,s]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},less:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=PD,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",a=[],o=[],s=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:LD.join(" ")},u={begin:"\\(",end:"\\)",contains:o,keywords:c,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),d={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DD.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:o,relevance:0}},g={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+OD.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+MD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+RD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},y={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[m]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,g,y,p,m,d,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}},lua:function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}},makefile:function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},a=e.inherit(r,{contains:[]}),o=e.inherit(i,{contains:[]});r.contains.push(o),i.contains.push(a);let s=[t,n];return[r,i,a,o].forEach(e=>{e.contains=e.contains.concat(s)}),s=s.concat(r,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},s={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,i,s],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(e,r,i="\\1")=>{const a="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,n)},d=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),p=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...u,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...u,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}},php:function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},h="[ \t\n]",d={scope:"string",variants:[c,l,u,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},f=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],m=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:g,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(f),built_in:m},v=e=>e.map(e=>e.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",v(m).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},x=t.concat(r,"\\b(?!\\()"),w={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},E={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},k={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[E,o,w,e.C_BLOCK_COMMENT_MODE,d,p,b]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",v(g).join("\\b|"),"|",v(m).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[k]};k.contains.push(T);const _=[E,w,e.C_BLOCK_COMMENT_MODE,d,p,b],C={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:f,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:f,keyword:["new","array"]},contains:["self",..._]},..._,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[C,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,T,w,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",C,o,w,e.C_BLOCK_COMMENT_MODE,d,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},d,p]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,h=`\\b|${r.join("|")}`,d={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${h})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${c})[jJ](?=${h})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",a,d,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,d,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,d,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[d,f,l]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},h="[0-9](_?[0-9])*",d={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},f=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},d,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);c.contains=f,p.contains=f;const g=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:a,contains:f}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(l).concat(f)}},rust:function(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:s},illegal:""},a]}},scss:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=zD,r=FD,i="@[a-z-]+",a={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+$D.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jD.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:BD.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=r,a=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!r.includes(e)),o={match:t.concat(/\b/,t.either(...i),/\s*\(/),relevance:0,keywords:{built_in:i}};function s(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}const l={scope:"keyword",match:s(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}(a,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:s(["double precision","large object","with timezone","without timezone"])},l,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qD(...VD,...YD)],className:{2:"keyword"}},a={match:GD(/\./,qD(...KD)),relevance:0},o=KD.filter(e=>"string"==typeof e).concat(["_|0"]),s={variants:[{className:"keyword",match:qD(...KD.filter(e=>"string"!=typeof e).concat(XD).map(WD),...YD)}]},l={$pattern:qD(/\b\w+/,/#\w+/),keyword:o.concat(JD),literal:QD},c=[i,a,s],u=[{match:GD(/\./,qD(...eP)),relevance:0},{className:"built_in",match:GD(/\b/,qD(...eP),/(?=\()/)}],h={match:/->/,relevance:0},d=[h,{className:"operator",relevance:0,variants:[{match:rP},{match:`\\.(\\.|${nP})+`}]}],p="([0-9]_*)+",f="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},m=(e="")=>({className:"subst",variants:[{match:GD(/\\/,e,/[0\\tnr"']/)},{match:GD(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),y=(e="")=>({className:"subst",match:GD(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:GD(/\\/,e,/\(/),end:/\)/}),b=(e="")=>({begin:GD(e,/"""/),end:GD(/"""/,e),contains:[m(e),y(e),v(e)]}),x=(e="")=>({begin:GD(e,/"/),end:GD(/"/,e),contains:[m(e),v(e)]}),w={className:"string",variants:[b(),b("#"),b("##"),b("###"),x(),x("#"),x("##"),x("###")]},E=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},T=e=>{const t=GD(e,/\//),n=GD(/\//,e);return{begin:t,end:n,contains:[...E,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},_={scope:"regexp",variants:[T("###"),T("##"),T("#"),k]},C={match:GD(/`/,oP,/`/)},S=[C,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${aP}+`}],A=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:cP,contains:[...d,g,w]}]}},{scope:"keyword",match:GD(/@/,qD(...lP),UD(qD(/\(/,/\s+/)))},{scope:"meta",match:GD(/@/,oP)}],N={match:UD(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:GD(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,aP,"+")},{className:"type",match:sP,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:GD(/\s+&\s+/,UD(sP)),relevance:0}]},I={begin://,keywords:l,contains:[...r,...c,...A,h,N]};N.contains.push(I);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:GD(oP,/\s*:/),keywords:"_|0",relevance:0},...r,_,...c,...u,...d,g,w,...S,...A,N]},L={begin://,keywords:"repeat each",contains:[...r,N]},M={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:qD(UD(GD(oP,/\s*:/)),UD(GD(oP,/\s+/,oP,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oP}]},...r,...c,...d,g,w,...A,N,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,qD(C.match,oP,rP)],className:{1:"keyword",3:"title.function"},contains:[L,M,t],illegal:[/\[/,/%/]},D={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[L,M,t],illegal:/\[|%/},P={match:[/operator/,/\s+/,rP],className:{1:"keyword",3:"title"}},$={begin:[/precedencegroup/,/\s+/,sP],className:{1:"keyword",3:"title"},contains:[N],keywords:[...ZD,...QD],end:/}/},B={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,oP,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[L,...c,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:sP},...c],relevance:0}]};for(const e of w.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...u,...d,g,w,...S];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,R,D,{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},B,P,$,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},_,...c,...u,...d,g,w,...S,...A,N,O]}},typescript:function(e){const t=e.regex,n=vP(e),r=uP,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={$pattern:uP,keyword:hP.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:dP,built_in:yP.concat(i),"variable.language":mP},l={className:"meta",begin:"@"+r},c=(e,t,n)=>{const r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(n.keywords,s),n.exports.PARAMS_CONTAINS.push(l);const u=n.contains.find(e=>"attr"===e.scope),h=Object.assign({},u,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,u,h]),n.contains=n.contains.concat([l,a,o,h]),c(n,"shebang",e.SHEBANG()),c(n,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});const d=n.contains.find(e=>"func.def"===e.label);return d.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},vbnet:function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,o={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,a),/ *#/)}]},s=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},s,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},wasm:function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,s,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,s,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},a,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,l,{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},r],u=[...c];return u.pop(),u.push(i),o.contains=u,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}};function xP(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||xP(n)}),e}class wP{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function EP(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function kP(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const TP=e=>!!e.scope;class _P{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=EP(e)}openNode(e){if(!TP(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){TP(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}const CP=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class SP{constructor(){this.rootNode=CP(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=CP({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{SP._collapse(e)}))}}class AP extends SP{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new _P(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function NP(e){return e?"string"==typeof e?e:e.source:null}function IP(e){return MP("(?=",e,")")}function OP(e){return MP("(?:",e,")*")}function LP(e){return MP("(?:",e,")?")}function MP(...e){const t=e.map(e=>NP(e)).join("");return t}function RP(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map(e=>NP(e)).join("|")+")";return n}function DP(e){return new RegExp(e.toString()+"|").exec("").length-1}const PP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $P(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let r=NP(e),i="";for(;r.length>0;){const e=PP.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}const BP="[a-zA-Z]\\w*",FP="[a-zA-Z_]\\w*",zP="\\b\\d+(\\.\\d+)?",jP="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",HP="\\b(0b[01]+)",UP={begin:"\\\\[\\s\\S]",relevance:0},GP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[UP]},qP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[UP]},WP=function(e,t,n={}){const r=kP({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=RP("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:MP(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},VP=WP("//","$"),YP=WP("/\\*","\\*/"),XP=WP("#","$"),KP={scope:"number",begin:zP,relevance:0},QP={scope:"number",begin:jP,relevance:0},ZP={scope:"number",begin:HP,relevance:0},JP={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[UP,{begin:/\[/,end:/\]/,relevance:0,contains:[UP]}]},e$={scope:"title",begin:BP,relevance:0},t$={scope:"title",begin:FP,relevance:0},n$={begin:"\\.\\s*"+FP,relevance:0};var r$=Object.freeze({__proto__:null,APOS_STRING_MODE:GP,BACKSLASH_ESCAPE:UP,BINARY_NUMBER_MODE:ZP,BINARY_NUMBER_RE:HP,COMMENT:WP,C_BLOCK_COMMENT_MODE:YP,C_LINE_COMMENT_MODE:VP,C_NUMBER_MODE:QP,C_NUMBER_RE:jP,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:XP,IDENT_RE:BP,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:n$,NUMBER_MODE:KP,NUMBER_RE:zP,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:qP,REGEXP_MODE:JP,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=MP(t,/.*\b/,e.binary,/\b.*/)),kP({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:e$,UNDERSCORE_IDENT_RE:FP,UNDERSCORE_TITLE_MODE:t$});function i$(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function a$(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function o$(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=i$,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function s$(e,t){Array.isArray(e.illegal)&&(e.illegal=RP(...e.illegal))}function l$(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function c$(e,t){void 0===e.relevance&&(e.relevance=1)}const u$=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=MP(n.beforeMatch,IP(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},h$=["of","and","for","in","not","or","if","then","parent","list","value"];function d$(e,t,n="keyword"){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,d$(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,p$(n[0],n[1])]})}}function p$(e,t){return t?Number(t):function(e){return h$.includes(e.toLowerCase())}(e)?0:1}const f$={},g$=e=>{console.error(e)},m$=(e,...t)=>{console.log(`WARN: ${e}`,...t)},y$=(e,t)=>{f$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),f$[`${e}/${t}`]=!0)},v$=new Error;function b$(e,t,{key:n}){let r=0;const i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=DP(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function x$(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw g$("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),v$;if("object"!=typeof e.beginScope||null===e.beginScope)throw g$("beginScope must be object"),v$;b$(e,e.begin,{key:"beginScope"}),e.begin=$P(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw g$("skip, excludeEnd, returnEnd not compatible with endScope: {}"),v$;if("object"!=typeof e.endScope||null===e.endScope)throw g$("endScope must be object"),v$;b$(e,e.end,{key:"endScope"}),e.end=$P(e.end,{joinWith:""})}}(e)}function w$(e){function t(t,n){return new RegExp(NP(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=DP(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t($P(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=kP(e.classNameAliases||{}),function n(i,a){const o=i;if(i.isCompiled)return o;[a$,l$,x$,u$].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[o$,s$,c$].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),s=i.keywords.$pattern,delete i.keywords.$pattern),s=s||/\w+/,i.keywords&&(i.keywords=d$(i.keywords,e.case_insensitive)),o.keywordPatternRe=t(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=t(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=t(o.end)),o.terminatorEnd=NP(o.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return kP(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(E$(e))return kP(e,{starts:e.starts?kP(e.starts):null});if(Object.isFrozen(e))return kP(e);return e}("self"===e?i:e)})),i.contains.forEach(function(e){n(e,o)}),i.starts&&n(i.starts,a),o.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function E$(e){return!!e&&(e.endsWithParent||E$(e.starts))}class k$ extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const T$=EP,_$=kP,C$=Symbol("nomatch"),S$=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:AP};function l(e){return s.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(y$("10.7.0","highlight(lang, code, ...args) has been deprecated."),y$("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const a={code:r,language:i};v("before:highlight",a);const o=a.result?a.result:u(a.language,a.code,n);return o.code=a.code,v("after:highlight",o),o}function u(e,n,r,o){const l=Object.create(null);function c(e,t){return e.keywords[t]}function d(){if(!C.keywords)return void A.addText(N);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=k.case_insensitive?t[0].toLowerCase():t[0],i=c(C,r);if(i){const[e,a]=i;if(A.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(I+=a),e.startsWith("_"))n+=t[0];else{const n=k.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(N)}n+=N.substring(e),A.addText(n)}function p(){null!=C.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof C.subLanguage){if(!t[C.subLanguage])return void A.addText(N);e=u(C.subLanguage,N,!0,S[C.subLanguage]),S[C.subLanguage]=e._top}else e=h(N,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(I+=e.relevance),A.__addSublanguage(e._emitter,e.language)}():d(),N=""}function f(e,t){""!==e&&(A.startScope(t),A.addText(e),A.endScope())}function m(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=k.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(N=i,d(),N=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(N,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=""):e.beginScope._multi&&(m(e.beginScope,t),N="")),C=Object.create(e,{parent:{value:C}}),C}function v(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new wP(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,n)}function b(e){return 0===C.matcher.regexIndex?(N+=e[0],1):(M=!0,0)}function x(e){const t=e[0],r=n.substring(e.index),i=v(C,e,r);if(!i)return C$;const a=C;C.endScope&&C.endScope._wrap?(p(),f(t,C.endScope._wrap)):C.endScope&&C.endScope._multi?(p(),m(C.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do{C.scope&&A.closeNode(),C.skip||C.subLanguage||(I+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&y(i.starts,e),a.returnEnd?0:t.length}let w={};function E(t,a){const o=a&&a[0];if(N+=t,null==o)return p(),0;if("begin"===w.type&&"end"===a.type&&w.index===a.index&&""===o){if(N+=n.slice(a.index,a.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=a,"begin"===a.type)return function(e){const t=e[0],n=e.rule,r=new wP(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),n.returnBegin||n.excludeBegin||(N=t)),y(n,e),n.returnBegin?0:t.length}(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.scope||"")+'"');throw e.mode=C,e}if("end"===a.type){const e=x(a);if(e!==C$)return e}if("illegal"===a.type&&""===o)return N+="\n",1;if(L>1e5&&L>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return N+=o,o.length}const k=g(e);if(!k)throw g$(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const T=w$(k);let _="",C=o||T;const S={},A=new s.__emitter(s);!function(){const e=[];for(let t=C;t!==k;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>A.openNode(e))}();let N="",I=0,O=0,L=0,M=!1;try{if(k.__emitTokens)k.__emitTokens(n,A);else{for(C.matcher.considerAll();;){L++,M?M=!1:C.matcher.considerAll(),C.matcher.lastIndex=O;const e=C.matcher.exec(n);if(!e)break;const t=E(n.substring(O,e.index),e);O=e.index+t}E(n.substring(O))}return A.finalize(),_=A.toHTML(),{language:e,value:_,relevance:I,illegal:!1,_emitter:A,_top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:T$(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:O,context:n.slice(O-100,O+100),mode:t.mode,resultSoFar:_},_emitter:A};if(i)return{language:e,value:T$(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:C};throw t}}function h(e,n){n=n||s.languages||Object.keys(t);const r=function(e){const t={value:T$(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}(e),i=n.filter(g).filter(y).map(t=>u(t,e,!1));i.unshift(r);const a=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(g(e.language).supersetOf===t.language)return 1;if(g(t.language).supersetOf===e.language)return-1}return 0}),[l,c]=a,h=l;return h.secondBest=c,h}function d(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=s.languageDetectRe.exec(t);if(n){const t=g(n[1]);return t||(m$(a.replace("{}",n[1])),m$("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>l(e)||g(e))}(e);if(l(r))return;if(v("before:highlightElement",{el:e,language:r}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),s.throwUnescapedHTML)){throw new k$("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,o=r?c(i,{language:r,ignoreIllegals:!0}):h(i);e.innerHTML=o.value,e.dataset.highlighted="yes",function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),v("after:highlightElement",{el:e,result:o,text:i})}let p=!1;function f(){if("loading"===document.readyState)return p||window.addEventListener("DOMContentLoaded",function(){f()},!1),void(p=!0);document.querySelectorAll(s.cssSelector).forEach(d)}function g(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function m(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function y(e){const t=g(e);return t&&!t.disableAutodetect}function v(e,t){const n=e;r.forEach(function(e){e[n]&&e[n](t)})}Object.assign(e,{highlight:c,highlightAuto:h,highlightAll:f,highlightElement:d,highlightBlock:function(e){return y$("10.7.0","highlightBlock will be removed entirely in v12.0"),y$("10.7.0","Please use highlightElement now."),d(e)},configure:function(e){s=_$(s,e)},initHighlighting:()=>{f(),y$("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),y$("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let a=null;try{a=r(e)}catch(e){if(g$("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;g$(e),a=o}a.name||(a.name=n),t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&m(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:g,registerAliases:m,autoDetection:y,inherit:_$,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="11.11.1",e.regex={concat:MP,lookahead:IP,either:RP,optional:LP,anyNumberOfTimes:OP};for(const e in r$)"object"==typeof r$[e]&&xP(r$[e]);return Object.assign(e,r$),e},A$=S$({});A$.newInstance=()=>S$({});var N$=A$;A$.HighlightJS=A$,A$.default=A$;var I$=Zt(N$);const O$={};class L${constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r={type:"element",tagName:"span",properties:{className:n},children:[]};this.stack[this.stack.length-1].children.push(r),this.stack.push(r)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const M$={};function R$(e){const t=e||M$,n=t.aliases,r=t.detect||!1,i=t.languages||bP,a=t.plainText,o=t.prefix,s=t.subset;let l="hljs";const c=function(e){const t=I$.newInstance();return e&&i(e),{highlight:n,highlightAuto:function(e,i){const a=(i||O$).subset||r();let o,s=-1,l=0;for(;++sl&&(l=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:r,register:i,registerAlias:function(e,n){if("string"==typeof e)t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){const r=e[n];t.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(e){return Boolean(t.getLanguage(e))}};function n(e,n,r){const i=r||O$,a="string"==typeof i.prefix?i.prefix:"hljs-";if(!t.getLanguage(e))throw new Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:L$,classPrefix:a});const o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});const s=o._emitter.root,l=s.data;return l.language=o.language,l.relevance=o.relevance,s}function r(){return t.listLanguages()}function i(e,n){if("string"==typeof e)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}(i);if(n&&c.registerAlias(n),o){const e=o.indexOf("-");l=-1===e?o:o.slice(0,e)}return function(e,t){TC(e,"element",function(e,n,i){if("code"!==e.tagName||!i||"element"!==i.type||"pre"!==i.tagName)return;const u=function(e){const t=e.properties.className;let n,r=-1;if(!Array.isArray(t))return;for(;++r0&&(e.children=d.children)})}}function D$(e,t){const n=e.indexOf("\r",t),r=e.indexOf("\n",t);return-1===r?n:-1===n||n+1===r?r:n1?n[e.line-2]:0)+e.column-1;if(r-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(void 0===i){const e=D$(t,n[r-1]);i=-1===e?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}}}(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case"#documentType":return n={type:"doctype"},z$(e,t,n),n;case"#text":{const r=t;return n={type:"text",value:r.value},z$(e,r,n),n}default:return n=function(e,t){const n=e.schema;e.schema=t.namespaceURI===WL.svg?ik:rk;let r=-1;const i={};for(;++r"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),cB=sB({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function uB(e,t){return t in e?e[t]:t}function hB(e,t){return uB(e,t.toLowerCase())}const dB=sB({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:hB,properties:{xmlns:null,xmlnsXLink:null}}),pB=sB({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:X$,ariaAutoComplete:null,ariaBusy:X$,ariaChecked:X$,ariaColCount:Q$,ariaColIndex:Q$,ariaColSpan:Q$,ariaControls:Z$,ariaCurrent:null,ariaDescribedBy:Z$,ariaDetails:null,ariaDisabled:X$,ariaDropEffect:Z$,ariaErrorMessage:null,ariaExpanded:X$,ariaFlowTo:Z$,ariaGrabbed:X$,ariaHasPopup:null,ariaHidden:X$,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Z$,ariaLevel:Q$,ariaLive:null,ariaModal:X$,ariaMultiLine:X$,ariaMultiSelectable:X$,ariaOrientation:null,ariaOwns:Z$,ariaPlaceholder:null,ariaPosInSet:Q$,ariaPressed:X$,ariaReadOnly:X$,ariaRelevant:null,ariaRequired:X$,ariaRoleDescription:Z$,ariaRowCount:Q$,ariaRowIndex:Q$,ariaRowSpan:Q$,ariaSelected:X$,ariaSetSize:Q$,ariaSort:null,ariaValueMax:Q$,ariaValueMin:Q$,ariaValueNow:Q$,ariaValueText:null,role:null}}),fB=sB({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:hB,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:J$,acceptCharset:Z$,accessKey:Z$,action:null,allow:null,allowFullScreen:Y$,allowPaymentRequest:Y$,allowUserMedia:Y$,alt:null,as:null,async:Y$,autoCapitalize:null,autoComplete:Z$,autoFocus:Y$,autoPlay:Y$,blocking:Z$,capture:null,charSet:null,checked:Y$,cite:null,className:Z$,cols:Q$,colSpan:null,content:null,contentEditable:X$,controls:Y$,controlsList:Z$,coords:Q$|J$,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y$,defer:Y$,dir:null,dirName:null,disabled:Y$,download:K$,draggable:X$,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y$,formTarget:null,headers:Z$,height:Q$,hidden:Y$,high:Q$,href:null,hrefLang:null,htmlFor:Z$,httpEquiv:Z$,id:null,imageSizes:null,imageSrcSet:null,inert:Y$,inputMode:null,integrity:null,is:null,isMap:Y$,itemId:null,itemProp:Z$,itemRef:Z$,itemScope:Y$,itemType:Z$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y$,low:Q$,manifest:null,max:null,maxLength:Q$,media:null,method:null,min:null,minLength:Q$,multiple:Y$,muted:Y$,name:null,nonce:null,noModule:Y$,noValidate:Y$,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Y$,optimum:Q$,pattern:null,ping:Z$,placeholder:null,playsInline:Y$,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y$,referrerPolicy:null,rel:Z$,required:Y$,reversed:Y$,rows:Q$,rowSpan:Q$,sandbox:Z$,scope:null,scoped:Y$,seamless:Y$,selected:Y$,shadowRootClonable:Y$,shadowRootDelegatesFocus:Y$,shadowRootMode:null,shape:null,size:Q$,sizes:null,slot:null,span:Q$,spellCheck:X$,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q$,step:null,style:null,tabIndex:Q$,target:null,title:null,translate:null,type:null,typeMustMatch:Y$,useMap:null,value:X$,width:Q$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Z$,axis:null,background:null,bgColor:null,border:Q$,borderColor:null,bottomMargin:Q$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y$,declare:Y$,event:null,face:null,frame:null,frameBorder:null,hSpace:Q$,leftMargin:Q$,link:null,longDesc:null,lowSrc:null,marginHeight:Q$,marginWidth:Q$,noResize:Y$,noHref:Y$,noShade:Y$,noWrap:Y$,object:null,profile:null,prompt:null,rev:null,rightMargin:Q$,rules:null,scheme:null,scrolling:X$,standby:null,summary:null,text:null,topMargin:Q$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Y$,disableRemotePlayback:Y$,prefix:null,property:null,results:Q$,security:null,unselectable:null}}),gB=sB({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:uB,properties:{about:eB,accentHeight:Q$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q$,amplitude:Q$,arabicForm:null,ascent:Q$,attributeName:null,attributeType:null,azimuth:Q$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q$,by:null,calcMode:null,capHeight:Q$,className:Z$,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q$,diffuseConstant:Q$,direction:null,display:null,dur:null,divisor:Q$,dominantBaseline:null,download:Y$,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q$,enableBackground:null,end:null,event:null,exponent:Q$,externalResourcesRequired:null,fill:null,fillOpacity:Q$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:J$,g2:J$,glyphName:J$,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q$,horizOriginX:Q$,horizOriginY:Q$,id:null,ideographic:Q$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q$,k:Q$,k1:Q$,k2:Q$,k3:Q$,k4:Q$,kernelMatrix:eB,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q$,overlineThickness:Q$,paintOrder:null,panose1:null,path:null,pathLength:Q$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Z$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q$,pointsAtY:Q$,pointsAtZ:Q$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eB,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eB,rev:eB,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eB,requiredFeatures:eB,requiredFonts:eB,requiredFormats:eB,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q$,specularExponent:Q$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q$,strikethroughThickness:Q$,string:null,stroke:null,strokeDashArray:eB,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q$,strokeOpacity:Q$,strokeWidth:null,style:null,surfaceScale:Q$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eB,tabIndex:Q$,tableValues:null,target:null,targetX:Q$,targetY:Q$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eB,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q$,underlineThickness:Q$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q$,values:null,vAlphabetic:Q$,vMathematical:Q$,vectorEffect:null,vHanging:Q$,vIdeographic:Q$,version:null,vertAdvY:Q$,vertOriginX:Q$,vertOriginY:Q$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),mB=/^data[-\w.:]+$/i,yB=/-[a-z]/g,vB=/[A-Z]/g;function bB(e){return"-"+e.toLowerCase()}function xB(e){return e.charAt(1).toUpperCase()}const wB=G$([cB,lB,dB,pB,fB],"html"),EB=G$([cB,lB,dB,pB,gB],"svg"),kB={},TB={}.hasOwnProperty,_B=KM("type",{handlers:{root:function(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=SB(e.children,n,t),AB(e,n),n},element:function(e,t){const n=t;let r=n;"element"===e.type&&"svg"===e.tagName.toLowerCase()&&"html"===n.space&&(r=EB);const i=[];let a;if(e.properties)for(a in e.properties)if("children"!==a&&TB.call(e.properties,a)){const t=CB(r,a,e.properties[a]);t&&i.push(t)}const o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:WL[o],childNodes:[],parentNode:null};s.childNodes=SB(e.children,s,r),AB(e,s),"template"===e.tagName&&e.content&&(s.content=function(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=SB(e.children,n,t),AB(e,n),n}(e.content,r));return s},text:function(e){const t={nodeName:"#text",value:e.value,parentNode:null};return AB(e,t),t},comment:function(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return AB(e,t),t},doctype:function(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return AB(e,t),t}}});function CB(e,t,n){const r=function(e,t){const n=q$(t);let r=t,i=W$;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&mB.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(yB,xB);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!yB.test(e)){let n=e.replace(vB,bB);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=iB}return new i(r,t)}(e,t);if(!1===n||null==n||"number"==typeof n&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?yE(n):ok(n));const i={name:r.attribute,value:!0===n?"":String(n)};if(r.space&&"html"!==r.space&&"svg"!==r.space){const e=i.name.indexOf(":");e<0?i.prefix="":(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=WL[r.space]}return i}function SB(e,t,n){let r=-1;const i=[];if(e)for(;++r=55296&&e<=57343}function zB(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159}function jB(e){return e>=64976&&e<=65007||IB.has(e)}var HB;!function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"}(HB||(HB={}));class UB{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){const{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,LB.EOF;return this._err(HB.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,LB.EOF;const n=this.html.charCodeAt(t);return n===LB.CARRIAGE_RETURN?LB.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,LB.EOF;let e=this.html.charCodeAt(this.pos);if(e===LB.CARRIAGE_RETURN)return this.isEol=!0,this.skipNextNewLine=!0,LB.LINE_FEED;if(e===LB.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine))return this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance();this.skipNextNewLine=!1,FB(e)&&(e=this._processSurrogate(e));return null===this.handler.onParseError||e>31&&e<127||e===LB.LINE_FEED||e===LB.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e}_checkForProblematicCharacters(e){zB(e)?this._err(HB.controlCharacterInInputStream):jB(e)&&this._err(HB.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}!function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"}(GB||(GB={}));const WB=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),VB=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var YB;!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(YB||(YB={}));var XB,KB,QB,ZB,JB,eF,tF,nF;function rF(e){return e>=YB.ZERO&&e<=YB.NINE}function iF(e){return e>=YB.UPPER_A&&e<=YB.UPPER_F||e>=YB.LOWER_A&&e<=YB.LOWER_F}function aF(e){return e===YB.EQUALS||function(e){return e>=YB.UPPER_A&&e<=YB.UPPER_Z||e>=YB.LOWER_A&&e<=YB.LOWER_Z||rF(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(XB||(XB={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(KB||(KB={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(QB||(QB={}));class oF{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=KB.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=QB.Strict}startEntity(e){this.decodeMode=e,this.state=KB.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case KB.EntityStart:return e.charCodeAt(t)===YB.NUM?(this.state=KB.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=KB.NamedEntity,this.stateNamedEntity(e,t));case KB.NumericStart:return this.stateNumericStart(e,t);case KB.NumericDecimal:return this.stateNumericDecimal(e,t);case KB.NumericHex:return this.stateNumericHex(e,t);case KB.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===YB.LOWER_X?(this.state=KB.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=KB.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t=55296&&e<=57343||e>1114111?65533:null!==(t=VB.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==YB.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&XB.VALUE_LENGTH)>>14;for(;t>14,0!==i){if(a===YB.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==QB.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&XB.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~XB.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case KB.NamedEntity:return 0===this.result||this.decodeMode===QB.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case KB.NumericDecimal:return this.emitNumericEntity(0,2);case KB.NumericHex:return this.emitNumericEntity(0,3);case KB.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case KB.EntityStart:return 0}}}function sF(e,t,n,r){const i=(t&XB.BRANCH_LENGTH)>>7,a=t&XB.JUMP_TABLE;if(0===i)return 0!==a&&r===a?n:-1;if(a){const t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){const t=o+s>>>1,n=e[t];if(nr))return e[t+i];s=t-1}}return-1}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"}(ZB||(ZB={})),function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"}(JB||(JB={})),function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"}(eF||(eF={})),function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"}(tF||(tF={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"}(nF||(nF={}));const lF=new Map([[tF.A,nF.A],[tF.ADDRESS,nF.ADDRESS],[tF.ANNOTATION_XML,nF.ANNOTATION_XML],[tF.APPLET,nF.APPLET],[tF.AREA,nF.AREA],[tF.ARTICLE,nF.ARTICLE],[tF.ASIDE,nF.ASIDE],[tF.B,nF.B],[tF.BASE,nF.BASE],[tF.BASEFONT,nF.BASEFONT],[tF.BGSOUND,nF.BGSOUND],[tF.BIG,nF.BIG],[tF.BLOCKQUOTE,nF.BLOCKQUOTE],[tF.BODY,nF.BODY],[tF.BR,nF.BR],[tF.BUTTON,nF.BUTTON],[tF.CAPTION,nF.CAPTION],[tF.CENTER,nF.CENTER],[tF.CODE,nF.CODE],[tF.COL,nF.COL],[tF.COLGROUP,nF.COLGROUP],[tF.DD,nF.DD],[tF.DESC,nF.DESC],[tF.DETAILS,nF.DETAILS],[tF.DIALOG,nF.DIALOG],[tF.DIR,nF.DIR],[tF.DIV,nF.DIV],[tF.DL,nF.DL],[tF.DT,nF.DT],[tF.EM,nF.EM],[tF.EMBED,nF.EMBED],[tF.FIELDSET,nF.FIELDSET],[tF.FIGCAPTION,nF.FIGCAPTION],[tF.FIGURE,nF.FIGURE],[tF.FONT,nF.FONT],[tF.FOOTER,nF.FOOTER],[tF.FOREIGN_OBJECT,nF.FOREIGN_OBJECT],[tF.FORM,nF.FORM],[tF.FRAME,nF.FRAME],[tF.FRAMESET,nF.FRAMESET],[tF.H1,nF.H1],[tF.H2,nF.H2],[tF.H3,nF.H3],[tF.H4,nF.H4],[tF.H5,nF.H5],[tF.H6,nF.H6],[tF.HEAD,nF.HEAD],[tF.HEADER,nF.HEADER],[tF.HGROUP,nF.HGROUP],[tF.HR,nF.HR],[tF.HTML,nF.HTML],[tF.I,nF.I],[tF.IMG,nF.IMG],[tF.IMAGE,nF.IMAGE],[tF.INPUT,nF.INPUT],[tF.IFRAME,nF.IFRAME],[tF.KEYGEN,nF.KEYGEN],[tF.LABEL,nF.LABEL],[tF.LI,nF.LI],[tF.LINK,nF.LINK],[tF.LISTING,nF.LISTING],[tF.MAIN,nF.MAIN],[tF.MALIGNMARK,nF.MALIGNMARK],[tF.MARQUEE,nF.MARQUEE],[tF.MATH,nF.MATH],[tF.MENU,nF.MENU],[tF.META,nF.META],[tF.MGLYPH,nF.MGLYPH],[tF.MI,nF.MI],[tF.MO,nF.MO],[tF.MN,nF.MN],[tF.MS,nF.MS],[tF.MTEXT,nF.MTEXT],[tF.NAV,nF.NAV],[tF.NOBR,nF.NOBR],[tF.NOFRAMES,nF.NOFRAMES],[tF.NOEMBED,nF.NOEMBED],[tF.NOSCRIPT,nF.NOSCRIPT],[tF.OBJECT,nF.OBJECT],[tF.OL,nF.OL],[tF.OPTGROUP,nF.OPTGROUP],[tF.OPTION,nF.OPTION],[tF.P,nF.P],[tF.PARAM,nF.PARAM],[tF.PLAINTEXT,nF.PLAINTEXT],[tF.PRE,nF.PRE],[tF.RB,nF.RB],[tF.RP,nF.RP],[tF.RT,nF.RT],[tF.RTC,nF.RTC],[tF.RUBY,nF.RUBY],[tF.S,nF.S],[tF.SCRIPT,nF.SCRIPT],[tF.SEARCH,nF.SEARCH],[tF.SECTION,nF.SECTION],[tF.SELECT,nF.SELECT],[tF.SOURCE,nF.SOURCE],[tF.SMALL,nF.SMALL],[tF.SPAN,nF.SPAN],[tF.STRIKE,nF.STRIKE],[tF.STRONG,nF.STRONG],[tF.STYLE,nF.STYLE],[tF.SUB,nF.SUB],[tF.SUMMARY,nF.SUMMARY],[tF.SUP,nF.SUP],[tF.TABLE,nF.TABLE],[tF.TBODY,nF.TBODY],[tF.TEMPLATE,nF.TEMPLATE],[tF.TEXTAREA,nF.TEXTAREA],[tF.TFOOT,nF.TFOOT],[tF.TD,nF.TD],[tF.TH,nF.TH],[tF.THEAD,nF.THEAD],[tF.TITLE,nF.TITLE],[tF.TR,nF.TR],[tF.TRACK,nF.TRACK],[tF.TT,nF.TT],[tF.U,nF.U],[tF.UL,nF.UL],[tF.SVG,nF.SVG],[tF.VAR,nF.VAR],[tF.WBR,nF.WBR],[tF.XMP,nF.XMP]]);function cF(e){var t;return null!==(t=lF.get(e))&&void 0!==t?t:nF.UNKNOWN}const uF=nF,hF={[ZB.HTML]:new Set([uF.ADDRESS,uF.APPLET,uF.AREA,uF.ARTICLE,uF.ASIDE,uF.BASE,uF.BASEFONT,uF.BGSOUND,uF.BLOCKQUOTE,uF.BODY,uF.BR,uF.BUTTON,uF.CAPTION,uF.CENTER,uF.COL,uF.COLGROUP,uF.DD,uF.DETAILS,uF.DIR,uF.DIV,uF.DL,uF.DT,uF.EMBED,uF.FIELDSET,uF.FIGCAPTION,uF.FIGURE,uF.FOOTER,uF.FORM,uF.FRAME,uF.FRAMESET,uF.H1,uF.H2,uF.H3,uF.H4,uF.H5,uF.H6,uF.HEAD,uF.HEADER,uF.HGROUP,uF.HR,uF.HTML,uF.IFRAME,uF.IMG,uF.INPUT,uF.LI,uF.LINK,uF.LISTING,uF.MAIN,uF.MARQUEE,uF.MENU,uF.META,uF.NAV,uF.NOEMBED,uF.NOFRAMES,uF.NOSCRIPT,uF.OBJECT,uF.OL,uF.P,uF.PARAM,uF.PLAINTEXT,uF.PRE,uF.SCRIPT,uF.SECTION,uF.SELECT,uF.SOURCE,uF.STYLE,uF.SUMMARY,uF.TABLE,uF.TBODY,uF.TD,uF.TEMPLATE,uF.TEXTAREA,uF.TFOOT,uF.TH,uF.THEAD,uF.TITLE,uF.TR,uF.TRACK,uF.UL,uF.WBR,uF.XMP]),[ZB.MATHML]:new Set([uF.MI,uF.MO,uF.MN,uF.MS,uF.MTEXT,uF.ANNOTATION_XML]),[ZB.SVG]:new Set([uF.TITLE,uF.FOREIGN_OBJECT,uF.DESC]),[ZB.XLINK]:new Set,[ZB.XML]:new Set,[ZB.XMLNS]:new Set},dF=new Set([uF.H1,uF.H2,uF.H3,uF.H4,uF.H5,uF.H6]);var pF;new Set([tF.STYLE,tF.SCRIPT,tF.XMP,tF.IFRAME,tF.NOEMBED,tF.NOFRAMES,tF.PLAINTEXT]),function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"}(pF||(pF={}));const fF={DATA:pF.DATA,RCDATA:pF.RCDATA,RAWTEXT:pF.RAWTEXT,SCRIPT_DATA:pF.SCRIPT_DATA,PLAINTEXT:pF.PLAINTEXT,CDATA_SECTION:pF.CDATA_SECTION};function gF(e){return e>=LB.LATIN_CAPITAL_A&&e<=LB.LATIN_CAPITAL_Z}function mF(e){return function(e){return e>=LB.LATIN_SMALL_A&&e<=LB.LATIN_SMALL_Z}(e)||gF(e)}function yF(e){return mF(e)||function(e){return e>=LB.DIGIT_0&&e<=LB.DIGIT_9}(e)}function vF(e){return e+32}function bF(e){return e===LB.SPACE||e===LB.LINE_FEED||e===LB.TABULATION||e===LB.FORM_FEED}function xF(e){return bF(e)||e===LB.SOLIDUS||e===LB.GREATER_THAN_SIGN}class wF{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=pF.DATA,this.returnState=pF.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new UB(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new oF(WB,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(HB.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(HB.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{const t=function(e){return e===LB.NULL?HB.nullCharacterReference:e>1114111?HB.characterReferenceOutsideUnicodeRange:FB(e)?HB.surrogateCharacterReference:jB(e)?HB.noncharacterCharacterReference:zB(e)||e===LB.CARRIAGE_RETURN?HB.controlCharacterReference:null}(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;null===(r=(n=this.handler).onParseError)||void 0===r||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==n||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(HB.endTagWithAttributes),e.selfClosing&&this._err(HB.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case GB.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case GB.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case GB.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:GB.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=bF(e)?GB.WHITESPACE_CHARACTER:e===LB.NULL?GB.NULL_CHARACTER:GB.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(GB.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=pF.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?QB.Attribute:QB.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===pF.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===pF.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===pF.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case pF.DATA:this._stateData(e);break;case pF.RCDATA:this._stateRcdata(e);break;case pF.RAWTEXT:this._stateRawtext(e);break;case pF.SCRIPT_DATA:this._stateScriptData(e);break;case pF.PLAINTEXT:this._statePlaintext(e);break;case pF.TAG_OPEN:this._stateTagOpen(e);break;case pF.END_TAG_OPEN:this._stateEndTagOpen(e);break;case pF.TAG_NAME:this._stateTagName(e);break;case pF.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case pF.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case pF.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case pF.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case pF.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case pF.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case pF.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case pF.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case pF.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case pF.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case pF.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case pF.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case pF.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case pF.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case pF.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case pF.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case pF.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case pF.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case pF.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case pF.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case pF.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case pF.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case pF.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case pF.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case pF.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case pF.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case pF.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case pF.BOGUS_COMMENT:this._stateBogusComment(e);break;case pF.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case pF.COMMENT_START:this._stateCommentStart(e);break;case pF.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case pF.COMMENT:this._stateComment(e);break;case pF.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case pF.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case pF.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case pF.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case pF.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case pF.COMMENT_END:this._stateCommentEnd(e);break;case pF.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case pF.DOCTYPE:this._stateDoctype(e);break;case pF.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case pF.DOCTYPE_NAME:this._stateDoctypeName(e);break;case pF.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case pF.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case pF.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case pF.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case pF.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case pF.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case pF.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case pF.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case pF.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case pF.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case pF.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case pF.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case pF.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case pF.CDATA_SECTION:this._stateCdataSection(e);break;case pF.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case pF.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case pF.CHARACTER_REFERENCE:this._stateCharacterReference();break;case pF.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case LB.LESS_THAN_SIGN:this.state=pF.TAG_OPEN;break;case LB.AMPERSAND:this._startCharacterReference();break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this._emitCodePoint(e);break;case LB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case LB.AMPERSAND:this._startCharacterReference();break;case LB.LESS_THAN_SIGN:this.state=pF.RCDATA_LESS_THAN_SIGN;break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this._emitChars(OB);break;case LB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case LB.LESS_THAN_SIGN:this.state=pF.RAWTEXT_LESS_THAN_SIGN;break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this._emitChars(OB);break;case LB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case LB.LESS_THAN_SIGN:this.state=pF.SCRIPT_DATA_LESS_THAN_SIGN;break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this._emitChars(OB);break;case LB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case LB.NULL:this._err(HB.unexpectedNullCharacter),this._emitChars(OB);break;case LB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(mF(e))this._createStartTagToken(),this.state=pF.TAG_NAME,this._stateTagName(e);else switch(e){case LB.EXCLAMATION_MARK:this.state=pF.MARKUP_DECLARATION_OPEN;break;case LB.SOLIDUS:this.state=pF.END_TAG_OPEN;break;case LB.QUESTION_MARK:this._err(HB.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=pF.BOGUS_COMMENT,this._stateBogusComment(e);break;case LB.EOF:this._err(HB.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(HB.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=pF.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(mF(e))this._createEndTagToken(),this.state=pF.TAG_NAME,this._stateTagName(e);else switch(e){case LB.GREATER_THAN_SIGN:this._err(HB.missingEndTagName),this.state=pF.DATA;break;case LB.EOF:this._err(HB.eofBeforeTagName),this._emitChars("");break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this.state=pF.SCRIPT_DATA_ESCAPED,this._emitChars(OB);break;case LB.EOF:this._err(HB.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=pF.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===LB.SOLIDUS?this.state=pF.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:mF(e)?(this._emitChars("<"),this.state=pF.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=pF.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){mF(e)?(this.state=pF.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break;case LB.NULL:this._err(HB.unexpectedNullCharacter),this.state=pF.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(OB);break;case LB.EOF:this._err(HB.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=pF.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===LB.SOLIDUS?(this.state=pF.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=pF.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(PB,!1)&&xF(this.preprocessor.peek(PB.length))){this._emitCodePoint(e);for(let e=0;e0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1)}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==ZB.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(OF,ZB.HTML)}clearBackToTableBodyContext(){this.clearBackTo(IF,ZB.HTML)}clearBackToTableRowContext(){this.clearBackTo(NF,ZB.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===nF.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===nF.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case ZB.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case ZB.SVG:if(AF.has(r))return!1;break;case ZB.MATHML:if(SF.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,TF)}hasInListItemScope(e){return this.hasInDynamicScope(e,_F)}hasInButtonScope(e){return this.hasInDynamicScope(e,CF)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ZB.HTML:if(dF.has(t))return!0;if(TF.has(t))return!1;break;case ZB.SVG:if(AF.has(t))return!1;break;case ZB.MATHML:if(SF.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ZB.HTML)switch(this.tagIDs[t]){case e:return!0;case nF.TABLE:case nF.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ZB.HTML)switch(this.tagIDs[e]){case nF.TBODY:case nF.THEAD:case nF.TFOOT:return!0;case nF.TABLE:case nF.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ZB.HTML)switch(this.tagIDs[t]){case e:return!0;case nF.OPTION:case nF.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&EF.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&kF.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;void 0!==this.currentTagId&&this.currentTagId!==e&&kF.has(this.currentTagId);)this.pop()}}var RF;!function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"}(RF||(RF={}));const DF={type:RF.Marker};class PF{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e[e.name,e.value]));let i=0;for(let e=0;er.get(e.name)===e.value)&&(i+=1,i>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(DF)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:RF.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:RF.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);-1!==t&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(DF);-1===e?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find(t=>t.type===RF.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===RF.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===RF.Element&&t.element===e)}}const $F={createDocument:()=>({nodeName:"#document",mode:eF.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,n)=>({nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),createTextNode:e=>({nodeName:"#text",value:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent:e=>e.content,setDocumentType(e,t,n,r){const i=e.childNodes.find(e=>"#documentType"===e.nodeName);if(i)i.name=t,i.publicId=n,i.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};$F.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if($F.isTextNode(n))return void(n.value+=t)}$F.appendChild(e,$F.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&$F.isTextNode(r)?r.value+=t:$F.insertBefore(e,$F.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(e=>e.name));for(let r=0;re.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},BF="html",FF=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],zF=[...FF,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],jF=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),HF=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],UF=[...HF,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function GF(e,t){return t.some(t=>e.startsWith(t))}const qF="text/html",WF="application/xhtml+xml",VF=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),YF=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ZB.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ZB.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ZB.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ZB.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ZB.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ZB.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ZB.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ZB.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ZB.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ZB.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ZB.XMLNS}]]),XF=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),KF=new Set([nF.B,nF.BIG,nF.BLOCKQUOTE,nF.BODY,nF.BR,nF.CENTER,nF.CODE,nF.DD,nF.DIV,nF.DL,nF.DT,nF.EM,nF.EMBED,nF.H1,nF.H2,nF.H3,nF.H4,nF.H5,nF.H6,nF.HEAD,nF.HR,nF.I,nF.IMG,nF.LI,nF.LISTING,nF.MENU,nF.META,nF.NOBR,nF.OL,nF.P,nF.PRE,nF.RUBY,nF.S,nF.SMALL,nF.SPAN,nF.STRONG,nF.STRIKE,nF.SUB,nF.SUP,nF.TABLE,nF.TT,nF.U,nF.UL,nF.VAR]);function QF(e){for(let t=0;t0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===ZB.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&void 0!==e&&void 0!==t&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,ZB.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=tz.TEXT}switchToPlaintextParsing(){this.insertionMode=tz.TEXT,this.originalInsertionMode=tz.IN_BODY,this.tokenizer.state=fF.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===tF.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===ZB.HTML)switch(this.fragmentContextID){case nF.TITLE:case nF.TEXTAREA:this.tokenizer.state=fF.RCDATA;break;case nF.STYLE:case nF.XMP:case nF.IFRAME:case nF.NOEMBED:case nF.NOFRAMES:case nF.NOSCRIPT:this.tokenizer.state=fF.RAWTEXT;break;case nF.SCRIPT:this.tokenizer.state=fF.SCRIPT_DATA;break;case nF.PLAINTEXT:this.tokenizer.state=fF.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=t?t:this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,ZB.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,ZB.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(tF.HTML,ZB.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,nF.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:n}=this._findFosterParentingLocation()),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),i=n?r.lastIndexOf(n):r.length,a=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===GB.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):({current:t,currentTagId:n}=this.openElements),(e.tagID!==nF.SVG||this.treeAdapter.getTagName(t)!==tF.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==ZB.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===nF.MGLYPH||e.tagID===nF.MALIGNMARK)&&void 0!==n&&!this._isIntegrationPoint(n,t,ZB.HTML))}_processToken(e){switch(e.type){case GB.CHARACTER:this.onCharacter(e);break;case GB.NULL_CHARACTER:this.onNullCharacter(e);break;case GB.COMMENT:this.onComment(e);break;case GB.DOCTYPE:this.onDoctype(e);break;case GB.START_TAG:this._processStartTag(e);break;case GB.END_TAG:this.onEndTag(e);break;case GB.EOF:this.onEof(e);break;case GB.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return ez(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(e=>e.type===RF.Marker||this.openElements.contains(e.element));for(let n=-1===t?e-1:t-1;n>=0;n--){const e=this.activeFormattingElements.entries[n];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=tz.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(nF.P),this.openElements.popUntilTagNamePopped(nF.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case nF.TR:return void(this.insertionMode=tz.IN_ROW);case nF.TBODY:case nF.THEAD:case nF.TFOOT:return void(this.insertionMode=tz.IN_TABLE_BODY);case nF.CAPTION:return void(this.insertionMode=tz.IN_CAPTION);case nF.COLGROUP:return void(this.insertionMode=tz.IN_COLUMN_GROUP);case nF.TABLE:return void(this.insertionMode=tz.IN_TABLE);case nF.BODY:return void(this.insertionMode=tz.IN_BODY);case nF.FRAMESET:return void(this.insertionMode=tz.IN_FRAMESET);case nF.SELECT:return void this._resetInsertionModeForSelect(e);case nF.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case nF.HTML:return void(this.insertionMode=this.headElement?tz.AFTER_HEAD:tz.BEFORE_HEAD);case nF.TD:case nF.TH:if(e>0)return void(this.insertionMode=tz.IN_CELL);break;case nF.HEAD:if(e>0)return void(this.insertionMode=tz.IN_HEAD)}this.insertionMode=tz.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===nF.TEMPLATE)break;if(e===nF.TABLE)return void(this.insertionMode=tz.IN_SELECT_IN_TABLE)}this.insertionMode=tz.IN_SELECT}_isElementCausesFosterParenting(e){return rz.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case nF.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===ZB.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case nF.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return hF[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e);else switch(this.insertionMode){case tz.INITIAL:gz(this,e);break;case tz.BEFORE_HTML:mz(this,e);break;case tz.BEFORE_HEAD:yz(this,e);break;case tz.IN_HEAD:xz(this,e);break;case tz.IN_HEAD_NO_SCRIPT:wz(this,e);break;case tz.AFTER_HEAD:Ez(this,e);break;case tz.IN_BODY:case tz.IN_CAPTION:case tz.IN_CELL:case tz.IN_TEMPLATE:_z(this,e);break;case tz.TEXT:case tz.IN_SELECT:case tz.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case tz.IN_TABLE:case tz.IN_TABLE_BODY:case tz.IN_ROW:Rz(this,e);break;case tz.IN_TABLE_TEXT:Fz(this,e);break;case tz.IN_COLUMN_GROUP:Uz(this,e);break;case tz.AFTER_BODY:Zz(this,e);break;case tz.AFTER_AFTER_BODY:Jz(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars=OB,e._insertCharacters(t)}(this,e);else switch(this.insertionMode){case tz.INITIAL:gz(this,e);break;case tz.BEFORE_HTML:mz(this,e);break;case tz.BEFORE_HEAD:yz(this,e);break;case tz.IN_HEAD:xz(this,e);break;case tz.IN_HEAD_NO_SCRIPT:wz(this,e);break;case tz.AFTER_HEAD:Ez(this,e);break;case tz.TEXT:this._insertCharacters(e);break;case tz.IN_TABLE:case tz.IN_TABLE_BODY:case tz.IN_ROW:Rz(this,e);break;case tz.IN_COLUMN_GROUP:Uz(this,e);break;case tz.AFTER_BODY:Zz(this,e);break;case tz.AFTER_AFTER_BODY:Jz(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)pz(this,e);else switch(this.insertionMode){case tz.INITIAL:case tz.BEFORE_HTML:case tz.BEFORE_HEAD:case tz.IN_HEAD:case tz.IN_HEAD_NO_SCRIPT:case tz.AFTER_HEAD:case tz.IN_BODY:case tz.IN_TABLE:case tz.IN_CAPTION:case tz.IN_COLUMN_GROUP:case tz.IN_TABLE_BODY:case tz.IN_ROW:case tz.IN_CELL:case tz.IN_SELECT:case tz.IN_SELECT_IN_TABLE:case tz.IN_TEMPLATE:case tz.IN_FRAMESET:case tz.AFTER_FRAMESET:pz(this,e);break;case tz.IN_TABLE_TEXT:zz(this,e);break;case tz.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0])}(this,e);break;case tz.AFTER_AFTER_BODY:case tz.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document)}(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case tz.INITIAL:!function(e,t){e._setDocumentType(t);const n=t.forceQuirks?eF.QUIRKS:function(e){if(e.name!==BF)return eF.QUIRKS;const{systemId:t}=e;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return eF.QUIRKS;let{publicId:n}=e;if(null!==n){if(n=n.toLowerCase(),jF.has(n))return eF.QUIRKS;let e=null===t?zF:FF;if(GF(n,e))return eF.QUIRKS;if(e=null===t?HF:UF,GF(n,e))return eF.LIMITED_QUIRKS}return eF.NO_QUIRKS}(t);(function(e){return e.name===BF&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err(t,HB.nonConformingDoctype);e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=tz.BEFORE_HTML}(this,e);break;case tz.BEFORE_HEAD:case tz.IN_HEAD:case tz.IN_HEAD_NO_SCRIPT:case tz.AFTER_HEAD:this._err(e,HB.misplacedDoctype);break;case tz.IN_TABLE_TEXT:zz(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,HB.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(function(e){const t=e.tagID,n=t===nF.FONT&&e.attrs.some(({name:e})=>e===JB.COLOR||e===JB.SIZE||e===JB.FACE);return n||KF.has(t)}(t))ej(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ZB.MATHML?QF(t):r===ZB.SVG&&(!function(e){const t=XF.get(e.tagName);null!=t&&(e.tagName=t,e.tagID=cF(e.tagName))}(t),ZF(t)),JF(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case tz.INITIAL:gz(this,e);break;case tz.BEFORE_HTML:!function(e,t){t.tagID===nF.HTML?(e._insertElement(t,ZB.HTML),e.insertionMode=tz.BEFORE_HEAD):mz(e,t)}(this,e);break;case tz.BEFORE_HEAD:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.HEAD:e._insertElement(t,ZB.HTML),e.headElement=e.openElements.current,e.insertionMode=tz.IN_HEAD;break;default:yz(e,t)}}(this,e);break;case tz.IN_HEAD:vz(this,e);break;case tz.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.BASEFONT:case nF.BGSOUND:case nF.HEAD:case nF.LINK:case nF.META:case nF.NOFRAMES:case nF.STYLE:vz(e,t);break;case nF.NOSCRIPT:e._err(t,HB.nestedNoscriptInHead);break;default:wz(e,t)}}(this,e);break;case tz.AFTER_HEAD:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.BODY:e._insertElement(t,ZB.HTML),e.framesetOk=!1,e.insertionMode=tz.IN_BODY;break;case nF.FRAMESET:e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_FRAMESET;break;case nF.BASE:case nF.BASEFONT:case nF.BGSOUND:case nF.LINK:case nF.META:case nF.NOFRAMES:case nF.SCRIPT:case nF.STYLE:case nF.TEMPLATE:case nF.TITLE:e._err(t,HB.abandonedHeadElementChild),e.openElements.push(e.headElement,nF.HEAD),vz(e,t),e.openElements.remove(e.headElement);break;case nF.HEAD:e._err(t,HB.misplacedStartTagForHeadElement);break;default:Ez(e,t)}}(this,e);break;case tz.IN_BODY:Iz(this,e);break;case tz.IN_TABLE:Dz(this,e);break;case tz.IN_TABLE_TEXT:zz(this,e);break;case tz.IN_CAPTION:!function(e,t){const n=t.tagID;jz.has(n)?e.openElements.hasInTableScope(nF.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(nF.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=tz.IN_TABLE,Dz(e,t)):Iz(e,t)}(this,e);break;case tz.IN_COLUMN_GROUP:Hz(this,e);break;case tz.IN_TABLE_BODY:Gz(this,e);break;case tz.IN_ROW:Wz(this,e);break;case tz.IN_CELL:!function(e,t){const n=t.tagID;jz.has(n)?(e.openElements.hasInTableScope(nF.TD)||e.openElements.hasInTableScope(nF.TH))&&(e._closeTableCell(),Wz(e,t)):Iz(e,t)}(this,e);break;case tz.IN_SELECT:Yz(this,e);break;case tz.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===nF.CAPTION||n===nF.TABLE||n===nF.TBODY||n===nF.TFOOT||n===nF.THEAD||n===nF.TR||n===nF.TD||n===nF.TH?(e.openElements.popUntilTagNamePopped(nF.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Yz(e,t)}(this,e);break;case tz.IN_TEMPLATE:!function(e,t){switch(t.tagID){case nF.BASE:case nF.BASEFONT:case nF.BGSOUND:case nF.LINK:case nF.META:case nF.NOFRAMES:case nF.SCRIPT:case nF.STYLE:case nF.TEMPLATE:case nF.TITLE:vz(e,t);break;case nF.CAPTION:case nF.COLGROUP:case nF.TBODY:case nF.TFOOT:case nF.THEAD:e.tmplInsertionModeStack[0]=tz.IN_TABLE,e.insertionMode=tz.IN_TABLE,Dz(e,t);break;case nF.COL:e.tmplInsertionModeStack[0]=tz.IN_COLUMN_GROUP,e.insertionMode=tz.IN_COLUMN_GROUP,Hz(e,t);break;case nF.TR:e.tmplInsertionModeStack[0]=tz.IN_TABLE_BODY,e.insertionMode=tz.IN_TABLE_BODY,Gz(e,t);break;case nF.TD:case nF.TH:e.tmplInsertionModeStack[0]=tz.IN_ROW,e.insertionMode=tz.IN_ROW,Wz(e,t);break;default:e.tmplInsertionModeStack[0]=tz.IN_BODY,e.insertionMode=tz.IN_BODY,Iz(e,t)}}(this,e);break;case tz.AFTER_BODY:!function(e,t){t.tagID===nF.HTML?Iz(e,t):Zz(e,t)}(this,e);break;case tz.IN_FRAMESET:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.FRAMESET:e._insertElement(t,ZB.HTML);break;case nF.FRAME:e._appendElement(t,ZB.HTML),t.ackSelfClosing=!0;break;case nF.NOFRAMES:vz(e,t)}}(this,e);break;case tz.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.NOFRAMES:vz(e,t)}}(this,e);break;case tz.AFTER_AFTER_BODY:!function(e,t){t.tagID===nF.HTML?Iz(e,t):Jz(e,t)}(this,e);break;case tz.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.NOFRAMES:vz(e,t)}}(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===nF.P||t.tagID===nF.BR)return ej(e),void e._endTagOutsideForeignContent(t);for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ZB.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case tz.INITIAL:gz(this,e);break;case tz.BEFORE_HTML:!function(e,t){const n=t.tagID;n!==nF.HTML&&n!==nF.HEAD&&n!==nF.BODY&&n!==nF.BR||mz(e,t)}(this,e);break;case tz.BEFORE_HEAD:!function(e,t){const n=t.tagID;n===nF.HEAD||n===nF.BODY||n===nF.HTML||n===nF.BR?yz(e,t):e._err(t,HB.endTagWithoutMatchingOpenElement)}(this,e);break;case tz.IN_HEAD:!function(e,t){switch(t.tagID){case nF.HEAD:e.openElements.pop(),e.insertionMode=tz.AFTER_HEAD;break;case nF.BODY:case nF.BR:case nF.HTML:xz(e,t);break;case nF.TEMPLATE:bz(e,t);break;default:e._err(t,HB.endTagWithoutMatchingOpenElement)}}(this,e);break;case tz.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case nF.NOSCRIPT:e.openElements.pop(),e.insertionMode=tz.IN_HEAD;break;case nF.BR:wz(e,t);break;default:e._err(t,HB.endTagWithoutMatchingOpenElement)}}(this,e);break;case tz.AFTER_HEAD:!function(e,t){switch(t.tagID){case nF.BODY:case nF.HTML:case nF.BR:Ez(e,t);break;case nF.TEMPLATE:bz(e,t);break;default:e._err(t,HB.endTagWithoutMatchingOpenElement)}}(this,e);break;case tz.IN_BODY:Lz(this,e);break;case tz.TEXT:!function(e,t){var n;t.tagID===nF.SCRIPT&&(null===(n=e.scriptHandler)||void 0===n||n.call(e,e.openElements.current));e.openElements.pop(),e.insertionMode=e.originalInsertionMode}(this,e);break;case tz.IN_TABLE:Pz(this,e);break;case tz.IN_TABLE_TEXT:zz(this,e);break;case tz.IN_CAPTION:!function(e,t){const n=t.tagID;switch(n){case nF.CAPTION:case nF.TABLE:e.openElements.hasInTableScope(nF.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(nF.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=tz.IN_TABLE,n===nF.TABLE&&Pz(e,t));break;case nF.BODY:case nF.COL:case nF.COLGROUP:case nF.HTML:case nF.TBODY:case nF.TD:case nF.TFOOT:case nF.TH:case nF.THEAD:case nF.TR:break;default:Lz(e,t)}}(this,e);break;case tz.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case nF.COLGROUP:e.openElements.currentTagId===nF.COLGROUP&&(e.openElements.pop(),e.insertionMode=tz.IN_TABLE);break;case nF.TEMPLATE:bz(e,t);break;case nF.COL:break;default:Uz(e,t)}}(this,e);break;case tz.IN_TABLE_BODY:qz(this,e);break;case tz.IN_ROW:Vz(this,e);break;case tz.IN_CELL:!function(e,t){const n=t.tagID;switch(n){case nF.TD:case nF.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=tz.IN_ROW);break;case nF.TABLE:case nF.TBODY:case nF.TFOOT:case nF.THEAD:case nF.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Vz(e,t));break;case nF.BODY:case nF.CAPTION:case nF.COL:case nF.COLGROUP:case nF.HTML:break;default:Lz(e,t)}}(this,e);break;case tz.IN_SELECT:Xz(this,e);break;case tz.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===nF.CAPTION||n===nF.TABLE||n===nF.TBODY||n===nF.TFOOT||n===nF.THEAD||n===nF.TR||n===nF.TD||n===nF.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(nF.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Xz(e,t)}(this,e);break;case tz.IN_TEMPLATE:!function(e,t){t.tagID===nF.TEMPLATE&&bz(e,t)}(this,e);break;case tz.AFTER_BODY:Qz(this,e);break;case tz.IN_FRAMESET:!function(e,t){t.tagID!==nF.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===nF.FRAMESET||(e.insertionMode=tz.AFTER_FRAMESET))}(this,e);break;case tz.AFTER_FRAMESET:!function(e,t){t.tagID===nF.HTML&&(e.insertionMode=tz.AFTER_AFTER_FRAMESET)}(this,e);break;case tz.AFTER_AFTER_BODY:Jz(this,e)}}onEof(e){switch(this.insertionMode){case tz.INITIAL:gz(this,e);break;case tz.BEFORE_HTML:mz(this,e);break;case tz.BEFORE_HEAD:yz(this,e);break;case tz.IN_HEAD:xz(this,e);break;case tz.IN_HEAD_NO_SCRIPT:wz(this,e);break;case tz.AFTER_HEAD:Ez(this,e);break;case tz.IN_BODY:case tz.IN_TABLE:case tz.IN_CAPTION:case tz.IN_COLUMN_GROUP:case tz.IN_TABLE_BODY:case tz.IN_ROW:case tz.IN_CELL:case tz.IN_SELECT:case tz.IN_SELECT_IN_TABLE:Mz(this,e);break;case tz.TEXT:!function(e,t){e._err(t,HB.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}(this,e);break;case tz.IN_TABLE_TEXT:zz(this,e);break;case tz.IN_TEMPLATE:Kz(this,e);break;case tz.AFTER_BODY:case tz.IN_FRAMESET:case tz.AFTER_FRAMESET:case tz.AFTER_AFTER_BODY:case tz.AFTER_AFTER_FRAMESET:fz(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===LB.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case tz.IN_HEAD:case tz.IN_HEAD_NO_SCRIPT:case tz.AFTER_HEAD:case tz.TEXT:case tz.IN_COLUMN_GROUP:case tz.IN_SELECT:case tz.IN_SELECT_IN_TABLE:case tz.IN_FRAMESET:case tz.AFTER_FRAMESET:this._insertCharacters(e);break;case tz.IN_BODY:case tz.IN_CAPTION:case tz.IN_CELL:case tz.IN_TEMPLATE:case tz.AFTER_BODY:case tz.AFTER_AFTER_BODY:case tz.AFTER_AFTER_FRAMESET:Tz(this,e);break;case tz.IN_TABLE:case tz.IN_TABLE_BODY:case tz.IN_ROW:Rz(this,e);break;case tz.IN_TABLE_TEXT:Bz(this,e)}}};function oz(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Oz(e,t),n}function sz(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function lz(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=3;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=cz(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function cz(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function uz(e,t,n){const r=cF(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);r===nF.TEMPLATE&&i===ZB.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hz(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function dz(e,t){for(let n=0;n<8;n++){const n=oz(e,t);if(!n)break;const r=sz(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;const i=lz(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&uz(e,a,i),hz(e,r,n)}}function pz(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function fz(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){const n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function gz(e,t){e._err(t,HB.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,eF.QUIRKS),e.insertionMode=tz.BEFORE_HTML,e._processToken(t)}function mz(e,t){e._insertFakeRootElement(),e.insertionMode=tz.BEFORE_HEAD,e._processToken(t)}function yz(e,t){e._insertFakeElement(tF.HEAD,nF.HEAD),e.headElement=e.openElements.current,e.insertionMode=tz.IN_HEAD,e._processToken(t)}function vz(e,t){switch(t.tagID){case nF.HTML:Iz(e,t);break;case nF.BASE:case nF.BASEFONT:case nF.BGSOUND:case nF.LINK:case nF.META:e._appendElement(t,ZB.HTML),t.ackSelfClosing=!0;break;case nF.TITLE:e._switchToTextParsing(t,fF.RCDATA);break;case nF.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,fF.RAWTEXT):(e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_HEAD_NO_SCRIPT);break;case nF.NOFRAMES:case nF.STYLE:e._switchToTextParsing(t,fF.RAWTEXT);break;case nF.SCRIPT:e._switchToTextParsing(t,fF.SCRIPT_DATA);break;case nF.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=tz.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(tz.IN_TEMPLATE);break;case nF.HEAD:e._err(t,HB.misplacedStartTagForHeadElement);break;default:xz(e,t)}}function bz(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==nF.TEMPLATE&&e._err(t,HB.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(nF.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,HB.endTagWithoutMatchingOpenElement)}function xz(e,t){e.openElements.pop(),e.insertionMode=tz.AFTER_HEAD,e._processToken(t)}function wz(e,t){const n=t.type===GB.EOF?HB.openElementsLeftAfterEof:HB.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=tz.IN_HEAD,e._processToken(t)}function Ez(e,t){e._insertFakeElement(tF.BODY,nF.BODY),e.insertionMode=tz.IN_BODY,kz(e,t)}function kz(e,t){switch(t.type){case GB.CHARACTER:_z(e,t);break;case GB.WHITESPACE_CHARACTER:Tz(e,t);break;case GB.COMMENT:pz(e,t);break;case GB.START_TAG:Iz(e,t);break;case GB.END_TAG:Lz(e,t);break;case GB.EOF:Mz(e,t)}}function Tz(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _z(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Cz(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ZB.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sz(e){const t=qB(e,JB.TYPE);return null!=t&&"hidden"===t.toLowerCase()}function Az(e,t){e._switchToTextParsing(t,fF.RAWTEXT)}function Nz(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML)}function Iz(e,t){switch(t.tagID){case nF.I:case nF.S:case nF.B:case nF.U:case nF.EM:case nF.TT:case nF.BIG:case nF.CODE:case nF.FONT:case nF.SMALL:case nF.STRIKE:case nF.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case nF.A:!function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(tF.A);n&&(dz(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case nF.H1:case nF.H2:case nF.H3:case nF.H4:case nF.H5:case nF.H6:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),void 0!==e.openElements.currentTagId&&dF.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.P:case nF.DL:case nF.OL:case nF.UL:case nF.DIV:case nF.DIR:case nF.NAV:case nF.MAIN:case nF.MENU:case nF.ASIDE:case nF.CENTER:case nF.FIGURE:case nF.FOOTER:case nF.HEADER:case nF.HGROUP:case nF.DIALOG:case nF.DETAILS:case nF.ADDRESS:case nF.ARTICLE:case nF.SEARCH:case nF.SECTION:case nF.SUMMARY:case nF.FIELDSET:case nF.BLOCKQUOTE:case nF.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.LI:case nF.DD:case nF.DT:!function(e,t){e.framesetOk=!1;const n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.tagIDs[t];if(n===nF.LI&&r===nF.LI||(n===nF.DD||n===nF.DT)&&(r===nF.DD||r===nF.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==nF.ADDRESS&&r!==nF.DIV&&r!==nF.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.BR:case nF.IMG:case nF.WBR:case nF.AREA:case nF.EMBED:case nF.KEYGEN:Cz(e,t);break;case nF.HR:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._appendElement(t,ZB.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t);break;case nF.RB:case nF.RTC:!function(e,t){e.openElements.hasInScope(nF.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.RT:case nF.RP:!function(e,t){e.openElements.hasInScope(nF.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(nF.RTC),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.PRE:case nF.LISTING:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}(e,t);break;case nF.XMP:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fF.RAWTEXT)}(e,t);break;case nF.SVG:!function(e,t){e._reconstructActiveFormattingElements(),ZF(t),JF(t),t.selfClosing?e._appendElement(t,ZB.SVG):e._insertElement(t,ZB.SVG),t.ackSelfClosing=!0}(e,t);break;case nF.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t);break;case nF.BASE:case nF.LINK:case nF.META:case nF.STYLE:case nF.TITLE:case nF.SCRIPT:case nF.BGSOUND:case nF.BASEFONT:case nF.TEMPLATE:vz(e,t);break;case nF.BODY:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t);break;case nF.FORM:!function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML),n||(e.formElement=e.openElements.current))}(e,t);break;case nF.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(nF.NOBR)&&(dz(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ZB.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case nF.MATH:!function(e,t){e._reconstructActiveFormattingElements(),QF(t),JF(t),t.selfClosing?e._appendElement(t,ZB.MATHML):e._insertElement(t,ZB.MATHML),t.ackSelfClosing=!0}(e,t);break;case nF.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==eF.QUIRKS&&e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML),e.framesetOk=!1,e.insertionMode=tz.IN_TABLE}(e,t);break;case nF.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ZB.HTML),Sz(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t);break;case nF.PARAM:case nF.TRACK:case nF.SOURCE:!function(e,t){e._appendElement(t,ZB.HTML),t.ackSelfClosing=!0}(e,t);break;case nF.IMAGE:!function(e,t){t.tagName=tF.IMG,t.tagID=nF.IMG,Cz(e,t)}(e,t);break;case nF.BUTTON:!function(e,t){e.openElements.hasInScope(nF.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(nF.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML),e.framesetOk=!1}(e,t);break;case nF.APPLET:case nF.OBJECT:case nF.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}(e,t);break;case nF.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fF.RAWTEXT)}(e,t);break;case nF.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===tz.IN_TABLE||e.insertionMode===tz.IN_CAPTION||e.insertionMode===tz.IN_TABLE_BODY||e.insertionMode===tz.IN_ROW||e.insertionMode===tz.IN_CELL?tz.IN_SELECT_IN_TABLE:tz.IN_SELECT}(e,t);break;case nF.OPTION:case nF.OPTGROUP:!function(e,t){e.openElements.currentTagId===nF.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ZB.HTML)}(e,t);break;case nF.NOEMBED:case nF.NOFRAMES:Az(e,t);break;case nF.FRAMESET:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_FRAMESET)}(e,t);break;case nF.TEXTAREA:!function(e,t){e._insertElement(t,ZB.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fF.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=tz.TEXT}(e,t);break;case nF.NOSCRIPT:e.options.scriptingEnabled?Az(e,t):Nz(e,t);break;case nF.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(nF.P)&&e._closePElement(),e._insertElement(t,ZB.HTML),e.tokenizer.state=fF.PLAINTEXT}(e,t);break;case nF.COL:case nF.TH:case nF.TD:case nF.TR:case nF.HEAD:case nF.FRAME:case nF.TBODY:case nF.TFOOT:case nF.THEAD:case nF.CAPTION:case nF.COLGROUP:break;default:Nz(e,t)}}function Oz(e,t){const n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==nF.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Lz(e,t){switch(t.tagID){case nF.A:case nF.B:case nF.I:case nF.S:case nF.U:case nF.EM:case nF.TT:case nF.BIG:case nF.CODE:case nF.FONT:case nF.NOBR:case nF.SMALL:case nF.STRIKE:case nF.STRONG:dz(e,t);break;case nF.P:!function(e){e.openElements.hasInButtonScope(nF.P)||e._insertFakeElement(tF.P,nF.P),e._closePElement()}(e);break;case nF.DL:case nF.UL:case nF.OL:case nF.DIR:case nF.DIV:case nF.NAV:case nF.PRE:case nF.MAIN:case nF.MENU:case nF.ASIDE:case nF.BUTTON:case nF.CENTER:case nF.FIGURE:case nF.FOOTER:case nF.HEADER:case nF.HGROUP:case nF.DIALOG:case nF.ADDRESS:case nF.ARTICLE:case nF.DETAILS:case nF.SEARCH:case nF.SECTION:case nF.SUMMARY:case nF.LISTING:case nF.FIELDSET:case nF.BLOCKQUOTE:case nF.FIGCAPTION:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case nF.LI:!function(e){e.openElements.hasInListItemScope(nF.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(nF.LI),e.openElements.popUntilTagNamePopped(nF.LI))}(e);break;case nF.DD:case nF.DT:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case nF.H1:case nF.H2:case nF.H3:case nF.H4:case nF.H5:case nF.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e);break;case nF.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(tF.BR,nF.BR),e.openElements.pop(),e.framesetOk=!1}(e);break;case nF.BODY:!function(e,t){if(e.openElements.hasInScope(nF.BODY)&&(e.insertionMode=tz.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}(e,t);break;case nF.HTML:!function(e,t){e.openElements.hasInScope(nF.BODY)&&(e.insertionMode=tz.AFTER_BODY,Qz(e,t))}(e,t);break;case nF.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(nF.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(nF.FORM):n&&e.openElements.remove(n))}(e);break;case nF.APPLET:case nF.OBJECT:case nF.MARQUEE:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}(e,t);break;case nF.TEMPLATE:bz(e,t);break;default:Oz(e,t)}}function Mz(e,t){e.tmplInsertionModeStack.length>0?Kz(e,t):fz(e,t)}function Rz(e,t){if(void 0!==e.openElements.currentTagId&&rz.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=tz.IN_TABLE_TEXT,t.type){case GB.CHARACTER:Fz(e,t);break;case GB.WHITESPACE_CHARACTER:Bz(e,t)}else $z(e,t)}function Dz(e,t){switch(t.tagID){case nF.TD:case nF.TH:case nF.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(tF.TBODY,nF.TBODY),e.insertionMode=tz.IN_TABLE_BODY,Gz(e,t)}(e,t);break;case nF.STYLE:case nF.SCRIPT:case nF.TEMPLATE:vz(e,t);break;case nF.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(tF.COLGROUP,nF.COLGROUP),e.insertionMode=tz.IN_COLUMN_GROUP,Hz(e,t)}(e,t);break;case nF.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,ZB.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t);break;case nF.TABLE:!function(e,t){e.openElements.hasInTableScope(nF.TABLE)&&(e.openElements.popUntilTagNamePopped(nF.TABLE),e._resetInsertionMode(),e._processStartTag(t))}(e,t);break;case nF.TBODY:case nF.TFOOT:case nF.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_TABLE_BODY}(e,t);break;case nF.INPUT:!function(e,t){Sz(t)?e._appendElement(t,ZB.HTML):$z(e,t),t.ackSelfClosing=!0}(e,t);break;case nF.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_CAPTION}(e,t);break;case nF.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ZB.HTML),e.insertionMode=tz.IN_COLUMN_GROUP}(e,t);break;default:$z(e,t)}}function Pz(e,t){switch(t.tagID){case nF.TABLE:e.openElements.hasInTableScope(nF.TABLE)&&(e.openElements.popUntilTagNamePopped(nF.TABLE),e._resetInsertionMode());break;case nF.TEMPLATE:bz(e,t);break;case nF.BODY:case nF.CAPTION:case nF.COL:case nF.COLGROUP:case nF.HTML:case nF.TBODY:case nF.TD:case nF.TFOOT:case nF.TH:case nF.THEAD:case nF.TR:break;default:$z(e,t)}}function $z(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,kz(e,t),e.fosterParentingEnabled=n}function Bz(e,t){e.pendingCharacterTokens.push(t)}function Fz(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function zz(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===nF.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===nF.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===nF.OPTGROUP&&e.openElements.pop();break;case nF.OPTION:e.openElements.currentTagId===nF.OPTION&&e.openElements.pop();break;case nF.SELECT:e.openElements.hasInSelectScope(nF.SELECT)&&(e.openElements.popUntilTagNamePopped(nF.SELECT),e._resetInsertionMode());break;case nF.TEMPLATE:bz(e,t)}}function Kz(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(nF.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):fz(e,t)}function Qz(e,t){var n;if(t.tagID===nF.HTML){if(e.fragmentContext||(e.insertionMode=tz.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===nF.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(null===(n=e.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&e._setEndLocation(r,t)}}else Zz(e,t)}function Zz(e,t){e.insertionMode=tz.IN_BODY,kz(e,t)}function Jz(e,t){e.insertionMode=tz.IN_BODY,kz(e,t)}function ej(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ZB.HTML&&void 0!==e.openElements.currentTagId&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}new Set([tF.AREA,tF.BASE,tF.BASEFONT,tF.BGSOUND,tF.BR,tF.COL,tF.EMBED,tF.FRAME,tF.HR,tF.IMG,tF.INPUT,tF.KEYGEN,tF.LINK,tF.META,tF.PARAM,tF.SOURCE,tF.TRACK,tF.WBR]);const tj=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,nj=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),rj={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ij(e,t){const n=function(e){const t="root"===e.type?e.children[0]:e;return Boolean(t&&("doctype"===t.type||"element"===t.type&&"html"===t.tagName.toLowerCase()))}(e),r=KM("type",{handlers:{root:oj,element:sj,text:lj,comment:hj,doctype:cj,raw:dj},unknown:pj}),i={parser:n?new az(rj):az.getFragmentParser(void 0,rj),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),fj(i,Mk());const a=function(e,t){const n=t||{};return B$({file:n.file||void 0,location:!1,schema:"svg"===n.space?ik:rk,verbose:n.verbose||!1},e)}(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&TC(a,"comment",function(e,t,n){const r=e;if(r.value.stitch&&n&&void 0!==t){return n.children[t]=r.value.stitch,t}}),"root"===a.type&&1===a.children.length&&a.children[0].type===e.type?a.children[0]:a}function aj(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:GB.CHARACTER,chars:e.value,location:mj(e)};fj(t,Mk(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function cj(e,t){const n={type:GB.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:mj(e)};fj(t,Mk(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function uj(e,t){t.stitches=!0;const n=function(e){return pC("children"in e?{...e,children:[]}:e)}(e);if("children"in e&&"children"in n){const r=ij({type:"root",children:e.children},t.options);n.children=r.children}hj({type:"comment",value:{stitch:n}},t)}function hj(e,t){const n=e.value,r={type:GB.COMMENT,data:n,location:mj(e)};fj(t,Mk(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function dj(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,gj(t,Mk(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(tj,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),72===t.parser.tokenizer.state||78===t.parser.tokenizer.state){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function pj(e,t){const n=e;if(!t.options.passThrough||!t.options.passThrough.includes(n.type)){let e="";throw nj.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+e)}uj(n,t)}function fj(e,t){gj(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fF.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function gj(e,t){if(t&&void 0!==t.offset){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=1-t.column,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function mj(e){const t=Mk(e)||{line:void 0,column:void 0,offset:void 0},n=Lk(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function yj(e){return function(t,n){return ij(t,{...e,file:n})}}const vj={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return 2.55*n;e/=360,t/=100;const i=(n/=100)<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case"r":return 255*vj.hue2rgb(a,i,e+1/3);case"g":return 255*vj.hue2rgb(a,i,e);case"b":return 255*vj.hue2rgb(a,i,e-1/3)}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;const i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if("l"===r)return 100*o;if(i===a)return 0;const s=i-a;if("s"===r)return 100*(o>.5?s/(2-i-a):s/(i+a));switch(i){case e:return 60*((t-n)/s+(tt>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(1e10*e)/1e10},xj={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},wj={channel:vj,lang:bj,unit:xj},Ej={};for(let e=0;e<=255;e++)Ej[e]=wj.unit.dec2hex(e);const kj=0,Tj=1,_j=2;let Cj=class{constructor(){this.type=kj}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=kj}is(e){return this.type===e}};const Sj=new class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new Cj}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=kj,this}_ensureHSL(){const e=this.data,{h:t,s:n,l:r}=e;void 0===t&&(e.h=wj.channel.rgb2hsl(e,"h")),void 0===n&&(e.s=wj.channel.rgb2hsl(e,"s")),void 0===r&&(e.l=wj.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:t,g:n,b:r}=e;void 0===t&&(e.r=wj.channel.hsl2rgb(e,"r")),void 0===n&&(e.g=wj.channel.hsl2rgb(e,"g")),void 0===r&&(e.b=wj.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,t=e.r;return this.type.is(_j)||void 0===t?(this._ensureHSL(),wj.channel.hsl2rgb(e,"r")):t}get g(){const e=this.data,t=e.g;return this.type.is(_j)||void 0===t?(this._ensureHSL(),wj.channel.hsl2rgb(e,"g")):t}get b(){const e=this.data,t=e.b;return this.type.is(_j)||void 0===t?(this._ensureHSL(),wj.channel.hsl2rgb(e,"b")):t}get h(){const e=this.data,t=e.h;return this.type.is(Tj)||void 0===t?(this._ensureRGB(),wj.channel.rgb2hsl(e,"h")):t}get s(){const e=this.data,t=e.s;return this.type.is(Tj)||void 0===t?(this._ensureRGB(),wj.channel.rgb2hsl(e,"s")):t}get l(){const e=this.data,t=e.l;return this.type.is(Tj)||void 0===t?(this._ensureRGB(),wj.channel.rgb2hsl(e,"l")):t}get a(){return this.data.a}set r(e){this.type.set(Tj),this.changed=!0,this.data.r=e}set g(e){this.type.set(Tj),this.changed=!0,this.data.g=e}set b(e){this.type.set(Tj),this.changed=!0,this.data.b=e}set h(e){this.type.set(_j),this.changed=!0,this.data.h=e}set s(e){this.type.set(_j),this.changed=!0,this.data.s=e}set l(e){this.type.set(_j),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}({r:0,g:0,b:0,a:0},"transparent"),Aj={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(35!==e.charCodeAt(0))return;const t=e.match(Aj.re);if(!t)return;const n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,l=o?8:4,c=a?0:-1,u=o?255:15;return Sj.set({r:(r>>l*(c+3)&u)*s,g:(r>>l*(c+2)&u)*s,b:(r>>l*(c+1)&u)*s,a:a?(r&u)*s/255:1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`#${Ej[Math.round(t)]}${Ej[Math.round(n)]}${Ej[Math.round(r)]}${Ej[Math.round(255*i)]}`:`#${Ej[Math.round(t)]}${Ej[Math.round(n)]}${Ej[Math.round(r)]}`}},Nj={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Nj.hueRe);if(t){const[,e,n]=t;switch(n){case"grad":return wj.channel.clamp.h(.9*parseFloat(e));case"rad":return wj.channel.clamp.h(180*parseFloat(e)/Math.PI);case"turn":return wj.channel.clamp.h(360*parseFloat(e))}}return wj.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(104!==t&&72!==t)return;const n=e.match(Nj.re);if(!n)return;const[,r,i,a,o,s]=n;return Sj.set({h:Nj._hue2deg(r),s:wj.channel.clamp.s(parseFloat(i)),l:wj.channel.clamp.l(parseFloat(a)),a:o?wj.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${wj.lang.round(t)}, ${wj.lang.round(n)}%, ${wj.lang.round(r)}%, ${i})`:`hsl(${wj.lang.round(t)}, ${wj.lang.round(n)}%, ${wj.lang.round(r)}%)`}},Ij={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ij.colors[e];if(t)return Aj.parse(t)},stringify:e=>{const t=Aj.stringify(e);for(const e in Ij.colors)if(Ij.colors[e]===t)return e}},Oj={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(114!==t&&82!==t)return;const n=e.match(Oj.re);if(!n)return;const[,r,i,a,o,s,l,c,u]=n;return Sj.set({r:wj.channel.clamp.r(i?2.55*parseFloat(r):parseFloat(r)),g:wj.channel.clamp.g(o?2.55*parseFloat(a):parseFloat(a)),b:wj.channel.clamp.b(l?2.55*parseFloat(s):parseFloat(s)),a:c?wj.channel.clamp.a(u?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${wj.lang.round(t)}, ${wj.lang.round(n)}, ${wj.lang.round(r)}, ${wj.lang.round(i)})`:`rgb(${wj.lang.round(t)}, ${wj.lang.round(n)}, ${wj.lang.round(r)})`}},Lj=e=>{if("string"!=typeof e)return e;const t=Aj.parse(e)||Oj.parse(e)||Nj.parse(e)||Ij.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},Mj=e=>!e.changed&&e.color?e.color:e.type.is(_j)||void 0===e.data.r?Nj.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Oj.stringify(e):Aj.stringify(e),Rj=(e,t)=>{const n=Lj(e);for(const e in t)n[e]=wj.channel.clamp[e](t[e]);return Mj(n)},Dj=(e,t,n=0,r=1)=>{if("number"!=typeof e)return Rj(e,{a:t});const i=Sj.set({r:wj.channel.clamp.r(e),g:wj.channel.clamp.g(t),b:wj.channel.clamp.b(n),a:wj.channel.clamp.a(r)});return Mj(i)},Pj=(e,t)=>wj.lang.round(Lj(e)[t]),$j=e=>(e=>{const{r:t,g:n,b:r}=Lj(e),i=.2126*wj.channel.toLinear(t)+.7152*wj.channel.toLinear(n)+.0722*wj.channel.toLinear(r);return wj.lang.round(i)})(e)>=.5,Bj=e=>!$j(e),Fj=(e,t,n)=>{const r=Lj(e),i=r[t],a=wj.channel.clamp[t](i+n);return i!==a&&(r[t]=a),Mj(r)},zj=(e,t)=>Fj(e,"l",t),jj=(e,t)=>Fj(e,"l",-t),Hj=(e,t)=>{const n=Lj(e),r={};for(const e in t)t[e]&&(r[e]=n[e]+t[e]);return Rj(e,r)},Uj=(e,t=100)=>{const n=Lj(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,((e,t,n=50)=>{const{r:r,g:i,b:a,a:o}=Lj(e),{r:s,g:l,b:c,a:u}=Lj(t),h=n/100,d=2*h-1,p=o-u,f=((d*p===-1?d:(d+p)/(1+d*p))+1)/2,g=1-f;return Dj(r*f+s*g,i*f+l*g,a*f+c*g,o*h+u*(1-h))})(n,e,t)},{entries:Gj,setPrototypeOf:qj,isFrozen:Wj,getPrototypeOf:Vj,getOwnPropertyDescriptor:Yj}=Object;let{freeze:Xj,seal:Kj,create:Qj}=Object,{apply:Zj,construct:Jj}="undefined"!=typeof Reflect&&Reflect;Xj||(Xj=function(e){return e}),Kj||(Kj=function(e){return e}),Zj||(Zj=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:aH;qj&&qj(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(Wj(t)||(t[r]=e),i=e)}e[i]=!0}return e}function yH(e){for(let t=0;t/gm),MH=Kj(/\$\{[\w\W]*/gm),RH=Kj(/^data-[\-\w.\u00B7-\uFFFF]+$/),DH=Kj(/^aria-[\-\w]+$/),PH=Kj(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$H=Kj(/^(?:\w+script|data):/i),BH=Kj(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FH=Kj(/^html$/i),zH=Kj(/^[a-z][.\w]*(-[.\w]+)+$/i);var jH=Object.freeze({__proto__:null,ARIA_ATTR:DH,ATTR_WHITESPACE:BH,CUSTOM_ELEMENT:zH,DATA_ATTR:RH,DOCTYPE_NAME:FH,ERB_EXPR:LH,IS_ALLOWED_URI:PH,IS_SCRIPT_OR_DATA:$H,MUSTACHE_EXPR:OH,TMPLIT_EXPR:MH});const HH=1,UH=3,GH=7,qH=8,WH=9,VH=function(){return"undefined"==typeof window?null:window};var YH,XH=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:VH();const n=t=>e(t);if(n.version="3.2.7",n.removed=[],!t||!t.document||t.document.nodeType!==WH||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,a=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=t,g=c.prototype,m=bH(g,"cloneNode"),y=bH(g,"remove"),v=bH(g,"nextSibling"),b=bH(g,"childNodes"),x=bH(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,E="";const{implementation:k,createNodeIterator:T,createDocumentFragment:_,getElementsByTagName:C}=r,{importNode:S}=i;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Gj&&"function"==typeof x&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:N,ERB_EXPR:I,TMPLIT_EXPR:O,DATA_ATTR:L,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:P}=jH;let{IS_ALLOWED_URI:$}=jH,B=null;const F=mH({},[...xH,...wH,...EH,...TH,...CH]);let z=null;const j=mH({},[...SH,...AH,...NH,...IH]);let H=Object.seal(Qj(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,G=null,q=!0,W=!0,V=!1,Y=!0,X=!1,K=!0,Q=!1,Z=!1,J=!1,ee=!1,te=!1,ne=!1,re=!0,ie=!1,ae=!0,oe=!1,se={},le=null;const ce=mH({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const he=mH({},["audio","video","img","source","image","track"]);let de=null;const pe=mH({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let ye=me,ve=!1,be=null;const xe=mH({},[fe,ge,me],oH);let we=mH({},["mi","mo","mn","ms","mtext"]),Ee=mH({},["annotation-xml"]);const ke=mH({},["title","style","font","a","script"]);let Te=null;const _e=["application/xhtml+xml","text/html"];let Ce=null,Se=null;const Ae=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Ie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=vH(e),Te=-1===_e.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===Te?oH:aH,B=hH(e,"ALLOWED_TAGS")?mH({},e.ALLOWED_TAGS,Ce):F,z=hH(e,"ALLOWED_ATTR")?mH({},e.ALLOWED_ATTR,Ce):j,be=hH(e,"ALLOWED_NAMESPACES")?mH({},e.ALLOWED_NAMESPACES,oH):xe,de=hH(e,"ADD_URI_SAFE_ATTR")?mH(vH(pe),e.ADD_URI_SAFE_ATTR,Ce):pe,ue=hH(e,"ADD_DATA_URI_TAGS")?mH(vH(he),e.ADD_DATA_URI_TAGS,Ce):he,le=hH(e,"FORBID_CONTENTS")?mH({},e.FORBID_CONTENTS,Ce):ce,U=hH(e,"FORBID_TAGS")?mH({},e.FORBID_TAGS,Ce):vH({}),G=hH(e,"FORBID_ATTR")?mH({},e.FORBID_ATTR,Ce):vH({}),se=!!hH(e,"USE_PROFILES")&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,$=e.ALLOWED_URI_REGEXP||PH,ye=e.NAMESPACE||me,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,Ee=e.HTML_INTEGRATION_POINTS||Ee,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),te&&(ee=!0),se&&(B=mH({},CH),z=[],!0===se.html&&(mH(B,xH),mH(z,SH)),!0===se.svg&&(mH(B,wH),mH(z,AH),mH(z,IH)),!0===se.svgFilters&&(mH(B,EH),mH(z,AH),mH(z,IH)),!0===se.mathMl&&(mH(B,TH),mH(z,NH),mH(z,IH))),e.ADD_TAGS&&(B===F&&(B=vH(B)),mH(B,e.ADD_TAGS,Ce)),e.ADD_ATTR&&(z===j&&(z=vH(z)),mH(z,e.ADD_ATTR,Ce)),e.ADD_URI_SAFE_ATTR&&mH(de,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(le===ce&&(le=vH(le)),mH(le,e.FORBID_CONTENTS,Ce)),ae&&(B["#text"]=!0),Q&&mH(B,["html","head","body"]),B.table&&(mH(B,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw pH('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw pH('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,E=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(f,a)),null!==w&&"string"==typeof E&&(E=w.createHTML(""));Xj&&Xj(e),Se=e}},Oe=mH({},[...wH,...EH,...kH]),Le=mH({},[...TH,..._H]),Me=function(e){rH(n.removed,{element:e});try{x(e).removeChild(e)}catch(t){y(e)}},Re=function(e,t){try{rH(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){rH(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Me(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,n=null;if(J)e=""+e;else{const t=sH(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Te&&ye===me&&(e=''+e+"");const i=w?w.createHTML(e):e;if(ye===me)try{t=(new p).parseFromString(i,Te)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ye,"template",null);try{t.documentElement.innerHTML=ve?E:i}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),ye===me?C.call(t,Q?"html":"body")[0]:Q?t.documentElement:a},Pe=function(e){return T.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},$e=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){eH(e,e=>{e.call(n,t,r,Se)})}const ze=function(e){let t=null;if(Fe(A.beforeSanitizeElements,e,null),$e(e))return Me(e),!0;const r=Ce(e.nodeName);if(Fe(A.uponSanitizeElement,e,{tagName:r,allowedTags:B}),K&&e.hasChildNodes()&&!Be(e.firstElementChild)&&dH(/<[/\w!]/g,e.innerHTML)&&dH(/<[/\w!]/g,e.textContent))return Me(e),!0;if(e.nodeType===GH)return Me(e),!0;if(K&&e.nodeType===qH&&dH(/<[/\w]/g,e.data))return Me(e),!0;if(!B[r]||U[r]){if(!U[r]&&He(r)){if(H.tagNameCheck instanceof RegExp&&dH(H.tagNameCheck,r))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(r))return!1}if(ae&&!le[r]){const t=x(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=m(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,v(e))}}}return Me(e),!0}return e instanceof c&&!function(e){let t=x(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=aH(e.tagName),r=aH(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||we[r]):Boolean(Oe[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&Ee[r]:Boolean(Le[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!Ee[r])&&!(t.namespaceURI===fe&&!we[r])&&!Le[n]&&(ke[n]||!Oe[n]):!("application/xhtml+xml"!==Te||!be[e.namespaceURI]))}(e)?(Me(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!dH(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&e.nodeType===UH&&(t=e.textContent,eH([N,I,O],e=>{t=lH(t,e," ")}),e.textContent!==t&&(rH(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(A.afterSanitizeElements,e,null),!1):(Me(e),!0)},je=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Ae))return!1;if(W&&!G[t]&&dH(L,t));else if(q&&dH(M,t));else if(!z[t]||G[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&dH(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&dH(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t,e))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&dH(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(de[t]);else if(dH($,lH(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==cH(n,"data:")||!ue[e]){if(V&&!dH(R,lH(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&sH(e,P)},Ue=function(e){Fe(A.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||$e(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=t.length;for(;i--;){const a=t[i],{name:o,namespaceURI:s,value:l}=a,c=Ce(o),u=l;let h="value"===o?u:uH(u);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,Fe(A.uponSanitizeAttribute,e,r),h=r.attrValue,!ie||"id"!==c&&"name"!==c||(Re(o,e),h="user-content-"+h),K&&dH(/((--!?|])>)|<\/(style|title|textarea)/i,h)){Re(o,e);continue}if("attributename"===c&&sH(h,"href")){Re(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Re(o,e);continue}if(!Y&&dH(/\/>/i,h)){Re(o,e);continue}X&&eH([N,I,O],e=>{h=lH(h,e," ")});const d=Ce(e.nodeName);if(je(d,c,h)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(d,c)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}if(h!==u)try{s?e.setAttributeNS(s,o,h):e.setAttribute(o,h),$e(e)?Me(e):nH(n.removed)}catch(t){Re(o,e)}}else Re(o,e)}Fe(A.afterSanitizeAttributes,e,null)},Ge=function e(t){let n=null;const r=Pe(t);for(Fe(A.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Fe(A.uponSanitizeShadowNode,n,null),ze(n),Ue(n),n.content instanceof o&&e(n.content);Fe(A.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,s=null,c=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw pH("toString is not a function");if("string"!=typeof(e=e.toString()))throw pH("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Ie(t),n.removed=[],"string"==typeof e&&(oe=!1),oe){if(e.nodeName){const t=Ce(e.nodeName);if(!B[t]||U[t])throw pH("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=De("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),a.nodeType===HH&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a);else{if(!ee&&!X&&!Q&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(r=De(e),!r)return ee?null:ne?E:""}r&&J&&Me(r.firstChild);const u=Pe(oe?e:r);for(;s=u.nextNode();)ze(s),Ue(s),s.content instanceof o&&Ge(s.content);if(oe)return e;if(ee){if(te)for(c=_.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(z.shadowroot||z.shadowrootmode)&&(c=S.call(i,c,!0)),c}let h=Q?r.outerHTML:r.innerHTML;return Q&&B["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&dH(FH,r.ownerDocument.doctype.name)&&(h="\n"+h),X&&eH([N,I,O],e=>{h=lH(h,e," ")}),w&&ne?w.createHTML(h):h},n.setConfig=function(){Ie(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Se=null,Z=!1},n.isValidAttribute=function(e,t,n){Se||Ie({});const r=Ce(e),i=Ce(t);return je(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&rH(A[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=tH(A[e],t);return-1===n?void 0:iH(A[e],n,1)[0]}return nH(A[e])},n.removeHooks=function(e){A[e]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),KH=Object.defineProperty,QH=(e,t)=>KH(e,"name",{value:t,configurable:!0}),ZH=(e,t)=>{for(var n in t)KH(e,n,{get:t[n],enumerable:!0})},JH={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},eU={trace:QH((...e)=>{},"trace"),debug:QH((...e)=>{},"debug"),info:QH((...e)=>{},"info"),warn:QH((...e)=>{},"warn"),error:QH((...e)=>{},"error"),fatal:QH((...e)=>{},"fatal")},tU=QH(function(e="fatal"){let t=JH.fatal;"string"==typeof e?e.toLowerCase()in JH&&(t=JH[e]):"number"==typeof e&&(t=e),eU.trace=()=>{},eU.debug=()=>{},eU.info=()=>{},eU.warn=()=>{},eU.error=()=>{},eU.fatal=()=>{},t<=JH.fatal&&(eU.fatal=console.error?console.error.bind(console,nU("FATAL"),"color: orange"):console.log.bind(console,"",nU("FATAL"))),t<=JH.error&&(eU.error=console.error?console.error.bind(console,nU("ERROR"),"color: orange"):console.log.bind(console,"",nU("ERROR"))),t<=JH.warn&&(eU.warn=console.warn?console.warn.bind(console,nU("WARN"),"color: orange"):console.log.bind(console,"",nU("WARN"))),t<=JH.info&&(eU.info=console.info?console.info.bind(console,nU("INFO"),"color: lightblue"):console.log.bind(console,"",nU("INFO"))),t<=JH.debug&&(eU.debug=console.debug?console.debug.bind(console,nU("DEBUG"),"color: lightgreen"):console.log.bind(console,"",nU("DEBUG"))),t<=JH.trace&&(eU.trace=console.debug?console.debug.bind(console,nU("TRACE"),"color: lightgreen"):console.log.bind(console,"",nU("TRACE")))},"setLogLevel"),nU=QH(e=>`%c${Rm().format("ss.SSS")} : ${e} : `,"format"),rU=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,iU=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,aU=/\s*%%.*\n/gm,oU=class extends Error{static{QH(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},sU={},lU=QH(function(e,t){e=e.replace(rU,"").replace(iU,"").replace(aU,"\n");for(const[n,{detector:r}]of Object.entries(sU)){if(r(e,t))return n}throw new oU(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),cU=QH((...e)=>{for(const{id:t,detector:n,loader:r}of e)uU(t,n,r)},"registerLazyLoadedDiagrams"),uU=QH((e,t,n)=>{sU[e]&&eU.warn(`Detector with key ${e} already exists. Overwriting.`),sU[e]={detector:t,loader:n},eU.debug(`Detector with key ${e} added${n?" with loader":""}`)},"addDetector"),hU=QH(e=>sU[e].loader,"getDiagramLoader"),dU=QH((e,t,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(t=>dU(e,t,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(t=>{e.includes(t)||e.push(t)}),e):void 0===e||n<=0?null!=e&&"object"==typeof e&&"object"==typeof t?Object.assign(e,t):t:(void 0!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(i=>{"object"!=typeof t[i]||void 0!==e[i]&&"object"!=typeof e[i]?(r||"object"!=typeof e[i]&&"object"!=typeof t[i])&&(e[i]=t[i]):(void 0===e[i]&&(e[i]=Array.isArray(t[i])?[]:{}),e[i]=dU(e[i],t[i],{depth:n-1,clobber:r}))}),e)},"assignWithDepth"),pU=dU,fU="#ffffff",gU="#f2f2f2",mU=QH((e,t)=>Hj(e,t?{s:-40,l:10}:{s:-40,l:-10}),"mkBorder"),yU=class{static{QH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Hj(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Hj(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mU(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mU(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mU(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Uj(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Uj(this.tertiaryColor),this.lineColor=this.lineColor||Uj(this.background),this.arrowheadColor=this.arrowheadColor||Uj(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?jj(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||jj(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Uj(this.lineColor),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||zj(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||jj(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||jj(this.mainBkg,10)):(this.rowOdd=this.rowOdd||zj(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||zj(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Hj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Hj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Hj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Hj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Hj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Hj(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Hj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Hj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Hj(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},vU=QH(e=>{const t=new yU;return t.calculate(e),t},"getThemeVariables"),bU=class{static{QH(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=zj(this.primaryColor,16),this.tertiaryColor=Hj(this.primaryColor,{h:-160}),this.primaryBorderColor=Uj(this.background),this.secondaryBorderColor=mU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mU(this.tertiaryColor,this.darkMode),this.primaryTextColor=Uj(this.primaryColor),this.secondaryTextColor=Uj(this.secondaryColor),this.tertiaryTextColor=Uj(this.tertiaryColor),this.lineColor=Uj(this.background),this.textColor=Uj(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=zj(Uj("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Dj(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=jj("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=jj(this.sectionBkgColor,10),this.taskBorderColor=Dj(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Dj(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||zj(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||jj(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=zj(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=zj(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=zj(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Hj(this.primaryColor,{h:64}),this.fillType3=Hj(this.secondaryColor,{h:64}),this.fillType4=Hj(this.primaryColor,{h:-64}),this.fillType5=Hj(this.secondaryColor,{h:-64}),this.fillType6=Hj(this.primaryColor,{h:128}),this.fillType7=Hj(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Hj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Hj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Hj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Hj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Hj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Hj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Hj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Hj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Hj(this.primaryColor,{h:330});for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},xU=QH(e=>{const t=new bU;return t.calculate(e),t},"getThemeVariables"),wU=class{static{QH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Hj(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Hj(this.primaryColor,{h:-160}),this.primaryBorderColor=mU(this.primaryColor,this.darkMode),this.secondaryBorderColor=mU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mU(this.tertiaryColor,this.darkMode),this.primaryTextColor=Uj(this.primaryColor),this.secondaryTextColor=Uj(this.secondaryColor),this.tertiaryTextColor=Uj(this.tertiaryColor),this.lineColor=Uj(this.background),this.textColor=Uj(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Dj(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Hj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Hj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Hj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Hj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Hj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Hj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Hj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Hj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Hj(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||jj(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||jj(this.tertiaryColor,40);for(let e=0;e{"calculated"===this[e]&&(this[e]=void 0)}),"object"!=typeof e)return void this.updateColors();const t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},EU=QH(e=>{const t=new wU;return t.calculate(e),t},"getThemeVariables"),kU=class{static{QH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=zj("#cde498",10),this.primaryBorderColor=mU(this.primaryColor,this.darkMode),this.secondaryBorderColor=mU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mU(this.tertiaryColor,this.darkMode),this.primaryTextColor=Uj(this.primaryColor),this.secondaryTextColor=Uj(this.secondaryColor),this.tertiaryTextColor=Uj(this.primaryColor),this.lineColor=Uj(this.background),this.textColor=Uj(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=jj(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Hj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Hj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Hj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Hj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Hj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Hj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Hj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Hj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Hj(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||jj(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||jj(this.tertiaryColor,40);for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},TU=QH(e=>{const t=new kU;return t.calculate(e),t},"getThemeVariables"),_U=class{static{QH(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=zj(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Hj(this.primaryColor,{h:-160}),this.primaryBorderColor=mU(this.primaryColor,this.darkMode),this.secondaryBorderColor=mU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mU(this.tertiaryColor,this.darkMode),this.primaryTextColor=Uj(this.primaryColor),this.secondaryTextColor=Uj(this.secondaryColor),this.tertiaryTextColor=Uj(this.tertiaryColor),this.lineColor=Uj(this.background),this.textColor=Uj(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||zj(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=zj(this.contrast,55),this.border2=this.contrast,this.actorBorder=zj(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},CU={base:{getThemeVariables:vU},dark:{getThemeVariables:xU},default:{getThemeVariables:EU},forest:{getThemeVariables:TU},neutral:{getThemeVariables:QH(e=>{const t=new _U;return t.calculate(e),t},"getThemeVariables")}},SU={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},AU={...SU,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:CU.default.getThemeVariables(),sequence:{...SU.sequence,messageFont:QH(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:QH(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:QH(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...SU.gantt,tickInterval:void 0,useWidth:void 0},c4:{...SU.c4,useWidth:void 0,personFont:QH(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:QH(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:QH(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:QH(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:QH(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:QH(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:QH(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:QH(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:QH(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:QH(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:QH(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:QH(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:QH(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:QH(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:QH(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:QH(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:QH(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:QH(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:QH(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:QH(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:QH(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:QH(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...SU.pie,useWidth:984},xyChart:{...SU.xyChart,useWidth:void 0},requirement:{...SU.requirement,useWidth:void 0},packet:{...SU.packet},radar:{...SU.radar}},NU=QH((e,t="")=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:"object"==typeof e[r]&&null!==e[r]?[...n,t+r,...NU(e[r],"")]:[...n,t+r],[]),"keyify"),IU=new Set(NU(AU,"")),OU=AU,LU=QH(e=>{if(eU.debug("sanitizeDirective called with",e),"object"==typeof e&&null!=e)if(Array.isArray(e))e.forEach(e=>LU(e));else{for(const t of Object.keys(e)){if(eU.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!IU.has(t)||null==e[t]){eU.debug("sanitize deleting key: ",t),delete e[t];continue}if("object"==typeof e[t]){eU.debug("sanitizing object",t),LU(e[t]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)t.includes(r)&&(eU.debug("sanitizing css option",t),e[t]=MU(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const n=e.themeVariables[t];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}eU.debug("After sanitization",e)}},"sanitizeDirective"),MU=QH(e=>{let t=0,n=0;for(const r of e){if(t{let n=pU({},e),r={};for(const e of t)qU(e),r=pU(r,e);if(n=pU(n,r),r.theme&&r.theme in CU){const e=pU({},YH),t=pU(e.themeVariables||{},r.themeVariables);n.theme&&n.theme in CU&&(n.themeVariables=CU[n.theme].getThemeVariables(t))}return QU($U=n),$U},"updateCurrentConfig"),FU=QH(e=>(DU=pU({},RU),DU=pU(DU,e),e.theme&&CU[e.theme]&&(DU.themeVariables=CU[e.theme].getThemeVariables(e.themeVariables)),BU(DU,PU),DU),"setSiteConfig"),zU=QH(e=>{YH=pU({},e)},"saveConfigFromInitialize"),jU=QH(e=>(DU=pU(DU,e),BU(DU,PU),DU),"updateSiteConfig"),HU=QH(()=>pU({},DU),"getSiteConfig"),UU=QH(e=>(QU(e),pU($U,e),GU()),"setConfig"),GU=QH(()=>pU({},$U),"getConfig"),qU=QH(e=>{e&&(["secure",...DU.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(eU.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{"string"==typeof e[t]&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],"object"==typeof e[t]&&qU(e[t])}))},"sanitize"),WU=QH(e=>{LU(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),PU.push(e),BU(DU,PU)},"addDirective"),VU=QH((e=DU)=>{BU(e,PU=[])},"reset"),YU={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},XU={},KU=QH(e=>{XU[e]||(eU.warn(YU[e]),XU[e]=!0)},"issueWarning"),QU=QH(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&KU("LAZY_LOAD_DEPRECATED")},"checkConfig"),ZU=//gi,JU=QH(e=>{if(!e)return[""];return cG(e).replace(/\\n/g,"#br#").split("#br#")},"getRows"),eG=(()=>{let e=!1;return()=>{e||(tG(),e=!0)}})();function tG(){const e="data-temp-href-target";XH.addHook("beforeSanitizeAttributes",t=>{t instanceof Element&&"A"===t.tagName&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),XH.addHook("afterSanitizeAttributes",t=>{t instanceof Element&&"A"===t.tagName&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),"_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener"))})}QH(tG,"setupDompurifyHooks");var nG=QH(e=>{eG();return XH.sanitize(e)},"removeScript"),rG=QH((e,t)=>{if(!1!==t.flowchart?.htmlLabels){const n=t.securityLevel;"antiscript"===n||"strict"===n?e=nG(e):"loose"!==n&&(e=(e=(e=cG(e)).replace(//g,">")).replace(/=/g,"="),e=lG(e))}return e},"sanitizeMore"),iG=QH((e,t)=>e?e=t.dompurifyConfig?XH.sanitize(rG(e,t),t.dompurifyConfig).toString():XH.sanitize(rG(e,t),{FORBID_TAGS:["style"]}).toString():e,"sanitizeText"),aG=QH((e,t)=>"string"==typeof e?iG(e,t):e.flat().map(e=>iG(e,t)),"sanitizeTextOrArray"),oG=QH(e=>ZU.test(e),"hasBreaks"),sG=QH(e=>e.split(ZU),"splitBreaks"),lG=QH(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),cG=QH(e=>e.replace(ZU,"#br#"),"breakToPlaceholder"),uG=QH(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=t.replaceAll(/\(/g,"\\("),t=t.replaceAll(/\)/g,"\\)")),t},"getUrl"),hG=QH(e=>!1!==e&&!["false","null","0"].includes(String(e).trim().toLowerCase()),"evaluate"),dG=QH(function(...e){const t=e.filter(e=>!isNaN(e));return Math.max(...t)},"getMax"),pG=QH(function(...e){const t=e.filter(e=>!isNaN(e));return Math.min(...t)},"getMin"),fG=QH(function(e){const t=e.split(/(,)/),n=[];for(let e=0;e0&&e+1Math.max(0,e.split(t).length-1),"countOccurrence"),mG=QH((e,t)=>{const n=gG(e,"~"),r=gG(t,"~");return 1===n&&1===r},"shouldCombineSets"),yG=QH(e=>{const t=gG(e,"~");let n=!1;if(t<=1)return e;t%2!=0&&e.startsWith("~")&&(e=e.substring(1),n=!0);const r=[...e];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")},"processSet"),vG=QH(()=>void 0!==window.MathMLElement,"isMathMLSupported"),bG=/\$\$(.*)\$\$/g,xG=QH(e=>(e.match(bG)?.length??0)>0,"hasKatex"),wG=QH(async(e,t)=>{e=await EG(e,t);const n=document.createElement("div");n.innerHTML=e,n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";const r=document.querySelector("body");r?.insertAdjacentElement("beforeend",n);const i={width:n.clientWidth,height:n.clientHeight};return n.remove(),i},"calculateMathMLDimensions"),EG=QH(async(e,t)=>{if(!xG(e))return e;if(!(vG()||t.legacyMathML||t.forceLegacyMathML))return e.replace(bG,"MathML is unsupported in this environment.");const{default:n}=await Promise.resolve().then(function(){return OL}),r=t.forceLegacyMathML||!vG()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(ZU).map(e=>xG(e)?`
${e}
`:`
${e}
`).join("").replace(bG,(e,t)=>n.renderToString(t,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(//g,""))},"renderKatex"),kG={getRows:JU,sanitizeText:iG,sanitizeTextOrArray:aG,hasBreaks:oG,splitBreaks:sG,lineBreakRegex:ZU,removeScript:nG,getUrl:uG,evaluate:hG,getMax:dG,getMin:pG},TG=QH(function(e,t){for(let n of t)e.attr(n[0],n[1])},"d3Attrs"),_G=QH(function(e,t,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},"calculateSvgSizeAttrs"),CG=QH(function(e,t,n,r){const i=_G(t,n,r);TG(e,i)},"configureSvgSize"),SG=QH(function(e,t,n,r){const i=t.node().getBBox(),a=i.width,o=i.height;eU.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;eU.info(`Graph bounds: ${s}x${l}`,e),s=a+2*n,l=o+2*n,eU.info(`Calculated bounds: ${s}x${l}`),CG(t,l,s,r);const c=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr("viewBox",c)},"setupGraphViewbox"),AG={},NG=QH((e,t,n)=>{let r="";return e in AG&&AG[e]?r=AG[e](n):eU.warn(`No theme found for ${e}`),` & {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n fill: ${n.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\n }\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${n.errorBkgColor};\n }\n & .error-text {\n fill: ${n.errorTextColor};\n stroke: ${n.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${n.lineColor};\n stroke: ${n.lineColor};\n }\n & .marker.cross {\n stroke: ${n.lineColor};\n }\n\n & svg {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${r}\n\n ${t}\n`},"getStyles"),IG=QH((e,t)=>{void 0!==t&&(AG[e]=t)},"addStylesForDiagram"),OG=NG,LG={};ZH(LG,{clear:()=>$G,getAccDescription:()=>jG,getAccTitle:()=>FG,getDiagramTitle:()=>UG,setAccDescription:()=>zG,setAccTitle:()=>BG,setDiagramTitle:()=>HG});var MG="",RG="",DG="",PG=QH(e=>iG(e,GU()),"sanitizeText"),$G=QH(()=>{MG="",DG="",RG=""},"clear"),BG=QH(e=>{MG=PG(e).replace(/^\s+/g,"")},"setAccTitle"),FG=QH(()=>MG,"getAccTitle"),zG=QH(e=>{DG=PG(e).replace(/\n\s+/g,"\n")},"setAccDescription"),jG=QH(()=>DG,"getAccDescription"),HG=QH(e=>{RG=PG(e)},"setDiagramTitle"),UG=QH(()=>RG,"getDiagramTitle"),GG=eU,qG=tU,WG=GU,VG=UU,YG=RU,XG=QH(e=>iG(e,WG()),"sanitizeText"),KG=SG,QG=QH(()=>LG,"getCommonDb"),ZG={},JG=QH((e,t,n)=>{ZG[e]&&GG.warn(`Diagram with id ${e} already registered. Overwriting.`),ZG[e]=t,n&&uU(e,n),IG(e,t.styles),t.injectUtils?.(GG,qG,WG,XG,KG,QG(),()=>{})},"registerDiagram"),eq=QH(e=>{if(e in ZG)return ZG[e];throw new tq(e)},"getDiagram"),tq=class extends Error{static{QH(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}};function nq(e){return null==e}function rq(e){return"object"==typeof e&&null!==e}function iq(e){return Array.isArray(e)?e:nq(e)?[]:[e]}function aq(e,t){var n,r,i,a;if(t)for(n=0,r=(a=Object.keys(t)).length;ns&&(t=r-s+(a=" ... ").length),n-r>s&&(n=r+s-(o=" ...").length),{str:a+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+a.length}}function pq(e,t){return lq.repeat(" ",t-e.length)+e}function fq(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],a=[],o=-1;n=r.exec(e.buffer);)a.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s,l,c="",u=Math.min(e.line+t.linesAfter,a.length).toString().length,h=t.maxLength-(t.indent+u+3);for(s=1;s<=t.linesBefore&&!(o-s<0);s++)l=dq(e.buffer,i[o-s],a[o-s],e.position-(i[o]-i[o-s]),h),c=lq.repeat(" ",t.indent)+pq((e.line-s+1).toString(),u)+" | "+l.str+"\n"+c;for(l=dq(e.buffer,i[o],a[o],e.position,h),c+=lq.repeat(" ",t.indent)+pq((e.line+1).toString(),u)+" | "+l.str+"\n",c+=lq.repeat("-",t.indent+u+3+l.pos)+"^\n",s=1;s<=t.linesAfter&&!(o+s>=a.length);s++)l=dq(e.buffer,i[o+s],a[o+s],e.position-(i[o]-i[o+s]),h),c+=lq.repeat(" ",t.indent)+pq((e.line+s+1).toString(),u)+" | "+l.str+"\n";return c.replace(/\n$/,"")}QH(dq,"getLine"),QH(pq,"padStart"),QH(fq,"makeSnippet");var gq=fq,mq=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],yq=["scalar","sequence","mapping"];function vq(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function bq(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===mq.indexOf(t))throw new hq('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=vq(t.styleAliases||null),-1===yq.indexOf(this.kind))throw new hq('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}QH(vq,"compileStyleAliases"),QH(bq,"Type$1");var xq=bq;function wq(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function Eq(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(QH(r,"collectType"),e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:QH(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:QH(function(e){return e.toString(10)},"decimal"),hexadecimal:QH(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Gq=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qq(e){return null!==e&&!(!Gq.test(e)||"_"===e[e.length-1])}function Wq(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)}QH(qq,"resolveYamlFloat"),QH(Wq,"constructYamlFloat");var Vq=/^[-+]?[0-9]+e/;function Yq(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(lq.isNegativeZero(e))return"-0.0";return n=e.toString(10),Vq.test(n)?n.replace("e",".e"):n}function Xq(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||lq.isNegativeZero(e))}QH(Yq,"representYamlFloat"),QH(Xq,"isFloat");var Kq=new xq("tag:yaml.org,2002:float",{kind:"scalar",resolve:qq,construct:Wq,predicate:Xq,represent:Yq,defaultStyle:"lowercase"}),Qq=Aq.extend({implicit:[Lq,Pq,Uq,Kq]}),Zq=Qq,Jq=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),eW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function tW(e){return null!==e&&(null!==Jq.exec(e)||null!==eW.exec(e))}function nW(e){var t,n,r,i,a,o,s,l,c=0,u=null;if(null===(t=Jq.exec(e))&&(t=eW.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,r,i,a,o,s,c)),u&&l.setTime(l.getTime()-u),l}function rW(e){return e.toISOString()}QH(tW,"resolveYamlTimestamp"),QH(nW,"constructYamlTimestamp"),QH(rW,"representYamlTimestamp");var iW=new xq("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:tW,construct:nW,instanceOf:Date,represent:rW});function aW(e){return"<<"===e||null===e}QH(aW,"resolveYamlMerge");var oW=new xq("tag:yaml.org,2002:merge",{kind:"scalar",resolve:aW}),sW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function lW(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=sW;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0}function cW(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=sW,o=0,s=[];for(t=0;t>16&255),s.push(o>>8&255),s.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)):18===n?(s.push(o>>10&255),s.push(o>>2&255)):12===n&&s.push(o>>4&255),new Uint8Array(s)}function uW(e){var t,n,r="",i=0,a=e.length,o=sW;for(t=0;t>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return 0===(n=a%3)?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}function hW(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}QH(lW,"resolveYamlBinary"),QH(cW,"constructYamlBinary"),QH(uW,"representYamlBinary"),QH(hW,"isBinary");var dW=new xq("tag:yaml.org,2002:binary",{kind:"scalar",resolve:lW,construct:cW,predicate:hW,represent:uW}),pW=Object.prototype.hasOwnProperty,fW=Object.prototype.toString;function gW(e){if(null===e)return!0;var t,n,r,i,a,o=[],s=e;for(t=0,n=s.length;t>10),56320+(e-65536&1023))}QH(MW,"_class"),QH(RW,"is_EOL"),QH(DW,"is_WHITE_SPACE"),QH(PW,"is_WS_OR_EOL"),QH($W,"is_FLOW_INDICATOR"),QH(BW,"fromHexCode"),QH(FW,"escapedHexLen"),QH(zW,"fromDecimalCode"),QH(jW,"simpleEscapeSequence"),QH(HW,"charFromCodepoint");var UW,GW=new Array(256),qW=new Array(256);for(UW=0;UW<256;UW++)GW[UW]=jW(UW)?1:0,qW[UW]=jW(UW);function WW(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||CW,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function VW(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=gq(n),new hq(t,n)}function YW(e,t){throw VW(e,t)}function XW(e,t){e.onWarning&&e.onWarning.call(null,VW(e,t))}QH(WW,"State$1"),QH(VW,"generateError"),QH(YW,"throwError"),QH(XW,"throwWarning");var KW={YAML:QH(function(e,t,n){var r,i,a;null!==e.version&&YW(e,"duplication of %YAML directive"),1!==n.length&&YW(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&YW(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&YW(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,1!==a&&2!==a&&XW(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:QH(function(e,t,n){var r,i;2!==n.length&&YW(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],OW.test(r)||YW(e,"ill-formed tag handle (first argument) of the TAG directive"),SW.call(e.tagMap,r)&&YW(e,'there is a previously declared suffix for "'+r+'" tag handle'),LW.test(i)||YW(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){YW(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i},"handleTagDirective")};function QW(e,t,n,r){var i,a,o,s;if(t1&&(e.result+=lq.repeat("\n",t-1))}function iV(e,t,n){var r,i,a,o,s,l,c,u,h=e.kind,d=e.result;if(PW(u=e.input.charCodeAt(e.position))||$W(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(PW(r=e.input.charCodeAt(e.position+1))||n&&$W(r)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,o=!1;0!==u;){if(58===u){if(PW(r=e.input.charCodeAt(e.position+1))||n&&$W(r))break}else if(35===u){if(PW(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&nV(e)||n&&$W(u))break;if(RW(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,tV(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=a,e.line=s,e.lineStart=l,e.lineIndent=c;break}}o&&(QW(e,i,a,!1),rV(e,e.line-s),i=a=e.position,o=!1),DW(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return QW(e,i,a,!1),!!e.result||(e.kind=h,e.result=d,!1)}function aV(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(QW(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else RW(n)?(QW(e,r,i,!0),rV(e,tV(e,!1,t)),r=i=e.position):e.position===e.lineStart&&nV(e)?YW(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);YW(e,"unexpected end of the stream within a single quoted scalar")}function oV(e,t){var n,r,i,a,o,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return QW(e,n,e.position,!0),e.position++,!0;if(92===s){if(QW(e,n,e.position,!0),RW(s=e.input.charCodeAt(++e.position)))tV(e,!1,t);else if(s<256&&GW[s])e.result+=qW[s],e.position++;else if((o=FW(s))>0){for(i=o,a=0;i>0;i--)(o=BW(s=e.input.charCodeAt(++e.position)))>=0?a=(a<<4)+o:YW(e,"expected hexadecimal character");e.result+=HW(a),e.position++}else YW(e,"unknown escape sequence");n=r=e.position}else RW(s)?(QW(e,n,r,!0),rV(e,tV(e,!1,t)),n=r=e.position):e.position===e.lineStart&&nV(e)?YW(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}YW(e,"unexpected end of the stream within a double quoted scalar")}function sV(e,t){var n,r,i,a,o,s,l,c,u,h,d,p,f=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(p=e.input.charCodeAt(e.position)))o=93,c=!1,a=[];else{if(123!==p)return!1;o=125,c=!0,a={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),p=e.input.charCodeAt(++e.position);0!==p;){if(tV(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=g,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=a,!0;f?44===p&&YW(e,"expected the node content, but found ','"):YW(e,"missed comma between flow collection entries"),d=null,s=l=!1,63===p&&PW(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,tV(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,fV(e,t,1,!1,!0),h=e.tag,u=e.result,tV(e,!0,t),p=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==p||(s=!0,p=e.input.charCodeAt(++e.position),tV(e,!0,t),fV(e,t,1,!1,!0),d=e.result),c?JW(e,a,y,h,u,d,n,r,i):s?a.push(JW(e,null,y,h,u,d,n,r,i)):a.push(u),tV(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(f=!0,p=e.input.charCodeAt(++e.position)):f=!1}YW(e,"unexpected end of the stream within a flow collection")}function lV(e,t){var n,r,i,a,o=1,s=!1,l=!1,c=t,u=0,h=!1;if(124===(a=e.input.charCodeAt(e.position)))r=!1;else{if(62!==a)return!1;r=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===o?o=43===a?3:2:YW(e,"repeat of a chomping mode identifier");else{if(!((i=zW(a))>=0))break;0===i?YW(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?YW(e,"repeat of an indentation width identifier"):(c=t+i-1,l=!0)}if(DW(a)){do{a=e.input.charCodeAt(++e.position)}while(DW(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!RW(a)&&0!==a)}for(;0!==a;){for(eV(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndentc&&(c=e.lineIndent),RW(a))u++;else{if(e.lineIndentt)&&0!==r)YW(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(o=e.line,s=e.lineStart,l=e.position),fV(e,t,4,!0,i)&&(y?g=e.result:m=e.result),y||(JW(e,d,p,f,g,m,o,s,l),f=g=m=null),tV(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&0!==c)YW(e,"bad indentation of a mapping entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),l=0,c=e.implicitTypes.length;l"),null!==e.result&&h.kind!==e.kind&&YW(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):YW(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function gV(e){var t,n,r,i,a=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(tV(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!PW(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&YW(e,"directive name must not be less than one character in length");0!==i;){for(;DW(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!RW(i));break}if(RW(i))break;for(t=e.position;0!==i&&!PW(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&eV(e),SW.call(KW,n)?KW[n](e,n,r):XW(e,'unknown document directive "'+n+'"')}tV(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,tV(e,!0,-1)):o&&YW(e,"directives end mark is expected"),fV(e,e.lineIndent-1,4,!1,!0),tV(e,!0,-1),e.checkLineBreaks&&NW.test(e.input.slice(a,e.position))&&XW(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nV(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,tV(e,!0,-1)):e.position=55296&&r<=56319&&t+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function BV(e){return/^\n* /.test(e)}QH(SV,"State"),QH(AV,"indentString"),QH(NV,"generateNextLine"),QH(IV,"testImplicitResolving"),QH(OV,"isWhitespace"),QH(LV,"isPrintable"),QH(MV,"isNsCharOrWhitespace"),QH(RV,"isPlainSafe"),QH(DV,"isPlainSafeFirst"),QH(PV,"isPlainSafeLast"),QH($V,"codePointAt"),QH(BV,"needIndentIndicator");function FV(e,t,n,r,i,a,o,s){var l,c=0,u=null,h=!1,d=!1,p=-1!==r,f=-1,g=DV($V(e,0))&&PV($V(e,e.length-1));if(t||o)for(l=0;l=65536?l+=2:l++){if(!LV(c=$V(e,l)))return 5;g=g&&RV(c,u,s),u=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=$V(e,l)))h=!0,p&&(d=d||l-f-1>r&&" "!==e[f+1],f=l);else if(!LV(c))return 5;g=g&&RV(c,u,s),u=c}d=d||p&&l-f-1>r&&" "!==e[f+1]}return h||d?n>9&&BV(e)?5:o?2===a?5:2:d?4:3:!g||o||i(e)?2===a?5:2:1}function zV(e,t,n,r,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==kV.indexOf(t)||TV.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function l(t){return IV(e,t)}switch(QH(l,"testAmbiguity"),FV(t,s,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+jV(t,e.indent)+HV(AV(t,a));case 4:return">"+jV(t,e.indent)+HV(AV(UV(t,o),a));case 5:return'"'+qV(t)+'"';default:throw new hq("impossible error: invalid scalar style")}}()}function jV(e,t){var n=BV(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function HV(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function UV(e,t){for(var n,r,i,a=/(\n+)([^\n]*)/g,o=(n=-1!==(n=e.indexOf("\n"))?n:e.length,a.lastIndex=n,GV(e.slice(0,n),t)),s="\n"===e[0]||" "===e[0];i=a.exec(e);){var l=i[1],c=i[2];r=" "===c[0],o+=l+(s||r||""===c?"":"\n")+GV(c,t),s=r}return o}function GV(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,a=0,o=0,s=0,l="";n=i.exec(e);)(s=n.index)-a>t&&(r=o>a?o:s,l+="\n"+e.slice(a,r),a=r+1),o=s;return l+="\n",e.length-a>t&&o>a?l+=e.slice(a,o)+"\n"+e.slice(o+1):l+=e.slice(a),l.slice(1)}function qV(e){for(var t,n="",r=0,i=0;i=65536?i+=2:i++)r=$V(e,i),!(t=EV[r])&&LV(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||CV(r);return n}function WV(e,t,n){var r,i,a,o="",s=e.tag;for(r=0,i=n.length;r1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),QV(e,t,o,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}function XV(e,t,n,r){var i,a,o,s,l,c,u="",h=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new hq("sortKeys must be a boolean or a function");for(i=0,a=d.length;i1024)&&(e.dump&&10===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,l&&(c+=NV(e,t)),QV(e,t+1,s,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=h,e.dump=u||"{}"}function KV(e,t,n){var r,i,a,o,s,l;for(a=0,o=(i=n?e.explicitTypes:e.implicitTypes).length;a tag resolver accepts not "'+l+'" style');r=s.represent[l](t,l)}e.dump=r}return!0}return!1}function QV(e,t,n,r,i,a,o){e.tag=null,e.dump=n,KV(e,n,!1)||KV(e,n,!0);var s,l=bV.call(e.dump),c=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var u,h,d="[object Object]"===l||"[object Array]"===l;if(d&&(h=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(i=!1),h&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&h&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===l)r&&0!==Object.keys(e.dump).length?(XV(e,t,e.dump,i),h&&(e.dump="&ref_"+u+e.dump)):(YV(e,t,e.dump),h&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===l)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?VV(e,t-1,e.dump,i):VV(e,t,e.dump,i),h&&(e.dump="&ref_"+u+e.dump)):(WV(e,t,e.dump),h&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(e.skipInvalid)return!1;throw new hq("unacceptable kind of an object to dump "+l)}"?"!==e.tag&&zV(e,e.dump,t,a,c)}null!==e.tag&&"?"!==e.tag&&(s=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),s="!"===e.tag[0]?"!"+s:"tag:yaml.org,2002:"===s.slice(0,18)?"!!"+s.slice(18):"!<"+s+">",e.dump=s+" "+e.dump)}return!0}function ZV(e,t){var n,r,i=[],a=[];for(JV(e,i,a),n=0,r=a.length;nArray.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),aY=QH(e=>({x:QH(function(t,n,r){let i=0;const a=iY(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(nY,e.arrowTypeEnd)){const{angle:t,deltaX:n}=rY(r[r.length-1],r[r.length-2]);i=nY[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}const o=Math.abs(iY(t).x-iY(r[r.length-1]).x),s=Math.abs(iY(t).y-iY(r[r.length-1]).y),l=Math.abs(iY(t).x-iY(r[0]).x),c=Math.abs(iY(t).y-iY(r[0]).y),u=nY[e.arrowTypeStart],h=nY[e.arrowTypeEnd];if(o0&&s0&&c=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(nY,e.arrowTypeEnd)){const{angle:t,deltaY:n}=rY(r[r.length-1],r[r.length-2]);i=nY[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}const o=Math.abs(iY(t).y-iY(r[r.length-1]).y),s=Math.abs(iY(t).x-iY(r[r.length-1]).x),l=Math.abs(iY(t).y-iY(r[0]).y),c=Math.abs(iY(t).x-iY(r[0]).x),u=nY[e.arrowTypeStart],h=nY[e.arrowTypeEnd];if(o0&&s0&&c{const t=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:t+n}},"getSubGraphTitleMargins");const sY=Object.freeze({left:0,top:0,width:16,height:16}),lY=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),cY=Object.freeze({...sY,...lY}),uY=Object.freeze({...cY,body:"",hidden:!1}),hY=Object.freeze({width:null,height:null}),dY=Object.freeze({...hY,...lY}),pY=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name);function fY(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}(e,t);for(const r in uY)r in lY?r in e&&!(r in n)&&(n[r]=lY[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function gY(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let a={};function o(e){a=fY(r[e]||i[e],a)}return o(t),n.forEach(o),fY(e,a)}function mY(e,t){if(e.icons[t])return gY(e,t,[]);const n=function(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);return(t||Object.keys(n).concat(Object.keys(r))).forEach(function e(t){if(n[t])return i[t]=[];if(!(t in i)){i[t]=null;const n=r[t]&&r[t].parent,a=n&&e(n);a&&(i[t]=[n].concat(a))}return i[t]}),i}(e,[t])[t];return n?gY(e,t,n):null}const yY=/(-?[0-9.]*[0-9]+[0-9.]*)/g,vY=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function bY(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const r=e.split(yY);if(null===r||!r.length)return e;const i=[];let a=r.shift(),o=vY.test(a);for(;;){if(o){const e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),void 0===a)return i.join("");o=!o}}const xY=/\sid="(\S+)"/g,wY="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let EY=0;var kY={body:'?',height:80,width:80},TY=new Map,_Y=new Map,CY=QH(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(eU.debug("Registering icon pack:",t.name),"loader"in t)_Y.set(t.name,t.loader);else{if(!("icons"in t))throw eU.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');TY.set(t.name,t.icons)}}},"registerIconPacks"),SY=QH(async(e,t)=>{const n=((e,t,n,r="")=>{const i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const e=i.pop(),t=i.pop(),n={provider:i.length>0?i[0]:r,prefix:t,name:e};return pY(n)?n:null}const a=i[0],o=a.split("-");if(o.length>1){const e={provider:r,prefix:o.shift(),name:o.join("-")};return pY(e)?e:null}if(n&&""===r){const e={provider:r,prefix:"",name:a};return pY(e,n)?e:null}return null})(e,0,void 0!==t);if(!n)throw new Error(`Invalid icon name: ${e}`);const r=n.prefix||t;if(!r)throw new Error(`Icon name must contain a prefix: ${e}`);let i=TY.get(r);if(!i){const e=_Y.get(r);if(!e)throw new Error(`Icon set not found: ${n.prefix}`);try{i={...await e(),prefix:r},TY.set(r,i)}catch(e){throw eU.error(e),new Error(`Failed to load icon set: ${n.prefix}`)}}const a=mY(i,n.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),AY=QH(async(e,t)=>{let n;try{n=await SY(e,t?.fallbackPrefix)}catch(e){eU.error(e),n=kY}const r=function(e,t){const n={...cY,...e},r={...dY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach(e=>{const t=[],n=e.hFlip,r=e.vFlip;let o,s=e.rotate;switch(n?r?s+=2:(t.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),t.push("scale(-1 1)"),i.top=i.left=0):r&&(t.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),t.push("scale(1 -1)"),i.top=i.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:o=i.height/2+i.top,t.unshift("rotate(90 "+o.toString()+" "+o.toString()+")");break;case 2:t.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:o=i.width/2+i.left,t.unshift("rotate(-90 "+o.toString()+" "+o.toString()+")")}s%2==1&&(i.left!==i.top&&(o=i.left,i.left=i.top,i.top=o),i.width!==i.height&&(o=i.width,i.width=i.height,i.height=o)),t.length&&(a=function(e,t,n){const r=function(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),a=e.indexOf("",a);if(-1===o)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}(e);return function(e,t){return e?""+e+""+t:t}(r.defs,t+r.content+n)}(a,'',""))});const o=r.width,s=r.height,l=i.width,c=i.height;let u,h;null===o?(h=null===s?"1em":"auto"===s?c:s,u=bY(h,l/c)):(u="auto"===o?l:o,h=null===s?bY(u,c/l):"auto"===s?c:s);const d={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(d[e]=t.toString())};p("width",u),p("height",h);const f=[i.left,i.top,l,c];return d.viewBox=f.join(" "),{attributes:d,viewBox:f,body:a}}(n,t),i=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)n+=" "+e+'="'+t[e]+'"';return'"+e+""}(function(e,t=wY){const n=[];let r;for(;r=xY.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const r="function"==typeof t?t(n):t+(EY++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),e=e.replace(new RegExp(i,"g"),"")}(r.body),r.attributes);return i},"getIconSVG"),NY={},IY={};Object.defineProperty(IY,"__esModule",{value:!0}),IY.BLANK_URL=IY.relativeFirstCharacters=IY.whitespaceEscapeCharsRegex=IY.urlSchemeRegex=IY.ctrlCharactersRegex=IY.htmlCtrlEntityRegex=IY.htmlEntitiesRegex=IY.invalidProtocolRegex=void 0,IY.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,IY.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,IY.htmlCtrlEntityRegex=/&(newline|tab);/gi,IY.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,IY.urlSchemeRegex=/^.+(:|:)/gim,IY.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,IY.relativeFirstCharacters=[".","/"],IY.BLANK_URL="about:blank",Object.defineProperty(NY,"__esModule",{value:!0});var OY=NY.sanitizeUrl=void 0,LY=IY;function MY(e){return e.replace(LY.ctrlCharactersRegex,"").replace(LY.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function RY(e){try{return decodeURIComponent(e)}catch(t){return e}}function DY(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function PY(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function $Y(e){let t,n,r;function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(iDY(e(t),n),r=(t,n)=>e(t)-n):(t=e===DY||e===PY?e:BY,n=e,r=e),{left:i,center:function(e,t,n=0,a=e.length){const o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o},right:function(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(i0);var r=n;if(!r)return LY.BLANK_URL;if(function(e){return LY.relativeFirstCharacters.indexOf(e[0])>-1}(r))return r;var i=r.trimStart(),a=i.match(LY.urlSchemeRegex);if(!a)return r;var o=a[0].toLowerCase().trim();if(LY.invalidProtocolRegex.test(o))return LY.BLANK_URL;var s=i.replace(/\\/g,"/");if("mailto:"===o||o.includes("://"))return s;if("http:"===o||"https:"===o){if(!function(e){return URL.canParse(e)}(s))return LY.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s};const FY=$Y(DY).right;$Y(function(e){return null===e?NaN:+e}).center;class zY extends Map{constructor(e,t=HY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(jY(this,e))}has(e){return super.has(jY(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function jY({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function HY(e){return null!==e&&"object"==typeof e?e.valueOf():e}const UY=Math.sqrt(50),GY=Math.sqrt(10),qY=Math.sqrt(2);function WY(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=UY?10:a>=GY?5:a>=qY?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),l=Math.round(t*c),s/ct&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),l=Math.round(t/c),s*ct&&--l),l=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function KY(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function QY(e){return e}var ZY=1e-6;function JY(e){return"translate("+e+",0)"}function eX(e){return"translate(0,"+e+")"}function tX(e){return t=>+e(t)}function nX(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function rX(){return!this.__axis}function iX(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===e||4===e?-1:1,u=4===e||2===e?"x":"y",h=1===e||3===e?JY:eX;function d(d){var p=null==r?t.ticks?t.ticks.apply(t,n):t.domain():r,f=null==i?t.tickFormat?t.tickFormat.apply(t,n):QY:i,g=Math.max(a,0)+s,m=t.range(),y=+m[0]+l,v=+m[m.length-1]+l,b=(t.bandwidth?nX:tX)(t.copy(),l),x=d.selection?d.selection():d,w=x.selectAll(".domain").data([null]),E=x.selectAll(".tick").data(p,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),_=E.select("line"),C=E.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),_=_.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),C=C.merge(T.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),d!==x&&(w=w.transition(d),E=E.transition(d),_=_.transition(d),C=C.transition(d),k=k.transition(d).attr("opacity",ZY).attr("transform",function(e){return isFinite(e=b(e))?h(e+l):this.getAttribute("transform")}),T.attr("opacity",ZY).attr("transform",function(e){var t=this.parentNode.__axis;return h((t&&isFinite(t=t(e))?t:b(e))+l)})),k.remove(),w.attr("d",4===e||2===e?o?"M"+c*o+","+y+"H"+l+"V"+v+"H"+c*o:"M"+l+","+y+"V"+v:o?"M"+y+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+y+","+l+"H"+v),E.attr("opacity",1).attr("transform",function(e){return h(b(e)+l)}),_.attr(u+"2",c*a),C.attr(u,c*g).text(f),x.filter(rX).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),x.each(function(){this.__axis=b})}return d.scale=function(e){return arguments.length?(t=e,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(e){return arguments.length?(n=null==e?[]:Array.from(e),d):n.slice()},d.tickValues=function(e){return arguments.length?(r=null==e?null:Array.from(e),d):r&&r.slice()},d.tickFormat=function(e){return arguments.length?(i=e,d):i},d.tickSize=function(e){return arguments.length?(a=o=+e,d):a},d.tickSizeInner=function(e){return arguments.length?(a=+e,d):a},d.tickSizeOuter=function(e){return arguments.length?(o=+e,d):o},d.tickPadding=function(e){return arguments.length?(s=+e,d):s},d.offset=function(e){return arguments.length?(l=+e,d):l},d}var aX={value:()=>{}};function oX(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}(e+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),a=0;a=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),hX.hasOwnProperty(t)?{space:hX[t],local:e}:e}function pX(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===uX&&t.documentElement.namespaceURI===uX?t.createElement(e):t.createElementNS(n,e)}}function fX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gX(e){var t=dX(e);return(t.local?fX:pX)(t)}function mX(){}function yX(e){return null==e?mX:function(){return this.querySelector(e)}}function vX(){return[]}function bX(e){return null==e?vX:function(){return this.querySelectorAll(e)}}function xX(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}function wX(e){return function(){return this.matches(e)}}function EX(e){return function(t){return t.matches(e)}}var kX=Array.prototype.find;function TX(){return this.firstElementChild}var _X=Array.prototype.filter;function CX(){return Array.from(this.children)}function SX(e){return new Array(e.length)}function AX(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function NX(e,t,n,r,i,a){for(var o,s=0,l=t.length,c=a.length;st?1:e>=t?0:NaN}function RX(e){return function(){this.removeAttribute(e)}}function DX(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PX(e,t){return function(){this.setAttribute(e,t)}}function $X(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function BX(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function FX(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function zX(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jX(e){return function(){this.style.removeProperty(e)}}function HX(e,t,n){return function(){this.style.setProperty(e,t,n)}}function UX(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function GX(e,t){return e.style.getPropertyValue(t)||zX(e).getComputedStyle(e,null).getPropertyValue(t)}function qX(e){return function(){delete this[e]}}function WX(e,t){return function(){this[e]=t}}function VX(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function YX(e){return e.trim().split(/^|\s+/)}function XX(e){return e.classList||new KX(e)}function KX(e){this._node=e,this._names=YX(e.getAttribute("class")||"")}function QX(e,t){for(var n=XX(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var bK=[null];function xK(e,t){this._groups=e,this._parents=t}function wK(){return new xK([[document.documentElement]],bK)}function EK(e){return"string"==typeof e?new xK([[document.querySelector(e)]],[document.documentElement]):new xK([[e]],bK)}function kK(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function TK(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _K(){}xK.prototype=wK.prototype={constructor:xK,select:function(e){"function"!=typeof e&&(e=yX(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=x&&(x=b+1);!(v=m[x])&&++x=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=MX);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?jX:"function"==typeof t?UX:HX)(e,t,null==n?"":n)):GX(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?qX:"function"==typeof t?VX:WX)(e,t)):this.node()[e]},classed:function(e,t){var n=YX(e+"");if(arguments.length<2){for(var r=XX(this.node()),i=-1,a=n.length;++i=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),o=a.length;if(!(arguments.length<2)){for(s=t?gK:fK,r=0;r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?UK(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?UK(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=LK.exec(e))?new WK(t[1],t[2],t[3],1):(t=MK.exec(e))?new WK(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=RK.exec(e))?UK(t[1],t[2],t[3],t[4]):(t=DK.exec(e))?UK(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=PK.exec(e))?ZK(t[1],t[2]/100,t[3]/100,1):(t=$K.exec(e))?ZK(t[1],t[2]/100,t[3]/100,t[4]):BK.hasOwnProperty(e)?HK(BK[e]):"transparent"===e?new WK(NaN,NaN,NaN,0):null}function HK(e){return new WK(e>>16&255,e>>8&255,255&e,1)}function UK(e,t,n,r){return r<=0&&(e=t=n=NaN),new WK(e,t,n,r)}function GK(e){return e instanceof _K||(e=jK(e)),e?new WK((e=e.rgb()).r,e.g,e.b,e.opacity):new WK}function qK(e,t,n,r){return 1===arguments.length?GK(e):new WK(e,t,n,null==r?1:r)}function WK(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function VK(){return`#${QK(this.r)}${QK(this.g)}${QK(this.b)}`}function YK(){const e=XK(this.opacity);return`${1===e?"rgb(":"rgba("}${KK(this.r)}, ${KK(this.g)}, ${KK(this.b)}${1===e?")":`, ${e})`}`}function XK(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function KK(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function QK(e){return((e=KK(e))<16?"0":"")+e.toString(16)}function ZK(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new eQ(e,t,n,r)}function JK(e){if(e instanceof eQ)return new eQ(e.h,e.s,e.l,e.opacity);if(e instanceof _K||(e=jK(e)),!e)return new eQ;if(e instanceof eQ)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(n-r)/s+6*(n0&&l<1?0:o,new eQ(o,s,l,e.opacity)}function eQ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tQ(e){return(e=(e||0)%360)<0?e+360:e}function nQ(e){return Math.max(0,Math.min(1,e||0))}function rQ(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}kK(_K,jK,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:FK,formatHex:FK,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return JK(this).formatHsl()},formatRgb:zK,toString:zK}),kK(WK,qK,TK(_K,{brighter(e){return e=null==e?SK:Math.pow(SK,e),new WK(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?CK:Math.pow(CK,e),new WK(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new WK(KK(this.r),KK(this.g),KK(this.b),XK(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:VK,formatHex:VK,formatHex8:function(){return`#${QK(this.r)}${QK(this.g)}${QK(this.b)}${QK(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:YK,toString:YK})),kK(eQ,function(e,t,n,r){return 1===arguments.length?JK(e):new eQ(e,t,n,null==r?1:r)},TK(_K,{brighter(e){return e=null==e?SK:Math.pow(SK,e),new eQ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?CK:Math.pow(CK,e),new eQ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new WK(rQ(e>=240?e-240:e+120,i,r),rQ(e,i,r),rQ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new eQ(tQ(this.h),nQ(this.s),nQ(this.l),XK(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=XK(this.opacity);return`${1===e?"hsl(":"hsla("}${tQ(this.h)}, ${100*nQ(this.s)}%, ${100*nQ(this.l)}%${1===e?")":`, ${e})`}`}}));const iQ=Math.PI/180,aQ=180/Math.PI,oQ=.96422,sQ=.82521,lQ=4/29,cQ=6/29,uQ=3*cQ*cQ,hQ=cQ*cQ*cQ;function dQ(e){if(e instanceof pQ)return new pQ(e.l,e.a,e.b,e.opacity);if(e instanceof bQ)return xQ(e);e instanceof WK||(e=GK(e));var t,n,r=yQ(e.r),i=yQ(e.g),a=yQ(e.b),o=fQ((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?t=n=o:(t=fQ((.4360747*r+.3850649*i+.1430804*a)/oQ),n=fQ((.0139322*r+.0971045*i+.7141733*a)/sQ)),new pQ(116*o-16,500*(t-o),200*(o-n),e.opacity)}function pQ(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function fQ(e){return e>hQ?Math.pow(e,1/3):e/uQ+lQ}function gQ(e){return e>cQ?e*e*e:uQ*(e-lQ)}function mQ(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function yQ(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vQ(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof bQ)return new bQ(e.h,e.c,e.l,e.opacity);if(e instanceof pQ||(e=dQ(e)),0===e.a&&0===e.b)return new bQ(NaN,0()=>e;function EQ(e,t){return function(n){return e+n*t}}function kQ(e){return 1===(e=+e)?TQ:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):wQ(isNaN(t)?n:t)}}function TQ(e,t){var n=t-e;return n?EQ(e,n):wQ(isNaN(e)?t:e)}var _Q=function e(t){var n=kQ(t);function r(e,t){var r=n((e=qK(e)).r,(t=qK(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=TQ(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function CQ(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(n=0;na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:NQ(n,r)})),a=LQ.lastIndex;return a180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:NQ(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:NQ(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,s,l),function(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:NQ(e,n)},{i:s-2,x:NQ(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,n=-1,r=l.length;++n180||n<-180?n-360*Math.round(n/360):n):wQ(isNaN(e)?t:e)}),WQ=0,VQ=0,YQ=0,XQ=0,KQ=0,QQ=0,ZQ="object"==typeof performance&&performance.now?performance:Date,JQ="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eZ(){return KQ||(JQ(tZ),KQ=ZQ.now()+QQ)}function tZ(){KQ=0}function nZ(){this._call=this._time=this._next=null}function rZ(e,t,n){var r=new nZ;return r.restart(e,t,n),r}function iZ(){KQ=(XQ=ZQ.now())+QQ,WQ=VQ=0;try{!function(){eZ(),++WQ;for(var e,t=UQ;t;)(e=KQ-t._time)>=0&&t._call.call(void 0,e),t=t._next;--WQ}()}finally{WQ=0,function(){var e,t,n=UQ,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:UQ=t);GQ=e,oZ(r)}(),KQ=0}}function aZ(){var e=ZQ.now(),t=e-XQ;t>1e3&&(QQ-=t,XQ=e)}function oZ(e){WQ||(VQ&&(VQ=clearTimeout(VQ)),e-KQ>24?(e<1/0&&(VQ=setTimeout(iZ,e-ZQ.now()-QQ)),YQ&&(YQ=clearInterval(YQ))):(YQ||(XQ=ZQ.now(),YQ=setInterval(aZ,1e3)),WQ=1,JQ(iZ)))}function sZ(e,t,n){var r=new nZ;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}nZ.prototype=rZ.prototype={constructor:nZ,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?eZ():+n)+(null==t?0:+t),this._next||GQ===this||(GQ?GQ._next=this:UQ=this,GQ=this),this._call=e,this._time=n,oZ()},stop:function(){this._call&&(this._call=null,this._time=1/0,oZ())}};var lZ=oX("start","end","cancel","interrupt"),cZ=[];function uZ(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var c,u,h,d;if(1!==n.state)return l();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return sZ(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function dZ(e,t){var n=pZ(e,t);if(n.state>3)throw new Error("too late; already running");return n}function pZ(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function fZ(e,t){var n,r;return function(){var i=dZ(this,e),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?hZ:dZ;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=dX(e),r="transform"===n?HQ:yZ;return this.attrTween(e,"function"==typeof t?(n.local?kZ:EZ)(n,r,mZ(this,"attr."+e,t)):null==t?(n.local?bZ:vZ)(n):(n.local?wZ:xZ)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=dX(e);return this.tween(n,(r.local?TZ:_Z)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?jQ:yZ;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=GX(this,e),o=(this.style.removeProperty(e),GX(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,OZ(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=GX(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=GX(this,e)),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}(e,r,mZ(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,s="end."+o;return function(){var l=dZ(this,e),c=l.on,u=null==l.value[o]?a||(a=OZ(t)):void 0;c===n&&i===u||(r=(n=c).copy()).on(s,i=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=GX(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(mZ(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=pZ(this.node(),n).tween,a=0,o=i.length;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete e.__transition}}(this,e)})},wK.prototype.transition=function(e){var t,n;e instanceof MZ?(t=e._id,e=e._name):(t=RZ(),(n=PZ).time=eZ(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a=0))throw new Error(`invalid digits: ${e}`);if(t>15)return HZ;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tzZ)if(Math.abs(u*s-l*c)>zZ&&i){let d=n-a,p=r-o,f=s*s+l*l,g=d*d+p*p,m=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((BZ-Math.acos((f+h-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>zZ&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*d>c*p)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,a){if(e=+e,t=+t,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,c=t+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>zZ||Math.abs(this._y1-c)>zZ)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%FZ+FZ),h>jZ?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>zZ&&this._append`A${n},${n},0,${+(h>=BZ)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function GZ(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function qZ(e){return(e=GZ(Math.abs(e)))?e[1]:NaN}var WZ,VZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function YZ(e){if(!(t=VZ.exec(e)))throw new Error("invalid format: "+e);var t;return new XZ({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]})}function XZ(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function KZ(e,t){var n=GZ(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}YZ.prototype=XZ.prototype,XZ.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var QZ={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>KZ(100*e,t),r:KZ,s:function(e,t){var n=GZ(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(WZ=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+GZ(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ZZ(e){return e}var JZ,eJ,tJ,nJ=Array.prototype.map,rJ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iJ(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?ZZ:(t=nJ.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?ZZ:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(nJ.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=YZ(e)).fill,n=e.align,h=e.sign,d=e.symbol,p=e.zero,f=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):QZ[v]||(void 0===m&&(m=12),y=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?a:/[%p]/.test(v)?l:"",w=QZ[v],E=/[defgprs%]/.test(v);function k(e){var i,a,l,d=b,k=x;if("c"===v)k=w(e)+k,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0===+e&&"+"!==h&&(T=!1),d=(T?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===v?rJ[8+WZ/3]:"")+k+(T&&"("===h?")":""),E)for(i=-1,a=e.length;++i(l=e.charCodeAt(i))||l>57){k=(46===l?o+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!p&&(e=r(e,1/0));var _=d.length+e.length+k.length,C=_>1)+d+e+k+C.slice(_);break;default:e=C+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=YZ(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(qZ(t)/3))),i=Math.pow(10,-r),a=rJ[8+r/3];return function(e){return n(i*e)+a}}}}function aJ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}!function(e){JZ=iJ(e),eJ=JZ.format,tJ=JZ.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const oJ=Symbol("implicit");function sJ(){var e=new zY,t=[],n=[],r=oJ;function i(i){let a=e.get(i);if(void 0===a){if(r!==oJ)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new zY;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return sJ(t,n).unknown(r)},aJ.apply(i,arguments),i}function lJ(){var e,t,n=sJ().unknown(void 0),r=n.domain,i=n.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(o[0],o[e-1])),r=e>2?fJ:pJ,i=a=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(o.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((a||(a=r(s,o.map(e),NQ)))(n)))},h.domain=function(e){return arguments.length?(o=Array.from(e,cJ),u()):o.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=DQ,u()},h.clamp=function(e){return arguments.length?(c=!!e||hJ,u()):c!==hJ},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function yJ(){return mJ()(hJ,hJ)}function vJ(e,t,n,r){var i,a=YY(e,t,n);switch((r=YZ(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(qZ(t)/3)))-qZ(Math.abs(e)))}(a,o))||(r.precision=i),tJ(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,qZ(t)-qZ(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-qZ(Math.abs(e)))}(a))||(r.precision=i-2*("%"===r.type))}return eJ(r)}function bJ(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let e=0;e0;){if((i=VY(l,c,n))===r)return a[o]=l,a[s]=c,t(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function xJ(){var e=yJ();return e.copy=function(){return gJ(e,xJ())},aJ.apply(e,arguments),bJ(e)}const wJ=new Date,EJ=new Date;function kJ(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,a)=>{const o=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n0))return o;let s;do{o.push(s=new Date(+n)),t(n,a),e(n)}while(skJ(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(wJ.setTime(+t),EJ.setTime(+r),e(wJ),e(EJ),Math.floor(n(wJ,EJ))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const TJ=kJ(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);TJ.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?kJ(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):TJ:null),TJ.range;const _J=1e3,CJ=6e4,SJ=36e5,AJ=864e5,NJ=6048e5,IJ=2592e6,OJ=31536e6,LJ=kJ(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_J)},(e,t)=>(t-e)/_J,e=>e.getUTCSeconds());LJ.range;const MJ=kJ(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_J)},(e,t)=>{e.setTime(+e+t*CJ)},(e,t)=>(t-e)/CJ,e=>e.getMinutes());MJ.range;const RJ=kJ(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*CJ)},(e,t)=>(t-e)/CJ,e=>e.getUTCMinutes());RJ.range;const DJ=kJ(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_J-e.getMinutes()*CJ)},(e,t)=>{e.setTime(+e+t*SJ)},(e,t)=>(t-e)/SJ,e=>e.getHours());DJ.range;const PJ=kJ(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*SJ)},(e,t)=>(t-e)/SJ,e=>e.getUTCHours());PJ.range;const $J=kJ(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*CJ)/AJ,e=>e.getDate()-1);$J.range;const BJ=kJ(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/AJ,e=>e.getUTCDate()-1);BJ.range;const FJ=kJ(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/AJ,e=>Math.floor(e/AJ));function zJ(e){return kJ(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*CJ)/NJ)}FJ.range;const jJ=zJ(0),HJ=zJ(1),UJ=zJ(2),GJ=zJ(3),qJ=zJ(4),WJ=zJ(5),VJ=zJ(6);function YJ(e){return kJ(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/NJ)}jJ.range,HJ.range,UJ.range,GJ.range,qJ.range,WJ.range,VJ.range;const XJ=YJ(0),KJ=YJ(1),QJ=YJ(2),ZJ=YJ(3),JJ=YJ(4),e0=YJ(5),t0=YJ(6);XJ.range,KJ.range,QJ.range,ZJ.range,JJ.range,e0.range,t0.range;const n0=kJ(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());n0.range;const r0=kJ(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());r0.range;const i0=kJ(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());i0.every=e=>isFinite(e=Math.floor(e))&&e>0?kJ(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,i0.range;const a0=kJ(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());a0.every=e=>isFinite(e=Math.floor(e))&&e>0?kJ(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,a0.range;const[o0,s0]=function(e,t,n,r,i,a){const o=[[LJ,1,_J],[LJ,5,5e3],[LJ,15,15e3],[LJ,30,3e4],[a,1,CJ],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,SJ],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,AJ],[r,2,1728e5],[n,1,NJ],[t,1,IJ],[t,3,7776e6],[e,1,OJ]];function s(t,n,r){const i=Math.abs(n-t)/r,a=$Y(([,,e])=>e).right(o,i);if(a===o.length)return e.every(YY(t/OJ,n/OJ,r));if(0===a)return TJ.every(Math.max(YY(t,n,r),1));const[s,l]=o[i/o[a-1][2][e.toLowerCase(),t]))}function w0(e,t,n){var r=f0.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function E0(e,t,n){var r=f0.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function k0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function T0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function C0(e,t,n){var r=f0.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function S0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function A0(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function N0(e,t,n){var r=f0.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function I0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function O0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function L0(e,t,n){var r=f0.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function M0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function R0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function D0(e,t,n){var r=f0.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function P0(e,t,n){var r=f0.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function $0(e,t,n){var r=f0.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function B0(e,t,n){var r=g0.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function F0(e,t,n){var r=f0.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function z0(e,t,n){var r=f0.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function j0(e,t){return y0(e.getDate(),t,2)}function H0(e,t){return y0(e.getHours(),t,2)}function U0(e,t){return y0(e.getHours()%12||12,t,2)}function G0(e,t){return y0(1+$J.count(i0(e),e),t,3)}function q0(e,t){return y0(e.getMilliseconds(),t,3)}function W0(e,t){return q0(e,t)+"000"}function V0(e,t){return y0(e.getMonth()+1,t,2)}function Y0(e,t){return y0(e.getMinutes(),t,2)}function X0(e,t){return y0(e.getSeconds(),t,2)}function K0(e){var t=e.getDay();return 0===t?7:t}function Q0(e,t){return y0(jJ.count(i0(e)-1,e),t,2)}function Z0(e){var t=e.getDay();return t>=4||0===t?qJ(e):qJ.ceil(e)}function J0(e,t){return e=Z0(e),y0(qJ.count(i0(e),e)+(4===i0(e).getDay()),t,2)}function e1(e){return e.getDay()}function t1(e,t){return y0(HJ.count(i0(e)-1,e),t,2)}function n1(e,t){return y0(e.getFullYear()%100,t,2)}function r1(e,t){return y0((e=Z0(e)).getFullYear()%100,t,2)}function i1(e,t){return y0(e.getFullYear()%1e4,t,4)}function a1(e,t){var n=e.getDay();return y0((e=n>=4||0===n?qJ(e):qJ.ceil(e)).getFullYear()%1e4,t,4)}function o1(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+y0(t/60|0,"0",2)+y0(t%60,"0",2)}function s1(e,t){return y0(e.getUTCDate(),t,2)}function l1(e,t){return y0(e.getUTCHours(),t,2)}function c1(e,t){return y0(e.getUTCHours()%12||12,t,2)}function u1(e,t){return y0(1+BJ.count(a0(e),e),t,3)}function h1(e,t){return y0(e.getUTCMilliseconds(),t,3)}function d1(e,t){return h1(e,t)+"000"}function p1(e,t){return y0(e.getUTCMonth()+1,t,2)}function f1(e,t){return y0(e.getUTCMinutes(),t,2)}function g1(e,t){return y0(e.getUTCSeconds(),t,2)}function m1(e){var t=e.getUTCDay();return 0===t?7:t}function y1(e,t){return y0(XJ.count(a0(e)-1,e),t,2)}function v1(e){var t=e.getUTCDay();return t>=4||0===t?JJ(e):JJ.ceil(e)}function b1(e,t){return e=v1(e),y0(JJ.count(a0(e),e)+(4===a0(e).getUTCDay()),t,2)}function x1(e){return e.getUTCDay()}function w1(e,t){return y0(KJ.count(a0(e)-1,e),t,2)}function E1(e,t){return y0(e.getUTCFullYear()%100,t,2)}function k1(e,t){return y0((e=v1(e)).getUTCFullYear()%100,t,2)}function T1(e,t){return y0(e.getUTCFullYear()%1e4,t,4)}function _1(e,t){var n=e.getUTCDay();return y0((e=n>=4||0===n?JJ(e):JJ.ceil(e)).getUTCFullYear()%1e4,t,4)}function C1(){return"+0000"}function S1(){return"%"}function A1(e){return+e}function N1(e){return Math.floor(+e/1e3)}function I1(e){return new Date(e)}function O1(e){return e instanceof Date?+e:+new Date(+e)}function L1(e,t,n,r,i,a,o,s,l,c){var u=yJ(),h=u.invert,d=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(l(e)=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:A1,s:N1,S:X0,u:K0,U:Q0,V:J0,w:e1,W:t1,x:null,X:null,y:n1,Y:i1,Z:o1,"%":S1},x={a:function(e){return o[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:s1,e:s1,f:d1,g:k1,G:_1,H:l1,I:c1,j:u1,L:h1,m:p1,M:f1,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:A1,s:N1,S:g1,u:m1,U:y1,V:b1,w:x1,W:w1,x:null,X:null,y:E1,Y:T1,Z:C1,"%":S1},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return T(e,t,n,r)},d:O0,e:O0,f:$0,g:S0,G:C0,H:M0,I:M0,j:L0,L:P0,m:I0,M:R0,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:N0,Q:F0,s:z0,S:D0,u:E0,U:k0,V:T0,w:w0,W:_0,x:function(e,t,r){return T(e,n,t,r)},X:function(e,t,n){return T(e,r,t,n)},y:S0,Y:C0,Z:A0,"%":B0};function E(e,t){return function(n){var r,i,a,o=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=c0(u0(a.y,0,1))).getUTCDay(),r=i>4||0===i?KJ.ceil(r):KJ(r),r=BJ.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=l0(u0(a.y,0,1))).getDay(),r=i>4||0===i?HJ.ceil(r):HJ(r),r=$J.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?c0(u0(a.y,0,1)).getUTCDay():l0(u0(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,c0(a)):l0(a)}}function T(e,t,n,r){for(var i,a,o=0,s=t.length,l=n.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=w[i in p0?t.charAt(o++):i])||(r=a(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),x.x=E(n,x),x.X=E(r,x),x.c=E(t,x),{format:function(e){var t=E(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=E(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}(e),d0=h0.format,h0.parse,h0.utcFormat,h0.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var R1=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r=1?q1:e<=-1?-q1:Math.asin(e)}function Y1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new UZ(t)}function X1(e){return e.innerRadius}function K1(e){return e.outerRadius}function Q1(e){return e.startAngle}function Z1(e){return e.endAngle}function J1(e){return e&&e.padAngle}function e2(e,t,n,r,i,a,o){var s=e-n,l=t-r,c=(o?a:-a)/H1(s*s+l*l),u=c*l,h=-c*s,d=e+u,p=t+h,f=n+u,g=r+h,m=(d+f)/2,y=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,w=i-a,E=d*g-f*p,k=(b<0?-1:1)*H1(F1(0,w*w*x-E*E)),T=(E*b-v*k)/x,_=(-E*v-b*k)/x,C=(E*b+v*k)/x,S=(-E*v+b*k)/x,A=T-m,N=_-y,I=C-m,O=S-y;return A*A+N*N>I*I+O*O&&(T=C,_=S),{cx:T,cy:_,x01:-u,y01:-h,x11:T*(i/w-1),y11:_*(i/w-1)}}function t2(){var e=X1,t=K1,n=D1(0),r=null,i=Q1,a=Z1,o=J1,s=null,l=Y1(c);function c(){var c,u,h=+e.apply(this,arguments),d=+t.apply(this,arguments),p=i.apply(this,arguments)-q1,f=a.apply(this,arguments)-q1,g=P1(f-p),m=f>p;if(s||(s=c=l()),dU1)if(g>W1-U1)s.moveTo(d*B1(p),d*j1(p)),s.arc(0,0,d,p,f,!m),h>U1&&(s.moveTo(h*B1(f),h*j1(f)),s.arc(0,0,h,f,p,m));else{var y,v,b=p,x=f,w=p,E=f,k=g,T=g,_=o.apply(this,arguments)/2,C=_>U1&&(r?+r.apply(this,arguments):H1(h*h+d*d)),S=z1(P1(d-h)/2,+n.apply(this,arguments)),A=S,N=S;if(C>U1){var I=V1(C/h*j1(_)),O=V1(C/d*j1(_));(k-=2*I)>U1?(w+=I*=m?1:-1,E-=I):(k=0,w=E=(p+f)/2),(T-=2*O)>U1?(b+=O*=m?1:-1,x-=O):(T=0,b=x=(p+f)/2)}var L=d*B1(b),M=d*j1(b),R=h*B1(E),D=h*j1(E);if(S>U1){var P,$=d*B1(x),B=d*j1(x),F=h*B1(w),z=h*j1(w);if(g1?0:e<-1?G1:Math.acos(e)}((j*U+H*G)/(H1(j*j+H*H)*H1(U*U+G*G)))/2),W=H1(P[0]*P[0]+P[1]*P[1]);A=z1(S,(h-W)/(q-1)),N=z1(S,(d-W)/(q+1))}else A=N=0}T>U1?N>U1?(y=e2(F,z,L,M,d,N,m),v=e2($,B,R,D,d,N,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),NU1&&k>U1?A>U1?(y=e2(R,D,$,B,h,-A,m),v=e2(L,M,F,z,h,-A,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Ae?1:t>=e?0:NaN}function c2(e){return e}r2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};class u2{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function h2(e){return new u2(e,!0)}function d2(e){return new u2(e,!1)}function p2(){}function f2(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function g2(e){this._context=e}function m2(e){return new g2(e)}function y2(e){this._context=e}function v2(e){this._context=e}function b2(e,t){this._basis=new g2(e),this._beta=t}g2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:f2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:f2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},y2.prototype={areaStart:p2,areaEnd:p2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:f2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},v2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:f2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},b2.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],a=t[0],o=e[n]-i,s=t[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+r*o),this._beta*t[l]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var x2=function e(t){function n(e){return 1===t?new g2(e):new b2(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function w2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function E2(e,t){this._context=e,this._k=(1-t)/6}E2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:w2(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:w2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var k2=function e(t){function n(e){return new E2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function T2(e,t){this._context=e,this._k=(1-t)/6}T2.prototype={areaStart:p2,areaEnd:p2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:w2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _2=function e(t){function n(e){return new T2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function C2(e,t){this._context=e,this._k=(1-t)/6}C2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:w2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var S2=function e(t){function n(e){return new C2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function A2(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>U1){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>U1){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function N2(e,t){this._context=e,this._alpha=t}N2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:A2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var I2=function e(t){function n(e){return t?new N2(e,t):new E2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function O2(e,t){this._context=e,this._alpha=t}O2.prototype={areaStart:p2,areaEnd:p2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:A2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var L2=function e(t){function n(e){return t?new O2(e,t):new T2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function M2(e,t){this._context=e,this._alpha=t}M2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:A2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var R2=function e(t){function n(e){return t?new M2(e,t):new C2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function D2(e){this._context=e}function P2(e){return e<0?-1:1}function $2(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(P2(a)+P2(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function B2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function F2(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function z2(e){this._context=e}function j2(e){this._context=new H2(e)}function H2(e){this._context=e}function U2(e){return new z2(e)}function G2(e){return new j2(e)}function q2(e){this._context=e}function W2(e){var t,n,r=e.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},Z2.prototype={constructor:Z2,scale:function(e){return 1===e?this:new Z2(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Z2(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Z2.prototype;var J2="object"==typeof global&&global&&global.Object===Object&&global,e4="object"==typeof self&&self&&self.Object===Object&&self,t4=J2||e4||Function("return this")(),n4=t4.Symbol,r4=Object.prototype,i4=r4.hasOwnProperty,a4=r4.toString,o4=n4?n4.toStringTag:void 0;var s4=Object.prototype.toString;var l4=n4?n4.toStringTag:void 0;function c4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l4&&l4 in Object(e)?function(e){var t=i4.call(e,o4),n=e[o4];try{e[o4]=void 0;var r=!0}catch(e){}var i=a4.call(e);return r&&(t?e[o4]=n:delete e[o4]),i}(e):function(e){return s4.call(e)}(e)}function u4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function h4(e){if(!u4(e))return!1;var t=c4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var d4,p4=t4["__core-js_shared__"],f4=(d4=/[^.]+$/.exec(p4&&p4.keys&&p4.keys.IE_PROTO||""))?"Symbol(src)_1."+d4:"";var g4=Function.prototype.toString;function m4(e){if(null!=e){try{return g4.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var y4=/^\[object .+?Constructor\]$/,v4=Function.prototype,b4=Object.prototype,x4=v4.toString,w4=b4.hasOwnProperty,E4=RegExp("^"+x4.call(w4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function k4(e){return!(!u4(e)||function(e){return!!f4&&f4 in e}(e))&&(h4(e)?E4:y4).test(m4(e))}function T4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k4(n)?n:void 0}var _4=T4(Object,"create");var C4=Object.prototype.hasOwnProperty;var S4=Object.prototype.hasOwnProperty;function A4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},L4.prototype.set=function(e,t){var n=this.__data__,r=I4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var M4=T4(t4,"Map");function R4(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function D4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}function d3(e){return null!=e&&h3(e.length)&&!h4(e)}function p3(e){return i3(e)&&d3(e)}var f3="object"==typeof exports&&exports&&!exports.nodeType&&exports,g3=f3&&"object"==typeof module&&module&&!module.nodeType&&module,m3=g3&&g3.exports===f3?t4.Buffer:void 0,y3=(m3?m3.isBuffer:void 0)||function(){return!1},v3=Function.prototype,b3=Object.prototype,x3=v3.toString,w3=b3.hasOwnProperty,E3=x3.call(Object);var k3={};function T3(e){return function(t){return e(t)}}k3["[object Float32Array]"]=k3["[object Float64Array]"]=k3["[object Int8Array]"]=k3["[object Int16Array]"]=k3["[object Int32Array]"]=k3["[object Uint8Array]"]=k3["[object Uint8ClampedArray]"]=k3["[object Uint16Array]"]=k3["[object Uint32Array]"]=!0,k3["[object Arguments]"]=k3["[object Array]"]=k3["[object ArrayBuffer]"]=k3["[object Boolean]"]=k3["[object DataView]"]=k3["[object Date]"]=k3["[object Error]"]=k3["[object Function]"]=k3["[object Map]"]=k3["[object Number]"]=k3["[object Object]"]=k3["[object RegExp]"]=k3["[object Set]"]=k3["[object String]"]=k3["[object WeakMap]"]=!1;var _3="object"==typeof exports&&exports&&!exports.nodeType&&exports,C3=_3&&"object"==typeof module&&module&&!module.nodeType&&module,S3=C3&&C3.exports===_3&&J2.process,A3=function(){try{var e=C3&&C3.require&&C3.require("util").types;return e||S3&&S3.binding&&S3.binding("util")}catch(e){}}(),N3=A3&&A3.isTypedArray,I3=N3?T3(N3):function(e){return i3(e)&&h3(e.length)&&!!k3[c4(e)]};function O3(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var L3=Object.prototype.hasOwnProperty;function M3(e,t,n){var r=e[t];L3.call(e,t)&&N4(r,n)&&(void 0!==n||t in e)||F4(e,t,n)}function R3(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Y3);function Q3(e,t){return K3(W3(e,t,G3),e+"")}function Z3(e,t,n){if(!u4(n))return!1;var r=typeof t;return!!("number"==r?d3(n)&&P3(t,n.length):"string"==r&&t in n)&&N4(n[t],e)}function J3(e){return Q3(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&Z3(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++re.args);LU(e),r=pU(r,[...e])}else r=n.args;if(!r)return;let i=lU(e,t);const a="config";return void 0!==r[a]&&("flowchart-v2"===i&&(i="flowchart"),r[i]=r[a],delete r[a]),r},"detectInit"),i5=QH(function(e,t=null){try{const n=new RegExp(`[%]{2}(?![{]${n5.source})(?=[}][%]{2}).*\n`,"ig");let r;e=e.trim().replace(n,"").replace(/'/gm,'"'),eU.debug(`Detecting diagram directive${null!==t?" type:"+t:""} based on the text:${e}`);const i=[];for(;null!==(r=iU.exec(e));)if(r.index===iU.lastIndex&&iU.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){const e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return 0===i.length?{type:e,args:null}:1===i.length?i[0]:i}catch(n){return eU.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),a5=QH(function(e){return e.replace(iU,"")},"removeDirectives"),o5=QH(function(e,t){for(const[n,r]of t.entries())if(r.match(e))return n;return-1},"isSubstringInArray");function s5(e,t){if(!e)return t;const n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return t5[n]??t}function l5(e,t){const n=e.trim();if(n)return"loose"!==t.securityLevel?OY(n):n}QH(s5,"interpolateToCurve"),QH(l5,"formatUrl");var c5=QH((e,...t)=>{const n=e.split("."),r=n.length-1,i=n[r];let a=window;for(let t=0;t{n+=u5(e,t),t=e});return f5(e,n/2)}function d5(e){return 1===e.length?e[0]:h5(e)}QH(u5,"distance"),QH(h5,"traverseEdge"),QH(d5,"calcLabelPosition");var p5=QH((e,t=2)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},"roundNumber"),f5=QH((e,t)=>{let n,r=t;for(const t of e){if(n){const e=u5(t,n);if(0===e)return n;if(e=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:p5((1-i)*n.x+i*t.x,5),y:p5((1-i)*n.y+i*t.y,5)}}}n=t}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),g5=QH((e,t,n)=>{eU.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());const r=f5(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},"calcCardinalityPosition");function m5(e,t,n){const r=structuredClone(n);eU.info("our points",r),"start_left"!==t&&"start_right"!==t&&r.reverse();const i=f5(r,25+e),a=10+.5*e,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return"start_left"===t?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):"end_right"===t?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):"end_left"===t?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}function y5(e){let t="",n="";for(const r of e)void 0!==r&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":t=t+r+";");return{style:t,labelStyle:n}}QH(m5,"calcTerminalLabelPosition"),QH(y5,"getStylesFromArray");var v5=0,b5=QH(()=>(v5++,"id-"+Math.random().toString(36).substr(2,12)+"-"+v5),"generateId");function x5(e){let t="";const n="0123456789abcdef";for(let r=0;rx5(e.length),"random"),E5=QH(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"),k5=QH(function(e,t){const n=t.text.replace(kG.lineBreakRegex," "),[,r]=R5(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",r),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),void 0!==t.class&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.attr("fill",t.fill),a.text(n),i},"drawSimpleText"),T5=P4((e,t,n)=>{if(!e)return e;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},n),kG.lineBreakRegex.test(e))return e;const r=e.split(" ").filter(Boolean),i=[];let a="";return r.forEach((e,o)=>{const s=S5(`${e} `,n),l=S5(a,n);if(s>t){const{hyphenatedStrings:r,remainingWord:o}=_5(e,t,"-",n);i.push(a,...r),a=o}else l+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(" ");o+1===r.length&&i.push(a)}),i.filter(e=>""!==e).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),_5=P4((e,t,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...e],a=[];let o="";return i.forEach((e,s)=>{const l=`${o}${e}`;if(S5(l,r)>=t){const e=s+1,t=i.length===e,r=`${l}${n}`;a.push(t?l:r),o=""}else o=l}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n="-",r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function C5(e,t){return N5(e,t).height}function S5(e,t){return N5(e,t).width}QH(C5,"calculateTextHeight"),QH(S5,"calculateTextWidth");var A5,N5=P4((e,t)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,a]=R5(n),o=["sans-serif",r],s=e.split(kG.lineBreakRegex),l=[],c=EK("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const u=c.append("svg");for(const e of o){let t=0;const n={width:0,height:0,lineHeight:0};for(const r of s){const o=E5();o.text=r||"​";const s=k5(u,o).style("font-size",a).style("font-weight",i).style("font-family",e),l=(s._groups||s)[0][0].getBBox();if(0===l.width&&0===l.height)throw new Error("svg element not in render tree");n.width=Math.round(Math.max(n.width,l.width)),t=Math.round(l.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}l.push(n)}u.remove();return l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),I5=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{QH(this,"InitIDGenerator")}},O5=QH(function(e){return A5=A5||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),A5.innerHTML=e,unescape(A5.textContent)},"entityDecode");function L5(e){return"str"in e}QH(L5,"isDetailedError");var M5=QH((e,t,n,r)=>{if(!r)return;const i=e.node()?.getBBox();i&&e.append("text").text(r).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-n).attr("class",t)},"insertTitle"),R5=QH(e=>{if("number"==typeof e)return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function D5(e,t){return e5({},e,t)}QH(D5,"cleanAndMerge");var P5={assignWithDepth:pU,wrapLabel:T5,calculateTextHeight:C5,calculateTextWidth:S5,calculateTextDimensions:N5,cleanAndMerge:D5,detectInit:r5,detectDirective:i5,isSubstringInArray:o5,interpolateToCurve:s5,calcLabelPosition:d5,calcCardinalityPosition:g5,calcTerminalLabelPosition:m5,formatUrl:l5,getStylesFromArray:y5,generateId:b5,random:w5,runFunc:c5,entityDecode:O5,insertTitle:M5,parseFontSize:R5,InitIDGenerator:I5},$5=QH(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){const t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?"fl°°"+t+"¶ß":"fl°"+t+"¶ß"}),t},"encodeEntities"),B5=QH(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),F5=QH((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:""}${e}_${t}_${n}${i?`_${i}`:""}`,"getEdgeId");function z5(e){return e??null}function j5(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}QH(z5,"handleUndefinedAttr");var H5={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function U5(e){H5=e}var G5={exec:()=>null};function q5(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(W5.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var W5={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},V5=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Y5=/(?:[*+-]|\d{1,9}[.)])/,X5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,K5=q5(X5).replace(/bull/g,Y5).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Q5=q5(X5).replace(/bull/g,Y5).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Z5=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,J5=/(?!\s*\])(?:\\.|[^\[\]\\])+/,e6=q5(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",J5).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),t6=q5(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Y5).getRegex(),n6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",r6=/|$))/,i6=q5("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",r6).replace("tag",n6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),a6=q5(Z5).replace("hr",V5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",n6).getRegex(),o6={blockquote:q5(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",a6).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:e6,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:V5,html:i6,lheading:K5,list:t6,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:a6,table:G5,text:/^[^\n]+/},s6=q5("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",n6).getRegex(),l6={...o6,lheading:Q5,table:s6,paragraph:q5(Z5).replace("hr",V5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",s6).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",n6).getRegex()},c6={...o6,html:q5("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",r6).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G5,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q5(Z5).replace("hr",V5).replace("heading"," *#{1,6} *[^\n]").replace("lheading",K5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},u6=/^( {2,}|\\)\n(?!\s*$)/,h6=/[\p{P}\p{S}]/u,d6=/[\s\p{P}\p{S}]/u,p6=/[^\s\p{P}\p{S}]/u,f6=q5(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,d6).getRegex(),g6=/(?!~)[\p{P}\p{S}]/u,m6=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,y6=q5(m6,"u").replace(/punct/g,h6).getRegex(),v6=q5(m6,"u").replace(/punct/g,g6).getRegex(),b6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",x6=q5(b6,"gu").replace(/notPunctSpace/g,p6).replace(/punctSpace/g,d6).replace(/punct/g,h6).getRegex(),w6=q5(b6,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,g6).getRegex(),E6=q5("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,p6).replace(/punctSpace/g,d6).replace(/punct/g,h6).getRegex(),k6=q5(/\\(punct)/,"gu").replace(/punct/g,h6).getRegex(),T6=q5(/^<(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(),_6=q5(r6).replace("(?:--\x3e|$)","--\x3e").getRegex(),C6=q5("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",_6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),S6=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,A6=q5(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",S6).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N6=q5(/^!?\[(label)\]\[(ref)\]/).replace("label",S6).replace("ref",J5).getRegex(),I6=q5(/^!?\[(ref)\](?:\[\])?/).replace("ref",J5).getRegex(),O6={_backpedal:G5,anyPunctuation:k6,autolink:T6,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:u6,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:G5,emStrongLDelim:y6,emStrongRDelimAst:x6,emStrongRDelimUnd:E6,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:A6,nolink:I6,punctuation:f6,reflink:N6,reflinkSearch:q5("reflink|nolink(?!\\()","g").replace("reflink",N6).replace("nolink",I6).getRegex(),tag:C6,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},B6=e=>$6[e];function F6(e,t){if(t){if(W5.escapeTest.test(e))return e.replace(W5.escapeReplace,B6)}else if(W5.escapeTestNoEncode.test(e))return e.replace(W5.escapeReplaceNoEncode,B6);return e}function z6(e){try{e=encodeURI(e).replace(W5.percentDecode,"%")}catch{return null}return e}function j6(e,t){const n=e.replace(W5.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}),r=n.split(W5.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:H6(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const i=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=i.length?e.slice(i.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=H6(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:H6(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=H6(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const a=[];let o;for(o=0;o1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const a=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let n=!1,r="",s="";if(!(t=a.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),h=0;if(this.options.pedantic?(h=2,s=l.trimStart()):u?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,s=l.slice(h),h+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),a=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h);for(;e;){const d=e.split("\n",1)[0];let p;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(a.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=h||!c.trim())s+="\n"+p.slice(h);else{if(u)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(a.test(l))break;if(n.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),r+=d+"\n",e=e.substring(d.length+1),l=p.slice(h)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let d,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(d="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!p,checked:d,loose:!1,text:s,tokens:[]}),i.raw+=r}const s=i.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));i.loose=n}if(i.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=H6(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),U6(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return U6(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let i,a,o=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},q6=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||H5,this.options.tokenizer=this.options.tokenizer||new G6,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:W5,block:D6.normal,inline:P6.normal};this.options.pedantic?(t.block=D6.pedantic,t.inline=P6.pedantic):this.options.gfm&&(t.block=D6.gfm,this.options.breaks?t.inline=P6.breaks:t.inline=P6.gfm),this.tokenizer.rules=t}static get rules(){return{block:D6,inline:P6}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(W5.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const a=t.at(-1);n&&"paragraph"===a?.type?(a.raw+="\n"+r.raw,a.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){let r;if(i||(a=""),i=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(a=r.raw.slice(-1)),i=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},W6=class{options;parser;constructor(e){this.options=e||H5}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(W5.notSpaceStart)?.[0],i=e.replace(W5.endingNewline,"")+"\n";return r?'
'+(n?i:F6(i,!0))+"
\n":"
"+(n?i:F6(i,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+F6(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"
    \n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${F6(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=z6(e);if(null===i)return r;let a='
    ",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=z6(e);if(null===i)return F6(n);let a=`${n}{const i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new W6(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new G6(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new X6;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,i=e.hooks[r],a=t[r];X6.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));const n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q6.lex(e,t??this.defaults)}parser(e,t){return Y6.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const o=i.hooks?i.hooks.provideLexer():e?q6.lex:q6.lexInline,s=i.hooks?i.hooks.provideParser():e?Y6.parse:Y6.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+F6(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Q6(e,t){return K6.parse(e,t)}function Z6(e){for(var t=[],n=1;n/g,"\n").replace(/\n{2,}/g,"\n"));return!1===t?n.replace(/ /g," "):n}function e7(e,t={}){const n=J6(e,t),r=Q6.lexer(n),i=[[]];let a=0;function o(e,t="normal"){if("text"===e.type){e.text.split("\n").forEach((e,n)=>{0!==n&&(a++,i.push([])),e.split(" ").forEach(e=>{(e=e.replace(/'/g,"'"))&&i[a].push({content:e,type:t})})})}else"strong"===e.type||"em"===e.type?e.tokens.forEach(t=>{o(t,e.type)}):"html"===e.type&&i[a].push({content:e.text,type:"normal"})}return QH(o,"processNode"),r.forEach(e=>{"paragraph"===e.type?e.tokens?.forEach(e=>{o(e)}):"html"===e.type&&i[a].push({content:e.text,type:"normal"})}),i}function t7(e,{markdownAutoWrap:t}={}){const n=Q6.lexer(e);function r(e){return"text"===e.type?!1===t?e.text.replace(/\n */g,"
    ").replace(/ /g," "):e.text.replace(/\n */g,"
    "):"strong"===e.type?`${e.tokens?.map(r).join("")}`:"em"===e.type?`${e.tokens?.map(r).join("")}`:"paragraph"===e.type?`

    ${e.tokens?.map(r).join("")}

    `:"space"===e.type?"":"html"===e.type?`${e.text}`:"escape"===e.type?e.text:`Unsupported markdown: ${e.type}`}return QH(r,"output"),n.map(r).join("")}function n7(e){return Intl.Segmenter?[...(new Intl.Segmenter).segment(e)].map(e=>e.segment):[...e]}function r7(e,t){return i7(e,[],n7(t.content),t.type)}function i7(e,t,n,r){if(0===n.length)return[{content:t.join(""),type:r},{content:"",type:r}];const[i,...a]=n,o=[...t,i];return e([{content:o.join(""),type:r}])?i7(e,o,a,r):(0===t.length&&i&&(t.push(i),n.shift()),[{content:t.join(""),type:r},{content:n.join(""),type:r}])}function a7(e,t){if(e.some(({content:e})=>e.includes("\n")))throw new Error("splitLineToFitWidth does not support newlines in the line");return o7(e,t)}function o7(e,t,n=[],r=[]){if(0===e.length)return r.length>0&&n.push(r),n.length>0?n:[];let i="";" "===e[0].content&&(i=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},o=[...r];if(""!==i&&o.push({content:i,type:"normal"}),o.push(a),t(o))return o7(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){const[r,i]=r7(t,a);n.push([r]),i.content&&e.unshift(i)}return o7(e,t,n)}function s7(e,t){t&&e.attr("style",t)}async function l7(e,t,n,r,i=!1){const a=e.append("foreignObject");a.attr("width",10*n+"px"),a.attr("height",10*n+"px");const o=a.append("xhtml:div");let s=t.label;t.label&&xG(t.label)&&(s=await EG(t.label.replace(kG.lineBreakRegex,"\n"),WG()));const l=t.isNode?"nodeLabel":"edgeLabel",c=o.append("span");c.html(s),s7(c,t.labelStyle),c.attr("class",`${l} ${r}`),s7(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",n+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let u=o.node().getBoundingClientRect();return u.width===n&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",n+"px"),u=o.node().getBoundingClientRect()),a.node()}function c7(e,t,n){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*n-.1+"em").attr("dy",n+"em")}function u7(e,t,n){const r=e.append("text"),i=c7(r,1,t);p7(i,n);const a=i.node().getComputedTextLength();return r.remove(),a}function h7(e,t,n){const r=e.append("text"),i=c7(r,1,t);p7(i,[{content:n,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}function d7(e,t,n,r=!1){const i=t.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");let s=0;for(const t of n){const n=QH(t=>u7(i,1.1,t)<=e,"checkWidth"),r=n(t)?[t]:a7(t,n);for(const e of r){p7(c7(o,s,1.1),e),s++}}if(r){const e=o.node().getBBox(),t=2;return a.attr("x",e.x-t).attr("y",e.y-t).attr("width",e.width+2*t).attr("height",e.height+2*t),i.node()}return o.node()}function p7(e,t){e.text(""),t.forEach((t,n)=>{const r=e.append("tspan").attr("font-style","em"===t.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===t.type?"bold":"normal");0===n?r.text(t.content):r.text(" "+t.content)})}function f7(e){return e.replace(/fa[bklrs]?:fa-[\w-]+/g,e=>``)}Q6.options=Q6.setOptions=function(e){return K6.setOptions(e),Q6.defaults=K6.defaults,U5(Q6.defaults),Q6},Q6.getDefaults=j5,Q6.defaults=H5,Q6.use=function(...e){return K6.use(...e),Q6.defaults=K6.defaults,U5(Q6.defaults),Q6},Q6.walkTokens=function(e,t){return K6.walkTokens(e,t)},Q6.parseInline=K6.parseInline,Q6.Parser=Y6,Q6.parser=Y6.parse,Q6.Renderer=W6,Q6.TextRenderer=V6,Q6.Lexer=q6,Q6.lexer=q6.lex,Q6.Tokenizer=G6,Q6.Hooks=X6,Q6.parse=Q6,Q6.options,Q6.setOptions,Q6.use,Q6.walkTokens,Q6.parseInline,Y6.parse,q6.lex,QH(J6,"preprocessMarkdown"),QH(e7,"markdownToLines"),QH(t7,"markdownToHTML"),QH(n7,"splitTextToChars"),QH(r7,"splitWordToFitWidth"),QH(i7,"splitWordToFitWidthRecursion"),QH(a7,"splitLineToFitWidth"),QH(o7,"splitLineToFitWidthRecursion"),QH(s7,"applyStyle"),QH(l7,"addHtmlSpan"),QH(c7,"createTspan"),QH(u7,"computeWidthOfText"),QH(h7,"computeDimensionOfText"),QH(d7,"createFormattedText"),QH(p7,"updateTextContentAndStyles"),QH(f7,"replaceIconSubstring");var g7=QH(async(e,t="",{style:n="",isTitle:r=!1,classes:i="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:l=!1}={},c)=>{if(eU.debug("XYZ createText",t,n,r,i,a,o,"addSvgBackground: ",l),a){const r=t7(t,c),a=f7(B5(r)),u=t.replace(/\\\\/g,"\\"),h={isNode:o,label:xG(t)?u:a,labelStyle:n.replace("fill:","color:")};return await l7(e,h,s,i,l)}{const r=d7(s,e,e7(t.replace(//g,"
    ").replace("
    ","
    "),c),!!t&&l);if(o){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");EK(r).attr("style",e)}else{const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");EK(r).select("rect").attr("style",e.replace(/background:/g,"fill:"));const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");EK(r).select("text").attr("style",t)}return r}},"createText");function m7(e,t,n){if(e&&e.length){const[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(const t of e){const[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function y7(e,t){return e[0]===t[0]&&e[1]===t[1]}function v7(e,t,n,r=1){const i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&"number"==typeof e[0][0]?[e]:e,s=[0,0];if(i)for(const e of o)m7(e,s,i);const l=function(e,t,n){const r=[];for(const t of e){const e=[...t];y7(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}const i=[];t=Math.max(t,.1);const a=[];for(const e of r)for(let t=0;te.ymint.ymin?1:e.xt.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!a.length)return i;let o=[],s=a[0].ymin,l=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;ts);t++)e=t;a.splice(0,e+1).forEach(e=>{o.push({s:s,edge:e})})}if(o=o.filter(e=>!(e.edge.ymax<=s)),o.sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),(1!==n||l%t==0)&&o.length>1)for(let e=0;e=o.length)break;const n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach(e=>{e.edge.x=e.edge.x+n*e.edge.islope}),l++}return i}(o,a,r);if(i){for(const e of o)m7(e,s,-i);!function(e,t,n){const r=[];e.forEach(e=>r.push(...e)),m7(r,t,n)}(l,s,-i)}return l}function b7(e,t){var n;const r=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&((null===(n=t.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(a=i),v7(e,i,r,a||1)}class x7{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=b7(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}function w7(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class E7 extends x7{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=b7(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)w7([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(a,t)}}}class k7 extends x7{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}let T7=class{constructor(e){this.helper=e}fillPolygons(e,t){const n=b7(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const a=r/4;for(const o of e){const e=w7(o),s=e/r,l=Math.ceil(s)-1,c=e-l*r,u=(o[0][0]+o[1][0])/2-r/4,h=Math.min(o[0][1],o[1][1]);for(let e=0;e{const a=w7(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e{const i=w7(e),a=Math.round(i/(2*t));let o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);const l=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;er%2?e+n:e+t);a.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":a.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":a.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":a.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":a.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],a.push({key:"T",data:[t,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=r,n=i}return a}function M7(e){const t=[];let n="",r=0,i=0,a=0,o=0,s=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,i]=u,[a,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],i=u[5],s=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,i]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,i]});break;case"V":i=u[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,a=0;"C"===n||"S"===n?(e=r+(r-s),a=i+(i-l)):(e=r,a=i),t.push({key:"C",data:[e,a,...u]}),s=u[0],l=u[1],r=u[2],i=u[3];break}case"T":{const[e,a]=u;let o=0,c=0;"Q"===n||"T"===n?(o=r+(r-s),c=i+(i-l)):(o=r,c=i);const h=r+2*(o-r)/3,d=i+2*(c-i)/3,p=e+2*(o-e)/3,f=a+2*(c-a)/3;t.push({key:"C",data:[h,d,p,f,e,a]}),s=o,l=c,r=e,i=a;break}case"Q":{const[e,n,a,o]=u,c=r+2*(e-r)/3,h=i+2*(n-i)/3,d=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:"C",data:[c,h,d,p,a,o]}),s=e,l=n,r=a,i=o;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],l=u[5],c=u[6];0===e||0===n?(t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c):r===l&&i===c||(D7(r,i,l,c,e,n,a,o,s).forEach(function(e){t.push({key:"C",data:e})}),r=l,i=c);break}case"Z":t.push({key:"Z",data:[]}),r=a,i=o}n=c}return t}function R7(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function D7(e,t,n,r,i,a,o,s,l,c){const u=(h=o,Math.PI*h/180);var h;let d=[],p=0,f=0,g=0,m=0;if(c)[p,f,g,m]=c;else{[e,t]=R7(e,t,-u),[n,r]=R7(n,r,-u);const o=(e-n)/2,c=(t-r)/2;let h=o*o/(i*i)+c*c/(a*a);h>1&&(h=Math.sqrt(h),i*=h,a*=h);const d=i*i,y=a*a,v=d*y-d*c*c-y*o*o,b=d*c*c+y*o*o,x=(s===l?-1:1)*Math.sqrt(Math.abs(v/b));g=x*i*c/a+(e+n)/2,m=x*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-m)/a).toFixed(9))),f=Math.asin(parseFloat(((r-m)/a).toFixed(9))),ef&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let y=f-p;if(Math.abs(y)>120*Math.PI/180){const e=f,t=n,s=r;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=D7(n=g+i*Math.cos(f),r=m+a*Math.sin(f),t,s,i,a,o,0,l,[f,e,g,m])}y=f-p;const v=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),E=Math.tan(y/4),k=4/3*i*E,T=4/3*a*E,_=[e,t],C=[e+k*b,t-T*v],S=[n+k*w,r-T*x],A=[n,r];if(C[0]=2*_[0]-C[0],C[1]=2*_[1]-C[1],c)return[C,S,A].concat(d);{d=[C,S,A].concat(d);const e=[];for(let t=0;t2){const i=[];for(let t=0;t2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(f-p)/2),y=t8(m,c,u,h,d,p,f,1,l);if(!l.disableMultiStroke){const e=t8(m,c,u,h,d,p,f,1.5,l);y.push(...e)}return o&&(s?y.push(...K7(c,u,c+h*Math.cos(p),u+d*Math.sin(p),l),...K7(c,u,c+h*Math.cos(f),u+d*Math.sin(f),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(p),u+d*Math.sin(p)]})),{type:"path",ops:y}}function U7(e,t){const n=M7(L7(O7(e))),r=[];let i=[0,0],a=[0,0];for(const{key:e,data:o}of n)switch(e){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":r.push(...K7(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case"C":{const[e,n,i,s,l,c]=o;r.push(...n8(e,n,i,s,l,c,a,t)),a=[l,c];break}case"Z":r.push(...K7(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:r}}function G7(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+X7(e,t),r[0][1]+X7(e,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=l/10);const h=u/2,d=.2+.2*V7(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,f=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=X7(p,i,c),f=X7(f,i,c);const g=[],m=()=>X7(h,i,c),y=()=>X7(u,i,c),v=i.preserveVertices;return o?g.push({op:"move",data:[e+(v?0:m()),t+(v?0:m())]}):g.push({op:"move",data:[e+(v?0:X7(u,i,c)),t+(v?0:X7(u,i,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*d+m(),f+t+(r-t)*d+m(),p+e+2*(n-e)*d+m(),f+t+2*(r-t)*d+m(),n+(v?0:m()),r+(v?0:m())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*d+y(),f+t+(r-t)*d+y(),p+e+2*(n-e)*d+y(),f+t+2*(r-t)*d+y(),n+(v?0:y()),r+(v?0:y())]}),g}function Z7(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+X7(t,n),e[0][1]+X7(t,n)]),r.push([e[0][0]+X7(t,n),e[0][1]+X7(t,n)]);for(let i=1;i3){const t=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&i.push(n)):i.push(n),i.push(e[t+3])}else{const r=.5,a=e[t+0],o=e[t+1],s=e[t+2],l=e[t+3],c=s8(a,o,r),u=s8(o,s,r),h=s8(s,l,r),d=s8(c,u,r),p=s8(u,h,r),f=s8(d,p,r);l8([a,c,d,f],0,n,i),l8([f,p,h,l],0,n,i)}var a,o;return i}function c8(e,t){return u8(e,0,e.length,t)}function u8(e,t,n,r,i){const a=i||[],o=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;rl&&(l=t,c=r)}return Math.sqrt(l)>r?(u8(e,t,c+1,r,a),u8(e,c,n,r,a)):(a.length||a.push(o),a.push(s)),a}function h8(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n0?u8(r,0,r.length,n):r}const d8="none";class p8{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const a=this._o(i);return this._d("line",[$7(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){const a=this._o(i),o=[],s=function(e,t,n,r,i){return function(e,t){return B7(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}(e,t,n,r,a);if(a.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===a.fillStyle?o.push(G7([i],a)):o.push(q7([i],a))}return a.stroke!==d8&&o.push(s),this._d("rectangle",o,a)}ellipse(e,t,n,r,i){const a=this._o(i),o=[],s=z7(n,r,a),l=j7(e,t,a,s);if(a.fill)if("solid"===a.fillStyle){const n=j7(e,t,a,s).opset;n.type="fillPath",o.push(n)}else o.push(q7([l.estimatedPoints],a));return a.stroke!==d8&&o.push(l.opset),this._d("ellipse",o,a)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[B7(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){const l=this._o(s),c=[],u=H7(e,t,n,r,i,a,o,!0,l);if(o&&l.fill)if("solid"===l.fillStyle){const o=Object.assign({},l);o.disableMultiStroke=!0;const s=H7(e,t,n,r,i,a,!0,!1,o);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,a,o){const s=e,l=t;let c=Math.abs(n/2),u=Math.abs(r/2);c+=X7(.01*c,o),u+=X7(.01*u,o);let h=i,d=a;for(;h<0;)h+=2*Math.PI,d+=2*Math.PI;d-h>2*Math.PI&&(h=0,d=2*Math.PI);const p=(d-h)/o.curveStepCount,f=[];for(let e=h;e<=d;e+=p)f.push([s+c*Math.cos(e),l+u*Math.sin(e)]);return f.push([s+c*Math.cos(d),l+u*Math.sin(d)]),f.push([s,l]),q7([f],o)}(e,t,n,r,i,a,l));return l.stroke!==d8&&c.push(u),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=F7(e,n);if(n.fill&&n.fill!==d8)if("solid"===n.fillStyle){const t=F7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(t.ops)})}else{const t=[],i=e;if(i.length){const e="number"==typeof i[0][0]?[i]:i;for(const r of e)r.length<3?t.push(...r):3===r.length?t.push(...h8(i8([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...h8(i8(r),10,(1+n.roughness)/2))}t.length&&r.push(q7([t],n))}return n.stroke!==d8&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=B7(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(G7([e],n)):r.push(q7([e],n))),n.stroke!==d8&&r.push(i),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==d8,a=n.stroke!==d8,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=M7(L7(O7(e))),i=[];let a=[],o=[0,0],s=[];const l=()=>{s.length>=4&&a.push(...h8(s,1)),s=[]},c=()=>{l(),a.length&&(i.push(a),a=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),o=[t[0],t[1]],a.push(o);break;case"L":l(),a.push([t[0],t[1]]);break;case"C":if(!s.length){const e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),a.push([o[0],o[1]])}if(c(),!n)return i;const u=[];for(const e of i){const t=c8(e,n);t.length&&u.push(t)}return u}(e,0,o?4-4*(n.simplification||1):(1+n.roughness)/2),l=U7(e,n);if(i)if("solid"===n.fillStyle)if(1===s.length){const t=U7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(t.ops)})}else r.push(G7(s,n));else r.push(q7(s,n));return a&&(o?s.forEach(e=>{r.push(B7(e,!1,n))}):r.push(l)),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map(e=>+e.toFixed(t)):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:d8};break;case"fillPath":t={d:this.opsToPath(e),stroke:d8,strokeWidth:0,fill:n.fill||d8};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||d8,strokeWidth:n,fill:d8}}_mergedShape(e){return e.filter((e,t)=>0===t||"move"!==e.op)}}const f8="http://www.w3.org/2000/svg";class g8{constructor(e,t){this.svg=e,this.gen=new p8(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(f8,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of t){let t=null;switch(o.type){case"path":t=r.createElementNS(f8,"path"),t.setAttribute("d",this.opsToPath(o,a)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(f8,"path"),t.setAttribute("d",this.opsToPath(o,a)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(f8,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){const a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){const a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){const l=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}var m8=(e,t)=>new g8(e,t),y8=QH(async(e,t,n)=>{let r;const i=t.useHtmlLabels||hG(WG()?.htmlLabels);r=n||"node default";const a=e.insert("g").attr("class",r).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",z5(t.labelStyle));let s;s=void 0===t.label?"":"string"==typeof t.label?t.label:t.label[0];const l=await g7(o,iG(B5(s),WG()),{useHtmlLabels:i,width:t.width||WG().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let c=l.getBBox();const u=(t?.padding??0)/2;if(i){const e=l.children[0],t=EK(l),n=e.getElementsByTagName("img");if(n){const e=""===s.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=WG().fontSize?WG().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[r=OU.fontSize]=R5(e),i=r*n+"px";t.style.minWidth=i,t.style.maxWidth=i}else t.style.width="100%";n(t)}QH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}return i?o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):o.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:c,halfPadding:u,label:o}},"labelHelper"),v8=QH(async(e,t,n)=>{const r=n.useHtmlLabels||hG(WG()?.flowchart?.htmlLabels),i=e.insert("g").attr("class","label").attr("style",n.labelStyle||""),a=await g7(i,iG(B5(t),WG()),{useHtmlLabels:r,width:n.width||WG()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img});let o=a.getBBox();const s=n.padding/2;if(hG(WG()?.flowchart?.htmlLabels)){const e=a.children[0],t=EK(a);o=e.getBoundingClientRect(),t.attr("width",o.width),t.attr("height",o.height)}return r?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),n.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:o,halfPadding:s,label:i}},"insertLabel"),b8=QH((e,t)=>{const n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),x8=QH((e,t)=>("handDrawn"===e.look?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function w8(e){const t=e.map((e,t)=>`${0===t?"M":"L"}${e.x},${e.y}`);return t.push("Z"),t.join(" ")}function E8(e,t,n,r,i,a){const o=[],s=n-e,l=r-t,c=s/a,u=2*Math.PI/c,h=t+l/2;for(let t=0;t<=50;t++){const n=e+t/50*s,r=h+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}function k8(e,t,n,r,i,a){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i{var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=0===s?0:c*o/s,r=c):(o<0&&(l=-l),n=l,r=0===o?0:l*s/o),{x:i+n,y:a+r}},"intersectRect"),_8=T8;function C8(e,t){t&&e.attr("style",t)}async function S8(e){const t=EK(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=t.append("xhtml:div");let r=e.label;e.label&&xG(e.label)&&(r=await EG(e.label.replace(kG.lineBreakRegex,"\n"),WG()));const i=e.isNode?"nodeLabel":"edgeLabel";return n.html('"+r+""),C8(n,e.labelStyle),n.style("display","inline-block"),n.style("padding-right","1px"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}QH(C8,"applyStyle"),QH(S8,"addHtmlLabel");var A8=QH(async(e,t,n,r)=>{let i=e||"";if("object"==typeof i&&(i=i[0]),hG(WG().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),eU.info("vertexText"+i);const e={isNode:r,label:B5(i).replace(/fa[blrs]?:fa-[\w-]+/g,e=>``),labelStyle:t?t.replace("fill:","color:"):t};return await S8(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",t.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const t of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)}return e}},"createLabel"),N8=A8,I8=QH((e,t,n,r,i)=>["M",e+i,t,"H",e+n-i,"A",i,i,0,0,1,e+n,t+i,"V",t+r-i,"A",i,i,0,0,1,e+n-i,t+r,"H",e+i,"A",i,i,0,0,1,e,t+r-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD"),O8=QH(e=>{const{handDrawnSeed:t}=WG();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),L8=QH(e=>{const t=M8([...e.cssCompiledStyles||[],...e.cssStyles||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),M8=QH(e=>{const t=new Map;return e.forEach(e=>{const[n,r]=e.split(":");t.set(n.trim(),r?.trim())}),t},"styles2Map"),R8=QH(e=>"color"===e||"font-size"===e||"font-family"===e||"font-weight"===e||"font-style"===e||"text-decoration"===e||"text-align"===e||"text-transform"===e||"line-height"===e||"letter-spacing"===e||"word-spacing"===e||"text-shadow"===e||"text-overflow"===e||"white-space"===e||"word-wrap"===e||"word-break"===e||"overflow-wrap"===e||"hyphens"===e,"isLabelStyle"),D8=QH(e=>{const{stylesArray:t}=L8(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{const t=e[0];R8(t)?n.push(e.join(":")+" !important"):(r.push(e.join(":")+" !important"),t.includes("stroke")&&i.push(e.join(":")+" !important"),"fill"===t&&a.push(e.join(":")+" !important"))}),{labelStyles:n.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),P8=QH((e,t)=>{const{themeVariables:n,handDrawnSeed:r}=WG(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:o}=L8(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:r,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},t)},"userNodeOverrides"),$8=QH(async(e,t)=>{eU.info("Creating subgraph rect for ",t.id,t);const n=WG(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:u}=D8(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=hG(n.flowchart.htmlLabels),p=h.insert("g").attr("class","cluster-label "),f=await g7(p,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0});let g=f.getBBox();if(hG(n.flowchart.htmlLabels)){const e=f.children[0],t=EK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,v=t.x-m/2,b=t.y-y/2;let x;if(eU.trace("Data ",t,JSON.stringify(t)),"handDrawn"===t.look){const e=m8(h),n=P8(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),r=e.path(I8(v,b,m,y,0),n);x=h.insert(()=>(eU.debug("Rough node insert CXC",r),r),":first-child"),x.select("path:nth-child(2)").attr("style",c.join(";")),x.select("path").attr("style",u.join(";").replace("fill","stroke"))}else x=h.insert("rect",":first-child"),x.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",v).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=oY(n);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){const e=p.select("span");e&&e.attr("style",s)}const E=x.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return _8(t,e)},{cluster:h,labelBBox:g}},"rect"),B8=QH((e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return _8(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},"noteGroup"),F8=QH(async(e,t)=>{const n=WG(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:l}=r,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),u=c.insert("g",":first-child"),h=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const p=h.node().appendChild(await N8(t.label,t.labelStyle,void 0,!0));let f=p.getBBox();if(hG(n.flowchart.htmlLabels)){const e=p.children[0],t=EK(p);f=e.getBoundingClientRect(),t.attr("width",f.width),t.attr("height",f.height)}const g=0*t.padding,m=g/2,y=(t.width<=f.width+t.padding?f.width+t.padding:t.width)+g;t.width<=f.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const v=t.height+g,b=t.height+g-f.height-6,x=t.x-y/2,w=t.y-v/2;t.width=y;const E=t.y-t.height/2-m+f.height+2;let k;if("handDrawn"===t.look){const e=t.cssClasses.includes("statediagram-cluster-alt"),n=m8(c),r=t.rx||t.ry?n.path(I8(x,w,y,v,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):n.rectangle(x,w,y,v,{seed:i});k=c.insert(()=>r,":first-child");const u=n.rectangle(x,E,y,b,{fill:e?a:o,fillStyle:e?"hachure":"solid",stroke:l,seed:i});k=c.insert(()=>r,":first-child"),d=c.insert(()=>u)}else{k=u.insert("rect",":first-child");const e="outer";k.attr("class",e).attr("x",x).attr("y",w).attr("width",y).attr("height",v).attr("data-look",t.look),d.attr("class","inner").attr("x",x).attr("y",E).attr("width",y).attr("height",b)}h.attr("transform",`translate(${t.x-f.width/2}, ${w+1-(hG(n.flowchart.htmlLabels)?0:3)})`);const T=k.node().getBBox();return t.height=T.height,t.offsetX=0,t.offsetY=f.height-t.padding/2,t.labelBBox=f,t.intersect=function(e){return _8(t,e)},{cluster:c,labelBBox:f}},"roundedWithTitle"),z8=QH(async(e,t)=>{eU.info("Creating subgraph rect for ",t.id,t);const n=WG(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:u}=D8(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=hG(n.flowchart.htmlLabels),p=h.insert("g").attr("class","cluster-label "),f=await g7(p,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width});let g=f.getBBox();if(hG(n.flowchart.htmlLabels)){const e=f.children[0],t=EK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,v=t.x-m/2,b=t.y-y/2;let x;if(eU.trace("Data ",t,JSON.stringify(t)),"handDrawn"===t.look){const e=m8(h),n=P8(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),r=e.path(I8(v,b,m,y,t.rx),n);x=h.insert(()=>(eU.debug("Rough node insert CXC",r),r),":first-child"),x.select("path:nth-child(2)").attr("style",c.join(";")),x.select("path").attr("style",u.join(";").replace("fill","stroke"))}else x=h.insert("rect",":first-child"),x.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",v).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=oY(n);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){const e=p.select("span");e&&e.attr("style",s)}const E=x.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return _8(t,e)},{cluster:h,labelBBox:g}},"kanbanSection"),j8=QH((e,t)=>{const n=WG(),{themeVariables:r,handDrawnSeed:i}=n,{nodeBorder:a}=r,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),s=o.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const u=t.height+l,h=t.x-c/2,d=t.y-u/2;let p;if(t.width=c,"handDrawn"===t.look){const e=m8(o).rectangle(h,d,c,u,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=o.insert(()=>e,":first-child")}else{p=s.insert("rect",":first-child");const e="divider";p.attr("class",e).attr("x",h).attr("y",d).attr("width",c).attr("height",u).attr("data-look",t.look)}const f=p.node().getBBox();return t.height=f.height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return _8(t,e)},{cluster:o,labelBBox:{}}},"divider"),H8={rect:$8,squareRect:$8,roundedWithTitle:F8,noteGroup:B8,divider:j8,kanbanSection:z8},U8=new Map,G8=QH(async(e,t)=>{const n=t.shape||"rect",r=await H8[n](e,t);return U8.set(t.id,r),r},"insertCluster"),q8=QH(()=>{U8=new Map},"clear");function W8(e,t){return e.intersect(t)}QH(W8,"intersectNode");var V8=W8;function Y8(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,l=Math.sqrt(t*t*s*s+n*n*o*o),c=Math.abs(t*n*o/l);r.x0}QH(Z8,"intersectLine"),QH(J8,"sameSign");var e9=Z8;function t9(e,t,n){let r=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof t.forEach?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let l=r-e.width/2-o,c=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,l=Math.sqrt(o*o+s*s);return ac,":first-child");return u.attr("class","anchor").attr("style",z5(o)),b8(t,u),t.intersect=function(e){return eU.info("Circle intersect",t,1,e),n9.circle(t,1,e)},a}function i9(e,t,n,r,i,a,o){const s=(e+n)/2,l=(t+r)/2,c=Math.atan2(r-t,n-e),u=(n-e)/2/i,h=(r-t)/2/a,d=Math.sqrt(u**2+h**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),f=s+p*a*Math.sin(c)*(o?-1:1),g=l-p*i*Math.cos(c)*(o?-1:1),m=Math.atan2((t-g)/a,(e-f)/i);let y=Math.atan2((r-g)/a,(n-f)/i)-m;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);const v=[];for(let e=0;e<20;e++){const t=m+e/19*y,n=f+i*Math.cos(t),r=g+a*Math.sin(t);v.push({x:n,y:r})}return v}async function a9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.width+t.padding+20,s=a.height+t.padding,l=s/2,c=l/(2.5+s/50),{cssStyles:u}=t,h=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...i9(-o/2,-s/2,-o/2,s/2,c,l,!1),{x:o/2,y:s/2},...i9(o/2,s/2,o/2,-s/2,c,l,!0)],d=m8(i),p=P8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=w8(h),g=d.path(f,p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${c/2}, 0)`),b8(t,m),t.intersect=function(e){return n9.polygon(t,h,e)},i}function o9(e,t,n,r){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+n/2+")")}async function s9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.height+t.padding,s=a.width+t.padding+12,l=-o,c=[{x:12,y:l},{x:s,y:l},{x:s,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let u;const{cssStyles:h}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=w8(c),a=e.path(r,n);u=i.insert(()=>a,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=o9(i,s,o,c);return r&&u.attr("style",r),b8(t,u),t.intersect=function(e){return n9.polygon(t,c,e)},i}function l9(e,t){const{nodeStyles:n}=D8(t);t.label="";const r=e.insert("g").attr("class",x8(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=m8(r),l=P8(t,{});"handDrawn"!==t.look&&(l.roughness=0,l.fillStyle="solid");const c=w8(o),u=s.path(c,l),h=r.insert(()=>u,":first-child");return i&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",i),n&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",n),t.width=28,t.height=28,t.intersect=function(e){return n9.polygon(t,o,e)},r}async function c9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:o}=await y8(e,t,x8(t)),s=a.width/2+o;let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=e.circle(0,0,2*s,n);l=i.insert(()=>r,":first-child"),l.attr("class","basic label-container").attr("style",z5(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",s).attr("cx",0).attr("cy",0);return b8(t,l),t.intersect=function(e){return eU.info("Circle intersect",t,s,e),n9.circle(t,s,e)},i}function u9(e){const t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=2*e;return`M ${-r/2*t},${r/2*n} L ${r/2*t},${-r/2*n}\n M ${r/2*t},${r/2*n} L ${-r/2*t},${-r/2*n}`}function h9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n,t.label="";const i=e.insert("g").attr("class",x8(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=m8(i),l=P8(t,{});"handDrawn"!==t.look&&(l.roughness=0,l.fillStyle="solid");const c=s.circle(0,0,2*a,l),u=u9(a),h=s.path(u,l),d=i.insert(()=>c,":first-child");return d.insert(()=>h),o&&"handDrawn"!==t.look&&d.selectAll("path").attr("style",o),r&&"handDrawn"!==t.look&&d.selectAll("path").attr("style",r),b8(t,d),t.intersect=function(e){eU.info("crossedCircle intersect",t,{radius:a,point:e});return n9.circle(t,a,e)},i}function d9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iv,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),u&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${c}, 0)`),o.attr("transform",`translate(${-s/2+c-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),b8(t,b),t.intersect=function(e){return n9.polygon(t,d,e)},i}function f9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iv,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),u&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${-c}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),b8(t,b),t.intersect=function(e){return n9.polygon(t,d,e)},i}function m9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iw,":first-child").attr("stroke-opacity",0),E.insert(()=>y,":first-child"),E.insert(()=>b,":first-child"),E.attr("class","text"),u&&"handDrawn"!==t.look&&E.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&E.selectAll("path").attr("style",r),E.attr("transform",`translate(${c-c/4}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),b8(t,E),t.intersect=function(e){return n9.polygon(t,p,e)},i}async function v9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(80,1.25*(a.width+2*(t.padding??0)),t?.width??0),s=Math.max(20,a.height+2*(t.padding??0),t?.height??0),l=s/2,{cssStyles:c}=t,u=m8(i),h=P8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=o-l,p=s/4,f=[{x:d,y:0},{x:p,y:0},{x:0,y:s/2},{x:p,y:s},{x:d,y:s},...k8(-d,-s/2,l,50,270,90)],g=w8(f),m=u.path(g,h),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",c),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(${-o/2}, ${-s/2})`),b8(t,y),t.intersect=function(e){return n9.polygon(t,f,e)},i}QH(r9,"anchor"),QH(i9,"generateArcPoints"),QH(a9,"bowTieRect"),QH(o9,"insertPolygonShape"),QH(s9,"card"),QH(l9,"choice"),QH(c9,"circle"),QH(u9,"createLine"),QH(h9,"crossedCircle"),QH(d9,"generateCirclePoints"),QH(p9,"curlyBraceLeft"),QH(f9,"generateCirclePoints"),QH(g9,"curlyBraceRight"),QH(m9,"generateCirclePoints"),QH(y9,"curlyBraces"),QH(v9,"curvedTrapezoid");var b9=QH((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" "),"createCylinderPathD"),x9=QH((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" "),"createOuterCylinderPathD"),w9=QH((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createInnerCylinderPathD");async function E9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+t.padding,t.width??0),l=s/2,c=l/(2.5+s/50),u=Math.max(a.height+c+t.padding,t.height??0);let h;const{cssStyles:d}=t;if("handDrawn"===t.look){const e=m8(i),n=x9(0,0,s,u,l,c),r=w9(0,c,s,u,l,c),a=e.path(n,P8(t,{})),o=e.path(r,P8(t,{fill:"none"}));h=i.insert(()=>o,":first-child"),h=i.insert(()=>a,":first-child"),h.attr("class","basic label-container"),d&&h.attr("style",d)}else{const e=b9(0,0,s,u,l,c);h=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",z5(d)).attr("style",r)}return h.attr("label-offset-y",c),h.attr("transform",`translate(${-s/2}, ${-(u/2+c)})`),b8(t,h),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(e){const n=n9.rect(t,e),r=n.x-(t.x??0);if(0!=l&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}async function k9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=a.width+t.padding,l=a.height+t.padding,c=.2*l,u=-s/2,h=-l/2-c/2,{cssStyles:d}=t,p=m8(i),f=P8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=[{x:u,y:h+c},{x:-u,y:h+c},{x:-u,y:-h},{x:u,y:-h},{x:u,y:h},{x:-u,y:h},{x:-u,y:h+c}],m=p.polygon(g.map(e=>[e.x,e.y]),f),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",d),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${u+(t.padding??0)/2-(a.x-(a.left??0))}, ${h+c+(t.padding??0)/2-(a.y-(a.top??0))})`),b8(t,y),t.intersect=function(e){return n9.rect(t,e)},i}async function T9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:o}=await y8(e,t,x8(t)),s=a.width/2+o+5,l=a.width/2+o;let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{roughness:.2,strokeWidth:2.5}),r=P8(t,{roughness:.2,strokeWidth:1.5}),a=e.circle(0,0,2*s,n),o=e.circle(0,0,2*l,r);c=i.insert("g",":first-child"),c.attr("class",z5(t.cssClasses)).attr("style",z5(u)),c.node()?.appendChild(a),c.node()?.appendChild(o)}else{c=i.insert("g",":first-child");const e=c.insert("circle",":first-child"),t=c.insert("circle");c.attr("class","basic label-container").attr("style",r),e.attr("class","outer-circle").attr("style",r).attr("r",s).attr("cx",0).attr("cy",0),t.attr("class","inner-circle").attr("style",r).attr("r",l).attr("cx",0).attr("cy",0)}return b8(t,c),t.intersect=function(e){return eU.info("DoubleCircle intersect",t,s,e),n9.circle(t,s,e)},i}function _9(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=D8(t);t.label="",t.labelStyle=r;const a=e.insert("g").attr("class",x8(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=m8(a),{nodeBorder:l}=n,c=P8(t,{fillStyle:"solid"});"handDrawn"!==t.look&&(c.roughness=0);const u=s.circle(0,0,14,c),h=a.insert(()=>u,":first-child");return h.selectAll("path").attr("style",`fill: ${l} !important;`),o&&o.length>0&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",o),i&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",i),b8(t,h),t.intersect=function(e){eU.info("filledCircle intersect",t,{radius:7,point:e});return n9.circle(t,7,e)},a}async function C9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=a.width+(t.padding??0),l=s+a.height,c=s+a.height,u=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:h}=t,d=m8(i),p=P8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=w8(u),g=d.path(f,p),m=i.insert(()=>g,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return h&&"handDrawn"!==t.look&&m.selectChildren("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectChildren("path").attr("style",r),t.width=s,t.height=l,b8(t,m),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(e){return eU.info("Triangle intersect",t,u,e),n9.polygon(t,u,e)},i}function S9(e,t,{dir:n,config:{state:r,themeVariables:i}}){const{nodeStyles:a}=D8(t);t.label="";const o=e.insert("g").attr("class",x8(t)).attr("id",t.domId??t.id),{cssStyles:s}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);"LR"===n&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const u=-1*l/2,h=-1*c/2,d=m8(o),p=P8(t,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=d.rectangle(u,h,l,c,p),g=o.insert(()=>f,":first-child");s&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",s),a&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",a),b8(t,g);const m=r?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(e){return n9.rect(t,e)},o}async function A9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(80,a.width+2*(t.padding??0),t?.width??0),s=Math.max(50,a.height+2*(t.padding??0),t?.height??0),l=s/2,{cssStyles:c}=t,u=m8(i),h=P8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=[{x:-o/2,y:-s/2},{x:o/2-l,y:-s/2},...k8(-o/2+l,0,l,50,90,270),{x:o/2-l,y:s/2},{x:-o/2,y:s/2}],p=w8(d),f=u.path(p,h),g=i.insert(()=>f,":first-child");return g.attr("class","basic label-container"),c&&"handDrawn"!==t.look&&g.selectChildren("path").attr("style",c),r&&"handDrawn"!==t.look&&g.selectChildren("path").attr("style",r),b8(t,g),t.intersect=function(e){eU.info("Pill intersect",t,{radius:l,point:e});return n9.polygon(t,d,e)},i}QH(E9,"cylinder"),QH(k9,"dividedRectangle"),QH(T9,"doublecircle"),QH(_9,"filledCircle"),QH(C9,"flippedTriangle"),QH(S9,"forkJoin"),QH(A9,"halfRoundedRectangle");var N9=QH((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createHexagonPathD");async function I9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.height+t.padding,s=o/4,l=a.width+2*s+t.padding,c=[{x:s,y:0},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:s,y:-o},{x:0,y:-o/2}];let u;const{cssStyles:h}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=N9(0,0,l,o,s),a=e.path(r,n);u=i.insert(()=>a,":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),h&&u.attr("style",h)}else u=o9(i,l,o,c);return r&&u.attr("style",r),t.width=l,t.height=o,b8(t,u),t.intersect=function(e){return n9.polygon(t,c,e)},i}async function O9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.label="",t.labelStyle=n;const{shapeSvg:i}=await y8(e,t,x8(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,l=m8(i),c=P8(t,{});"handDrawn"!==t.look&&(c.roughness=0,c.fillStyle="solid");const u=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],h=w8(u),d=l.path(h,c),p=i.insert(()=>d,":first-child");return p.attr("class","basic label-container"),s&&"handDrawn"!==t.look&&p.selectChildren("path").attr("style",s),r&&"handDrawn"!==t.look&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-a/2}, ${-o/2})`),b8(t,p),t.intersect=function(e){eU.info("Pill intersect",t,{points:u});return n9.polygon(t,u,e)},i}async function L9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=D8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,label:h}=await y8(e,t,"icon-shape default"),d="t"===t.pos,p=s,f=s,{nodeBorder:g}=n,{stylesMap:m}=L8(t),y=-f/2,v=-p/2,b=t.label?8:0,x=m8(c),w=P8(t,{stroke:"none",fill:"none"});"handDrawn"!==t.look&&(w.roughness=0,w.fillStyle="solid");const E=x.rectangle(y,v,f,p,w),k=Math.max(f,u.width),T=p+u.height+b,_=x.rectangle(-k/2,-T/2,k,T,{...w,fill:"transparent",stroke:"none"}),C=c.insert(()=>E,":first-child"),S=c.insert(()=>_);if(t.icon){const e=c.append("g");e.html(`${await AY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${d?u.height/2+b/2-i/2-o:-u.height/2-b/2-i/2-o})`),e.attr("style",`color: ${m.get("stroke")??g};`)}return h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${d?-T/2:T/2-u.height})`),C.attr("transform",`translate(0,${d?u.height/2+b/2:-u.height/2-b/2})`),b8(t,S),t.intersect=function(e){if(eU.info("iconSquare intersect",t,e),!t.label)return n9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=d?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+b},{x:n+f/2,y:r-i/2+u.height+b},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+u.height+b},{x:n-u.width/2,y:r-i/2+u.height+b}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+p},{x:n+u.width/2,y:r-i/2+p},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+p},{x:n-f/2,y:r-i/2+p}];return n9.polygon(t,a,e)},c}async function M9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=D8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,label:h}=await y8(e,t,"icon-shape default"),d=t.label?8:0,p="t"===t.pos,{nodeBorder:f,mainBkg:g}=n,{stylesMap:m}=L8(t),y=m8(c),v=P8(t,{});"handDrawn"!==t.look&&(v.roughness=0,v.fillStyle="solid");const b=m.get("fill");v.stroke=b??g;const x=c.append("g");t.icon&&x.html(`${await AY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const w=x.node().getBBox(),E=w.width,k=w.height,T=w.x,_=w.y,C=Math.max(E,k)*Math.SQRT2+40,S=y.circle(0,0,C,v),A=Math.max(C,u.width),N=C+u.height+d,I=y.rectangle(-A/2,-N/2,A,N,{...v,fill:"transparent",stroke:"none"}),O=c.insert(()=>S,":first-child"),L=c.insert(()=>I);return x.attr("transform",`translate(${-E/2-T},${p?u.height/2+d/2-k/2-_:-u.height/2-d/2-k/2-_})`),x.attr("style",`color: ${m.get("stroke")??f};`),h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-N/2:N/2-u.height})`),O.attr("transform",`translate(0,${p?u.height/2+d/2:-u.height/2-d/2})`),b8(t,L),t.intersect=function(e){eU.info("iconSquare intersect",t,e);return n9.rect(t,e)},c}async function R9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=D8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:d}=await y8(e,t,"icon-shape default"),p="t"===t.pos,f=s+2*h,g=s+2*h,{nodeBorder:m,mainBkg:y}=n,{stylesMap:v}=L8(t),b=-g/2,x=-f/2,w=t.label?8:0,E=m8(c),k=P8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=v.get("fill");k.stroke=T??y;const _=E.path(I8(b,x,g,f,5),k),C=Math.max(g,u.width),S=f+u.height+w,A=E.rectangle(-C/2,-S/2,C,S,{...k,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child").attr("class","icon-shape2"),I=c.insert(()=>A);if(t.icon){const e=c.append("g");e.html(`${await AY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${p?u.height/2+w/2-i/2-o:-u.height/2-w/2-i/2-o})`),e.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-S/2:S/2-u.height})`),N.attr("transform",`translate(0,${p?u.height/2+w/2:-u.height/2-w/2})`),b8(t,I),t.intersect=function(e){if(eU.info("iconSquare intersect",t,e),!t.label)return n9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+w},{x:n+g/2,y:r-i/2+u.height+w},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+u.height+w},{x:n-u.width/2,y:r-i/2+u.height+w}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+f},{x:n+u.width/2,y:r-i/2+f},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+f},{x:n-g/2,y:r-i/2+f}];return n9.polygon(t,a,e)},c}async function D9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=D8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:d}=await y8(e,t,"icon-shape default"),p="t"===t.pos,f=s+2*h,g=s+2*h,{nodeBorder:m,mainBkg:y}=n,{stylesMap:v}=L8(t),b=-g/2,x=-f/2,w=t.label?8:0,E=m8(c),k=P8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=v.get("fill");k.stroke=T??y;const _=E.path(I8(b,x,g,f,.1),k),C=Math.max(g,u.width),S=f+u.height+w,A=E.rectangle(-C/2,-S/2,C,S,{...k,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child"),I=c.insert(()=>A);if(t.icon){const e=c.append("g");e.html(`${await AY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${p?u.height/2+w/2-i/2-o:-u.height/2-w/2-i/2-o})`),e.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-S/2:S/2-u.height})`),N.attr("transform",`translate(0,${p?u.height/2+w/2:-u.height/2-w/2})`),b8(t,I),t.intersect=function(e){if(eU.info("iconSquare intersect",t,e),!t.label)return n9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+w},{x:n+g/2,y:r-i/2+u.height+w},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+u.height+w},{x:n-u.width/2,y:r-i/2+u.height+w}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+f},{x:n+u.width/2,y:r-i/2+f},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+f},{x:n-g/2,y:r-i/2+f}];return n9.polygon(t,a,e)},c}async function P9(e,t,{config:{flowchart:n}}){const r=new Image;r.src=t?.img??"",await r.decode();const i=Number(r.naturalWidth.toString().replace("px","")),a=Number(r.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;const{labelStyles:o}=D8(t);t.labelStyle=o;const s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;const l=Math.max(t.label?s??0:0,t?.assetWidth??i),c="on"===t.constraint&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,u="on"===t.constraint?c/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(c,s??0);const{shapeSvg:h,bbox:d,label:p}=await y8(e,t,"image-shape default"),f="t"===t.pos,g=-c/2,m=-u/2,y=t.label?8:0,v=m8(h),b=P8(t,{});"handDrawn"!==t.look&&(b.roughness=0,b.fillStyle="solid");const x=v.rectangle(g,m,c,u,b),w=Math.max(c,d.width),E=u+d.height+y,k=v.rectangle(-w/2,-E/2,w,E,{...b,fill:"none",stroke:"none"}),T=h.insert(()=>x,":first-child"),_=h.insert(()=>k);if(t.img){const e=h.append("image");e.attr("href",t.img),e.attr("width",c),e.attr("height",u),e.attr("preserveAspectRatio","none"),e.attr("transform",`translate(${-c/2},${f?E/2-u:-E/2})`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${f?-u/2-d.height/2-y/2:u/2-d.height/2+y/2})`),T.attr("transform",`translate(0,${f?d.height/2+y/2:-d.height/2-y/2})`),b8(t,_),t.intersect=function(e){if(eU.info("iconSquare intersect",t,e),!t.label)return n9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=f?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+y},{x:n+c/2,y:r-i/2+d.height+y},{x:n+c/2,y:r+i/2},{x:n-c/2,y:r+i/2},{x:n-c/2,y:r-i/2+d.height+y},{x:n-d.width/2,y:r-i/2+d.height+y}]:[{x:n-c/2,y:r-i/2},{x:n+c/2,y:r-i/2},{x:n+c/2,y:r-i/2+u},{x:n+d.width/2,y:r-i/2+u},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+u},{x:n-c/2,y:r-i/2+u}];return n9.polygon(t,a,e)},h}async function $9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=w8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=o9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,b8(t,c),t.intersect=function(e){return n9.polygon(t,l,e)},i}async function B9(e,t,n){const{labelStyles:r,nodeStyles:i}=D8(t);t.labelStyle=r;const{shapeSvg:a,bbox:o}=await y8(e,t,x8(t)),s=Math.max(o.width+2*n.labelPaddingX,t?.width||0),l=Math.max(o.height+2*n.labelPaddingY,t?.height||0),c=-s/2,u=-l/2;let h,{rx:d,ry:p}=t;const{cssStyles:f}=t;if(n?.rx&&n.ry&&(d=n.rx,p=n.ry),"handDrawn"===t.look){const e=m8(a),n=P8(t,{}),r=d||p?e.path(I8(c,u,s,l,d||0),n):e.rectangle(c,u,s,l,n);h=a.insert(()=>r,":first-child"),h.attr("class","basic label-container").attr("style",z5(f))}else h=a.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",z5(d)).attr("ry",z5(p)).attr("x",c).attr("y",u).attr("width",s).attr("height",l);return b8(t,h),t.intersect=function(e){return n9.rect(t,e)},a}async function F9(e,t){const{shapeSvg:n,bbox:r,label:i}=await y8(e,t,"label"),a=n.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),n.attr("class","label edgeLabel"),i.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-r.height/2-(r.y-(r.top??0))})`),b8(t,a),t.intersect=function(e){return n9.rect(t,e)},n}async function z9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-3*s/6,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=w8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=o9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,b8(t,c),t.intersect=function(e){return n9.polygon(t,l,e)},i}async function j9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),l=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=w8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=o9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,b8(t,c),t.intersect=function(e){return n9.polygon(t,l,e)},i}function H9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.label="",t.labelStyle=n;const i=e.insert("g").attr("class",x8(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),l=[{x:o,y:0},{x:0,y:s+3.5},{x:o-14,y:s+3.5},{x:0,y:2*s},{x:o,y:s-3.5},{x:14,y:s-3.5}],c=m8(i),u=P8(t,{});"handDrawn"!==t.look&&(u.roughness=0,u.fillStyle="solid");const h=w8(l),d=c.path(h,u),p=i.insert(()=>d,":first-child");return a&&"handDrawn"!==t.look&&p.selectAll("path").attr("style",a),r&&"handDrawn"!==t.look&&p.selectAll("path").attr("style",r),p.attr("transform",`translate(-${o/2},${-s})`),b8(t,p),t.intersect=function(e){eU.info("lightningBolt intersect",t,e);return n9.polygon(t,l,e)},i}QH(I9,"hexagon"),QH(O9,"hourglass"),QH(L9,"icon"),QH(M9,"iconCircle"),QH(R9,"iconRounded"),QH(D9,"iconSquare"),QH(P9,"imageSquare"),QH($9,"inv_trapezoid"),QH(B9,"drawRect"),QH(F9,"labelRect"),QH(z9,"lean_left"),QH(j9,"lean_right"),QH(H9,"lightningBolt");var U9=QH((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createCylinderPathD"),G9=QH((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createOuterCylinderPathD"),q9=QH((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createInnerCylinderPathD");async function W9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+(t.padding??0),t.width??0),l=s/2,c=l/(2.5+s/50),u=Math.max(a.height+c+(t.padding??0),t.height??0),h=.1*u;let d;const{cssStyles:p}=t;if("handDrawn"===t.look){const e=m8(i),n=G9(0,0,s,u,l,c,h),r=q9(0,c,s,u,l,c),a=P8(t,{}),o=e.path(n,a),f=e.path(r,a);i.insert(()=>f,":first-child").attr("class","line"),d=i.insert(()=>o,":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{const e=U9(0,0,s,u,l,c,h);d=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",z5(p)).attr("style",r)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-s/2}, ${-(u/2+c)})`),b8(t,d),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+c-(a.y-(a.top??0))})`),t.intersect=function(e){const n=n9.rect(t,e),r=n.x-(t.x??0);if(0!=l&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}async function V9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=l+c,{cssStyles:h}=t,d=m8(i),p=P8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=[{x:-s/2-s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:u/2},...E8(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,c,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2},{x:-s/2,y:-u/2},{x:-s/2,y:u/2*1.1},{x:-s/2,y:-u/2}],g=d.polygon(f.map(e=>[e.x,e.y]),p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),b8(t,m),t.intersect=function(e){return n9.polygon(t,f,e)},i}async function Y9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=m8(i),p=P8(t,{}),f=[{x:c-5,y:u+5},{x:c-5,y:u+l+5},{x:c+s-5,y:u+l+5},{x:c+s-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u+l-5},{x:c+s+5,y:u+l-5},{x:c+s+5,y:u-5},{x:c+5,y:u-5},{x:c+5,y:u},{x:c,y:u},{x:c,y:u+5}],g=[{x:c,y:u+5},{x:c+s-5,y:u+5},{x:c+s-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u},{x:c,y:u}];"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const m=w8(f),y=d.path(m,p),v=w8(g),b=d.path(v,{...p,fill:"none"}),x=i.insert(()=>b,":first-child");return x.insert(()=>y,":first-child"),x.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&x.selectAll("path").attr("style",r),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),b8(t,x),t.intersect=function(e){return n9.polygon(t,f,e)},i}async function X9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=l+c,h=-s/2,d=-u/2,{cssStyles:p}=t,f=E8(h-5,d+u+5,h+s-5,d+u+5,c,.8),g=f?.[f.length-1],m=[{x:h-5,y:d+5},{x:h-5,y:d+u+5},...f,{x:h+s-5,y:g.y-5},{x:h+s,y:g.y-5},{x:h+s,y:g.y-10},{x:h+s+5,y:g.y-10},{x:h+s+5,y:d-5},{x:h+5,y:d-5},{x:h+5,y:d},{x:h,y:d},{x:h,y:d+5}],y=[{x:h,y:d+5},{x:h+s-5,y:d+5},{x:h+s-5,y:g.y-5},{x:h+s,y:g.y-5},{x:h+s,y:d},{x:h,y:d}],v=m8(i),b=P8(t,{});"handDrawn"!==t.look&&(b.roughness=0,b.fillStyle="solid");const x=w8(m),w=v.path(x,b),E=w8(y),k=v.path(E,b),T=i.insert(()=>w,":first-child");return T.insert(()=>k),T.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-c/2-(a.y-(a.top??0))})`),b8(t,T),t.intersect=function(e){return n9.polygon(t,m,e)},i}async function K9(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=D8(t);t.labelStyle=r;t.useHtmlLabels||!1!==GU().flowchart?.htmlLabels||(t.centerLabel=!0);const{shapeSvg:a,bbox:o}=await y8(e,t,x8(t)),s=Math.max(o.width+2*(t.padding??0),t?.width??0),l=Math.max(o.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=m8(a),p=P8(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=d.rectangle(c,u,s,l,p),g=a.insert(()=>f,":first-child");return g.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",h),i&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",i),b8(t,g),t.intersect=function(e){return n9.rect(t,e)},a}QH(W9,"linedCylinder"),QH(V9,"linedWaveEdgedRect"),QH(Y9,"multiRect"),QH(X9,"multiWaveEdgedRectangle"),QH(K9,"note");var Q9=QH((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Z9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.width+t.padding+(a.height+t.padding),s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=Q9(0,0,o),a=e.path(r,n);l=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${o/2})`),c&&l.attr("style",c)}else l=o9(i,o,o,s);return r&&l.attr("style",r),b8(t,l),t.intersect=function(e){return eU.debug("APA12 Intersect called SPLIT\npoint:",e,"\nnode:\n",t,"\nres:",n9.polygon(t,s,e)),n9.polygon(t,s,e)},i}async function J9(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=-Math.max(a.width+(t.padding??0),t?.width??0)/2,l=-Math.max(a.height+(t.padding??0),t?.height??0)/2,c=l/2,u=[{x:s+c,y:l},{x:s,y:0},{x:s+c,y:-l},{x:-s,y:-l},{x:-s,y:l}],{cssStyles:h}=t,d=m8(i),p=P8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=w8(u),g=d.path(f,p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${-c/2},0)`),o.attr("transform",`translate(${-c/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),b8(t,m),t.intersect=function(e){return n9.polygon(t,u,e)},i}async function eee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);let i;t.labelStyle=n,i=t.cssClasses?"node "+t.cssClasses:"node default";const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",r),l=t.description,c=t.label,u=s.node().appendChild(await N8(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(hG(WG()?.flowchart?.htmlLabels)){const e=u.children[0],t=EK(u);h=e.getBoundingClientRect(),t.attr("width",h.width),t.attr("height",h.height)}eU.info("Text 2",l);const d=l||[],p=u.getBBox(),f=s.node().appendChild(await N8(d.join?d.join("
    "):d,t.labelStyle,!0,!0)),g=f.children[0],m=EK(f);h=g.getBoundingClientRect(),m.attr("width",h.width),m.attr("height",h.height);const y=(t.padding||0)/2;EK(f).attr("transform","translate( "+(h.width>p.width?0:(p.width-h.width)/2)+", "+(p.height+y+5)+")"),EK(u).attr("transform","translate( "+(h.width(eU.debug("Rough node insert CXC",r),i),":first-child"),E=a.insert(()=>(eU.debug("Rough node insert CXC",r),r),":first-child")}else E=o.insert("rect",":first-child"),k=o.insert("line"),E.attr("class","outer title-state").attr("style",r).attr("x",-h.width/2-y).attr("y",-h.height/2-y).attr("width",h.width+(t.padding||0)).attr("height",h.height+(t.padding||0)),k.attr("class","divider").attr("x1",-h.width/2-y).attr("x2",h.width/2+y).attr("y1",-h.height/2-y+p.height+y).attr("y2",-h.height/2-y+p.height+y);return b8(t,E),t.intersect=function(e){return n9.rect(t,e)},a}async function tee(e,t){return B9(e,t,{rx:5,ry:5,labelPaddingX:1*(t?.padding||0),labelPaddingY:1*(t?.padding||0)})}async function nee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=t?.padding??0,l=Math.max(a.width+2*(t.padding??0),t?.width??0),c=Math.max(a.height+2*(t.padding??0),t?.height??0),u=-a.width/2-s,h=-a.height/2-s,{cssStyles:d}=t,p=m8(i),f=P8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=[{x:u,y:h},{x:u+l+8,y:h},{x:u+l+8,y:h+c},{x:u-8,y:h+c},{x:u-8,y:h},{x:u,y:h},{x:u,y:h+c}],m=p.polygon(g.map(e=>[e.x,e.y]),f),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container").attr("style",z5(d)),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),d&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${-l/2+4+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-(a.y-(a.top??0))})`),b8(t,y),t.intersect=function(e){return n9.rect(t,e)},i}async function ree(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=m8(i),p=P8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=[{x:c,y:u},{x:c,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u-l/2}],g=w8(f),m=d.path(g,p),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",h),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-l/4+(t.padding??0)-(a.y-(a.top??0))})`),b8(t,y),t.intersect=function(e){return n9.polygon(t,f,e)},i}async function iee(e,t){return B9(e,t,{rx:0,ry:0,labelPaddingX:2*(t?.padding||0),labelPaddingY:1*(t?.padding||0)})}async function aee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.height+t.padding,s=a.width+o/4+t.padding;let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=I8(-s/2,-o/2,s,o,o/2),a=e.path(r,n);l=i.insert(()=>a,":first-child"),l.attr("class","basic label-container").attr("style",z5(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",r).attr("rx",o/2).attr("ry",o/2).attr("x",-s/2).attr("y",-o/2).attr("width",s).attr("height",o);return b8(t,l),t.intersect=function(e){return n9.rect(t,e)},i}async function oee(e,t){return B9(e,t,{rx:5,ry:5})}function see(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=D8(t);t.labelStyle=r;const{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:l}=n,c=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),u=m8(c),h=P8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=u.circle(0,0,14,{...h,stroke:o,strokeWidth:2}),p=s??l,f=u.circle(0,0,5,{...h,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),g=c.insert(()=>d,":first-child");return g.insert(()=>f),a&&g.selectAll("path").attr("style",a),i&&g.selectAll("path").attr("style",i),b8(t,g),t.intersect=function(e){return n9.circle(t,7,e)},c}function lee(e,t,{config:{themeVariables:n}}){const{lineColor:r}=n,i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if("handDrawn"===t.look){const e=m8(i).circle(0,0,14,O8(r));a=i.insert(()=>e),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return b8(t,a),t.intersect=function(e){return n9.circle(t,7,e)},i}async function cee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=(t?.padding||0)/2,s=a.width+t.padding,l=a.height+t.padding,c=-a.width/2-o,u=-a.height/2-o,h=[{x:0,y:0},{x:s,y:0},{x:s,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=e.rectangle(c-8,u,s+16,l,n),a=e.line(c,u,c,u+l,n),o=e.line(c+s,u,c+s,u+l,n);i.insert(()=>a,":first-child"),i.insert(()=>o,":first-child");const h=i.insert(()=>r,":first-child"),{cssStyles:d}=t;h.attr("class","basic label-container").attr("style",z5(d)),b8(t,h)}else{const e=o9(i,s,l,h);r&&e.attr("style",r),b8(t,e)}return t.intersect=function(e){return n9.polygon(t,h,e)},i}async function uee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=-o/2,c=-s/2,u=.2*s,h=.2*s,{cssStyles:d}=t,p=m8(i),f=P8(t,{}),g=[{x:l-u/2,y:c},{x:l+o+u/2,y:c},{x:l+o+u/2,y:c+s},{x:l-u/2,y:c+s}],m=[{x:l+o-u/2,y:c+s},{x:l+o+u/2,y:c+s},{x:l+o+u/2,y:c+s-h}];"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const y=w8(g),v=p.path(y,f),b=w8(m),x=p.path(b,{...f,fillStyle:"solid"}),w=i.insert(()=>x,":first-child");return w.insert(()=>v,":first-child"),w.attr("class","basic label-container"),d&&"handDrawn"!==t.look&&w.selectAll("path").attr("style",d),r&&"handDrawn"!==t.look&&w.selectAll("path").attr("style",r),b8(t,w),t.intersect=function(e){return n9.polygon(t,g,e)},i}async function hee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=.2*s,h=.2*l,d=l+c,{cssStyles:p}=t,f=m8(i),g=P8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-s/2-s/2*.1,y:d/2},...E8(-s/2-s/2*.1,d/2,s/2+s/2*.1,d/2,c,.8),{x:s/2+s/2*.1,y:-d/2},{x:-s/2-s/2*.1,y:-d/2}],y=-s/2+s/2*.1,v=-d/2-.4*h,b=[{x:y+s-u,y:1.4*(v+l)},{x:y+s,y:v+l-h},{x:y+s,y:.9*(v+l)},...E8(y+s,1.3*(v+l),y+s-u,1.5*(v+l),.03*-l,.5)],x=w8(m),w=f.path(x,g),E=w8(b),k=f.path(E,{...g,fillStyle:"solid"}),T=i.insert(()=>k,":first-child");return T.insert(()=>w,":first-child"),T.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),b8(t,T),t.intersect=function(e){return n9.polygon(t,m,e)},i}async function dee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+t.padding,t?.width||0),s=Math.max(a.height+t.padding,t?.height||0),l=-o/2,c=-s/2,u=i.insert("rect",":first-child");return u.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",o).attr("height",s),b8(t,u),t.intersect=function(e){return n9.rect(t,e)},i}QH(Z9,"question"),QH(J9,"rect_left_inv_arrow"),QH(eee,"rectWithTitle"),QH(tee,"roundedRect"),QH(nee,"shadedProcess"),QH(ree,"slopedRect"),QH(iee,"squareRect"),QH(aee,"stadium"),QH(oee,"state"),QH(see,"stateEnd"),QH(lee,"stateStart"),QH(cee,"subroutine"),QH(uee,"taggedRect"),QH(hee,"taggedWaveEdgedRectangle"),QH(dee,"text");var pee=QH((e,t,n,r,i,a)=>`M${e},${t}\n a${i},${a} 0,0,1 0,${-r}\n l${n},0\n a${i},${a} 0,0,1 0,${r}\n M${n},${-r}\n a${i},${a} 0,0,0 0,${r}\n l${-n},0`,"createCylinderPathD"),fee=QH((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(" "),"createOuterCylinderPathD"),gee=QH((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(" "),"createInnerCylinderPathD");async function mee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o,halfPadding:s}=await y8(e,t,x8(t)),l="neo"===t.look?2*s:s,c=a.height+l,u=c/2,h=u/(2.5+c/50),d=a.width+h+l,{cssStyles:p}=t;let f;if("handDrawn"===t.look){const e=m8(i),n=fee(0,0,d,c,h,u),r=gee(0,0,d,c,h,u),a=e.path(n,P8(t,{})),o=e.path(r,P8(t,{fill:"none"}));f=i.insert(()=>o,":first-child"),f=i.insert(()=>a,":first-child"),f.attr("class","basic label-container"),p&&f.attr("style",p)}else{const e=pee(0,0,d,c,h,u);f=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",z5(p)).attr("style",r),f.attr("class","basic label-container"),p&&f.selectAll("path").attr("style",p),r&&f.selectAll("path").attr("style",r)}return f.attr("label-offset-x",h),f.attr("transform",`translate(${-d/2}, ${c/2} )`),o.attr("transform",`translate(${-a.width/2-h-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),b8(t,f),t.intersect=function(e){const n=n9.rect(t,e),r=n.y-(t.y??0);if(0!=u&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-h)){let i=h*h*(1-r*r/(u*u));0!=i&&(i=Math.sqrt(Math.abs(i))),i=h-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},i}async function yee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=a.width+t.padding,s=a.height+t.padding,l=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=m8(i),n=P8(t,{}),r=w8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=o9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,b8(t,c),t.intersect=function(e){return n9.polygon(t,l,e)},i}async function vee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(60,a.width+2*(t.padding??0),t?.width??0),s=Math.max(20,a.height+2*(t.padding??0),t?.height??0),{cssStyles:l}=t,c=m8(i),u=P8(t,{});"handDrawn"!==t.look&&(u.roughness=0,u.fillStyle="solid");const h=[{x:-o/2*.8,y:-s/2},{x:o/2*.8,y:-s/2},{x:o/2,y:-s/2*.6},{x:o/2,y:s/2},{x:-o/2,y:s/2},{x:-o/2,y:-s/2*.6}],d=w8(h),p=c.path(d,u),f=i.insert(()=>p,":first-child");return f.attr("class","basic label-container"),l&&"handDrawn"!==t.look&&f.selectChildren("path").attr("style",l),r&&"handDrawn"!==t.look&&f.selectChildren("path").attr("style",r),b8(t,f),t.intersect=function(e){return n9.polygon(t,h,e)},i}async function bee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=hG(WG().flowchart?.htmlLabels),l=a.width+(t.padding??0),c=l+a.height,u=l+a.height,h=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-c}],{cssStyles:d}=t,p=m8(i),f=P8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=w8(h),m=p.path(g,f),y=i.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",d),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),t.width=l,t.height=c,b8(t,y),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${c/2-(a.height+(t.padding??0)/(s?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(e){return eU.info("Triangle intersect",t,h,e),n9.polygon(t,h,e)},i}async function xee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/8,u=l+c,{cssStyles:h}=t,d=70-s,p=d>0?d/2:0,f=m8(i),g=P8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-s/2-p,y:u/2},...E8(-s/2-p,u/2,s/2+p,u/2,c,.8),{x:s/2+p,y:-u/2},{x:-s/2-p,y:-u/2}],y=w8(m),v=f.path(y,g),b=i.insert(()=>v,":first-child");return b.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c-(a.y-(a.top??0))})`),b8(t,b),t.intersect=function(e){return n9.polygon(t,m,e)},i}async function wee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await y8(e,t,x8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=o/s;let c=o,u=s;c>u*l?u=c/l:c=u*l,c=Math.max(c,100),u=Math.max(u,50);const h=Math.min(.2*u,u/4),d=u+2*h,{cssStyles:p}=t,f=m8(i),g=P8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-c/2,y:d/2},...E8(-c/2,d/2,c/2,d/2,h,1),{x:c/2,y:-d/2},...E8(c/2,-d/2,-c/2,-d/2,h,-1)],y=w8(m),v=f.path(y,g),b=i.insert(()=>v,":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b8(t,b),t.intersect=function(e){return n9.polygon(t,m,e)},i}async function Eee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await y8(e,t,x8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=m8(i),p=P8(t,{}),f=[{x:c-5,y:u-5},{x:c-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u-5}],g=`M${c-5},${u-5} L${c+s},${u-5} L${c+s},${u+l} L${c-5},${u+l} L${c-5},${u-5}\n M${c-5},${u} L${c+s},${u}\n M${c},${u-5} L${c},${u+l}`;"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const m=d.path(g,p),y=i.insert(()=>m,":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),b8(t,y),t.intersect=function(e){return n9.polygon(t,f,e)},i}async function kee(e,t){const n=t;if(n.alias&&(t.label=n.alias),"handDrawn"===t.look){const{themeVariables:n}=GU(),{background:r}=n,i={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${r}`]};await kee(e,i)}const r=GU();t.useHtmlLabels=r.htmlLabels;let i=r.er?.diagramPadding??10,a=r.er?.entityPadding??6;const{cssStyles:o}=t,{labelStyles:s}=D8(t);if(0===n.attributes.length&&t.label){const n={rx:0,ry:0,labelPaddingX:i,labelPaddingY:1.5*i};S5(t.label,r)+2*n.labelPaddingX0){const e=u.width+2*i-(p+f+g+m);p+=e/b,f+=e/b,g>0&&(g+=e/b),m>0&&(m+=e/b)}const w=p+f+g+m,E=m8(c),k=P8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=Math.max(x.width+2*i,t?.width||0,w),_=Math.max(x.height+(d[0]||h)+a,t?.height||0),C=-T/2,S=-_/2;c.selectAll("g:not(:first-child)").each((e,t,n)=>{const r=EK(n[t]),o=r.attr("transform");let s=0,l=0;if(o){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[1]),l=parseFloat(e[2]),r.attr("class").includes("attribute-name")?s+=p:r.attr("class").includes("attribute-keys")?s+=p+f:r.attr("class").includes("attribute-comment")&&(s+=p+f+g))}r.attr("transform",`translate(${C+i/2+s}, ${l+S+u.height+a/2})`)}),c.select(".name").attr("transform","translate("+-u.width/2+", "+(S+a/2)+")");const A=E.rectangle(C,S,T,_,k),N=c.insert(()=>A,":first-child").attr("style",o.join("")),{themeVariables:I}=GU(),{rowEven:O,rowOdd:L,nodeBorder:M}=I;d.push(0);for(const[e,t]of d.entries()){if(0===e&&d.length>1)continue;const n=e%2==0&&0!==t,r=E.rectangle(C,u.height+S+t,T,u.height,{...k,fill:n?O:L,stroke:M});c.insert(()=>r,"g.label").attr("style",o.join("")).attr("class","row-rect-"+(e%2==0?"even":"odd"))}let R=E.line(C,u.height+S,T+C,u.height+S,k);c.insert(()=>R).attr("class","divider"),R=E.line(p+C,u.height+S,p+C,_+S,k),c.insert(()=>R).attr("class","divider"),y&&(R=E.line(p+f+C,u.height+S,p+f+C,_+S,k),c.insert(()=>R).attr("class","divider")),v&&(R=E.line(p+f+g+C,u.height+S,p+f+g+C,_+S,k),c.insert(()=>R).attr("class","divider"));for(const e of d)R=E.line(C,u.height+S+e,T+C,u.height+S+e,k),c.insert(()=>R).attr("class","divider");return b8(t,N),t.intersect=function(e){return n9.rect(t,e)},c}async function Tee(e,t,n,r=0,i=0,a=[],o=""){const s=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${r}, ${i})`).attr("style",o);t!==fG(t)&&(t=(t=fG(t)).replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await g7(s,t,{width:S5(t,n)+100,style:o,useHtmlLabels:n.htmlLabels},n));if(t.includes("<")||t.includes(">")){let e=l.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(hG(n.htmlLabels)){const e=l.children[0];e.style.textAlign="start";const t=EK(l);c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}return c}async function _ee(e,t,n,r,i=n.class.padding??12){const a=r?0:3,o=e.insert("g").attr("class",x8(t)).attr("id",t.domId||t.id);let s=null,l=null,c=null,u=null,h=0,d=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const e=t.annotations[0];await Cee(s,{text:`«${e}»`},0);h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await Cee(l,t,0,["font-weight: bolder"]);const f=l.node().getBBox();d=f.height,c=o.insert("g").attr("class","members-group text");let g=0;for(const e of t.members){g+=await Cee(c,e,g,[e.parseClassifier()])+a}p=c.node().getBBox().height,p<=0&&(p=i/2),u=o.insert("g").attr("class","methods-group text");let m=0;for(const e of t.methods){m+=await Cee(u,e,m,[e.parseClassifier()])+a}let y=o.node().getBBox();if(null!==s){const e=s.node().getBBox();s.attr("transform",`translate(${-e.width/2})`)}return l.attr("transform",`translate(${-f.width/2}, ${h})`),y=o.node().getBBox(),c.attr("transform",`translate(0, ${h+d+2*i})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${h+d+(p?p+4*i:2*i)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}async function Cee(e,t,n,r=[]){const i=e.insert("g").attr("class","label").attr("style",r.join("; ")),a=GU();let o="useHtmlLabels"in t?t.useHtmlLabels:hG(a.htmlLabels)??!0,s="";s="text"in t?t.text:t.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),xG(s)&&(o=!0);const l=await g7(i,XG(B5(s)),{width:S5(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let c,u=1;if(o){const e=l.children[0],t=EK(l);u=e.innerHTML.split("
    ").length,e.innerHTML.includes("")&&(u+=e.innerHTML.split("").length-1);const n=e.getElementsByTagName("img");if(n){const e=""===s.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(e,10)*n+"px";t.style.minWidth=r,t.style.maxWidth=r}else t.style.width="100%";n(t)}QH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}else{r.includes("font-weight: bolder")&&EK(l).selectAll("tspan").attr("font-weight",""),u=l.children.length;const e=l.children[0];if(""===l.textContent||l.textContent.includes(">")){e.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim();" "===s[1]&&(e.textContent=e.textContent[0]+" "+e.textContent.substring(1))}"undefined"===e.textContent&&(e.textContent=""),c=l.getBBox()}return i.attr("transform","translate(0,"+(-c.height/(2*u)+n)+")"),c.height}async function See(e,t){const n=WG(),r=n.class.padding??12,i=r,a=t.useHtmlLabels??hG(n.htmlLabels)??!0,o=t;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:s,bbox:l}=await _ee(e,t,n,a,i),{labelStyles:c,nodeStyles:u}=D8(t);t.labelStyle=c,t.cssStyles=o.styles||"";const h=o.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=h.replaceAll("!important","").split(";"));const d=0===o.members.length&&0===o.methods.length&&!n.class?.hideEmptyMembersBox,p=m8(s),f=P8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=l.width;let m=l.height;0===o.members.length&&0===o.methods.length?m+=i:o.members.length>0&&0===o.methods.length&&(m+=2*i);const y=-g/2,v=-m/2,b=p.rectangle(y-r,v-r-(d?r:0===o.members.length&&0===o.methods.length?-r/2:0),g+2*r,m+2*r+(d?2*r:0===o.members.length&&0===o.methods.length?-r:0),f),x=s.insert(()=>b,":first-child");x.attr("class","basic label-container");const w=x.node().getBBox();s.selectAll(".text").each((e,t,n)=>{const i=EK(n[t]),l=i.attr("transform");let c=0;if(l){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);e&&(c=parseFloat(e[2]))}let u=c+v+r-(d?r:0===o.members.length&&0===o.methods.length?-r/2:0);a||(u-=4);let h=y;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(h=-i.node()?.getBBox().width/2||0,s.selectAll("text").each(function(e,t,n){"middle"===window.getComputedStyle(n[t]).textAnchor&&(h=0)})),i.attr("transform",`translate(${h}, ${u})`)});const E=s.select(".annotation-group").node().getBBox().height-(d?r/2:0)||0,k=s.select(".label-group").node().getBBox().height-(d?r/2:0)||0,T=s.select(".members-group").node().getBBox().height-(d?r/2:0)||0;if(o.members.length>0||o.methods.length>0||d){const e=p.line(w.x,E+k+v+r,w.x+w.width,E+k+v+r,f);s.insert(()=>e).attr("class","divider").attr("style",h)}if(d||o.members.length>0||o.methods.length>0){const e=p.line(w.x,E+k+T+v+2*i+r,w.x+w.width,E+k+T+v+r+2*i,f);s.insert(()=>e).attr("class","divider").attr("style",h)}if("handDrawn"!==o.look&&s.selectAll("path").attr("style",h),x.select(":nth-child(2)").attr("style",h),s.selectAll(".divider").select("path").attr("style",h),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",h),!a){const e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(h);if(t){const e=t[0].replace("color","fill");s.selectAll("tspan").attr("style",e)}else if(c){const t=e.exec(c);if(t){const e=t[0].replace("color","fill");s.selectAll("tspan").attr("style",e)}}}return b8(t,x),t.intersect=function(e){return n9.rect(t,e)},s}async function Aee(e,t){const{labelStyles:n,nodeStyles:r}=D8(t);t.labelStyle=n;const i=t,a=t,o="verifyMethod"in t,s=x8(t),l=e.insert("g").attr("class",s).attr("id",t.domId??t.id);let c;c=o?await Nee(l,`<<${i.type}>>`,0,t.labelStyle):await Nee(l,"<<Element>>",0,t.labelStyle);let u=c;const h=await Nee(l,i.name,u,t.labelStyle+"; font-weight: bold;");if(u+=h+20,o){u+=await Nee(l,""+(i.requirementId?`Id: ${i.requirementId}`:""),u,t.labelStyle);u+=await Nee(l,""+(i.text?`Text: ${i.text}`:""),u,t.labelStyle);u+=await Nee(l,""+(i.risk?`Risk: ${i.risk}`:""),u,t.labelStyle),await Nee(l,""+(i.verifyMethod?`Verification: ${i.verifyMethod}`:""),u,t.labelStyle)}else{u+=await Nee(l,""+(a.type?`Type: ${a.type}`:""),u,t.labelStyle),await Nee(l,""+(a.docRef?`Doc Ref: ${a.docRef}`:""),u,t.labelStyle)}const d=(l.node()?.getBBox().width??200)+20,p=(l.node()?.getBBox().height??200)+20,f=-d/2,g=-p/2,m=m8(l),y=P8(t,{});"handDrawn"!==t.look&&(y.roughness=0,y.fillStyle="solid");const v=m.rectangle(f,g,d,p,y),b=l.insert(()=>v,":first-child");if(b.attr("class","basic label-container").attr("style",r),l.selectAll(".label").each((e,t,n)=>{const r=EK(n[t]),i=r.attr("transform");let a=0,o=0;if(i){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]))}const s=o-p/2;let l=f+10;0!==t&&1!==t||(l=a),r.attr("transform",`translate(${l}, ${s+20})`)}),u>c+h+20){const e=m.line(f,g+c+h+20,f+d,g+c+h+20,y);l.insert(()=>e).attr("style",r)}return b8(t,b),t.intersect=function(e){return n9.rect(t,e)},l}async function Nee(e,t,n,r=""){if(""===t)return 0;const i=e.insert("g").attr("class","label").attr("style",r),a=WG(),o=a.htmlLabels??!0,s=await g7(i,XG(B5(t)),{width:S5(t,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:r},a);let l;if(o){const e=s.children[0],t=EK(s);l=e.getBoundingClientRect(),t.attr("width",l.width),t.attr("height",l.height)}else{const e=s.children[0];for(const t of e.children)t.textContent=t.textContent.replaceAll(">",">").replaceAll("<","<"),r&&t.setAttribute("style",r);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+n})`),l.height}QH(mee,"tiltedCylinder"),QH(yee,"trapezoid"),QH(vee,"trapezoidalPentagon"),QH(bee,"triangle"),QH(xee,"waveEdgedRectangle"),QH(wee,"waveRectangle"),QH(Eee,"windowPane"),QH(kee,"erBox"),QH(Tee,"addText"),QH(_ee,"textHelper"),QH(Cee,"addText"),QH(See,"classBox"),QH(Aee,"requirementBox"),QH(Nee,"addText");var Iee=QH(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Oee(e,t,{config:n}){const{labelStyles:r,nodeStyles:i}=D8(t);t.labelStyle=r||"";const a=t.width;t.width=(t.width??200)-10;const{shapeSvg:o,bbox:s,label:l}=await y8(e,t,x8(t)),c=t.padding||10;let u,h="";"ticket"in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(h=n?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",h).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,f;({label:p,bbox:f}=u?await v8(u,"ticket"in t&&t.ticket||"",d):await v8(o,"ticket"in t&&t.ticket||"",d));const{label:g,bbox:m}=await v8(o,"assigned"in t&&t.assigned||"",d);t.width=a;const y=t?.width||0,v=Math.max(f.height,m.height)/2,b=Math.max(s.height+20,t?.height||0)+v,x=-y/2,w=-b/2;let E;l.attr("transform","translate("+(c-y/2)+", "+(-v-s.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-v+s.height/2)+")"),g.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-v+s.height/2)+")");const{rx:k,ry:T}=t,{cssStyles:_}=t;if("handDrawn"===t.look){const e=m8(o),n=P8(t,{}),r=k||T?e.path(I8(x,w,y,b,k||0),n):e.rectangle(x,w,y,b,n);E=o.insert(()=>r,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",k??5).attr("ry",T??5).attr("x",x).attr("y",w).attr("width",y).attr("height",b);const e="priority"in t&&t.priority;if(e){const t=o.append("line"),n=x+2,r=w+Math.floor((k??0)/2),i=w+b-Math.floor((k??0)/2);t.attr("x1",n).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width","4").attr("stroke",Iee(e))}}return b8(t,E),t.height=b,t.intersect=function(e){return n9.rect(t,e)},o}QH(Oee,"kanbanItem");var Lee=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:iee},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tee},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:aee},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:cee},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:E9},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:c9},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Z9},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:I9},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:j9},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:z9},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:yee},{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:$9},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:T9},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:dee},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:s9},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:nee},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:lee},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:see},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:S9},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:O9},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:p9},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:g9},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:y9},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:H9},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:xee},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:A9},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:mee},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:W9},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:v9},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:k9},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:bee},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Eee},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:_9},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:vee},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:C9},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ree},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:X9},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Y9},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:a9},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:h9},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:hee},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:uee},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:wee},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:J9},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:V9}],Mee=QH(()=>{const e={state:oee,choice:l9,note:K9,rectWithTitle:eee,labelRect:F9,iconSquare:D9,iconCircle:M9,icon:L9,iconRounded:R9,imageSquare:P9,anchor:r9,kanbanItem:Oee,classBox:See,erBox:kee,requirementBox:Aee},t=[...Object.entries(e),...Lee.flatMap(e=>[e.shortName,..."aliases"in e?e.aliases:[],..."internalAliases"in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Ree=Mee();function Dee(e){return e in Ree}QH(Dee,"isValidShape");var Pee=new Map;async function $ee(e,t,n){let r,i;"rect"===t.shape&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?Ree[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;"sandbox"===n.config.securityLevel?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return t.tooltip&&i.attr("title",t.tooltip),Pee.set(t.id,r),t.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}QH($ee,"insertNode");var Bee=QH((e,t)=>{Pee.set(t.id,e)},"setNodeElem"),Fee=QH(()=>{Pee.clear()},"clear"),zee=QH(e=>{const t=Pee.get(e.id);eU.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-8)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode"),jee=QH((e,t,n,r,i,a)=>{t.arrowTypeStart&&Uee(e,"start",t.arrowTypeStart,n,r,i,a),t.arrowTypeEnd&&Uee(e,"end",t.arrowTypeEnd,n,r,i,a)},"addEdgeMarkers"),Hee={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Uee=QH((e,t,n,r,i,a,o)=>{const s=Hee[n];if(!s)return void eU.warn(`Unknown arrow type: ${n}`);const l=`${i}_${a}-${s.type}${"start"===t?"Start":"End"}`;if(o&&""!==o.trim()){const n=`${l}_${o.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(n)){const e=document.getElementById(l);if(e){const t=e.cloneNode(!0);t.id=n;t.querySelectorAll("path, circle, line").forEach(e=>{e.setAttribute("stroke",o),s.fill&&e.setAttribute("fill",o)}),e.parentNode?.appendChild(t)}}e.attr(`marker-${t}`,`url(${r}#${n})`)}else e.attr(`marker-${t}`,`url(${r}#${l})`)},"addEdgeMarker"),Gee=new Map,qee=new Map,Wee=QH(()=>{Gee.clear(),qee.clear()},"clear"),Vee=QH(e=>{let t=e?e.reduce((e,t)=>e+";"+t,""):"";return t},"getLabelStyles"),Yee=QH(async(e,t)=>{let n=hG(WG().flowchart.htmlLabels);const r=await g7(e,t.label,{style:Vee(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1});eU.info("abc82",t,t.labelType);const i=e.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(r);let o,s=r.getBBox();if(n){const e=r.children[0],t=EK(r);s=e.getBoundingClientRect(),t.attr("width",s.width),t.attr("height",s.height)}if(a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),Gee.set(t.id,i),t.width=s.width,t.height=s.height,t.startLabelLeft){const n=await N8(t.startLabelLeft,Vee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),qee.get(t.id)||qee.set(t.id,{}),qee.get(t.id).startLeft=r,Xee(o,t.startLabelLeft)}if(t.startLabelRight){const n=await N8(t.startLabelRight,Vee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),qee.get(t.id)||qee.set(t.id,{}),qee.get(t.id).startRight=r,Xee(o,t.startLabelRight)}if(t.endLabelLeft){const n=await N8(t.endLabelLeft,Vee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),qee.get(t.id)||qee.set(t.id,{}),qee.get(t.id).endLeft=r,Xee(o,t.endLabelLeft)}if(t.endLabelRight){const n=await N8(t.endLabelRight,Vee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),qee.get(t.id)||qee.set(t.id,{}),qee.get(t.id).endRight=r,Xee(o,t.endLabelRight)}return r},"insertEdgeLabel");function Xee(e,t){WG().flowchart.htmlLabels&&e&&(e.style.width=9*t.length+"px",e.style.height="12px")}QH(Xee,"setTerminalWidth");var Kee=QH((e,t)=>{eU.debug("Moving label abc88 ",e.id,e.label,Gee.get(e.id),t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=WG(),{subGraphTitleTotalMargin:i}=oY(r);if(e.label){const r=Gee.get(e.id);let a=e.x,o=e.y;if(n){const r=P5.calcLabelPosition(n);eU.debug("Moving label "+e.label+" from (",a,",",o,") to (",r.x,",",r.y,") abc88"),t.updatedPath&&(a=r.x,o=r.y)}r.attr("transform",`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){const t=qee.get(e.id).startLeft;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.startLabelRight){const t=qee.get(e.id).startRight;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelLeft){const t=qee.get(e.id).endLeft;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelRight){const t=qee.get(e.id).endRight;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}},"positionEdgeLabel"),Qee=QH((e,t)=>{const n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},"outsideNode"),Zee=QH((e,t,n)=>{eU.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(t)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2;let s=n.xMath.abs(r-t.x)*l){let e=n.y{eU.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(eU.info("abc88 checking point",e,t),Qee(t,e)||i)eU.warn("abc88 outside",e,r),r=e,i||n.push(e);else{const a=Zee(t,r,e);eU.debug("abc88 inside",e,r,a),eU.debug("abc88 intersection",a,t);let o=!1;n.forEach(e=>{o=o||e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)?eU.warn("abc88 no intersect",a,n):n.push(a),i=!0}}),eU.debug("returning points",n),n},"cutPathAtIntersect");function ete(e){const t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}QH(ete,"extractCornerPoints");var tte=QH(function(e,t,n){const r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},"findAdjacentPoint"),nte=QH(function(e){const{cornerPointPositions:t}=ete(e),n=[];for(let r=0;r10&&Math.abs(i.y-t.y)>=10){eU.debug("Corner point fixing",Math.abs(i.x-t.x),Math.abs(i.y-t.y));const e=5;h=a.x===o.x?{x:l<0?o.x-e+u:o.x+e-u,y:c<0?o.y-u:o.y+u}:{x:l<0?o.x-u:o.x+u,y:c<0?o.y-e+u:o.y+e-u}}else eU.debug("Corner point skipping fixing",Math.abs(i.x-t.x),Math.abs(i.y-t.y));n.push(h,s)}else n.push(e[r]);return n},"fixCorners"),rte=QH(function(e,t,n,r,i,a,o){const{handDrawnSeed:s}=WG();let l=t.points,c=!1;const u=i;var h=a;const d=[];for(const e in t.cssCompiledStyles)R8(e)||d.push(t.cssCompiledStyles[e]);h.intersect&&u.intersect&&(l=l.slice(1,t.points.length-1),l.unshift(u.intersect(l[0])),eU.debug("Last point APA12",t.start,"--\x3e",t.end,l[l.length-1],h,h.intersect(l[l.length-1])),l.push(h.intersect(l[l.length-1]))),t.toCluster&&(eU.info("to cluster abc88",n.get(t.toCluster)),l=Jee(t.points,n.get(t.toCluster).node),c=!0),t.fromCluster&&(eU.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(l,null,2)),l=Jee(l.reverse(),n.get(t.fromCluster).node).reverse(),c=!0);let p=l.filter(e=>!Number.isNaN(e.y));p=nte(p);let f=m2;switch(f=i2,t.curve){case"linear":f=i2;break;case"basis":default:f=m2;break;case"cardinal":f=k2;break;case"bumpX":f=h2;break;case"bumpY":f=d2;break;case"catmullRom":f=I2;break;case"monotoneX":f=U2;break;case"monotoneY":f=G2;break;case"natural":f=V2;break;case"step":f=X2;break;case"stepAfter":f=Q2;break;case"stepBefore":f=K2}const{x:g,y:m}=aY(t),y=s2().x(g).y(m).curve(f);let v,b;switch(t.thickness){case"normal":default:v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-invisible"}switch(t.pattern){case"solid":default:v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed"}let x=y(p);const w=Array.isArray(t.style)?t.style:[t.style];let E=w.find(e=>e?.startsWith("stroke:"));if("handDrawn"===t.look){const n=m8(e);Object.assign([],p);v+=" transition",b=EK(n.path(x,{roughness:.3,seed:s})).select("path").attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")).attr("style",w?w.reduce((e,t)=>e+";"+t,""):"");let r=b.attr("d");b.attr("d",r),e.node().appendChild(b.node())}else{const n=d.join(";"),r=w?w.reduce((e,t)=>e+t+";",""):"";let i="";t.animate&&(i=" edge-animation-fast"),t.animation&&(i=" edge-animation-"+t.animation);const a=n?n+";"+r+";":r;b=e.append("path").attr("d",x).attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")+(i??"")).attr("style",a),E=a.match(/stroke:([^;]+)/)?.[1]}let k="";(WG().flowchart.arrowMarkerAbsolute||WG().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),eU.info("arrowTypeStart",t.arrowTypeStart),eU.info("arrowTypeEnd",t.arrowTypeEnd),jee(b,t,k,o,r,E);let T={};return c&&(T.updatedPath=l),T.originalPath=t.points,T},"insertEdge"),ite=QH((e,t,n,r)=>{t.forEach(t=>{xte[t](e,n,r)})},"insertMarkers"),ate=QH((e,t,n)=>{eU.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),ote=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),ste=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),lte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),cte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),ute=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),hte=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),dte=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),pte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),fte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),gte=QH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),mte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),yte=QH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),vte=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")},"requirement_arrow"),bte=QH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),xte={extension:ate,composition:ote,aggregation:ste,dependency:lte,lollipop:cte,point:ute,circle:hte,cross:dte,barb:pte,only_one:fte,zero_or_one:gte,one_or_more:mte,zero_or_more:yte,requirement_arrow:vte,requirement_contains:bte},wte=ite,Ete={common:kG,getConfig:GU,insertCluster:G8,insertEdge:rte,insertEdgeLabel:Yee,insertMarkers:wte,insertNode:$ee,interpolateToCurve:s5,labelHelper:y8,log:eU,positionEdgeLabel:Kee},kte={},Tte=QH(e=>{for(const t of e)kte[t.name]=t},"registerLayoutLoaders");QH(()=>{Tte([{name:"dagre",loader:QH(async()=>await Promise.resolve().then(function(){return Sce}),"loader")}])},"registerDefaultLayoutLoaders")();var _te=QH(async(e,t)=>{if(!(e.layoutAlgorithm in kte))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=kte[e.layoutAlgorithm];return(await n.loader()).render(e,t,Ete,{algorithm:n.algorithm})},"render"),Cte=QH((e="",{fallback:t="dagre"}={})=>{if(e in kte)return e;if(t in kte)return eU.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"),Ste="11.6.0",Ate=QH(e=>{const{securityLevel:t}=WG();let n=EK("body");if("sandbox"===t){const t=EK(`#i${e}`);n=EK((t.node()?.contentDocument??document).body)}return n.select(`#${e}`)},"selectSvgElement"),Nte=J4(Object.keys,Object),Ite=Object.prototype.hasOwnProperty;function Ote(e){if(!n3(e))return Nte(e);var t=[];for(var n in Object(e))Ite.call(e,n)&&"constructor"!=n&&t.push(n);return t}var Lte=T4(t4,"DataView"),Mte=T4(t4,"Promise"),Rte=T4(t4,"Set"),Dte=T4(t4,"WeakMap"),Pte="[object Map]",$te="[object Promise]",Bte="[object Set]",Fte="[object WeakMap]",zte="[object DataView]",jte=m4(Lte),Hte=m4(M4),Ute=m4(Mte),Gte=m4(Rte),qte=m4(Dte),Wte=c4;(Lte&&Wte(new Lte(new ArrayBuffer(1)))!=zte||M4&&Wte(new M4)!=Pte||Mte&&Wte(Mte.resolve())!=$te||Rte&&Wte(new Rte)!=Bte||Dte&&Wte(new Dte)!=Fte)&&(Wte=function(e){var t=c4(e),n="[object Object]"==t?e.constructor:void 0,r=n?m4(n):"";if(r)switch(r){case jte:return zte;case Hte:return Pte;case Ute:return $te;case Gte:return Bte;case qte:return Fte}return t});var Vte=Object.prototype.hasOwnProperty;function Yte(e){if(null==e)return!0;if(d3(e)&&(u3(e)||"string"==typeof e||"function"==typeof e.splice||y3(e)||I3(e)||c3(e)))return!e.length;var t=Wte(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(n3(e))return!Ote(e).length;for(var n in e)if(Vte.call(e,n))return!1;return!0}var Xte={id:"c4",detector:QH(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return ohe});return{id:"c4",diagram:e}},"loader")},Kte="flowchart",Qte=QH((e,t)=>"dagre-wrapper"!==t?.flowchart?.defaultRenderer&&"elk"!==t?.flowchart?.defaultRenderer&&/^\s*graph/.test(e),"detector"),Zte={id:Kte,detector:Qte,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return Ehe});return{id:Kte,diagram:e}},"loader")},Jte="flowchart-v2",ene=QH((e,t)=>"dagre-d3"!==t?.flowchart?.defaultRenderer&&("elk"===t?.flowchart?.defaultRenderer&&(t.layout="elk"),!(!/^\s*graph/.test(e)||"dagre-wrapper"!==t?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(e)),"detector"),tne={id:Jte,detector:ene,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return Ehe});return{id:Jte,diagram:e}},"loader")},nne={id:"er",detector:QH(e=>/^\s*erDiagram/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return Ohe});return{id:"er",diagram:e}},"loader")},rne="gitGraph",ine={id:rne,detector:QH(e=>/^\s*gitGraph/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return QTe});return{id:rne,diagram:e}},"loader")},ane="gantt",one={id:ane,detector:QH(e=>/^\s*gantt/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return _Ce});return{id:ane,diagram:e}},"loader")},sne="info",lne={id:sne,detector:QH(e=>/^\s*info/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return OCe});return{id:sne,diagram:e}},"loader")},cne={id:"pie",detector:QH(e=>/^\s*pie/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return VCe});return{id:"pie",diagram:e}},"loader")},une="quadrantChart",hne={id:une,detector:QH(e=>/^\s*quadrantChart/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return ESe});return{id:une,diagram:e}},"loader")},dne="xychart",pne={id:dne,detector:QH(e=>/^\s*xychart-beta/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return vAe});return{id:dne,diagram:e}},"loader")},fne="requirement",gne={id:fne,detector:QH(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return CAe});return{id:fne,diagram:e}},"loader")},mne="sequence",yne={id:mne,detector:QH(e=>/^\s*sequenceDiagram/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return PNe});return{id:mne,diagram:e}},"loader")},vne="class",bne=QH((e,t)=>"dagre-wrapper"!==t?.class?.defaultRenderer&&/^\s*classDiagram/.test(e),"detector"),xne={id:vne,detector:bne,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return QNe});return{id:vne,diagram:e}},"loader")},wne="classDiagram",Ene=QH((e,t)=>!(!/^\s*classDiagram/.test(e)||"dagre-wrapper"!==t?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(e),"detector"),kne={id:wne,detector:Ene,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return JNe});return{id:wne,diagram:e}},"loader")},Tne="state",_ne=QH((e,t)=>"dagre-wrapper"!==t?.state?.defaultRenderer&&/^\s*stateDiagram/.test(e),"detector"),Cne={id:Tne,detector:_ne,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return kOe});return{id:Tne,diagram:e}},"loader")},Sne="stateDiagram",Ane=QH((e,t)=>!!/^\s*stateDiagram-v2/.test(e)||!(!/^\s*stateDiagram/.test(e)||"dagre-wrapper"!==t?.state?.defaultRenderer),"detector"),Nne={id:Sne,detector:Ane,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return _Oe});return{id:Sne,diagram:e}},"loader")},Ine="journey",One={id:Ine,detector:QH(e=>/^\s*journey/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return dLe});return{id:Ine,diagram:e}},"loader")},Lne=QH((e,t,n)=>{eU.debug("rendering svg for syntax error\n");const r=Ate(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),CG(r,100,512,!0),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),Mne={draw:Lne},Rne=Mne,Dne={db:{},renderer:Mne,parser:{parse:QH(()=>{},"parse")}},Pne="flowchart-elk",$ne=QH((e,t={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*flowchart|graph/.test(e)&&"elk"===t?.flowchart?.defaultRenderer)&&(t.layout="elk",!0),"detector"),Bne={id:Pne,detector:$ne,loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return Ehe});return{id:Pne,diagram:e}},"loader")},Fne="timeline",zne={id:Fne,detector:QH(e=>/^\s*timeline/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return tMe});return{id:Fne,diagram:e}},"loader")},jne="mindmap",Hne={id:jne,detector:QH(e=>/^\s*mindmap/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return BVe});return{id:jne,diagram:e}},"loader")},Une="kanban",Gne={id:Une,detector:QH(e=>/^\s*kanban/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return lYe});return{id:Une,diagram:e}},"loader")},qne="sankey",Wne={id:qne,detector:QH(e=>/^\s*sankey-beta/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return cXe});return{id:qne,diagram:e}},"loader")},Vne="packet",Yne={id:Vne,detector:QH(e=>/^\s*packet-beta/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return _Xe});return{id:Vne,diagram:e}},"loader")},Xne="radar",Kne={id:Xne,detector:QH(e=>/^\s*radar-beta/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return eKe});return{id:Xne,diagram:e}},"loader")},Qne="block",Zne={id:Qne,detector:QH(e=>/^\s*block-beta/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return TZe});return{id:Qne,diagram:e}},"loader")},Jne="architecture",ere={id:Jne,detector:QH(e=>/^\s*architecture/.test(e),"detector"),loader:QH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return LJe});return{id:Jne,diagram:e}},"loader")},tre=!1,nre=QH(()=>{tre||(tre=!0,JG("error",Dne,e=>"error"===e.toLowerCase().trim()),JG("---",{db:{clear:QH(()=>{},"clear")},styles:{},renderer:{draw:QH(()=>{},"draw")},parser:{parse:QH(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:QH(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),cU(Xte,Gne,kne,xne,nne,one,lne,cne,gne,yne,Bne,tne,Zte,Hne,zne,ine,Nne,Cne,One,hne,Wne,Yne,pne,Zne,ere,Kne))},"addDiagrams"),rre=QH(async()=>{eU.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(sU).map(async([e,{detector:t,loader:n}])=>{if(n)try{eq(e)}catch{try{const{diagram:e,id:r}=await n();JG(r,e,t)}catch(t){throw eU.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete sU[e],t}}}))).filter(e=>"rejected"===e.status);if(e.length>0){eU.error(`Failed to load ${e.length} external diagrams`);for(const t of e)eU.error(t);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function ire(e,t){e.attr("role","graphics-document document"),""!==t&&e.attr("aria-roledescription",t)}function are(e,t,n,r){if(void 0!==e.insert){if(n){const t=`chart-desc-${r}`;e.attr("aria-describedby",t),e.insert("desc",":first-child").attr("id",t).text(n)}if(t){const n=`chart-title-${r}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}QH(ire,"setA11yDiagramInfo"),QH(are,"addSVGa11yTitleDescription");var ore=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{QH(this,"Diagram")}static async fromText(t,n={}){const r=GU(),i=lU(t,r);t=$5(t)+"\n";try{eq(i)}catch{const e=hU(i);if(!e)throw new oU(`Diagram ${i} not found.`);const{id:t,diagram:n}=await e();JG(t,n)}const{db:a,parser:o,renderer:s,init:l}=eq(i);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},sre=[],lre=QH(()=>{sre.forEach(e=>{e()}),sre=[]},"attachFunctions"),cre=QH(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ure(e){const t=e.match(rU);if(!t)return{text:e,metadata:{}};let n=tY(t[1],{schema:eY})??{};n="object"!=typeof n||Array.isArray(n)?{}:n;const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}QH(ure,"extractFrontMatter");var hre=QH(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,t,n)=>"<"+t+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),dre=QH(e=>{const{text:t,metadata:n}=ure(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:t}},"processFrontmatter"),pre=QH(e=>{const t=P5.detectInit(e)??{},n=P5.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:e})=>"wrap"===e):"wrap"===n?.type&&(t.wrap=!0),{text:a5(e),directive:t}},"processDirectives");function fre(e){const t=hre(e),n=dre(t),r=pre(n.text),i=D5(n.config,r.directive);return{code:e=cre(r.text),title:n.title,config:i}}function gre(e){const t=(new TextEncoder).encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join("");return btoa(n)}QH(fre,"preprocessDiagram"),QH(gre,"toBase64");var mre=["foreignobject"],yre=["dominant-baseline"];function vre(e){const t=fre(e);return VU(),WU(t.config??{}),t}async function bre(e,t){nre();try{const{code:t,config:n}=vre(e);return{diagramType:(await Ire(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}QH(vre,"processAndSetConfigs"),QH(bre,"parse");var xre=QH((e,t,n=[])=>`\n.${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),wre=QH((e,t=new Map)=>{let n="";if(void 0!==e.themeCSS&&(n+=`\n${e.themeCSS}`),void 0!==e.fontFamily&&(n+=`\n:root { --mermaid-font-family: ${e.fontFamily}}`),void 0!==e.altFontFamily&&(n+=`\n:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const r=e.htmlLabels??e.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(e=>{Yte(e.styles)||r.forEach(t=>{n+=xre(e.id,t,e.styles)}),Yte(e.textStyles)||(n+=xre(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))))})}return n},"createCssStyles"),Ere=QH((e,t,n,r)=>{const i=wre(e,n);return Mt(At(`${r}{${OG(t,i,e.themeVariables)}}`),Rt)},"createUserStyles"),kre=QH((e="",t,n)=>{let r=e;return n||t||(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=B5(r),r=r.replace(/
    /g,"
    "),r},"cleanUpSvgCode"),Tre=QH((e="",t)=>``,"putIntoIFrame"),_re=QH((e,t,n,r,i)=>{const a=e.append("div");a.attr("id",n),r&&a.attr("style",r);const o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function Cre(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}QH(Cre,"sandboxedIframe");var Sre=QH((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},"removeExistingElements"),Are=QH(async function(e,t,n){nre();const r=vre(t);t=r.code;const i=GU();eU.debug(i),t.length>(i?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const a="#"+e,o="i"+e,s="#"+o,l="d"+e,c="#"+l,u=QH(()=>{const e=EK(d?s:c).node();e&&"remove"in e&&e.remove()},"removeTempElements");let h=EK("body");const d="sandbox"===i.securityLevel,p="loose"===i.securityLevel,f=i.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),d){const e=Cre(EK(n),o);h=EK(e.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=EK(n);_re(h,e,l,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(Sre(document,e,l,o),d){const e=Cre(EK("body"),o);h=EK(e.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=EK("body");_re(h,e,l)}let g,m;try{g=await ore.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;g=await ore.fromText("error"),m=e}const y=h.select(c).node(),v=g.type,b=y.firstChild,x=b.firstChild,w=g.renderer.getClasses?.(t,g),E=Ere(i,v,w,a),k=document.createElement("style");k.innerHTML=E,b.insertBefore(k,x);try{await g.renderer.draw(t,e,Ste,g)}catch(n){throw i.suppressErrorRendering?u():Rne.draw(t,e,Ste),n}const T=h.select(`${c} svg`),_=g.db.getAccTitle?.(),C=g.db.getAccDescription?.();Ore(v,T,_,C),h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let S=h.select(c).node().innerHTML;if(eU.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),S=kre(S,d,hG(i.arrowMarkerAbsolute)),d){const e=h.select(c+" svg").node();S=Tre(S,e)}else p||(S=XH.sanitize(S,{ADD_TAGS:mre,ADD_ATTR:yre,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(lre(),m)throw m;return u(),{diagramType:v,svg:S,bindFunctions:g.db.bindFunctions}},"render");function Nre(e={}){const t=pU({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),zU(t),t?.theme&&t.theme in CU?t.themeVariables=CU[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=CU.default.getThemeVariables(t.themeVariables));const n="object"==typeof t?FU(t):HU();tU(n.logLevel),nre()}QH(Nre,"initialize");var Ire=QH((e,t={})=>{const{code:n}=fre(e);return ore.fromText(n,t)},"getDiagramFromText");function Ore(e,t,n,r){ire(t,e),are(t,n,r,t.attr("id"))}QH(Ore,"addA11yInfo");var Lre=Object.freeze({render:Are,parse:bre,getDiagramFromText:Ire,initialize:Nre,getConfig:GU,setConfig:UU,getSiteConfig:HU,updateSiteConfig:jU,reset:QH(()=>{VU()},"reset"),globalReset:QH(()=>{VU(RU)},"globalReset"),defaultConfig:RU});tU(GU().logLevel),VU(GU());var Mre=QH((e,t,n)=>{eU.warn(e),L5(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Rre=QH(async function(e={querySelector:".mermaid"}){try{await Dre(e)}catch(t){if(L5(t)&&eU.error(t.str),Wre.parseError&&Wre.parseError(t),!e.suppressErrors)throw eU.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Dre=QH(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){const r=Lre.getConfig();let i;if(eU.debug((e?"":"No ")+"Callback function found"),n)i=n;else{if(!t)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(t)}eU.debug(`Found ${i.length} diagrams`),void 0!==r?.startOnLoad&&(eU.debug("Start On Load: "+r?.startOnLoad),Lre.updateSiteConfig({startOnLoad:r?.startOnLoad}));const a=new P5.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let o;const s=[];for(const t of Array.from(i)){if(eU.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const n=`mermaid-${a.next()}`;o=t.innerHTML,o=Z6(P5.entityDecode(o)).trim().replace(//gi,"
    ");const r=P5.detectInit(o);r&&eU.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:i}=await qre(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){Mre(e,s,Wre.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),Pre=QH(function(e){Lre.initialize(e)},"initialize"),$re=QH(async function(e,t,n){eU.warn("mermaid.init is deprecated. Please use run instead."),e&&Pre(e);const r={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof t?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await Rre(r)},"init"),Bre=QH(async(e,{lazyLoad:t=!0}={})=>{nre(),cU(...e),!1===t&&await rre()},"registerExternalDiagrams"),Fre=QH(function(){if(Wre.startOnLoad){const{startOnLoad:e}=Lre.getConfig();e&&Wre.run().catch(e=>eU.error("Mermaid failed to initialize",e))}},"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",Fre,!1);var zre=QH(function(e){Wre.parseError=e},"setParseErrorHandler"),jre=[],Hre=!1,Ure=QH(async()=>{if(!Hre){for(Hre=!0;jre.length>0;){const e=jre.shift();if(e)try{await e()}catch(e){eU.error("Error executing queue",e)}}Hre=!1}},"executeQueue"),Gre=QH(async(e,t)=>new Promise((n,r)=>{const i=QH(()=>new Promise((i,a)=>{Lre.parse(e,t).then(e=>{i(e),n(e)},e=>{eU.error("Error parsing",e),Wre.parseError?.(e),a(e),r(e)})}),"performCall");jre.push(i),Ure().catch(r)}),"parse"),qre=QH((e,t,n)=>new Promise((r,i)=>{const a=QH(()=>new Promise((a,o)=>{Lre.render(e,t,n).then(e=>{a(e),r(e)},e=>{eU.error("Error parsing",e),Wre.parseError?.(e),o(e),i(e)})}),"performCall");jre.push(a),Ure().catch(i)}),"render"),Wre={startOnLoad:!0,mermaidAPI:Lre,parse:Gre,render:qre,init:$re,run:Rre,registerExternalDiagrams:Bre,registerLayoutLoaders:Tte,initialize:Pre,parseError:void 0,contentLoaded:Fre,setParseErrorHandler:zre,detectType:lU,registerIconPacks:CY},Vre=Wre;function Yre(e){const t=onull,[n,r]=d(!1);return l(()=>{e.code&&t.current&&Vre.run({nodes:[t.current],suppressErrors:!0}).catch(e=>{r(!0),console.error("[Mermaid] ",e.message)})},[e.code]),n?null:Iw.jsx("div",{className:pE("no-dark","mermaid"),style:{cursor:"pointer",overflow:"auto"},ref:t,onClick:()=>{t.current?.querySelector("svg")},children:e.code})}const Xre=u((e,t)=>{const[n,r]=d(""),i= + */!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",o=32,s=128,l=256,c=1/0,u=9007199254740991,h=NaN,d=4294967295,p=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",o],["partialRight",64],["rearg",l]],f="[object Arguments]",g="[object Array]",m="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",x="[object GeneratorFunction]",w="[object Map]",E="[object Number]",k="[object Object]",T="[object Promise]",_="[object RegExp]",C="[object Set]",S="[object String]",A="[object Symbol]",N="[object WeakMap]",I="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",P="[object Int32Array]",$="[object Uint8Array]",B="[object Uint8ClampedArray]",F="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,W=RegExp(G.source),V=RegExp(q.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",ke="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Se="['’]",Ae="["+xe+"]",Ne="["+Ce+"]",Ie="["+we+"]",Oe="\\d+",Le="["+Ee+"]",Me="["+ke+"]",Re="[^"+xe+Ce+Oe+Ee+ke+Te+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+xe+"]",$e="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Te+"]",ze="\\u200d",je="(?:"+Me+"|"+Re+")",He="(?:"+Fe+"|"+Re+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Ie+"|"+De+")"+"?",We="["+_e+"]?",Ve=We+qe+("(?:"+ze+"(?:"+[Pe,$e,Be].join("|")+")"+We+qe+")*"),Ye="(?:"+[Le,$e,Be].join("|")+")"+Ve,Xe="(?:"+[Pe+Ie+"?",Ie,$e,Be,Ae].join("|")+")",Ke=RegExp(Se,"g"),Qe=RegExp(Ie,"g"),Ze=RegExp(De+"(?="+De+")|"+Xe+Ve,"g"),Je=RegExp([Fe+"?"+Me+"+"+Ue+"(?="+[Ne,Fe,"$"].join("|")+")",He+"+"+Ge+"(?="+[Ne,Fe+je,"$"].join("|")+")",Fe+"?"+je+"+"+Ue,Fe+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+ze+xe+we+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[L]=it[M]=it[R]=it[D]=it[P]=it[$]=it[B]=it[F]=it[z]=!0,it[f]=it[g]=it[I]=it[m]=it[O]=it[y]=it[v]=it[b]=it[w]=it[E]=it[k]=it[_]=it[C]=it[S]=it[N]=!1;var at={};at[f]=at[g]=at[I]=at[O]=at[m]=at[y]=at[L]=at[M]=at[R]=at[D]=at[P]=at[w]=at[E]=at[k]=at[_]=at[C]=at[S]=at[A]=at[$]=at[B]=at[F]=at[z]=!0,at[v]=at[b]=at[N]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,pt=dt&&e&&!e.nodeType&&e,ft=pt&&pt.exports===dt,gt=ft&&ct.process,mt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,bt=mt&&mt.isMap,xt=mt&&mt.isRegExp,wt=mt&&mt.isSet,Et=mt&&mt.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function en(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var tn=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(e){return"\\"+ot[e]}function an(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function sn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var gn=function e(t){var re,xe=(t=null==t?ht:gn.defaults(ht.Object(),t,gn.pick(ht,nt))).Array,we=t.Date,Ee=t.Error,ke=t.Function,Te=t.Math,_e=t.Object,Ce=t.RegExp,Se=t.String,Ae=t.TypeError,Ne=xe.prototype,Ie=ke.prototype,Oe=_e.prototype,Le=t["__core-js_shared__"],Me=Ie.toString,Re=Oe.hasOwnProperty,De=0,Pe=(re=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",$e=Oe.toString,Be=Me.call(_e),Fe=ht._,ze=Ce("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=ft?t.Buffer:n,He=t.Symbol,Ue=t.Uint8Array,Ge=je?je.allocUnsafe:n,qe=sn(_e.getPrototypeOf,_e),We=_e.create,Ve=Oe.propertyIsEnumerable,Ye=Ne.splice,Xe=He?He.isConcatSpreadable:n,Ze=He?He.iterator:n,et=He?He.toStringTag:n,ot=function(){try{var e=ua(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ht.Date.now&&we.now,dt=t.setTimeout!==ht.setTimeout&&t.setTimeout,pt=Te.ceil,gt=Te.floor,mt=_e.getOwnPropertySymbols,Pt=je?je.isBuffer:n,Gt=t.isFinite,Qt=Ne.join,mn=sn(_e.keys,_e),yn=Te.max,vn=Te.min,bn=we.now,xn=t.parseInt,wn=Te.random,En=Ne.reverse,kn=ua(t,"DataView"),Tn=ua(t,"Map"),_n=ua(t,"Promise"),Cn=ua(t,"Set"),Sn=ua(t,"WeakMap"),An=ua(_e,"create"),Nn=Sn&&new Sn,In={},On=Pa(kn),Ln=Pa(Tn),Mn=Pa(_n),Rn=Pa(Cn),Dn=Pa(Sn),Pn=He?He.prototype:n,$n=Pn?Pn.valueOf:n,Bn=Pn?Pn.toString:n;function Fn(e){if(es(e)&&!Uo(e)&&!(e instanceof Un)){if(e instanceof Hn)return e;if(Re.call(e,"__wrapped__"))return $a(e)}return new Hn(e)}var zn=function(){function e(){}return function(t){if(!Jo(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function jn(){}function Hn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,r,i,a,o){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!Jo(e))return e;var h=Uo(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Re.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ai(e,s)}else{var d=pa(e),p=d==b||d==x;if(Vo(e))return Ei(e,l);if(d==k||d==f||p&&!a){if(s=c||p?{}:ga(e),!l)return c?function(e,t){return Ni(e,da(e),t)}(e,function(e,t){return e&&Ni(t,Os(t),e)}(s,e)):function(e,t){return Ni(e,ha(e),t)}(e,rr(s,e))}else{if(!at[d])return a?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return ki(e);case m:case y:return new r(+e);case O:return function(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case M:case R:case D:case P:case $:case B:case F:case z:return Ti(e,n);case w:return new r;case E:case S:return new r(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case A:return i=e,$n?_e($n.call(i)):{}}var i}(e,d,l)}}o||(o=new Yn);var g=o.get(e);if(g)return g;o.set(e,s),as(e)?e.forEach(function(n){s.add(sr(n,t,r,n,e,o))}):ts(e)&&e.forEach(function(n,i){s.set(i,sr(n,t,r,i,e,o))});var v=h?n:(u?c?ra:na:c?Os:Is)(e);return _t(v||e,function(n,i){v&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,o))}),s}function lr(e,t,r){var i=r.length;if(null==e)return!i;for(e=_e(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Ae(r);return Na(function(){e.apply(n,i)},t)}function ur(e,t,n,r){var i=-1,a=Nt,o=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Ot(t,Xt(n))),r?(a=It,o=!1):t.length>=200&&(a=Zt,o=!1,t=new Vn(t));e:for(;++i-1},qn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Tn||qn),string:new Gn}},Wn.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return la(this,e).get(e)},Wn.prototype.has=function(e){return la(this,e).has(e)},Wn.prototype.set=function(e,t){var n=la(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(e){return this.__data__.set(e,i),this},Vn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Tn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var hr=Li(br),dr=Li(xr,!0);function pr(e,t){var n=!0;return hr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function fr(e,t,r){for(var i=-1,a=e.length;++i0&&n(s)?t>1?mr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var yr=Mi(),vr=Mi(!0);function br(e,t){return e&&yr(e,t,Is)}function xr(e,t){return e&&vr(e,t,Is)}function wr(e,t){return At(t,function(t){return Ko(e[t])})}function Er(e,t){for(var r=0,i=(t=vi(t,e)).length;null!=e&&rt}function Cr(e,t){return null!=e&&Re.call(e,t)}function Sr(e,t){return null!=e&&t in _e(e)}function Ar(e,t,r){for(var i=r?It:Nt,a=e[0].length,o=e.length,s=o,l=xe(o),c=1/0,u=[];s--;){var h=e[s];s&&t&&(h=Ot(h,Xt(t))),c=vn(h.length,c),l[s]=!r&&(t||a>=120&&h.length>=120)?new Vn(s&&h):n}h=e[0];var d=-1,p=l[0];e:for(;++d=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Gr(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ya(i)?Ye.call(e,i,1):ui(e,i)}}return e}function Vr(e,t){return e+gt(wn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Ia(_a(e,t,nl),e+"")}function Kr(e){return Kn(Fs(e))}function Qr(e,t){var n=Fs(e);return Ma(n,or(t,0,n.length))}function Zr(e,t,r,i){if(!Jo(e))return e;for(var a=-1,o=(t=vi(t,e)).length,s=o-1,l=e;null!=l&&++ai?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=xe(i);++r>>1,o=e[a];null!==o&&!ss(o)&&(n?o<=t:o=200){var c=t?null:Yi(e);if(c)return cn(c);o=!1,i=Zt,l=new Vn}else l=t?[]:s;e:for(;++r=i?e:ni(e,t,r)}var wi=ct||function(e){return ht.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function ki(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ti(e,t){var n=t?ki(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _i(e,t){if(e!==t){var r=e!==n,i=null===e,a=e==e,o=ss(e),s=t!==n,l=null===t,c=t==t,u=ss(t);if(!l&&!u&&!o&&e>t||o&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!a)return 1;if(!i&&!o&&!u&&e1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(a--,o):n,s&&va(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_e(t);++i-1?a[o?t[s]:s]:n}}function Bi(e){return ta(function(t){var i=t.length,a=i,o=Hn.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if("function"!=typeof s)throw new Ae(r);if(o&&!l&&"wrapper"==aa(s))var l=new Hn([],!0)}for(a=l?a:i;++a1&&b.reverse(),d&&ul))return!1;var u=o.get(e),h=o.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&r?new Vn:n;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(p,function(n){var r="_."+n[0];t&n[1]&&!Nt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(oe):[]}(r),n)))}function La(e){var t=0,r=0;return function(){var i=bn(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ma(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ro(e,r)});function uo(e){var t=Fn(e);return t.__chain__=!0,t}function ho(e,t){return t(e)}var po=ta(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Un&&ya(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ho,args:[a],thisArg:n}),new Hn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(a)});var fo=Ii(function(e,t,n){Re.call(e,n)?++e[n]:ir(e,n,1)});var go=$i(ja),mo=$i(Ha);function yo(e,t){return(Uo(e)?_t:hr)(e,sa(t,3))}function vo(e,t){return(Uo(e)?Ct:dr)(e,sa(t,3))}var bo=Ii(function(e,t,n){Re.call(e,n)?e[n].push(t):ir(e,n,[t])});var xo=Xr(function(e,t,n){var r=-1,i="function"==typeof t,a=qo(e)?xe(e.length):[];return hr(e,function(e){a[++r]=i?kt(t,e,n):Nr(e,t,n)}),a}),wo=Ii(function(e,t,n){ir(e,n,t)});function Eo(e,t){return(Uo(e)?Ot:Br)(e,sa(t,3))}var ko=Ii(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var To=Xr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&va(e,t[0],t[1])?t=[]:n>2&&va(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,mr(t,1),[])}),_o=ut||function(){return ht.Date.now()};function Co(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ki(e,s,n,n,n,n,t)}function So(e,t){var i;if("function"!=typeof t)throw new Ae(r);return e=ps(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ao=Xr(function(e,t,n){var r=1;if(n.length){var i=ln(n,oa(Ao));r|=o}return Ki(e,r,t,n,i)}),No=Xr(function(e,t,n){var r=3;if(n.length){var i=ln(n,oa(No));r|=o}return Ki(t,r,e,n,i)});function Io(e,t,i){var a,o,s,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Ae(r);function g(t){var r=a,i=o;return a=o=n,h=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||p&&e-h>=s}function y(){var e=_o();if(m(e))return v(e);c=Na(y,function(e){var n=t-(e-u);return p?vn(n,s-(e-h)):n}(e))}function v(e){return c=n,f&&a?g(e):(a=o=n,l)}function b(){var e=_o(),r=m(e);if(a=arguments,o=this,u=e,r){if(c===n)return function(e){return h=e,c=Na(y,t),d?g(e):l}(u);if(p)return wi(c),c=Na(y,t),g(u)}return c===n&&(c=Na(y,t)),l}return t=gs(t)||0,Jo(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(gs(i.maxWait)||0,t):s,f="trailing"in i?!!i.trailing:f),b.cancel=function(){c!==n&&wi(c),h=0,a=u=o=c=n},b.flush=function(){return c===n?l:v(_o())},b}var Oo=Xr(function(e,t){return cr(e,1,t)}),Lo=Xr(function(e,t,n){return cr(e,gs(t)||0,n)});function Mo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Mo.Cache||Wn),n}function Ro(e){if("function"!=typeof e)throw new Ae(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Mo.Cache=Wn;var Do=bi(function(e,t){var n=(t=1==t.length&&Uo(t[0])?Ot(t[0],Xt(sa())):Ot(mr(t,1),Xt(sa()))).length;return Xr(function(r){for(var i=-1,a=vn(r.length,n);++i=t}),Ho=Ir(function(){return arguments}())?Ir:function(e){return es(e)&&Re.call(e,"callee")&&!Ve.call(e,"callee")},Uo=xe.isArray,Go=yt?Xt(yt):function(e){return es(e)&&Tr(e)==I};function qo(e){return null!=e&&Zo(e.length)&&!Ko(e)}function Wo(e){return es(e)&&qo(e)}var Vo=Pt||gl,Yo=vt?Xt(vt):function(e){return es(e)&&Tr(e)==y};function Xo(e){if(!es(e))return!1;var t=Tr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Ko(e){if(!Jo(e))return!1;var t=Tr(e);return t==b||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==ps(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Jo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&pa(e)==w};function ns(e){return"number"==typeof e||es(e)&&Tr(e)==E}function rs(e){if(!es(e)||Tr(e)!=k)return!1;var t=qe(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Be}var is=xt?Xt(xt):function(e){return es(e)&&Tr(e)==_};var as=wt?Xt(wt):function(e){return es(e)&&pa(e)==C};function os(e){return"string"==typeof e||!Uo(e)&&es(e)&&Tr(e)==S}function ss(e){return"symbol"==typeof e||es(e)&&Tr(e)==A}var ls=Et?Xt(Et):function(e){return es(e)&&Zo(e.length)&&!!it[Tr(e)]};var cs=qi($r),us=qi(function(e,t){return e<=t});function hs(e){if(!e)return[];if(qo(e))return os(e)?dn(e):Ai(e);if(Ze&&e[Ze])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ze]());var t=pa(e);return(t==w?on:t==C?cn:Fs)(e)}function ds(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ps(e){var t=ds(e),n=t%1;return t==t?n?t-n:t:0}function fs(e){return e?or(ps(e),0,d):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return h;if(Jo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Jo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var n=pe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?h:+e}function ms(e){return Ni(e,Os(e))}function ys(e){return null==e?"":li(e)}var vs=Oi(function(e,t){if(Ea(t)||qo(t))Ni(t,Is(t),e);else for(var n in t)Re.call(t,n)&&er(e,n,t[n])}),bs=Oi(function(e,t){Ni(t,Os(t),e)}),xs=Oi(function(e,t,n,r){Ni(t,Os(t),e,r)}),ws=Oi(function(e,t,n,r){Ni(t,Is(t),e,r)}),Es=ta(ar);var ks=Xr(function(e,t){e=_e(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&va(t[0],t[1],a)&&(i=1);++r1),t}),Ni(e,ra(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)ui(n,t[i]);return n});var Ds=ta(function(e,t){return null==e?{}:function(e,t){return Gr(e,t,function(t,n){return Cs(e,n)})}(e,t)});function Ps(e,t){if(null==e)return{};var n=Ot(ra(e),function(e){return[e]});return t=sa(t),Gr(e,n,function(e,n){return t(e,n[0])})}var $s=Xi(Is),Bs=Xi(Os);function Fs(e){return null==e?[]:Kt(e,Is(e))}var zs=Di(function(e,t,n){return t=t.toLowerCase(),e+(n?js(t):t)});function js(e){return Xs(ys(e).toLowerCase())}function Hs(e){return(e=ys(e))&&e.replace(ye,tn).replace(Qe,"")}var Us=Di(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Gs=Di(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qs=Ri("toLowerCase");var Ws=Di(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Vs=Di(function(e,t,n){return e+(n?" ":"")+Xs(t)});var Ys=Di(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,r){return e=ys(e),(t=r?n:t)===n?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Qs=Xr(function(e,t){try{return kt(e,n,t)}catch(e){return Xo(e)?e:new Ee(e)}}),Zs=ta(function(e,t){return _t(t,function(t){t=Da(t),ir(e,t,Ao(e[t],e))}),e});function Js(e){return function(){return e}}var el=Bi(),tl=Bi(!0);function nl(e){return e}function rl(e){return Rr("function"==typeof e?e:sr(e,1))}var il=Xr(function(e,t){return function(n){return Nr(n,e,t)}}),al=Xr(function(e,t){return function(n){return Nr(e,n,t)}});function ol(e,t,n){var r=Is(t),i=wr(t,r);null!=n||Jo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Is(t)));var a=!(Jo(n)&&"chain"in n&&!n.chain),o=Ko(e);return _t(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})}),e}function sl(){}var ll=Hi(Ot),cl=Hi(St),ul=Hi(Dt);function hl(e){return ba(e)?Ut(Da(e)):function(e){return function(t){return Er(t,e)}}(e)}var dl=Gi(),pl=Gi(!0);function fl(){return[]}function gl(){return!1}var ml=ji(function(e,t){return e+t},0),yl=Vi("ceil"),vl=ji(function(e,t){return e/t},1),bl=Vi("floor");var xl=ji(function(e,t){return e*t},1),wl=Vi("round"),El=ji(function(e,t){return e-t},0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Ae(r);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=Co,Fn.assign=vs,Fn.assignIn=bs,Fn.assignInWith=xs,Fn.assignWith=ws,Fn.at=Es,Fn.before=So,Fn.bind=Ao,Fn.bindAll=Zs,Fn.bindKey=No,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Uo(e)?e:[e]},Fn.chain=uo,Fn.chunk=function(e,t,r){t=(r?va(e,t,r):t===n)?1:yn(ps(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=xe(pt(i/t));aa?0:a+r),(i=i===n||i>a?a:ps(i))<0&&(i+=a),i=r>i?0:fs(i);r>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&an(e)?xi(dn(e),0,r):e.split(t,r):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Ae(r);return t=null==t?0:yn(ps(t),0),Xr(function(n){var r=n[t],i=xi(n,0,t);return r&&Lt(i,r),kt(e,this,i)})},Fn.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Fn.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:ps(t))<0?0:t):[]},Fn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:ps(t)))<0?0:t,i):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?di(e,sa(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?di(e,sa(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new Ae(r);return Jo(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),Io(e,t,{leading:i,maxWait:t,trailing:a})},Fn.thru=ho,Fn.toArray=hs,Fn.toPairs=$s,Fn.toPairsIn=Bs,Fn.toPath=function(e){return Uo(e)?Ot(e,Da):ss(e)?[e]:Ai(Ra(ys(e)))},Fn.toPlainObject=ms,Fn.transform=function(e,t,n){var r=Uo(e),i=r||Vo(e)||ls(e);if(t=sa(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:Jo(e)&&Ko(a)?zn(qe(e)):{}}return(i?_t:br)(e,function(e,r,i){return t(n,e,r,i)}),n},Fn.unary=function(e){return Co(e,1)},Fn.union=Ja,Fn.unionBy=eo,Fn.unionWith=to,Fn.uniq=function(e){return e&&e.length?ci(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?ci(e,sa(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Fn.unset=function(e,t){return null==e||ui(e,t)},Fn.unzip=no,Fn.unzipWith=ro,Fn.update=function(e,t,n){return null==e?e:hi(e,t,yi(n))},Fn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:hi(e,t,yi(r),i)},Fn.values=Fs,Fn.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Fn.without=io,Fn.words=Ks,Fn.wrap=function(e,t){return Po(yi(t),e)},Fn.xor=ao,Fn.xorBy=oo,Fn.xorWith=so,Fn.zip=lo,Fn.zipObject=function(e,t){return gi(e||[],t||[],er)},Fn.zipObjectDeep=function(e,t){return gi(e||[],t||[],Zr)},Fn.zipWith=co,Fn.entries=$s,Fn.entriesIn=Bs,Fn.extend=bs,Fn.extendWith=xs,ol(Fn,Fn),Fn.add=ml,Fn.attempt=Qs,Fn.camelCase=zs,Fn.capitalize=js,Fn.ceil=yl,Fn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=gs(r))==r?r:0),t!==n&&(t=(t=gs(t))==t?t:0),or(gs(e),t,r)},Fn.clone=function(e){return sr(e,4)},Fn.cloneDeep=function(e){return sr(e,5)},Fn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},Fn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},Fn.conformsTo=function(e,t){return null==t||lr(e,t,Is(t))},Fn.deburr=Hs,Fn.defaultTo=function(e,t){return null==e||e!=e?t:e},Fn.divide=vl,Fn.endsWith=function(e,t,r){e=ys(e),t=li(t);var i=e.length,a=r=r===n?i:or(ps(r),0,i);return(r-=t.length)>=0&&e.slice(r,a)==t},Fn.eq=Fo,Fn.escape=function(e){return(e=ys(e))&&V.test(e)?e.replace(q,nn):e},Fn.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Fn.every=function(e,t,r){var i=Uo(e)?St:pr;return r&&va(e,t,r)&&(t=n),i(e,sa(t,3))},Fn.find=go,Fn.findIndex=ja,Fn.findKey=function(e,t){return $t(e,sa(t,3),br)},Fn.findLast=mo,Fn.findLastIndex=Ha,Fn.findLastKey=function(e,t){return $t(e,sa(t,3),xr)},Fn.floor=bl,Fn.forEach=yo,Fn.forEachRight=vo,Fn.forIn=function(e,t){return null==e?e:yr(e,sa(t,3),Os)},Fn.forInRight=function(e,t){return null==e?e:vr(e,sa(t,3),Os)},Fn.forOwn=function(e,t){return e&&br(e,sa(t,3))},Fn.forOwnRight=function(e,t){return e&&xr(e,sa(t,3))},Fn.get=_s,Fn.gt=zo,Fn.gte=jo,Fn.has=function(e,t){return null!=e&&fa(e,t,Cr)},Fn.hasIn=Cs,Fn.head=Ga,Fn.identity=nl,Fn.includes=function(e,t,n,r){e=qo(e)?e:Fs(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),os(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Fn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=u},Fn.isSet=as,Fn.isString=os,Fn.isSymbol=ss,Fn.isTypedArray=ls,Fn.isUndefined=function(e){return e===n},Fn.isWeakMap=function(e){return es(e)&&pa(e)==N},Fn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Tr(e)},Fn.join=function(e,t){return null==e?"":Qt.call(e,t)},Fn.kebabCase=Us,Fn.last=Ya,Fn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=ps(r))<0?yn(i+a,0):vn(a,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Bt(e,jt,a,!0)},Fn.lowerCase=Gs,Fn.lowerFirst=qs,Fn.lt=cs,Fn.lte=us,Fn.max=function(e){return e&&e.length?fr(e,nl,_r):n},Fn.maxBy=function(e,t){return e&&e.length?fr(e,sa(t,2),_r):n},Fn.mean=function(e){return Ht(e,nl)},Fn.meanBy=function(e,t){return Ht(e,sa(t,2))},Fn.min=function(e){return e&&e.length?fr(e,nl,$r):n},Fn.minBy=function(e,t){return e&&e.length?fr(e,sa(t,2),$r):n},Fn.stubArray=fl,Fn.stubFalse=gl,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xl,Fn.nth=function(e,t){return e&&e.length?Hr(e,ps(t)):n},Fn.noConflict=function(){return ht._===this&&(ht._=Fe),this},Fn.noop=sl,Fn.now=_o,Fn.pad=function(e,t,n){e=ys(e);var r=(t=ps(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(gt(i),n)+e+Ui(pt(i),n)},Fn.padEnd=function(e,t,n){e=ys(e);var r=(t=ps(t))?hn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var a=wn();return vn(e+a*(t-e+st("1e-"+((a+"").length-1))),t)}return Vr(e,t)},Fn.reduce=function(e,t,n){var r=Uo(e)?Mt:qt,i=arguments.length<3;return r(e,sa(t,4),n,i,hr)},Fn.reduceRight=function(e,t,n){var r=Uo(e)?Rt:qt,i=arguments.length<3;return r(e,sa(t,4),n,i,dr)},Fn.repeat=function(e,t,r){return t=(r?va(e,t,r):t===n)?1:ps(t),Yr(ys(e),t)},Fn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,r){var i=-1,a=(t=vi(t,e)).length;for(a||(a=1,e=n);++iu)return[];var n=d,r=vn(e,d);t=sa(t),e-=d;for(var i=Vt(r,t);++n=o)return e;var l=r-hn(i);if(l<1)return i;var c=s?xi(s,0,l).join(""):e.slice(0,l);if(a===n)return c+i;if(s&&(l+=c.length-l),is(a)){if(e.slice(l).search(a)){var u,h=c;for(a.global||(a=Ce(a.source,ys(he.exec(a))+"g")),a.lastIndex=0;u=a.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(e.indexOf(li(a),l)!=l){var p=c.lastIndexOf(a);p>-1&&(c=c.slice(0,p))}return c+i},Fn.unescape=function(e){return(e=ys(e))&&W.test(e)?e.replace(G,fn):e},Fn.uniqueId=function(e){var t=++De;return ys(e)+t},Fn.upperCase=Ys,Fn.upperFirst=Xs,Fn.each=yo,Fn.eachRight=vo,Fn.first=Ga,ol(Fn,function(){var e={};return br(Fn,function(t,n){Re.call(Fn.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Fn.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Fn[e].placeholder=Fn}),_t(["drop","take"],function(e,t){Un.prototype[e]=function(r){r=r===n?1:yn(ps(r),0);var i=this.__filtered__&&!t?new Un(this):this.clone();return i.__filtered__?i.__takeCount__=vn(r,i.__takeCount__):i.__views__.push({size:vn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:sa(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(nl)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Xr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Nr(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Ro(sa(e)))},Un.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(d)},br(Un.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=Fn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);a&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Un,c=s[0],u=l||Uo(t),h=function(e){var t=a.apply(Fn,Lt([e],s));return i&&d?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,g=l&&!p;if(!o&&u){t=g?t:new Un(this);var m=e.apply(t,s);return m.__actions__.push({func:ho,args:[h],thisArg:n}),new Hn(m,d)}return f&&g?e.apply(this,s):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ne[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Uo(i)?i:[],e)}return this[n](function(n){return t.apply(Uo(n)?n:[],e)})}}),br(Un.prototype,function(e,t){var n=Fn[t];if(n){var r=n.name+"";Re.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}}),In[Fi(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Uo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,r=this;r instanceof jn;){var i=$a(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:ho,args:[Za],thisArg:n}),new Hn(t,this.__chain__)}return this.thru(Za)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Ze&&(Fn.prototype[Ze]=function(){return this}),Fn}();pt?((pt.exports=gn)._=gn,dt._=gn):ht._=gn}).call(Qt)}(iE,iE.exports);var aE=iE.exports;function oE(e){const{config:t={},aggregations:n=[],filter:r={},onSearch:i}=e,[a,o]=d(r);return Ow.jsx("div",{children:n.map(e=>{let n=0;e.list.forEach(e=>n+=e.count);const r=a[e.key]||[],s=e.list?.length>0&&e.list.every(e=>r.includes(e.key));return Ow.jsxs("div",{className:"mb-24px",children:[Ow.jsxs("div",{className:"mb-12px flex justify-between items-center",children:[Ow.jsx("div",{className:"text-[#999] uppercase",children:t?.[e.key]?.displayName||e.key}),Ow.jsx("div",{className:"cursor-pointer",children:Ow.jsx(Gw,{className:"w-14px h-14px text-[#bbb]",onClick:()=>(e=>{const t=aE.cloneDeep(a);delete t[e.key],o(t),i(t)})(e)})})]}),Ow.jsxs("div",{children:[Ow.jsxs("div",{className:"color-[rgba(102,102,102,1)] flex mb-16px",children:[Ow.jsx(Cy,{className:"mr-8px",checked:s,onChange:t=>((e,t)=>{const n=aE.cloneDeep(a);e?n[t.key]=t.list.map(e=>e.key):delete n[t.key],o(n),i(n)})(t.target.checked,e)}),Ow.jsxs("div",{className:"flex items-center justify-between w-[calc(100%-24px)] text-[#666]",children:[Ow.jsxs("div",{className:"flex-1 flex items-center",children:[Ow.jsx("img",{className:"w-4 h-4 mr-2",src:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22128px%22%20height%3D%22128.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M102.4%20238.933A136.533%20136.533%200%200%201%20238.933%20102.4h102.4a136.533%20136.533%200%200%201%20136.534%20136.533v102.4a136.533%20136.533%200%200%201-136.534%20136.534h-102.4A136.533%20136.533%200%200%201%20102.4%20341.333v-102.4z%20m0%20443.734a136.533%20136.533%200%200%201%20136.533-136.534h102.4a136.533%20136.533%200%200%201%20136.534%20136.534v102.4A136.533%20136.533%200%200%201%20341.333%20921.6h-102.4A136.533%20136.533%200%200%201%20102.4%20785.067v-102.4z%20m580.267-136.534a136.533%20136.533%200%200%200-136.534%20136.534v102.4A136.533%20136.533%200%200%200%20682.667%20921.6h102.4A136.533%20136.533%200%200%200%20921.6%20785.067v-102.4a136.533%20136.533%200%200%200-136.533-136.534h-102.4z%22%20fill%3D%22%23FF7744%22%20%2F%3E%3Cpath%20d%3D%22M546.133%20238.933A136.533%20136.533%200%200%201%20682.667%20102.4h102.4A136.533%20136.533%200%200%201%20921.6%20238.933v102.4a136.533%20136.533%200%200%201-136.533%20136.534h-102.4a136.533%20136.533%200%200%201-136.534-136.534v-102.4z%22%20fill%3D%22%23FFAA44%22%20%2F%3E%3C%2Fsvg%3E"}),"All"]}),Ow.jsx("div",{children:n||0})]})]}),e.list.map((t,n)=>Ow.jsxs("div",{className:"color-[rgba(102,102,102,1)] flex mb-16px",children:[Ow.jsx(Cy,{className:"mr-8px",checked:r?.some(e=>e===t.key),onChange:n=>((e,t,n)=>{const r=aE.cloneDeep(a);if(e)r[t.key]||(r[t.key]=[]),r[t.key].push(n.key);else{const e=r[t.key]?.findIndex(e=>e===n.key);-1!==e&&r[t.key].splice(e,1),0===r[t.key]?.length&&delete r[t.key]}o(r),i(r)})(n.target.checked,e,t)}),Ow.jsxs("div",{className:"flex items-center justify-between w-[calc(100%-24px)] gap-6px text-[#666]",children:[Ow.jsxs("div",{className:"flex-1 flex items-center truncate",children:[Ow.jsx("img",{className:"w-4 h-4 mr-2",src:t.icon||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20class%3D%22icon%22%20width%3D%22128px%22%20height%3D%22128.00px%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M512%200c282.7776%200%20512%20229.2224%20512%20512s-229.2224%20512-512%20512S0%20794.7776%200%20512%20229.2224%200%20512%200z%20m102.4%20716.8H409.6a51.2%2051.2%200%200%200%200%20102.4h204.8a51.2%2051.2%200%200%200%200-102.4z%20m51.2-204.8H358.4a51.2%2051.2%200%200%200%200%20102.4h307.2a51.2%2051.2%200%200%200%200-102.4z%20m51.2-204.8H307.2a51.2%2051.2%200%201%200%200%20102.4h409.6a51.2%2051.2%200%200%200%200-102.4z%22%20fill%3D%22%230080FF%22%20%2F%3E%3C%2Fsvg%3E"}),t.name||t.key]}),Ow.jsx("div",{className:"flex-shrink-0",children:t.count})]})]},n))]})]},e.key)})})}function sE(e){const{hits:t,isMobile:n}=e;return Ow.jsxs("div",{className:"flex justify-between items-center w-full text-[#999]",children:[Ow.jsxs("div",{className:"text-12px",children:["Found ",t?.total||0," records (",t?.took||0," millisecond)"]}),n?Ow.jsx(Yw,{className:"w-14px h-14px"}):null]})}var lE="index-module__detail___InBmd",cE={exports:{}};cE.exports=function(e,t,n){e=e||{};var r=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var l,c,u,h=a.$locale().relativeTime||i,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=d.length,f=0;f0,m<=g.r||!g.r){m<=1&&f>0&&(g=d[f-1]);var y=h[g.l];s&&(m=s(""+m)),c="string"==typeof y?y.replace("%d",m):y(m,r,g.l,u);break}}if(r)return c;var v=u?h.future:h.past;return"function"==typeof v?v(c):v.replace("%s",c)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}};var uE=Zt(cE.exports);Rm.extend(uE);const hE=e=>{const t=Rm(e);return Rm().diff(t)<=6048e5},dE=e=>{const t=Rm(e);return hE(e)?t.fromNow():t.format("YYYY-MM-DD HH:mm:ss")};function pE(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function GE(e,t){return t in e?e[t]:t}function qE(e,t){return GE(e,t.toLowerCase())}const WE=HE({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:DE,acceptCharset:RE,accessKey:RE,action:null,allow:null,allowFullScreen:IE,allowPaymentRequest:IE,allowUserMedia:IE,alt:null,as:null,async:IE,autoCapitalize:null,autoComplete:RE,autoFocus:IE,autoPlay:IE,blocking:RE,capture:null,charSet:null,checked:IE,cite:null,className:RE,cols:ME,colSpan:null,content:null,contentEditable:OE,controls:IE,controlsList:RE,coords:ME|DE,crossOrigin:null,data:null,dateTime:null,decoding:null,default:IE,defer:IE,dir:null,dirName:null,disabled:IE,download:LE,draggable:OE,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:IE,formTarget:null,headers:RE,height:ME,hidden:LE,high:ME,href:null,hrefLang:null,htmlFor:RE,httpEquiv:RE,id:null,imageSizes:null,imageSrcSet:null,inert:IE,inputMode:null,integrity:null,is:null,isMap:IE,itemId:null,itemProp:RE,itemRef:RE,itemScope:IE,itemType:RE,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:IE,low:ME,manifest:null,max:null,maxLength:ME,media:null,method:null,min:null,minLength:ME,multiple:IE,muted:IE,name:null,nonce:null,noModule:IE,noValidate:IE,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:IE,optimum:ME,pattern:null,ping:RE,placeholder:null,playsInline:IE,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:IE,referrerPolicy:null,rel:RE,required:IE,reversed:IE,rows:ME,rowSpan:ME,sandbox:RE,scope:null,scoped:IE,seamless:IE,selected:IE,shadowRootClonable:IE,shadowRootDelegatesFocus:IE,shadowRootMode:null,shape:null,size:ME,sizes:null,slot:null,span:ME,spellCheck:OE,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ME,step:null,style:null,tabIndex:ME,target:null,title:null,translate:null,type:null,typeMustMatch:IE,useMap:null,value:OE,width:ME,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:RE,axis:null,background:null,bgColor:null,border:ME,borderColor:null,bottomMargin:ME,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:IE,declare:IE,event:null,face:null,frame:null,frameBorder:null,hSpace:ME,leftMargin:ME,link:null,longDesc:null,lowSrc:null,marginHeight:ME,marginWidth:ME,noResize:IE,noHref:IE,noShade:IE,noWrap:IE,object:null,profile:null,prompt:null,rev:null,rightMargin:ME,rules:null,scheme:null,scrolling:OE,standby:null,summary:null,text:null,topMargin:ME,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ME,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:IE,disableRemotePlayback:IE,prefix:null,property:null,results:ME,security:null,unselectable:null},space:"html",transform:qE}),VE=HE({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:PE,accentHeight:ME,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ME,amplitude:ME,arabicForm:null,ascent:ME,attributeName:null,attributeType:null,azimuth:ME,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ME,by:null,calcMode:null,capHeight:ME,className:RE,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ME,diffuseConstant:ME,direction:null,display:null,dur:null,divisor:ME,dominantBaseline:null,download:IE,dx:null,dy:null,edgeMode:null,editable:null,elevation:ME,enableBackground:null,end:null,event:null,exponent:ME,externalResourcesRequired:null,fill:null,fillOpacity:ME,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:DE,g2:DE,glyphName:DE,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ME,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ME,horizOriginX:ME,horizOriginY:ME,id:null,ideographic:ME,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ME,k:ME,k1:ME,k2:ME,k3:ME,k4:ME,kernelMatrix:PE,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ME,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ME,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ME,overlineThickness:ME,paintOrder:null,panose1:null,path:null,pathLength:ME,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:RE,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ME,pointsAtY:ME,pointsAtZ:ME,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:PE,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:PE,rev:PE,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:PE,requiredFeatures:PE,requiredFonts:PE,requiredFormats:PE,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ME,specularExponent:ME,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ME,strikethroughThickness:ME,string:null,stroke:null,strokeDashArray:PE,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ME,strokeOpacity:ME,strokeWidth:null,style:null,surfaceScale:ME,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:PE,tabIndex:ME,tableValues:null,target:null,targetX:ME,targetY:ME,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:PE,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ME,underlineThickness:ME,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ME,values:null,vAlphabetic:ME,vMathematical:ME,vectorEffect:null,vHanging:ME,vIdeographic:ME,version:null,vertAdvY:ME,vertOriginX:ME,vertOriginY:ME,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ME,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:GE}),YE=HE({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),XE=HE({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qE}),KE=HE({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),QE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ZE=/[A-Z]/g,JE=/-[a-z]/g,ek=/^data[-\w.:]+$/i;function tk(e,t){const n=SE(t);let r=t,i=AE;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ek.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(JE,rk);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!JE.test(e)){let n=e.replace(ZE,nk);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=zE}return new i(r,t)}function nk(e){return"-"+e.toLowerCase()}function rk(e){return e.charAt(1).toUpperCase()}const ik=CE([UE,WE,YE,XE,KE],"html"),ak=CE([UE,VE,YE,XE,KE],"svg");function ok(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function sk(e){return e.join(" ").trim()}var lk={},ck=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,uk=/\n/g,hk=/^\s*/,dk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pk=/^:\s*/,fk=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,gk=/^[;\s]*/,mk=/^\s+|\s+$/g,yk="";function vk(e){return e?e.replace(mk,yk):yk}var bk=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(e){var t=e.match(uk);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),c(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(i){var a=new Error(t.source+":"+n+":"+r+": "+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function l(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function c(){l(hk)}function u(e){var t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;yk!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,yk===e.charAt(n-1))return s("End of comment missing");var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:"comment",comment:o})}}function d(){var e=a(),t=l(dk);if(t){if(h(),!l(pk))return s("property missing ':'");var n=l(fk),r=e({type:"declaration",property:vk(t[0].replace(ck,yk)),value:n?vk(n[0].replace(ck,yk)):yk});return l(gk),r}}return o.prototype.content=e,c(),function(){var e,t=[];for(u(t);e=d();)!1!==e&&(t.push(e),u(t));return t}()},xk=Qt&&Qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lk,"__esModule",{value:!0}),lk.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,wk.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:a}=e;i?t(r,a,e):a&&(n=n||{},n[r]=a)}),n};const wk=xk(bk);var Ek={};Object.defineProperty(Ek,"__esModule",{value:!0}),Ek.camelCase=void 0;var kk=/^--[a-zA-Z0-9_-]+$/,Tk=/-([a-z])/g,_k=/^[^-]+$/,Ck=/^-(webkit|moz|ms|o|khtml)-/,Sk=/^-(ms)-/,Ak=function(e,t){return t.toUpperCase()},Nk=function(e,t){return"".concat(t,"-")};Ek.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||_k.test(e)||kk.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(Sk,Nk):e.replace(Ck,Nk)).replace(Tk,Ak))};var Ik=(Qt&&Qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(lk),Ok=Ek;function Lk(e,t){var n={};return e&&"string"==typeof e?((0,Ik.default)(e,function(e,r){e&&r&&(n[(0,Ok.camelCase)(e,t)]=r)}),n):n}Lk.default=Lk;var Mk=Zt(Lk);const Rk=Pk("end"),Dk=Pk("start");function Pk(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function $k(e){return e&&"object"==typeof e?"position"in e||"type"in e?Fk(e.position):"start"in e||"end"in e?Fk(e):"line"in e||"column"in e?Bk(e):"":""}function Bk(e){return zk(e&&e.line)+":"+zk(e&&e.column)}function Fk(e){return Bk(e&&e.start)+"-"+Bk(e&&e.end)}function zk(e){return e&&"number"==typeof e?e:1}class jk extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=$k(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jk.prototype.file="",jk.prototype.name="",jk.prototype.reason="",jk.prototype.message="",jk.prototype.stack="",jk.prototype.column=void 0,jk.prototype.line=void 0,jk.prototype.ancestors=void 0,jk.prototype.cause=void 0,jk.prototype.fatal=void 0,jk.prototype.place=void 0,jk.prototype.ruleId=void 0,jk.prototype.source=void 0;const Hk={}.hasOwnProperty,Uk=new Map,Gk=/[A-Z]/g,qk=new Set(["table","tbody","thead","tfoot","tr"]),Wk=new Set(["td","th"]),Vk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Yk(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,i,a){const o=Array.isArray(i.children),s=Dk(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,i,a){const o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}(0,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ak:ik,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=Xk(i,e,void 0);return a&&"string"!=typeof a?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Xk(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=ak,e.schema=i);e.ancestors.push(t);const a=eT(e,t.tagName,!1),o=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&Hk.call(t.properties,i)){const a=Jk(e,i,t.properties[i]);if(a){const[i,o]=a;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof o&&Wk.has(t.tagName)?r=o:n[i]=o}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Zk(e,t);qk.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&TE(t.value):TE(t));var t}));return Kk(e,o,a,t),Qk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}tT(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=ak,e.schema=i);e.ancestors.push(t);const a=null===t.name?e.Fragment:eT(e,t.name,!0),o=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];gE(t.type);const i=t.expression;gE(i.type);const a=i.properties[0];gE(a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else tT(e,t.position);else{const i=r.name;let a;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];gE(t.type),a=e.evaluater.evaluateExpression(t.expression)}else tT(e,t.position);else a=null===r.value||r.value;n[i]=a}return n}(e,t),s=Zk(e,t);return Kk(e,o,a,t),Qk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tT(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Qk(r,Zk(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Kk(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Zk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Uk;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(hT(e,e.length,0,t),e):t}const pT={}.hasOwnProperty;function fT(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function vT(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bT=OT(/[A-Za-z]/),xT=OT(/[\dA-Za-z]/),wT=OT(/[#-'*+\--9=?A-Z^-~]/);function ET(e){return null!==e&&(e<32||127===e)}const kT=OT(/\d/),TT=OT(/[\dA-Fa-f]/),_T=OT(/[!-/:-@[-`{-~]/);function CT(e){return null!==e&&e<-2}function ST(e){return null!==e&&(e<0||32===e)}function AT(e){return-2===e||-1===e||32===e}const NT=OT(/\p{P}|\p{S}/u),IT=OT(/\s/);function OT(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function LT(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function MT(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){if(AT(r))return e.enter(n),o(r);return t(r)};function o(r){return AT(r)&&a++a))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(y(o),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},PT={tokenize:function(e,t,n){return MT(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function $T(e){return null===e||ST(e)||IT(e)?1:NT(e)?2:void 0}function BT(e,t,n){const r=[];let i=-1;for(;++i1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const h={...e[n][1].end},d={...e[u][1].start};zT(h,-s),zT(d,s),a={type:s>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[n][1].end={...a.start},e[u][1].start={...o.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=dT(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=dT(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=dT(l,BT(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=dT(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=dT(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,hT(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u=s?(e.exit("codeFencedFenceSequence"),AT(t)?MT(e,h,"whitespace")(t):h(t)):n(t)}function h(r){return null===r||CT(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,o=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===a?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),AT(t)?MT(e,c,"whitespace")(t):c(t))}function c(n){return null===n||CT(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(WT,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||CT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):AT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),MT(e,h,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function h(t){return null===t||CT(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||CT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?n(t):(e.consume(t),d)}function p(t){return e.attempt(i,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return o>0&&AT(t)?MT(e,m,"linePrefix",o+1)(t):m(t)}function m(t){return null===t||CT(t)?e.check(WT,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||CT(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}};const YT={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),MT(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?a(e):n(e)}function a(t){return null===t?s(t):CT(t)?e.attempt(XT,a,s)(t):(e.enter("codeFlowValue"),o(t))}function o(t){return null===t||CT(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),o)}function s(n){return e.exit("codeIndented"),t(n)}}},XT={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):CT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):MT(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):CT(e)?i(e):n(e)}}};const KT={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&ZT(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),ZT(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ZT(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}};function r_(e,t,n,r,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),h;if(null===t||32===t||41===t||ET(t))return n(t);return e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t)};function h(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),h(t)):null===t||60===t||CT(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(i){return u||null!==i&&41!==i&&!ST(i)?u999||null===h||91===h||93===h&&!s||94===h&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):93===h?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):CT(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||CT(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!AT(t)),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function a_(e,t,n,r,i,a){let o;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=40===t?41:t,s;return n(t)};function s(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),s(o)):null===t?n(t):CT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),MT(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||CT(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function o_(e,t){let n;return function r(i){if(CT(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(AT(i))return MT(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}const s_={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return i_.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return i=vT(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):n(t)}function o(t){return ST(t)?o_(e,s)(t):s(t)}function s(t){return r_(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(l_,c,c)(t)}function c(t){return AT(t)?MT(e,u,"whitespace")(t):u(t)}function u(a){return null===a||CT(a)?(e.exit("definition"),r.parser.defined.push(i),t(a)):n(a)}}},l_={partial:!0,tokenize:function(e,t,n){return function(t){return ST(t)?o_(e,r)(t):n(t)};function r(t){return a_(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return AT(t)?MT(e,a,"whitespace")(t):a(t)}function a(e){return null===e||CT(e)?t(e):n(e)}}};const c_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return CT(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const u_={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;"whitespace"===e[a][1].type&&(a+=2);i-2>a&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4);i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},hT(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||ST(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),o(n)):null===n||CT(n)?(e.exit("atxHeading"),t(n)):AT(n)?MT(e,a,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function o(t){return 35===t?(e.consume(t),o):(e.exit("atxHeadingSequence"),a(t))}function s(t){return null===t||35===t||ST(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),s)}}};const h_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],d_=["pre","script","style","textarea"],p_={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let i,a,o,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),a=!0,p):63===s?(e.consume(s),i=3,r.interrupt?t:R):bT(s)?(e.consume(s),o=String.fromCharCode(s),f):n(s)}function u(a){return 45===a?(e.consume(a),i=2,h):91===a?(e.consume(a),i=5,s=0,d):bT(a)?(e.consume(a),i=4,r.interrupt?t:R):n(a)}function h(i){return 45===i?(e.consume(i),r.interrupt?t:R):n(i)}function d(i){const a="CDATA[";return i===a.charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:C:d):n(i)}function p(t){return bT(t)?(e.consume(t),o=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||ST(s)){const l=47===s,c=o.toLowerCase();return l||a||!d_.includes(c)?h_.includes(o.toLowerCase())?(i=6,l?(e.consume(s),g):r.interrupt?t(s):C(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?m(s):y(s)):(i=1,r.interrupt?t(s):C(s))}return 45===s||xT(s)?(e.consume(s),o+=String.fromCharCode(s),f):n(s)}function g(i){return 62===i?(e.consume(i),r.interrupt?t:C):n(i)}function m(t){return AT(t)?(e.consume(t),m):T(t)}function y(t){return 47===t?(e.consume(t),T):58===t||95===t||bT(t)?(e.consume(t),v):AT(t)?(e.consume(t),y):T(t)}function v(t){return 45===t||46===t||58===t||95===t||xT(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),x):AT(t)?(e.consume(t),b):y(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):AT(t)?(e.consume(t),x):E(t)}function w(t){return t===l?(e.consume(t),l=null,k):null===t||CT(t)?n(t):(e.consume(t),w)}function E(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||ST(t)?b(t):(e.consume(t),E)}function k(e){return 47===e||62===e||AT(e)?y(e):n(e)}function T(t){return 62===t?(e.consume(t),_):n(t)}function _(t){return null===t||CT(t)?C(t):AT(t)?(e.consume(t),_):n(t)}function C(t){return 45===t&&2===i?(e.consume(t),I):60===t&&1===i?(e.consume(t),O):62===t&&4===i?(e.consume(t),D):63===t&&3===i?(e.consume(t),R):93===t&&5===i?(e.consume(t),M):!CT(t)||6!==i&&7!==i?null===t||CT(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(f_,P,S)(t))}function S(t){return e.check(g_,A,P)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||CT(t)?S(t):(e.enter("htmlFlowData"),C(t))}function I(t){return 45===t?(e.consume(t),R):C(t)}function O(t){return 47===t?(e.consume(t),o="",L):C(t)}function L(t){if(62===t){const n=o.toLowerCase();return d_.includes(n)?(e.consume(t),D):C(t)}return bT(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),L):C(t)}function M(t){return 93===t?(e.consume(t),R):C(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===i?(e.consume(t),R):C(t)}function D(t){return null===t||CT(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),D)}function P(n){return e.exit("htmlFlow"),t(n)}}},f_={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(HT,t,n)}}},g_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(CT(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const m_={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,a,o;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),v):bT(t)?(e.consume(t),k):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,p):bT(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):CT(t)?(o=u,L(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?O(e):45===e?h(e):u(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),6===a?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),g):CT(t)?(o=f,L(t)):(e.consume(t),f)}function g(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?O(t):93===t?(e.consume(t),m):f(t)}function y(t){return null===t||62===t?O(t):CT(t)?(o=y,L(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):CT(t)?(o=v,L(t)):(e.consume(t),v)}function b(e){return 62===e?O(e):v(e)}function x(t){return bT(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||xT(t)?(e.consume(t),w):E(t)}function E(t){return CT(t)?(o=E,L(t)):AT(t)?(e.consume(t),E):O(t)}function k(t){return 45===t||xT(t)?(e.consume(t),k):47===t||62===t||ST(t)?T(t):n(t)}function T(t){return 47===t?(e.consume(t),O):58===t||95===t||bT(t)?(e.consume(t),_):CT(t)?(o=T,L(t)):AT(t)?(e.consume(t),T):O(t)}function _(t){return 45===t||46===t||58===t||95===t||xT(t)?(e.consume(t),_):C(t)}function C(t){return 61===t?(e.consume(t),S):CT(t)?(o=C,L(t)):AT(t)?(e.consume(t),C):T(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,A):CT(t)?(o=S,L(t)):AT(t)?(e.consume(t),S):(e.consume(t),N)}function A(t){return t===i?(e.consume(t),i=void 0,I):null===t?n(t):CT(t)?(o=A,L(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||ST(t)?T(t):(e.consume(t),N)}function I(e){return 47===e||62===e||ST(e)?T(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function L(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return AT(t)?MT(e,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),o(t)}}};const y_={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t=3&&(null===a||CT(a))?(e.exit("thematicBreak"),t(a)):n(a)}function o(t){return t===r?(e.consume(t),i++,o):(e.exit("thematicBreakSequence"),AT(t)?MT(e,a,"whitespace")(t):a(t))}}};const __={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(HT,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,MT(e,t,"listItemIndent",r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!AT(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(S_,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,MT(e,e.attempt(__,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,o=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:kT(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(T_,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return kT(t)&&++o<10?(e.consume(t),s):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(HT,r.interrupt?n:c,e.attempt(C_,h,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,h(e)}function u(t){return AT(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),h):n(t)}function h(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},C_={partial:!0,tokenize:function(e,t,n){const r=this;return MT(e,function(e){const i=r.events[r.events.length-1];return!AT(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},S_={partial:!0,tokenize:function(e,t,n){const r=this;return MT(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const A_={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=o;return e.push(["exit",o,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let o,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){o="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||o))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t);return n(t)};function a(t){return t===i?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),AT(t)?MT(e,o,"lineSuffix")(t):o(t))}function o(r){return null===r||CT(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const N_={tokenize:function(e){const t=this,n=e.attempt(HT,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,MT(e,e.attempt(this.parser.constructs.flow,r,e.attempt(t_,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const I_={resolveAll:R_()},O_=M_("string"),L_=M_("text");function M_(e){return{resolveAll:R_("text"===e?D_:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return l(e)?i(e):o(e)}function o(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i-1){const e=o[0];"string"==typeof e?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}(o,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(){let e;for(;r._index0){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||J_).call(a,void 0,e[0])}for(r.position={start:K_(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:K_(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h1:t}function rC(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(iC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(iC(t.slice(i),i>0,!1)),a.join("")}function iC(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const aC={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=LT(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tC(e,t);const i={src:LT(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:LT(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tC(e,t);const i={href:LT(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:LT(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Dk(t.children[1]),o=Rk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,o=a?a.length:t.children.length;let s=-1;const l=[];for(;++s((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{const e=n([],i);for(const t of o)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{const{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of o)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of o)e.add(r(t));return e}case 7:{const{name:e,message:t}=o;return n(new sC[e](t),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new sC[a](o),i)};return r})(new Map,e)(0),cC="",{toString:uC}={},{keys:hC}=Object,dC=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=uC.call(e).slice(8,-1);switch(n){case"Array":return[1,cC];case"Object":return[2,cC];case"Date":return[3,cC];case"RegExp":return[4,cC];case"Map":return[5,cC];case"Set":return[6,cC];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},pC=([e,t])=>0===e&&("function"===t||"symbol"===t),fC=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=dC(r);switch(o){case 0:{let t=r;switch(s){case"bigint":o=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),i([s,[...e]],r)}const e=[],t=i([o,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],l=i([o,n],r);for(const t of hC(r))!e&&pC(dC(r[t]))||n.push([a(t),a(r[t])]);return l}case 3:return i([o,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{const t=[],n=i([o,t],r);for(const[n,i]of r)(e||!pC(dC(n))&&!pC(dC(i)))&&t.push([a(n),a(i)]);return n}case 6:{const t=[],n=i([o,t],r);for(const n of r)!e&&pC(dC(n))||t.push(a(n));return n}}const{message:l}=r;return i([o,{name:s,message:l}],r)};return a})(!(t||n),!!t,new Map,r)(e),r};var gC="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?lC(fC(e,t)):structuredClone(e):(e,t)=>lC(fC(e,t));function mC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function yC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const vC=function(e){if(null==e)return xC;if("function"==typeof e)return bC(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n":"")+")"})}return u;function u(){let c,u,h,d=wC;if((!t||a(i,s,l[l.length-1]||void 0))&&(d=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[EC,e];return null==e?wC:[e]}(n(i,l)),d[0]===kC))return d;if("children"in i&&i.children){const t=i;if(t.children&&d[0]!==TC)for(u=(r?t.children.length:-1)+o,h=l.concat(t);u>-1&&u0&&n.push({type:"text",value:"\n"}),n}function MC(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function RC(e,t){const n=function(e,t){const n=t||AC,r=new Map,i=new Map,a=new Map,o={...aC,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r0&&h.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...h)}else a.push(...h);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,f),s.push(f)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gC(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:"\n"},i),a}function DC(e,t){return e&&"run"in e?async function(n,r){const i=RC(n,{file:r,...t});await e.run(i,r)}:function(n,r){return RC(n,{file:r,...e||t})}}function PC(e){if(e)throw e}var $C=Object.prototype.hasOwnProperty,BC=Object.prototype.toString,FC=Object.defineProperty,zC=Object.getOwnPropertyDescriptor,jC=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===BC.call(e)},HC=function(e){if(!e||"[object Object]"!==BC.call(e))return!1;var t,n=$C.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$C.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||$C.call(e,t)},UC=function(e,t){FC&&"__proto__"===t.name?FC(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},GC=function(e,t){if("__proto__"===t){if(!$C.call(e,t))return;if(zC)return zC(e,t).value}return e[t]},qC=function e(){var t,n,r,i,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});lt.length;let o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(o&&o.then&&"function"==typeof o.then?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}(s,i)(...o):r(null,...o)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const XC={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');KC(e);let n,r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(i=a):(s=-1,i=o));r===i?i=o:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(KC(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){KC(e);let t,n=e.length,r=-1,i=0,a=-1,o=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==o&&(o=1):a>-1&&(o=-1);else if(t){i=n+1;break}}if(a<0||r<0||0===o||1===o&&a===r-1&&a===i+1)return"";return e.slice(a,r)},join:function(...e){let t,n=-1;for(;++n2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",a=0):(i=i.slice(0,r),a=i.length-1-i.lastIndexOf("/")),o=l,s=0;continue}}else if(i.length>0){i="",a=0,o=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,l):i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function KC(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QC={cwd:function(){return"/"}};function ZC(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function JC(e){if("string"==typeof e)e=new URL(e);else if(!ZC(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("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n0){let[r,...a]=t;const o=n[i][1];VC(o)&&VC(r)&&(r=WC(!0,o,r)),n[i]=[e,r,...a]}}}}const lS=(new sS).freeze();function cS(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function uS(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function hS(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dS(e){if(!VC(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function pS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fS(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new tS(e)}const gS=[],mS={allowDangerousHtml:!0},yS=/^(https?|ircs?|mailto|xmpp)$/i,vS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function bS(e){const t=function(e){const t=e.rehypePlugins||gS,n=e.remarkPlugins||gS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mS}:mS,i=lS().use(eC).use(n).use(DC,r).use(t);return i}(e),n=function(e){const t=e.children||"",n=new tS;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||xS;for(const e of vS)Object.hasOwn(t,e.from)&&mE((e.from,e.to&&e.to,e.id));return CC(e,c),Yk(e,{Fragment:Ow.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Ow.jsx,jsxs:Ow.jsxs,passKeys:!0,passNode:!0});function c(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return o?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in iT)if(Object.hasOwn(iT,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=iT[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let o=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!o&&r&&"number"==typeof t&&(o=!r(e,t,i)),o&&i&&"number"==typeof t)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function xS(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||yS.test(e.slice(0,t))?e:""}function wS(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}const ES={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),s(t)};function s(t){return 36===t?(e.consume(t),o++,s):o<2?n(t):(e.exit("mathFlowFenceSequence"),MT(e,l,"whitespace")(t))}function l(t){return null===t||CT(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||CT(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(kS,h,g)(n)}function h(t){return e.attempt({tokenize:m,partial:!0},g,d)(t)}function d(t){return(a?MT(e,p,"linePrefix",a+1):p)(t)}function p(t){return null===t?g(t):CT(t)?e.attempt(kS,h,g)(t):(e.enter("mathFlowValue"),f(t))}function f(t){return null===t||CT(t)?(e.exit("mathFlowValue"),p(t)):(e.consume(t),f)}function g(n){return e.exit("mathFlow"),t(n)}function m(e,t,n){let i=0;return MT(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function a(t){return 36===t?(i++,e.consume(t),a):i15?"…"+o.slice(n-15,n):o.slice(0,n))+s+(r+15":">","<":"<",'"':""","'":"'"},LS=/[&><"']/g;var MS=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},RS={deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(LS,e=>OS[e])},hyphenate:function(e){return e.replace(IS,"-$1").toLowerCase()},getBaseElem:MS,isCharacterBox:function(e){var t=MS(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},DS={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function PS(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class $S{constructor(e){for(var t in 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||{},DS)if(DS.hasOwnProperty(t)){var n=DS[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:PS(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new NS("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=RS.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class BS{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return FS[zS[this.id]]}sub(){return FS[jS[this.id]]}fracNum(){return FS[HS[this.id]]}fracDen(){return FS[US[this.id]]}cramp(){return FS[GS[this.id]]}text(){return FS[qS[this.id]]}isTight(){return this.size>=2}}var FS=[new BS(0,0,!1),new BS(1,0,!0),new BS(2,1,!1),new BS(3,1,!0),new BS(4,2,!1),new BS(5,2,!0),new BS(6,3,!1),new BS(7,3,!0)],zS=[4,5,4,5,6,7,6,7],jS=[5,5,5,5,7,7,7,7],HS=[2,3,4,5,6,7,6,7],US=[3,3,5,5,7,7,7,7],GS=[1,1,3,3,5,5,7,7],qS=[0,1,2,3,2,3,2,3],WS={DISPLAY:FS[0],TEXT:FS[2],SCRIPT:FS[4],SCRIPTSCRIPT:FS[6]},VS=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var YS=[];function XS(e){for(var t=0;t=YS[t]&&e<=YS[t+1])return!0;return!1}VS.forEach(e=>e.blocks.forEach(e=>YS.push(...e)));var KS=80,QS={doubleleftarrow:"M262 157\nl10-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\n 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\n 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\nc2 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\n 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\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-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\n 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\n-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\n-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\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-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\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 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\n-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\nc-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\n 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\n 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\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 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\n 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\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 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\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-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\n-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\n-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\n 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\n-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\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 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\n-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\n 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\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-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\n-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\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.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\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-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\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 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\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.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\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 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\n-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\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.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\n60.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\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 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\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.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\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 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\n-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\n 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\n 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\n-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\n-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\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-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\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.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\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-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\n 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\n 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\n-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\n-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\n 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\n-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\n 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\nm0 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\n 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\n-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\n-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\n 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\n 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\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-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\n 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\n-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\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-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\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 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\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 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\nc-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\n 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\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 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\n-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\n 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\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-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\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 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\n 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\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -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\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-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\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-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\n-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\n-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\n-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,\n-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,\n-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,\n-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,\n-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\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-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\ns-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\n121.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\ns2.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\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-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\n13.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\n-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\n-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\n-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\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,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\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM0 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\nc1.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,\n1c0,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,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 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\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-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\nc-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\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class ZS{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;te.toText()).join("")}}var JS={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},eA={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},tA={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function nA(e,t){JS[e]=t}function rA(e,t,n){if(!JS[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=JS[t][r];if(!i&&e[0]in tA&&(r=tA[e[0]].charCodeAt(0),i=JS[t][r]),i||"text"!==n||XS(r)&&(i=JS[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var iA={};var aA=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],oA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],sA=function(e,t){return t.size<2?e:aA[e-1][t.size-1]};class lA{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||lA.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=oA[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new lA(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:sA(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:oA[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=sA(lA.BASESIZE,e);return this.size===t&&this.textSize===lA.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==lA.BASESIZE?["sizing","reset-size"+this.size,"size"+lA.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!iA[t=e>=5?0:e>=3?1:2]){var n=iA[t]={cssEmPerMu:eA.quad[t]/18};for(var r in eA)eA.hasOwnProperty(r)&&(n[r]=eA[r][t])}return iA[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}lA.BASESIZE=6;var cA={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},uA={ex:!0,em:!0,mu:!0},hA=function(e){return"string"!=typeof e&&(e=e.unit),e in cA||e in uA||"ex"===e},dA=function(e,t){var n;if(e.unit in cA)n=cA[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new NS("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},pA=function(e){return+e.toFixed(4)+"em"},fA=function(e){return e.filter(e=>e).join(" ")},gA=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},mA=function(e){var t=document.createElement(e);for(var n in t.className=fA(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i/=\x00-\x1f]/,vA=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+RS.escape(fA(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=RS.hyphenate(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+RS.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(yA.test(i))throw new NS("Invalid attribute name '"+i+"'");t+=" "+i+'="'+RS.escape(this.attributes[i])+'"'}t+=">";for(var a=0;a"};class bA{constructor(e,t,n,r){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,gA.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return mA.call(this,"span")}toMarkup(){return vA.call(this,"span")}}class xA{constructor(e,t,n,r){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,gA.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return mA.call(this,"a")}toMarkup(){return vA.call(this,"a")}}class wA{constructor(e,t,n){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.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=''+RS.escape(this.alt)+'=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=EA[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=pA(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=fA(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=RS.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+RS.escape(n)+'"');var i=RS.escape(this.text);return e?(t+=">",t+=i,t+=""):i}}class TA{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n':''}}class CA{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="","\\gt",!0),OA(LA,RA,GA,"∈","\\in",!0),OA(LA,RA,GA,"","\\@not"),OA(LA,RA,GA,"⊂","\\subset",!0),OA(LA,RA,GA,"⊃","\\supset",!0),OA(LA,RA,GA,"⊆","\\subseteq",!0),OA(LA,RA,GA,"⊇","\\supseteq",!0),OA(LA,DA,GA,"⊈","\\nsubseteq",!0),OA(LA,DA,GA,"⊉","\\nsupseteq",!0),OA(LA,RA,GA,"⊨","\\models"),OA(LA,RA,GA,"←","\\leftarrow",!0),OA(LA,RA,GA,"≤","\\le"),OA(LA,RA,GA,"≤","\\leq",!0),OA(LA,RA,GA,"<","\\lt",!0),OA(LA,RA,GA,"→","\\rightarrow",!0),OA(LA,RA,GA,"→","\\to"),OA(LA,DA,GA,"≱","\\ngeq",!0),OA(LA,DA,GA,"≰","\\nleq",!0),OA(LA,RA,qA," ","\\ "),OA(LA,RA,qA," ","\\space"),OA(LA,RA,qA," ","\\nobreakspace"),OA(MA,RA,qA," ","\\ "),OA(MA,RA,qA," "," "),OA(MA,RA,qA," ","\\space"),OA(MA,RA,qA," ","\\nobreakspace"),OA(LA,RA,qA,null,"\\nobreak"),OA(LA,RA,qA,null,"\\allowbreak"),OA(LA,RA,UA,",",","),OA(LA,RA,UA,";",";"),OA(LA,DA,$A,"⊼","\\barwedge",!0),OA(LA,DA,$A,"⊻","\\veebar",!0),OA(LA,RA,$A,"⊙","\\odot",!0),OA(LA,RA,$A,"⊕","\\oplus",!0),OA(LA,RA,$A,"⊗","\\otimes",!0),OA(LA,RA,WA,"∂","\\partial",!0),OA(LA,RA,$A,"⊘","\\oslash",!0),OA(LA,DA,$A,"⊚","\\circledcirc",!0),OA(LA,DA,$A,"⊡","\\boxdot",!0),OA(LA,RA,$A,"△","\\bigtriangleup"),OA(LA,RA,$A,"▽","\\bigtriangledown"),OA(LA,RA,$A,"†","\\dagger"),OA(LA,RA,$A,"⋄","\\diamond"),OA(LA,RA,$A,"⋆","\\star"),OA(LA,RA,$A,"◃","\\triangleleft"),OA(LA,RA,$A,"▹","\\triangleright"),OA(LA,RA,HA,"{","\\{"),OA(MA,RA,WA,"{","\\{"),OA(MA,RA,WA,"{","\\textbraceleft"),OA(LA,RA,BA,"}","\\}"),OA(MA,RA,WA,"}","\\}"),OA(MA,RA,WA,"}","\\textbraceright"),OA(LA,RA,HA,"{","\\lbrace"),OA(LA,RA,BA,"}","\\rbrace"),OA(LA,RA,HA,"[","\\lbrack",!0),OA(MA,RA,WA,"[","\\lbrack",!0),OA(LA,RA,BA,"]","\\rbrack",!0),OA(MA,RA,WA,"]","\\rbrack",!0),OA(LA,RA,HA,"(","\\lparen",!0),OA(LA,RA,BA,")","\\rparen",!0),OA(MA,RA,WA,"<","\\textless",!0),OA(MA,RA,WA,">","\\textgreater",!0),OA(LA,RA,HA,"⌊","\\lfloor",!0),OA(LA,RA,BA,"⌋","\\rfloor",!0),OA(LA,RA,HA,"⌈","\\lceil",!0),OA(LA,RA,BA,"⌉","\\rceil",!0),OA(LA,RA,WA,"\\","\\backslash"),OA(LA,RA,WA,"∣","|"),OA(LA,RA,WA,"∣","\\vert"),OA(MA,RA,WA,"|","\\textbar",!0),OA(LA,RA,WA,"∥","\\|"),OA(LA,RA,WA,"∥","\\Vert"),OA(MA,RA,WA,"∥","\\textbardbl"),OA(MA,RA,WA,"~","\\textasciitilde"),OA(MA,RA,WA,"\\","\\textbackslash"),OA(MA,RA,WA,"^","\\textasciicircum"),OA(LA,RA,GA,"↑","\\uparrow",!0),OA(LA,RA,GA,"⇑","\\Uparrow",!0),OA(LA,RA,GA,"↓","\\downarrow",!0),OA(LA,RA,GA,"⇓","\\Downarrow",!0),OA(LA,RA,GA,"↕","\\updownarrow",!0),OA(LA,RA,GA,"⇕","\\Updownarrow",!0),OA(LA,RA,jA,"∐","\\coprod"),OA(LA,RA,jA,"⋁","\\bigvee"),OA(LA,RA,jA,"⋀","\\bigwedge"),OA(LA,RA,jA,"⨄","\\biguplus"),OA(LA,RA,jA,"⋂","\\bigcap"),OA(LA,RA,jA,"⋃","\\bigcup"),OA(LA,RA,jA,"∫","\\int"),OA(LA,RA,jA,"∫","\\intop"),OA(LA,RA,jA,"∬","\\iint"),OA(LA,RA,jA,"∭","\\iiint"),OA(LA,RA,jA,"∏","\\prod"),OA(LA,RA,jA,"∑","\\sum"),OA(LA,RA,jA,"⨂","\\bigotimes"),OA(LA,RA,jA,"⨁","\\bigoplus"),OA(LA,RA,jA,"⨀","\\bigodot"),OA(LA,RA,jA,"∮","\\oint"),OA(LA,RA,jA,"∯","\\oiint"),OA(LA,RA,jA,"∰","\\oiiint"),OA(LA,RA,jA,"⨆","\\bigsqcup"),OA(LA,RA,jA,"∫","\\smallint"),OA(MA,RA,FA,"…","\\textellipsis"),OA(LA,RA,FA,"…","\\mathellipsis"),OA(MA,RA,FA,"…","\\ldots",!0),OA(LA,RA,FA,"…","\\ldots",!0),OA(LA,RA,FA,"⋯","\\@cdots",!0),OA(LA,RA,FA,"⋱","\\ddots",!0),OA(LA,RA,WA,"⋮","\\varvdots"),OA(MA,RA,WA,"⋮","\\varvdots"),OA(LA,RA,PA,"ˊ","\\acute"),OA(LA,RA,PA,"ˋ","\\grave"),OA(LA,RA,PA,"¨","\\ddot"),OA(LA,RA,PA,"~","\\tilde"),OA(LA,RA,PA,"ˉ","\\bar"),OA(LA,RA,PA,"˘","\\breve"),OA(LA,RA,PA,"ˇ","\\check"),OA(LA,RA,PA,"^","\\hat"),OA(LA,RA,PA,"⃗","\\vec"),OA(LA,RA,PA,"˙","\\dot"),OA(LA,RA,PA,"˚","\\mathring"),OA(LA,RA,zA,"","\\@imath"),OA(LA,RA,zA,"","\\@jmath"),OA(LA,RA,WA,"ı","ı"),OA(LA,RA,WA,"ȷ","ȷ"),OA(MA,RA,WA,"ı","\\i",!0),OA(MA,RA,WA,"ȷ","\\j",!0),OA(MA,RA,WA,"ß","\\ss",!0),OA(MA,RA,WA,"æ","\\ae",!0),OA(MA,RA,WA,"œ","\\oe",!0),OA(MA,RA,WA,"ø","\\o",!0),OA(MA,RA,WA,"Æ","\\AE",!0),OA(MA,RA,WA,"Œ","\\OE",!0),OA(MA,RA,WA,"Ø","\\O",!0),OA(MA,RA,PA,"ˊ","\\'"),OA(MA,RA,PA,"ˋ","\\`"),OA(MA,RA,PA,"ˆ","\\^"),OA(MA,RA,PA,"˜","\\~"),OA(MA,RA,PA,"ˉ","\\="),OA(MA,RA,PA,"˘","\\u"),OA(MA,RA,PA,"˙","\\."),OA(MA,RA,PA,"¸","\\c"),OA(MA,RA,PA,"˚","\\r"),OA(MA,RA,PA,"ˇ","\\v"),OA(MA,RA,PA,"¨",'\\"'),OA(MA,RA,PA,"˝","\\H"),OA(MA,RA,PA,"◯","\\textcircled");var VA={"--":!0,"---":!0,"``":!0,"''":!0};OA(MA,RA,WA,"–","--",!0),OA(MA,RA,WA,"–","\\textendash"),OA(MA,RA,WA,"—","---",!0),OA(MA,RA,WA,"—","\\textemdash"),OA(MA,RA,WA,"‘","`",!0),OA(MA,RA,WA,"‘","\\textquoteleft"),OA(MA,RA,WA,"’","'",!0),OA(MA,RA,WA,"’","\\textquoteright"),OA(MA,RA,WA,"“","``",!0),OA(MA,RA,WA,"“","\\textquotedblleft"),OA(MA,RA,WA,"”","''",!0),OA(MA,RA,WA,"”","\\textquotedblright"),OA(LA,RA,WA,"°","\\degree",!0),OA(MA,RA,WA,"°","\\degree"),OA(MA,RA,WA,"°","\\textdegree",!0),OA(LA,RA,WA,"£","\\pounds"),OA(LA,RA,WA,"£","\\mathsterling",!0),OA(MA,RA,WA,"£","\\pounds"),OA(MA,RA,WA,"£","\\textsterling",!0),OA(LA,DA,WA,"✠","\\maltese"),OA(MA,DA,WA,"✠","\\maltese");for(var YA='0123456789/@."',XA=0;XA<14;XA++){var KA=YA.charAt(XA);OA(LA,RA,WA,KA,KA)}for(var QA='0123456789!@*()-=+";:?/.,',ZA=0;ZA<25;ZA++){var JA=QA.charAt(ZA);OA(MA,RA,WA,JA,JA)}for(var eN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",tN=0;tN<52;tN++){var nN=eN.charAt(tN);OA(LA,RA,zA,nN,nN),OA(MA,RA,WA,nN,nN)}OA(LA,DA,WA,"C","ℂ"),OA(MA,DA,WA,"C","ℂ"),OA(LA,DA,WA,"H","ℍ"),OA(MA,DA,WA,"H","ℍ"),OA(LA,DA,WA,"N","ℕ"),OA(MA,DA,WA,"N","ℕ"),OA(LA,DA,WA,"P","ℙ"),OA(MA,DA,WA,"P","ℙ"),OA(LA,DA,WA,"Q","ℚ"),OA(MA,DA,WA,"Q","ℚ"),OA(LA,DA,WA,"R","ℝ"),OA(MA,DA,WA,"R","ℝ"),OA(LA,DA,WA,"Z","ℤ"),OA(MA,DA,WA,"Z","ℤ"),OA(LA,RA,zA,"h","ℎ"),OA(MA,RA,zA,"h","ℎ");for(var rN="",iN=0;iN<52;iN++){var aN=eN.charAt(iN);OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56320+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56372+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56424+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56580+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56684+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56736+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56788+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56840+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56944+iN)),OA(MA,RA,WA,aN,rN),iN<26&&(OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56632+iN)),OA(MA,RA,WA,aN,rN),OA(LA,RA,zA,aN,rN=String.fromCharCode(55349,56476+iN)),OA(MA,RA,WA,aN,rN))}OA(LA,RA,zA,"k",rN=String.fromCharCode(55349,56668)),OA(MA,RA,WA,"k",rN);for(var oN=0;oN<10;oN++){var sN=oN.toString();OA(LA,RA,zA,sN,rN=String.fromCharCode(55349,57294+oN)),OA(MA,RA,WA,sN,rN),OA(LA,RA,zA,sN,rN=String.fromCharCode(55349,57314+oN)),OA(MA,RA,WA,sN,rN),OA(LA,RA,zA,sN,rN=String.fromCharCode(55349,57324+oN)),OA(MA,RA,WA,sN,rN),OA(LA,RA,zA,sN,rN=String.fromCharCode(55349,57334+oN)),OA(MA,RA,WA,sN,rN)}for(var lN="ÐÞþ",cN=0;cN<3;cN++){var uN=lN.charAt(cN);OA(LA,RA,zA,uN,uN),OA(MA,RA,WA,uN,uN)}var hN=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],dN=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],pN=function(e,t,n){return IA[n][e]&&IA[n][e].replace&&(e=IA[n][e].replace),{value:e,metrics:rA(e,t,n)}},fN=function(e,t,n,r,i){var a,o=pN(e,t,n),s=o.metrics;if(e=o.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),a=new kA(e,s.height,s.depth,l,s.skew,s.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),a=new kA(e,0,0,0,0,0,i);if(r){a.maxFontSize=r.sizeMultiplier,r.style.isTight()&&a.classes.push("mtight");var c=r.getColor();c&&(a.style.color=c)}return a},gN=(e,t)=>{if(fA(e.classes)!==fA(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},mN=function(e){for(var t=0,n=0,r=0,i=0;it&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},yN=function(e,t,n,r){var i=new bA(e,t,n,r);return mN(i),i},vN=(e,t,n,r)=>new bA(e,t,n,r),bN=function(e){var t=new ZS(e);return mN(t),t},xN=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},wN={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},EN={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},kN={fontMap:wN,makeSymbol:fN,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&pN(e,"Main-Bold",t).metrics?fN(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===IA[t][e].font?fN(e,"Main-Regular",t,n,r):fN(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:yN,makeSvgSpan:vN,makeLineSpan:function(e,t,n){var r=yN([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=pA(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new xA(e,t,n,r);return mN(i),i},makeFragment:bN,wrapFragment:function(e,t){return e instanceof ZS?yN([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a0)return fN(i,l,r,t,a.concat(c));if(s){var u,h;if("boldsymbol"===s){var d=function(e,t,n,r,i){return"textord"!==i&&pN(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);u=d.fontName,h=[d.fontClass]}else o?(u=wN[s].fontName,h=[s]):(u=xN(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(pN(i,u,r).metrics)return fN(i,u,r,t,a.concat(h));if(VA.hasOwnProperty(i)&&"Typewriter"===u.slice(0,10)){for(var p=[],f=0;f{var n=yN(["mspace"],[],t),r=dA(e,t);return n.style.marginRight=pA(r),n},staticSvg:function(e,t){var[n,r,i]=EN[e],a=new _A(n),o=new TA([a],{width:pA(r),height:pA(i),style:"width:"+pA(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),s=vN(["overlay"],[o],t);return s.height=i,s.style.height=pA(i),s.style.width=pA(r),s},svgData:EN,tryCombineChars:e=>{for(var t=0;t{var n=t.classes[0],r=e.classes[0];"mbin"===n&&BN.includes(r)?t.classes[0]="mord":"mbin"===r&&$N.includes(n)&&(e.classes[0]="mord")},{node:u},h,d),HN(i,(e,t)=>{var n=qN(t),r=qN(e),i=n&&r?e.hasClass("mtight")?AN[n][r]:SN[n][r]:null;if(i)return kN.makeGlue(i,l)},{node:u},h,d),i},HN=function e(t,n,r,i,a){i&&t.push(i);for(var o=0;on=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},UN=function(e){return e instanceof ZS||e instanceof xA||e instanceof bA&&e.hasClass("enclosing")?e:null},GN=function e(t,n){var r=UN(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},qN=function(e,t){return e?(t&&(e=GN(e,t)),zN[e.classes[0]]||null):null},WN=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return PN(t.concat(n))},VN=function(e,t,n){if(!e)return PN();if(IN[e.type]){var r=IN[e.type](e,t);if(n&&t.size!==n.size){r=PN(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new NS("Got group of unknown type: '"+e.type+"'")};function YN(e,t){var n=PN(["base"],e,t),r=PN(["strut"]);return r.style.height=pA(n.height+n.depth),n.depth&&(r.style.verticalAlign=pA(-n.depth)),n.children.unshift(r),n}function XN(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=jN(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var a,o=[],s=[],l=0;l0&&(o.push(YN(s,t)),s=[]),o.push(i[l]));s.length>0&&o.push(YN(s,t)),n?((a=YN(jN(n,t,!0))).classes=["tag"],o.push(a)):r&&o.push(r);var u=PN(["katex-html"],o);if(u.setAttribute("aria-hidden","true"),a){var h=a.children[0];h.style.height=pA(u.height+u.depth),u.depth&&(h.style.verticalAlign=pA(-u.depth))}return u}function KN(e){return new ZS(e)}class QN{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=fA(this.classes));for(var n=0;n0&&(e+=' class ="'+RS.escape(fA(this.classes))+'"'),e+=">";for(var n=0;n"}toText(){return this.children.map(e=>e.toText()).join("")}}class ZN{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return RS.escape(this.toText())}toText(){return this.text}}var JN={MathNode:QN,TextNode:ZN,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",pA(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},newDocumentFragment:KN},eI=function(e,t,n){return!IA[t][e]||!IA[t][e].replace||55349===e.charCodeAt(0)||VA.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=IA[t][e].replace),new JN.TextNode(e)},tI=function(e){return 1===e.length?e[0]:new JN.MathNode("mrow",e)},nI=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=e.text;return["\\imath","\\jmath"].includes(i)?null:(IA[r][i]&&IA[r][i].replace&&(i=IA[r][i].replace),rA(i,kN.fontMap[n].fontName,r)?kN.fontMap[n].variant:null)};function rI(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof ZN&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof ZN&&","===n.text}return!1}var iI=function(e,t,n){if(1===e.length){var r=oI(e[0],t);return n&&r instanceof QN&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,a=[],o=0;o=1&&("mn"===i.type||rI(i))){var l=s.children[0];l instanceof QN&&"mn"===l.type&&(l.children=[...i.children,...l.children],a.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof ZN&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof ZN&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),a.pop())}}}a.push(s),i=s}return a},aI=function(e,t,n){return tI(iI(e,t,n))},oI=function(e,t){if(!e)return new JN.MathNode("mrow");if(ON[e.type])return ON[e.type](e,t);throw new NS("Got group of unknown type: '"+e.type+"'")};function sI(e,t,n,r,i){var a,o=iI(e,n);a=1===o.length&&o[0]instanceof QN&&["mrow","mtable"].includes(o[0].type)?o[0]:new JN.MathNode("mrow",o);var s=new JN.MathNode("annotation",[new JN.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new JN.MathNode("semantics",[a,s]),c=new JN.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return kN.makeSpan([u],[c])}var lI=function(e){return new lA({style:e.displayMode?WS.DISPLAY:WS.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},cI=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=kN.makeSpan(n,[e])}return e},uI={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},hI={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},dI=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=kN.makeSpan(["stretchy",t],[],i),"fbox"===t){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new CA({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new CA({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new TA(l,{width:"100%",height:pA(o)});a=kN.makeSvgSpan([],[c],i)}return a.height=o,a.style.height=pA(o),a},pI=function(e){var t=new JN.MathNode("mo",[new JN.TextNode(uI[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},fI=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(r)){var i,a,o,s="ordgroup"===(p=e.base).type?p.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,a=r+"4"):(i=312,n=2340,o=.34,a="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],a=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new _A(a),u=new TA([c],{width:"100%",height:pA(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:kN.makeSvgSpan([],[u],t),minWidth:0,height:o}}var h,d,p,f=[],g=hI[r],[m,y,v]=g,b=v/1e3,x=m.length;if(1===x)h=["hide-tail"],d=[g[3]];else if(2===x)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w0&&(n.style.minWidth=pA(r)),n};function gI(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function mI(e){var t=yI(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function yI(e){return e&&("atom"===e.type||NA.hasOwnProperty(e.type))?e:null}var vI=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=gI(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof bA)return e;throw new Error("Expected span but got "+String(e)+".")}(VN(e,t)),e.base=r):n=(r=gI(e,"accent")).base;var a=VN(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&RS.isCharacterBox(n)){var s=RS.getBaseElem(n);o=SA(VN(s,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight);if(r.isStretchy)l=fI(r,t),l=kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+pA(2*o)+")",marginLeft:pA(2*o)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=kN.staticSvg("vec",t),d=kN.svgData.vec[1]):((h=SA(h=kN.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=kN.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=a.height);var f=o;p||(f-=d/2),l.style.left=pA(f),"\\textcircled"===r.label&&(l.style.top=".2em"),l=kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var g=kN.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=g,i.height=Math.max(g.height,i.height),i.classes[0]="mord",i):g},bI=(e,t)=>{var n=e.isStretchy?pI(e.label):new JN.MathNode("mo",[eI(e.label,e.mode)]),r=new JN.MathNode("mover",[oI(e.base,t),n]);return r.setAttribute("accent","true"),r},xI=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));LN({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=RN(t[0]),r=!xI.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:vI,mathmlBuilder:bI}),LN({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:vI,mathmlBuilder:bI}),LN({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=VN(e.base,t),r=fI(e,t),i="\\utilde"===e.label?.12:0,a=kN.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return kN.makeSpan(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=pI(e.label),r=new JN.MathNode("munder",[oI(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var wI=e=>{var t=new JN.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};LN({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),a=kN.wrapFragment(VN(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";a.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=kN.wrapFragment(VN(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var s,l=fI(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((a.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=a.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=kN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else s=kN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),kN.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=pI(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=wI(oI(e.body,t));if(e.below){var a=wI(oI(e.below,t));n=new JN.MathNode("munderover",[r,a,i])}else n=new JN.MathNode("mover",[r,i])}else if(e.below){var o=wI(oI(e.below,t));n=new JN.MathNode("munder",[r,o])}else n=wI(),n=new JN.MathNode("mover",[r,n]);return n}});var EI=kN.makeSpan;function kI(e,t){var n=jN(e.body,t,!0);return EI([e.mclass],n,t)}function TI(e,t){var n,r=iI(e.body,t);return"minner"===e.mclass?n=new JN.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new JN.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new JN.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}LN({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:DN(i),isCharacterBox:RS.isCharacterBox(i)}},htmlBuilder:kI,mathmlBuilder:TI});var _I=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};LN({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:_I(t[0]),body:DN(t[1]),isCharacterBox:RS.isCharacterBox(t[1])}}}),LN({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,a=t[1],o=t[0];n="\\stackrel"!==i?_I(a):"mrel";var s={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:DN(a)},l={type:"supsub",mode:o.mode,base:s,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:RS.isCharacterBox(l)}},htmlBuilder:kI,mathmlBuilder:TI}),LN({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:_I(t[0]),body:DN(t[0])}},htmlBuilder(e,t){var n=jN(e.body,t,!0),r=kN.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=iI(e.body,t),r=new JN.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var CI={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},SI=()=>({type:"styling",body:[],mode:"math",style:"display"}),AI=e=>"textord"===e.type&&"@"===e.text,NI=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function II(e,t,n){var r=CI[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}LN({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=kN.wrapFragment(VN(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=pA(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new JN.MathNode("mrow",[oI(e.label,t)]);return(n=new JN.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new JN.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),LN({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=kN.wrapFragment(VN(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new JN.MathNode("mrow",[oI(e.fragment,t)])}),LN({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=gI(t[0],"ordgroup").body,i="",a=0;a=1114111)throw new NS("\\@char with invalid code point "+i);return s<=65535?o=String.fromCharCode(s):(s-=65536,o=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:o}}});var OI=(e,t)=>{var n=jN(e.body,t.withColor(e.color),!1);return kN.makeFragment(n)},LI=(e,t)=>{var n=iI(e.body,t.withColor(e.color)),r=new JN.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};LN({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=gI(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:DN(i)}},htmlBuilder:OI,mathmlBuilder:LI}),LN({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=gI(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:OI,mathmlBuilder:LI}),LN({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&gI(i,"size").value}},htmlBuilder(e,t){var n=kN.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=pA(dA(e.size,t)))),n},mathmlBuilder(e,t){var n=new JN.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",pA(dA(e.size,t)))),n}});var MI={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},RI=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new NS("Expected a control sequence",e);return t},DI=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};LN({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(MI[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=MI[r.text]),gI(t.parseFunction(),"internal");throw new NS("Invalid token after macro prefix",r)}}),LN({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new NS("Expected a control sequence",r);for(var a,o=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){a=t.gullet.future(),s[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new NS('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new NS('Argument number "'+r.text+'" out of order');o++,s.push([])}else{if("EOF"===r.text)throw new NS("Expected a macro definition");s[o].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:s},n===MI[n]),{type:"internal",mode:t.mode}}}),LN({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=RI(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return DI(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),LN({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=RI(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return DI(t,r,a,"\\\\globalfuture"===n),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var PI=function(e,t,n){var r=rA(IA.math[e]&&IA.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},$I=function(e,t,n,r){var i=n.havingBaseStyle(t),a=kN.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},BI=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=pA(i),e.height-=i,e.depth+=i},FI=function(e,t,n,r,i,a){var o=function(e,t,n,r){return kN.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),s=$I(kN.makeSpan(["delimsizing","size"+t],[o],r),WS.TEXT,r,a);return n&&BI(s,r,WS.TEXT),s},zI=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:kN.makeSpan(["delimsizinginner",r],[kN.makeSpan([],[kN.makeSymbol(e,t,n)])])}},jI=function(e,t,n){var r=JS["Size4-Regular"][e.charCodeAt(0)]?JS["Size4-Regular"][e.charCodeAt(0)][4]:JS["Size1-Regular"][e.charCodeAt(0)][4],i=new _A("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),a=new TA([i],{width:pA(r),height:pA(t),style:"width:"+pA(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=kN.makeSvgSpan([],[a],n);return o.height=t,o.style.height=pA(t),o.style.width=pA(r),{type:"elem",elem:o}},HI={type:"kern",size:-.008},UI=["|","\\lvert","\\rvert","\\vert"],GI=["\\|","\\lVert","\\rVert","\\Vert"],qI=function(e,t,n,r,i,a){var o,s,l,c,u="",h=0;o=l=c=e,s=null;var d="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):UI.includes(e)?(l="∣",u="vert",h=333):GI.includes(e)?(l="∥",u="doublevert",h=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",d="Size4-Regular",u="lbrack",h=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",d="Size4-Regular",u="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",d="Size4-Regular",u="lfloor",h=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",d="Size4-Regular",u="lceil",h=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",d="Size4-Regular",u="rfloor",h=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",d="Size4-Regular",u="rceil",h=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",d="Size4-Regular",u="lparen",h=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",d="Size4-Regular",u="rparen",h=875):"\\{"===e||"\\lbrace"===e?(o="⎧",s="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",s="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=PI(o,d,i),f=p.height+p.depth,g=PI(l,d,i),m=g.height+g.depth,y=PI(c,d,i),v=y.height+y.depth,b=0,x=1;if(null!==s){var w=PI(s,d,i);b=w.height+w.depth,x=2}var E=f+v+b,k=E+Math.max(0,Math.ceil((t-E)/(x*m)))*x*m,T=r.fontMetrics().axisHeight;n&&(T*=r.sizeMultiplier);var _=k/2-T,C=[];if(u.length>0){var S=k-f-v,A=Math.round(1e3*k),N=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 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\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-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\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-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\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 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\nc-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,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.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\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-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,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-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\nc-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\nc0,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\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-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.")}}(u,Math.round(1e3*S)),I=new _A(u,N),O=(h/1e3).toFixed(3)+"em",L=(A/1e3).toFixed(3)+"em",M=new TA([I],{width:O,height:L,viewBox:"0 0 "+h+" "+A}),R=kN.makeSvgSpan([],[M],r);R.height=A/1e3,R.style.width=O,R.style.height=L,C.push({type:"elem",elem:R})}else{if(C.push(zI(c,d,i)),C.push(HI),null===s){var D=k-f-v+.016;C.push(jI(l,D,r))}else{var P=(k-f-v-b)/2+.016;C.push(jI(l,P,r)),C.push(HI),C.push(zI(s,d,i)),C.push(HI),C.push(jI(l,P,r))}C.push(HI),C.push(zI(o,d,i))}var $=r.havingBaseStyle(WS.TEXT),B=kN.makeVList({positionType:"bottom",positionData:_,children:C},$);return $I(kN.makeSpan(["delimsizing","mult"],[B],$),WS.TEXT,r,a)},WI=.08,VI=function(e,t,n,r,i){var a=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.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\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,KS);break;case"sqrtSize1":r=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,KS);break;case"sqrtSize2":r=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,KS);break;case"sqrtSize3":r=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-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\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,KS);break;case"sqrtSize4":r=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-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\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,KS);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"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\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,KS,n)}return r}(e,r,n),o=new _A(e,a),s=new TA([o],{width:"400em",height:pA(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return kN.makeSvgSpan(["hide-tail"],[s],i)},YI=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],XI=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],KI=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],QI=[0,1.2,1.8,2.4,3],ZI=[{type:"small",style:WS.SCRIPTSCRIPT},{type:"small",style:WS.SCRIPT},{type:"small",style:WS.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],JI=[{type:"small",style:WS.SCRIPTSCRIPT},{type:"small",style:WS.SCRIPT},{type:"small",style:WS.TEXT},{type:"stack"}],eO=[{type:"small",style:WS.SCRIPTSCRIPT},{type:"small",style:WS.SCRIPT},{type:"small",style:WS.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],tO=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},nO=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);it)return n[i]}return n[n.length-1]},rO=function(e,t,n,r,i,a){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=KI.includes(e)?ZI:YI.includes(e)?eO:JI;var s=nO(e,t,o,r);return"small"===s.type?function(e,t,n,r,i,a){var o=kN.makeSymbol(e,"Main-Regular",i,r),s=$I(o,t,r,a);return n&&BI(s,r,t),s}(e,s.style,n,r,i,a):"large"===s.type?FI(e,s.size,n,r,i,a):qI(e,t,n,r,i,a)},iO={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),a=nO("\\surd",e*i.sizeMultiplier,eO,i),o=i.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===a.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+s)/o,(n=VI("sqrtMain",l=(1+s+WI)/o,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/o):"large"===a.type?(u=1080*QI[a.size],c=(QI[a.size]+s)/o,l=(QI[a.size]+s+WI)/o,(n=VI("sqrtSize"+a.size,l,u,s,t)).style.minWidth="1.02em",r=1/o):(l=e+s+WI,c=e+s,u=Math.floor(1e3*e+s)+80,(n=VI("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=pA(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),YI.includes(e)||KI.includes(e))return FI(e,t,!1,n,r,i);if(XI.includes(e))return qI(e,QI[t],!1,n,r,i);throw new NS("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:QI,customSizedDelim:rO,leftRightDelim:function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-s);return rO(e,c,!0,r,i,a)}},aO={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},oO=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function sO(e,t){var n=yI(e);if(n&&oO.includes(n.text))return n;throw new NS(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function lO(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}LN({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=sO(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:aO[e.funcName].size,mclass:aO[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?kN.makeSpan([e.mclass]):iO.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(eI(e.delim,e.mode));var n=new JN.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=pA(iO.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),LN({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new NS("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:sO(t[0],e).text,color:n}}}),LN({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=sO(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=gI(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{lO(e);for(var n,r,i=jN(e.body,t,!0,["mopen","mclose"]),a=0,o=0,s=!1,l=0;l{lO(e);var n=iI(e.body,t);if("."!==e.left){var r=new JN.MathNode("mo",[eI(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new JN.MathNode("mo",[eI(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return tI(n)}}),LN({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=sO(t[0],e);if(!e.parser.leftrightDepth)throw new NS("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=WN(t,[]);else{n=iO.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?eI("|","text"):eI(e.delim,e.mode),r=new JN.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var cO=(e,t)=>{var n,r,i=kN.wrapFragment(VN(e.body,t),t),a=e.label.slice(1),o=t.sizeMultiplier,s=0,l=RS.isCharacterBox(e.body);if("sout"===a)(n=kN.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/o,s=-.5*t.fontMetrics().xHeight;else if("phase"===a){var c=dA({number:.6,unit:"pt"},t),u=dA({number:.35,unit:"ex"},t);o/=t.havingBaseSizing().sizeMultiplier;var h=i.height+i.depth+c+u;i.style.paddingLeft=pA(h/2+c);var d=Math.floor(1e3*h*o),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),f=new TA([new _A("phase",p)],{width:"400em",height:pA(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=kN.makeSvgSpan(["hide-tail"],[f],t)).style.height=pA(h),s=i.depth+c+u}else{/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var g=0,m=0,y=0;/box/.test(a)?(y=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),m=g=t.fontMetrics().fboxsep+("colorbox"===a?0:y)):"angl"===a?(g=4*(y=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),m=Math.max(0,.25-i.depth)):m=g=l?.2:0,n=dI(i,a,g,m,t),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=pA(y)):"angl"===a&&.049!==y&&(n.style.borderTopWidth=pA(y),n.style.borderRightWidth=pA(y)),s=i.depth+m,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=kN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:i,shift:0}]},t);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];r=kN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:v}]},t)}return/cancel/.test(a)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(a)&&!l?kN.makeSpan(["mord","cancel-lap"],[r],t):kN.makeSpan(["mord"],[r],t)},uO=(e,t)=>{var n=0,r=new JN.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[oI(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};LN({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=gI(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:cO,mathmlBuilder:uO}),LN({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=gI(t[0],"color-token").color,o=gI(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:cO,mathmlBuilder:uO}),LN({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),LN({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:cO,mathmlBuilder:uO}),LN({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var hO={};function dO(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{if(!e.parser.settings.displayMode)throw new NS("{"+e.envName+"} can be used only in display mode.")};function yO(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function vO(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new NS("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],g=[f],m=[],y=[],v=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function x(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new AS("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),y.push(gO(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),f.push(w);var E=e.fetch().text;if("&"===E){if(h&&f.length===h){if(c||s)throw new NS("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===E){x(),1===f.length&&"styling"===w.type&&0===w.body[0].body.length&&(g.length>1||!u)&&g.pop(),y.length0&&(y+=.25),l.push({pos:y,isDashed:e[t]})}for(v(a[0]),n=0;n0&&(w<(_+=m)&&(w=_),_=0),e.addJot&&(w+=p),E.height=x,E.depth=w,y+=x,E.pos=y,y+=w+_,s[n]=E,v(a[n+1])}var C,S,A=y/2+t.fontMetrics().axisHeight,N=e.cols||[],I=[],O=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=RS.deflt(P.pregap,h))&&((C=kN.makeSpan(["arraycolsep"],[])).style.width=pA(j),I.push(C));var H=[];for(n=0;n0){for(var W=kN.makeLineSpan("hline",t,c),V=kN.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:s,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-A;X.isDashed?Y.push({type:"elem",elem:V,shift:K}):Y.push({type:"elem",elem:W,shift:K})}s=kN.makeVList({positionType:"individualShift",children:Y},t)}if(0===O.length)return kN.makeSpan(["mord"],[s],t);var Q=kN.makeVList({positionType:"individualShift",children:O},t);return Q=kN.makeSpan(["tag"],[Q],t),kN.makeFragment([s,Q])},wO={c:"center ",l:"left ",r:"right "},EO=function(e,t){for(var n=[],r=new JN.MathNode("mtd",[],["mtr-glue"]),i=new JN.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var p=e.cols,f="",g=!1,m=0,y=p.length;"separator"===p[0].type&&(h+="top ",m=1),"separator"===p[p.length-1].type&&(h+="bottom ",y-=1);for(var v=m;v0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var T=1;T-1?"alignat":"align",a="split"===e.envName,o=vO(e.parser,{cols:r,addJot:!0,autoTag:a?void 0:yO(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u0&&h&&(f=1),r[d]={type:"align",align:p,pregap:f,postgap:0}}return o.colSeparationType=h?"align":"alignat",o};dO({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(yI(t[0])?[t[0]]:gI(t[0],"ordgroup").body).map(function(e){var t=mI(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new NS("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return vO(e.parser,r,bO(e.envName))},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new NS("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=vO(e.parser,r,bO(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=vO(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(yI(t[0])?[t[0]]:gI(t[0],"ordgroup").body).map(function(e){var t=mI(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new NS("Unknown column alignment: "+t,e)});if(n.length>1)throw new NS("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=vO(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new NS("{subarray} can contain only one column");return r},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=vO(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},bO(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:kO,htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&mO(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:yO(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return vO(e.parser,t,"display")},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:kO,htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){mO(e);var t={autoTag:yO(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return vO(e.parser,t,"display")},htmlBuilder:xO,mathmlBuilder:EO}),dO({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(mO(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new NS("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],a=0;a-1);else{if(!("<>AV".indexOf(c)>-1))throw new NS('Expected one of "<>AV=|." after @',o[l]);for(var h=0;h<2;h++){for(var d=!0,p=l+1;p{var n=e.font,r=t.withFont(n);return VN(e.body,r)},CO=(e,t)=>{var n=e.font,r=t.withFont(n);return oI(e.body,r)},SO={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};LN({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=RN(t[0]),a=r;return a in SO&&(a=SO[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:_O,mathmlBuilder:CO}),LN({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=RS.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:_I(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),LN({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:_O,mathmlBuilder:CO});var AO=(e,t)=>{var n=t;return"display"===e?n=n.id>=WS.SCRIPT.id?n.text():WS.DISPLAY:"text"===e&&n.size===WS.DISPLAY.size?n=WS.TEXT:"script"===e?n=WS.SCRIPT:"scriptscript"===e&&(n=WS.SCRIPTSCRIPT),n},NO=(e,t)=>{var n,r=AO(e.size,t.style),i=r.fracNum(),a=r.fracDen();n=t.havingStyle(i);var o=VN(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*h:7*h,f=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),f=t.fontMetrics().denom2),c){var x=t.fontMetrics().axisHeight;d-o.depth-(x+.5*u){var n=new JN.MathNode("mfrac",[oI(e.numer,t),oI(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=dA(e.barSize,t);n.setAttribute("linethickness",pA(r))}}else n.setAttribute("linethickness","0px");var i=AO(e.size,t.style);if(i.size!==t.style.size){n=new JN.MathNode("mstyle",[n]);var a=i.size===WS.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var s=new JN.MathNode("mo",[new JN.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(n),null!=e.rightDelim){var l=new JN.MathNode("mo",[new JN.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return tI(o)}return n};LN({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,a=t[0],o=t[1],s=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:a,denom:o,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:NO,mathmlBuilder:IO}),LN({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),LN({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var OO=["display","text","script","scriptscript"],LO=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};LN({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],a=t[5],o=RN(t[0]),s="atom"===o.type&&"open"===o.family?LO(o.text):null,l=RN(t[1]),c="atom"===l.type&&"close"===l.family?LO(l.text):null,u=gI(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=gI(p.body[0],"textord");d=OO[Number(f.text)]}}else p=gI(p,"textord"),d=OO[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:NO,mathmlBuilder:IO}),LN({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:gI(t[0],"size").value,token:i}}}),LN({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(gI(t[1],"infix").size),o=t[2],s=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:NO,mathmlBuilder:IO});var MO=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?VN(e.sup,t.havingStyle(i.sup()),t):VN(e.sub,t.havingStyle(i.sub()),t),r=gI(e.base,"horizBrace")):r=gI(e,"horizBrace");var a,o=VN(r.base,t.havingBaseStyle(WS.DISPLAY)),s=fI(r,t);if(r.isOver?(a=kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(a=kN.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=kN.makeSpan(["mord",r.isOver?"mover":"munder"],[a],t);a=r.isOver?kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):kN.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return kN.makeSpan(["mord",r.isOver?"mover":"munder"],[a],t)};LN({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:MO,mathmlBuilder:(e,t)=>{var n=pI(e.label);return new JN.MathNode(e.isOver?"mover":"munder",[oI(e.base,t),n])}}),LN({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=gI(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:DN(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=jN(e.body,t,!1);return kN.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=aI(e.body,t);return n instanceof QN||(n=new QN("mrow",[n])),n.setAttribute("href",e.href),n}}),LN({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=gI(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;anew JN.MathNode("mrow",iI(e.body,t))}),LN({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:a}=e,o=gI(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),u=0;u{var n=jN(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=kN.makeSpan(r,n,t);for(var a in e.attributes)"class"!==a&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>aI(e.body,t)}),LN({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:DN(t[0]),mathml:DN(t[1])}},htmlBuilder:(e,t)=>{var n=jN(e.html,t,!1);return kN.makeFragment(n)},mathmlBuilder:(e,t)=>aI(e.mathml,t)});var RO=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new NS("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!hA(n))throw new NS("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};LN({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(n[0])for(var l=gI(n[0],"raw").string.split(","),c=0;c{var n=dA(e.height,t),r=0;e.totalheight.number>0&&(r=dA(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=dA(e.width,t));var a={height:pA(n+r)};i>0&&(a.width=pA(i)),r>0&&(a.verticalAlign=pA(-r));var o=new wA(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new JN.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=dA(e.height,t),i=0;if(e.totalheight.number>0&&(i=dA(e.totalheight,t)-r,n.setAttribute("valign",pA(-i))),n.setAttribute("height",pA(r+i)),e.width.number>0){var a=dA(e.width,t);n.setAttribute("width",pA(a))}return n.setAttribute("src",e.src),n}}),LN({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=gI(t[0],"size");if(n.settings.strict){var a="m"===r[1],o="mu"===i.value.unit;a?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>kN.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=dA(e.dimension,t);return new JN.SpaceNode(n)}}),LN({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=kN.makeSpan([],[VN(e.body,t)]),n=kN.makeSpan(["inner"],[n],t)):n=kN.makeSpan(["inner"],[VN(e.body,t)]);var r=kN.makeSpan(["fix"],[]),i=kN.makeSpan([e.alignment],[n,r],t),a=kN.makeSpan(["strut"]);return a.style.height=pA(i.height+i.depth),i.depth&&(a.style.verticalAlign=pA(-i.depth)),i.children.unshift(a),i=kN.makeSpan(["thinbox"],[i],t),kN.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new JN.MathNode("mpadded",[oI(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),LN({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a="\\("===n?"\\)":"$",o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),LN({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new NS("Mismatched "+e.funcName)}});var DO=(e,t)=>{switch(t.style.size){case WS.DISPLAY.size:return e.display;case WS.TEXT.size:return e.text;case WS.SCRIPT.size:return e.script;case WS.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};LN({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:DN(t[0]),text:DN(t[1]),script:DN(t[2]),scriptscript:DN(t[3])}},htmlBuilder:(e,t)=>{var n=DO(e,t),r=jN(n,t,!1);return kN.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=DO(e,t);return aI(n,t)}});var PO=(e,t,n,r,i,a,o)=>{e=kN.makeSpan([],[e]);var s,l,c,u=n&&RS.isCharacterBox(n);if(t){var h=VN(t,r.havingStyle(i.sup()),r);l={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=VN(n,r.havingStyle(i.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+o;c=kN.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:pA(-a)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:pA(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var f=e.height-o;c=kN.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:pA(-a)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var g=e.depth+o;c=kN.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:pA(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var m=[c];if(s&&0!==a&&!u){var y=kN.makeSpan(["mspace"],[],r);y.style.marginRight=pA(a),m.unshift(y)}return kN.makeSpan(["mop","op-limits"],m,r)},$O=["\\smallint"],BO=(e,t)=>{var n,r,i,a=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=gI(e.base,"op"),a=!0):i=gI(e,"op");var o,s=t.style,l=!1;if(s.size===WS.DISPLAY.size&&i.symbol&&!$O.includes(i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(u=i.name.slice(1),i.name="oiint"===u?"\\iint":"\\iiint"),o=kN.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=o.italic,d=kN.staticSvg(u+"Size"+(l?"2":"1"),t);o=kN.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),i.name="\\"+u,o.classes.unshift("mop"),o.italic=h}}else if(i.body){var p=jN(i.body,t,!0);1===p.length&&p[0]instanceof kA?(o=p[0]).classes[0]="mop":o=kN.makeSpan(["mop"],p,t)}else{for(var f=[],g=1;g{var n;if(e.symbol)n=new QN("mo",[eI(e.name,e.mode)]),$O.includes(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new QN("mo",iI(e.body,t));else{n=new QN("mi",[new ZN(e.name.slice(1))]);var r=new QN("mo",[eI("⁡","text")]);n=e.parentIsSupSub?new QN("mrow",[n,r]):KN([n,r])}return n},zO={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};LN({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=zO[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:BO,mathmlBuilder:FO}),LN({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:DN(r)}},htmlBuilder:BO,mathmlBuilder:FO});var jO={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};LN({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:BO,mathmlBuilder:FO}),LN({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:BO,mathmlBuilder:FO}),LN({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=jO[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:BO,mathmlBuilder:FO});var HO=(e,t)=>{var n,r,i,a,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=gI(e.base,"operatorname"),o=!0):i=gI(e,"operatorname"),i.body.length>0){for(var s=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=jN(s,t.withFont("mathrm"),!0),c=0;c{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:DN(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:HO,mathmlBuilder:(e,t)=>{for(var n=iI(e.body,t.withFont("mathrm")),r=!0,i=0;ie.toText()).join("");n=[new JN.TextNode(s)]}var l=new JN.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new JN.MathNode("mo",[eI("⁡","text")]);return e.parentIsSupSub?new JN.MathNode("mrow",[l,c]):JN.newDocumentFragment([l,c])}}),fO("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),MN({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?kN.makeFragment(jN(e.body,t,!1)):kN.makeSpan(["mord"],jN(e.body,t,!0),t),mathmlBuilder:(e,t)=>aI(e.body,t,!0)}),LN({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=VN(e.body,t.havingCrampedStyle()),r=kN.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return kN.makeSpan(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new JN.MathNode("mo",[new JN.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new JN.MathNode("mover",[oI(e.body,t),n]);return r.setAttribute("accent","true"),r}}),LN({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:DN(r)}},htmlBuilder:(e,t)=>{var n=jN(e.body,t.withPhantom(),!1);return kN.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=iI(e.body,t);return new JN.MathNode("mphantom",n)}}),LN({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=kN.makeSpan([],[VN(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=iI(DN(e.body),t),r=new JN.MathNode("mphantom",n),i=new JN.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),LN({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=kN.makeSpan(["inner"],[VN(e.body,t.withPhantom())]),r=kN.makeSpan(["fix"],[]);return kN.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=iI(DN(e.body),t),r=new JN.MathNode("mphantom",n),i=new JN.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),LN({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=gI(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=VN(e.body,t),r=dA(e.dy,t);return kN.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new JN.MathNode("mpadded",[oI(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),LN({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),LN({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=gI(t[0],"size"),o=gI(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&gI(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=kN.makeSpan(["mord","rule"],[],t),r=dA(e.width,t),i=dA(e.height,t),a=e.shift?dA(e.shift,t):0;return n.style.borderRightWidth=pA(r),n.style.borderTopWidth=pA(i),n.style.bottom=pA(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=dA(e.width,t),r=dA(e.height,t),i=e.shift?dA(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new JN.MathNode("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",pA(n)),o.setAttribute("height",pA(r));var s=new JN.MathNode("mpadded",[o]);return i>=0?s.setAttribute("height",pA(i)):(s.setAttribute("height",pA(i)),s.setAttribute("depth",pA(-i))),s.setAttribute("voffset",pA(i)),s}});var GO=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];LN({type:"sizing",names:GO,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:GO.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return UO(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=iI(e.body,n),i=new JN.MathNode("mstyle",r);return i.setAttribute("mathsize",pA(n.sizeMultiplier)),i}}),LN({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&gI(n[0],"ordgroup");if(o)for(var s="",l=0;l{var n=kN.makeSpan([],[VN(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new JN.MathNode("mpadded",[oI(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),LN({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=VN(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=kN.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var h=s.height-n.height-a-l;n.style.paddingLeft=pA(c);var d=kN.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(WS.SCRIPTSCRIPT),f=VN(e.index,p,t),g=.6*(d.height-d.depth),m=kN.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),y=kN.makeSpan(["root"],[m]);return kN.makeSpan(["mord","sqrt"],[y,d],t)}return kN.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new JN.MathNode("mroot",[oI(n,t),oI(r,t)]):new JN.MathNode("msqrt",[oI(n,t)])}});var qO={display:WS.DISPLAY,text:WS.TEXT,script:WS.SCRIPT,scriptscript:WS.SCRIPTSCRIPT};LN({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=qO[e.style],r=t.havingStyle(n).withFont("");return UO(e.body,r,t)},mathmlBuilder(e,t){var n=qO[e.style],r=t.havingStyle(n),i=iI(e.body,r),a=new JN.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});MN({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===WS.DISPLAY.size||n.alwaysHandleSupSub)?BO:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===WS.DISPLAY.size||n.limits)?HO:null:"accent"===n.type?RS.isCharacterBox(n.base)?vI:null:"horizBrace"===n.type&&!e.sub===n.isOver?MO:null:null}(e,t);if(n)return n(e,t);var r,i,a,{base:o,sup:s,sub:l}=e,c=VN(o,t),u=t.fontMetrics(),h=0,d=0,p=o&&RS.isCharacterBox(o);if(s){var f=t.havingStyle(t.style.sup());r=VN(s,f,t),p||(h=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var g=t.havingStyle(t.style.sub());i=VN(l,g,t),p||(d=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}a=t.style===WS.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var m,y=t.sizeMultiplier,v=pA(.5/u.ptPerEm/y),b=null;if(i){var x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof kA||x)&&(b=pA(-c.italic))}if(r&&i){h=Math.max(h,a,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var w=4*u.defaultRuleThickness;if(h-r.depth-(i.height-d)0&&(h+=E,d-=E)}var k=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:b},{type:"elem",elem:r,shift:-h,marginRight:v}];m=kN.makeVList({positionType:"individualShift",children:k},t)}else if(i){d=Math.max(d,u.sub1,i.height-.8*u.xHeight);var T=[{type:"elem",elem:i,marginLeft:b,marginRight:v}];m=kN.makeVList({positionType:"shift",positionData:d,children:T},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,a,r.depth+.25*u.xHeight),m=kN.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:v}]},t)}var _=qN(c,"right")||"mord";return kN.makeSpan([_],[c,kN.makeSpan(["msupsub"],[m])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,a=[oI(e.base,t)];if(e.sub&&a.push(oI(e.sub,t)),e.sup&&a.push(oI(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===WS.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===WS.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;i=s&&"op"===s.type&&s.limits&&(t.style===WS.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===WS.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===WS.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===WS.DISPLAY)?"mover":"msup"}return new JN.MathNode(i,a)}}),MN({type:"atom",htmlBuilder:(e,t)=>kN.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new JN.MathNode("mo",[eI(e.text,e.mode)]);if("bin"===e.family){var r=nI(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var WO={mi:"italic",mn:"normal",mtext:"normal"};MN({type:"mathord",htmlBuilder:(e,t)=>kN.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new JN.MathNode("mi",[eI(e.text,e.mode,t)]),r=nI(e,t)||"italic";return r!==WO[n.type]&&n.setAttribute("mathvariant",r),n}}),MN({type:"textord",htmlBuilder:(e,t)=>kN.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=eI(e.text,e.mode,t),i=nI(e,t)||"normal";return n="text"===e.mode?new JN.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new JN.MathNode("mn",[r]):"\\prime"===e.text?new JN.MathNode("mo",[r]):new JN.MathNode("mi",[r]),i!==WO[n.type]&&n.setAttribute("mathvariant",i),n}});var VO={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},YO={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};MN({type:"spacing",htmlBuilder(e,t){if(YO.hasOwnProperty(e.text)){var n=YO[e.text].className||"";if("text"===e.mode){var r=kN.makeOrd(e,t,"textord");return r.classes.push(n),r}return kN.makeSpan(["mspace",n],[kN.mathsym(e.text,e.mode,t)],t)}if(VO.hasOwnProperty(e.text))return kN.makeSpan(["mspace",VO[e.text]],[],t);throw new NS('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!YO.hasOwnProperty(e.text)){if(VO.hasOwnProperty(e.text))return new JN.MathNode("mspace");throw new NS('Unknown type of space "'+e.text+'"')}return new JN.MathNode("mtext",[new JN.TextNode(" ")])}});var XO=()=>{var e=new JN.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};MN({type:"tag",mathmlBuilder(e,t){var n=new JN.MathNode("mtable",[new JN.MathNode("mtr",[XO(),new JN.MathNode("mtd",[aI(e.body,t)]),XO(),new JN.MathNode("mtd",[aI(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var KO={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},QO={"\\textbf":"textbf","\\textmd":"textmd"},ZO={"\\textit":"textit","\\textup":"textup"},JO=(e,t)=>{var n=e.font;return n?KO[n]?t.withTextFontFamily(KO[n]):QO[n]?t.withTextFontWeight(QO[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(ZO[n]):t};LN({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:DN(i),font:r}},htmlBuilder(e,t){var n=JO(e,t),r=jN(e.body,n,!0);return kN.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=JO(e,t);return aI(e.body,n)}}),LN({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=VN(e.body,t),r=kN.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=kN.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return kN.makeSpan(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new JN.MathNode("mo",[new JN.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new JN.MathNode("munder",[oI(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),LN({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=VN(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return kN.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new JN.MathNode("mpadded",[oI(e.body,t)],["vcenter"])}),LN({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new NS("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=eL(e),r=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"␣":" "),tL=NN,nL="[ \r\n\t]",rL="(\\\\[a-zA-Z@]+)"+nL+"*",iL="[̀-ͯ]",aL=new RegExp(iL+"+$"),oL="("+nL+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]"+iL+"*|[\ud800-\udbff][\udc00-\udfff]"+iL+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+rL+"|\\\\[^\ud800-\udfff])";let sL=class{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(oL,"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 AS("EOF",new SS(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new NS("Unexpected character: '"+e[t]+"'",new AS(e[t],new SS(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(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=i+1,this.lex()}return new AS(r,new SS(this,t,this.tokenRegex.lastIndex))}};class lL{constructor(e,t){void 0===e&&(e={}),void 0===t&&(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(0===this.undefStack.length)throw new NS("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)&&(null==e[t]?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,n){if(void 0===n&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var cL=pO;fO("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),fO("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),fO("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),fO("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),fO("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),fO("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),fO("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var uL={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};fO("\\char",function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new NS("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=uL[n.text])||r>=t)throw new NS("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=uL[e.future().text])&&i{var i=e.consumeArg().tokens;if(1!==i.length)throw new NS("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new NS("\\newcommand{"+a+"} attempting to redefine "+a+"; use \\renewcommand");if(!o&&!n)throw new NS("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new NS("Invalid number of arguments: "+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),""};fO("\\newcommand",e=>hL(e,!1,!0,!1)),fO("\\renewcommand",e=>hL(e,!0,!1,!1)),fO("\\providecommand",e=>hL(e,!0,!0,!0)),fO("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),fO("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),fO("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),tL[n],IA.math[n],IA.text[n]),""}),fO("\\bgroup","{"),fO("\\egroup","}"),fO("~","\\nobreakspace"),fO("\\lq","`"),fO("\\rq","'"),fO("\\aa","\\r a"),fO("\\AA","\\r A"),fO("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),fO("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),fO("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),fO("ℬ","\\mathscr{B}"),fO("ℰ","\\mathscr{E}"),fO("ℱ","\\mathscr{F}"),fO("ℋ","\\mathscr{H}"),fO("ℐ","\\mathscr{I}"),fO("ℒ","\\mathscr{L}"),fO("ℳ","\\mathscr{M}"),fO("ℛ","\\mathscr{R}"),fO("ℭ","\\mathfrak{C}"),fO("ℌ","\\mathfrak{H}"),fO("ℨ","\\mathfrak{Z}"),fO("\\Bbbk","\\Bbb{k}"),fO("·","\\cdotp"),fO("\\llap","\\mathllap{\\textrm{#1}}"),fO("\\rlap","\\mathrlap{\\textrm{#1}}"),fO("\\clap","\\mathclap{\\textrm{#1}}"),fO("\\mathstrut","\\vphantom{(}"),fO("\\underbar","\\underline{\\text{#1}}"),fO("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),fO("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),fO("\\ne","\\neq"),fO("≠","\\neq"),fO("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),fO("∉","\\notin"),fO("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),fO("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),fO("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),fO("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),fO("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),fO("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),fO("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),fO("⟂","\\perp"),fO("‼","\\mathclose{!\\mkern-0.8mu!}"),fO("∌","\\notni"),fO("⌜","\\ulcorner"),fO("⌝","\\urcorner"),fO("⌞","\\llcorner"),fO("⌟","\\lrcorner"),fO("©","\\copyright"),fO("®","\\textregistered"),fO("️","\\textregistered"),fO("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),fO("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),fO("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),fO("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),fO("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),fO("⋮","\\vdots"),fO("\\varGamma","\\mathit{\\Gamma}"),fO("\\varDelta","\\mathit{\\Delta}"),fO("\\varTheta","\\mathit{\\Theta}"),fO("\\varLambda","\\mathit{\\Lambda}"),fO("\\varXi","\\mathit{\\Xi}"),fO("\\varPi","\\mathit{\\Pi}"),fO("\\varSigma","\\mathit{\\Sigma}"),fO("\\varUpsilon","\\mathit{\\Upsilon}"),fO("\\varPhi","\\mathit{\\Phi}"),fO("\\varPsi","\\mathit{\\Psi}"),fO("\\varOmega","\\mathit{\\Omega}"),fO("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),fO("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),fO("\\boxed","\\fbox{$\\displaystyle{#1}$}"),fO("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),fO("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),fO("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),fO("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),fO("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var dL={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};fO("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in dL?t=dL[n]:("\\not"===n.slice(0,4)||n in IA.math&&["bin","rel"].includes(IA.math[n].group))&&(t="\\dotsb"),t});var pL={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};fO("\\dotso",function(e){return e.future().text in pL?"\\ldots\\,":"\\ldots"}),fO("\\dotsc",function(e){var t=e.future().text;return t in pL&&","!==t?"\\ldots\\,":"\\ldots"}),fO("\\cdots",function(e){return e.future().text in pL?"\\@cdots\\,":"\\@cdots"}),fO("\\dotsb","\\cdots"),fO("\\dotsm","\\cdots"),fO("\\dotsi","\\!\\cdots"),fO("\\dotsx","\\ldots\\,"),fO("\\DOTSI","\\relax"),fO("\\DOTSB","\\relax"),fO("\\DOTSX","\\relax"),fO("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),fO("\\,","\\tmspace+{3mu}{.1667em}"),fO("\\thinspace","\\,"),fO("\\>","\\mskip{4mu}"),fO("\\:","\\tmspace+{4mu}{.2222em}"),fO("\\medspace","\\:"),fO("\\;","\\tmspace+{5mu}{.2777em}"),fO("\\thickspace","\\;"),fO("\\!","\\tmspace-{3mu}{.1667em}"),fO("\\negthinspace","\\!"),fO("\\negmedspace","\\tmspace-{4mu}{.2222em}"),fO("\\negthickspace","\\tmspace-{5mu}{.277em}"),fO("\\enspace","\\kern.5em "),fO("\\enskip","\\hskip.5em\\relax"),fO("\\quad","\\hskip1em\\relax"),fO("\\qquad","\\hskip2em\\relax"),fO("\\tag","\\@ifstar\\tag@literal\\tag@paren"),fO("\\tag@paren","\\tag@literal{({#1})}"),fO("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new NS("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),fO("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),fO("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),fO("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),fO("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),fO("\\newline","\\\\\\relax"),fO("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var fL=pA(JS["Main-Regular"]["T".charCodeAt(0)][1]-.7*JS["Main-Regular"]["A".charCodeAt(0)][1]);fO("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+fL+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),fO("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+fL+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),fO("\\hspace","\\@ifstar\\@hspacer\\@hspace"),fO("\\@hspace","\\hskip #1\\relax"),fO("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),fO("\\ordinarycolon",":"),fO("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),fO("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),fO("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),fO("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),fO("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),fO("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),fO("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),fO("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),fO("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),fO("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),fO("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),fO("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),fO("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),fO("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),fO("∷","\\dblcolon"),fO("∹","\\eqcolon"),fO("≔","\\coloneqq"),fO("≕","\\eqqcolon"),fO("⩴","\\Coloneqq"),fO("\\ratio","\\vcentcolon"),fO("\\coloncolon","\\dblcolon"),fO("\\colonequals","\\coloneqq"),fO("\\coloncolonequals","\\Coloneqq"),fO("\\equalscolon","\\eqqcolon"),fO("\\equalscoloncolon","\\Eqqcolon"),fO("\\colonminus","\\coloneq"),fO("\\coloncolonminus","\\Coloneq"),fO("\\minuscolon","\\eqcolon"),fO("\\minuscoloncolon","\\Eqcolon"),fO("\\coloncolonapprox","\\Colonapprox"),fO("\\coloncolonsim","\\Colonsim"),fO("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),fO("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),fO("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),fO("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),fO("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),fO("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),fO("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),fO("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),fO("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),fO("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),fO("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),fO("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),fO("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),fO("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),fO("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),fO("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),fO("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),fO("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),fO("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),fO("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),fO("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),fO("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),fO("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),fO("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),fO("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),fO("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),fO("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),fO("\\imath","\\html@mathml{\\@imath}{ı}"),fO("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),fO("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),fO("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),fO("⟦","\\llbracket"),fO("⟧","\\rrbracket"),fO("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),fO("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),fO("⦃","\\lBrace"),fO("⦄","\\rBrace"),fO("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),fO("⦵","\\minuso"),fO("\\darr","\\downarrow"),fO("\\dArr","\\Downarrow"),fO("\\Darr","\\Downarrow"),fO("\\lang","\\langle"),fO("\\rang","\\rangle"),fO("\\uarr","\\uparrow"),fO("\\uArr","\\Uparrow"),fO("\\Uarr","\\Uparrow"),fO("\\N","\\mathbb{N}"),fO("\\R","\\mathbb{R}"),fO("\\Z","\\mathbb{Z}"),fO("\\alef","\\aleph"),fO("\\alefsym","\\aleph"),fO("\\Alpha","\\mathrm{A}"),fO("\\Beta","\\mathrm{B}"),fO("\\bull","\\bullet"),fO("\\Chi","\\mathrm{X}"),fO("\\clubs","\\clubsuit"),fO("\\cnums","\\mathbb{C}"),fO("\\Complex","\\mathbb{C}"),fO("\\Dagger","\\ddagger"),fO("\\diamonds","\\diamondsuit"),fO("\\empty","\\emptyset"),fO("\\Epsilon","\\mathrm{E}"),fO("\\Eta","\\mathrm{H}"),fO("\\exist","\\exists"),fO("\\harr","\\leftrightarrow"),fO("\\hArr","\\Leftrightarrow"),fO("\\Harr","\\Leftrightarrow"),fO("\\hearts","\\heartsuit"),fO("\\image","\\Im"),fO("\\infin","\\infty"),fO("\\Iota","\\mathrm{I}"),fO("\\isin","\\in"),fO("\\Kappa","\\mathrm{K}"),fO("\\larr","\\leftarrow"),fO("\\lArr","\\Leftarrow"),fO("\\Larr","\\Leftarrow"),fO("\\lrarr","\\leftrightarrow"),fO("\\lrArr","\\Leftrightarrow"),fO("\\Lrarr","\\Leftrightarrow"),fO("\\Mu","\\mathrm{M}"),fO("\\natnums","\\mathbb{N}"),fO("\\Nu","\\mathrm{N}"),fO("\\Omicron","\\mathrm{O}"),fO("\\plusmn","\\pm"),fO("\\rarr","\\rightarrow"),fO("\\rArr","\\Rightarrow"),fO("\\Rarr","\\Rightarrow"),fO("\\real","\\Re"),fO("\\reals","\\mathbb{R}"),fO("\\Reals","\\mathbb{R}"),fO("\\Rho","\\mathrm{P}"),fO("\\sdot","\\cdot"),fO("\\sect","\\S"),fO("\\spades","\\spadesuit"),fO("\\sub","\\subset"),fO("\\sube","\\subseteq"),fO("\\supe","\\supseteq"),fO("\\Tau","\\mathrm{T}"),fO("\\thetasym","\\vartheta"),fO("\\weierp","\\wp"),fO("\\Zeta","\\mathrm{Z}"),fO("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),fO("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),fO("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),fO("\\bra","\\mathinner{\\langle{#1}|}"),fO("\\ket","\\mathinner{|{#1}\\rangle}"),fO("\\braket","\\mathinner{\\langle{#1}\\rangle}"),fO("\\Bra","\\left\\langle#1\\right|"),fO("\\Ket","\\left|#1\\right\\rangle");var gL=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",s));var a=t;!t&&i.length&&("|"===n.future().text&&(n.popToken(),a=!0));return{tokens:a?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...a,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};fO("\\bra@ket",gL(!1)),fO("\\bra@set",gL(!0)),fO("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),fO("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),fO("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),fO("\\angln","{\\angl n}"),fO("\\blue","\\textcolor{##6495ed}{#1}"),fO("\\orange","\\textcolor{##ffa500}{#1}"),fO("\\pink","\\textcolor{##ff00af}{#1}"),fO("\\red","\\textcolor{##df0030}{#1}"),fO("\\green","\\textcolor{##28ae7b}{#1}"),fO("\\gray","\\textcolor{gray}{#1}"),fO("\\purple","\\textcolor{##9d38bd}{#1}"),fO("\\blueA","\\textcolor{##ccfaff}{#1}"),fO("\\blueB","\\textcolor{##80f6ff}{#1}"),fO("\\blueC","\\textcolor{##63d9ea}{#1}"),fO("\\blueD","\\textcolor{##11accd}{#1}"),fO("\\blueE","\\textcolor{##0c7f99}{#1}"),fO("\\tealA","\\textcolor{##94fff5}{#1}"),fO("\\tealB","\\textcolor{##26edd5}{#1}"),fO("\\tealC","\\textcolor{##01d1c1}{#1}"),fO("\\tealD","\\textcolor{##01a995}{#1}"),fO("\\tealE","\\textcolor{##208170}{#1}"),fO("\\greenA","\\textcolor{##b6ffb0}{#1}"),fO("\\greenB","\\textcolor{##8af281}{#1}"),fO("\\greenC","\\textcolor{##74cf70}{#1}"),fO("\\greenD","\\textcolor{##1fab54}{#1}"),fO("\\greenE","\\textcolor{##0d923f}{#1}"),fO("\\goldA","\\textcolor{##ffd0a9}{#1}"),fO("\\goldB","\\textcolor{##ffbb71}{#1}"),fO("\\goldC","\\textcolor{##ff9c39}{#1}"),fO("\\goldD","\\textcolor{##e07d10}{#1}"),fO("\\goldE","\\textcolor{##a75a05}{#1}"),fO("\\redA","\\textcolor{##fca9a9}{#1}"),fO("\\redB","\\textcolor{##ff8482}{#1}"),fO("\\redC","\\textcolor{##f9685d}{#1}"),fO("\\redD","\\textcolor{##e84d39}{#1}"),fO("\\redE","\\textcolor{##bc2612}{#1}"),fO("\\maroonA","\\textcolor{##ffbde0}{#1}"),fO("\\maroonB","\\textcolor{##ff92c6}{#1}"),fO("\\maroonC","\\textcolor{##ed5fa6}{#1}"),fO("\\maroonD","\\textcolor{##ca337c}{#1}"),fO("\\maroonE","\\textcolor{##9e034e}{#1}"),fO("\\purpleA","\\textcolor{##ddd7ff}{#1}"),fO("\\purpleB","\\textcolor{##c6b9fc}{#1}"),fO("\\purpleC","\\textcolor{##aa87ff}{#1}"),fO("\\purpleD","\\textcolor{##7854ab}{#1}"),fO("\\purpleE","\\textcolor{##543b78}{#1}"),fO("\\mintA","\\textcolor{##f5f9e8}{#1}"),fO("\\mintB","\\textcolor{##edf2df}{#1}"),fO("\\mintC","\\textcolor{##e0e5cc}{#1}"),fO("\\grayA","\\textcolor{##f6f7f7}{#1}"),fO("\\grayB","\\textcolor{##f0f1f2}{#1}"),fO("\\grayC","\\textcolor{##e3e5e6}{#1}"),fO("\\grayD","\\textcolor{##d6d8da}{#1}"),fO("\\grayE","\\textcolor{##babec2}{#1}"),fO("\\grayF","\\textcolor{##888d93}{#1}"),fO("\\grayG","\\textcolor{##626569}{#1}"),fO("\\grayH","\\textcolor{##3b3e40}{#1}"),fO("\\grayI","\\textcolor{##21242c}{#1}"),fO("\\kaBlue","\\textcolor{##314453}{#1}"),fO("\\kaGreen","\\textcolor{##71B307}{#1}");var mL={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class yL{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new lL(cL,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new sL(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new AS("EOF",n.loc)),this.pushTokens(r),new AS("",SS.range(t,n))}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),a=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++a;else if("}"===r.text){if(-1===--a)throw new NS("Extra }",r)}else if("EOF"===r.text)throw new NS("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===a||1===a&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==a||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new NS("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;rthis.settings.maxExpand)throw new NS("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new NS("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var s=i[o];if("#"===s.text){if(0===o)throw new NS("Incomplete placeholder at end of macro body",s);if("#"===(s=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(s.text))throw new NS("Not a valid argument number",s);i.splice(o,2,...a[+s.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new AS(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var a=r.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var o=new sL(r,this.settings),s=[],l=o.lex();"EOF"!==l.text;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||tL.hasOwnProperty(e)||IA.math.hasOwnProperty(e)||IA.text.hasOwnProperty(e)||mL.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:tL.hasOwnProperty(e)&&!tL[e].primitive}}var vL=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,bL=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),xL={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},wL={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};let EL=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new yL(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new NS("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new AS("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==e.endOfExpression.indexOf(i.text))break;if(n&&i.text===n)break;if(t&&tL[i.text]&&tL[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;"internal"!==a.type&&r.push(a)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t,n=-1,r=0;r=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,s=IA[this.mode][t].group,l=SS.range(e);if(AA.hasOwnProperty(s)){var c=s;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:s,mode:this.mode,loc:l,text:t};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(XS(t.charCodeAt(0))?"math"===this.mode&&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)),i={type:"textord",mode:"text",loc:SS.range(e),text:t}}if(this.consume(),a)for(var u=0;u0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+h[0].length,c=!0),!r.global)break;h=r.exec(e.value)}c?(sc&&(c=e):e&&(void 0!==c&&c>-1&&l.push("\n".repeat(c)||" "),c=-1,l.push(e))}return l.join("")}function dM(e,t,n){return"element"===e.type?function(e,t,n){const r=gM(e,n),i=e.children||[];let a,o,s=-1,l=[];if(cM(e))return l;aM(e)||lM(e)&&JL(t,e,lM)?o="\n":sM(e)?(a=2,o=2):uM(e)&&(a=1,o=1);for(;++s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=bM(e,"(");let a=bM(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function IM(e,t,n,r){return!(!OM(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function OM(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||IT(n)||NT(n))&&(!t||47!==n)}function LM(){this.buffer()}function MM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RM(){this.buffer()}function DM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function PM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $M(e){this.exit(e)}function BM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FM(e){this.exit(e)}function zM(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function jM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const a=r.createTracker(i);let o=a.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");o+=a.move(r.safe(r.associationId(e),{before:o,after:"]"})),l(),o+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,a.current()),t?UM:HM)));return s(),o},footnoteReference:zM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function HM(e,t,n){return 0===t?e:UM(e,t,n)}function UM(e,t,n){return(n?"":" ")+e}zM.peek=function(){return"["};const GM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function qM(e){this.enter({type:"delete",children:[]},e)}function WM(e){this.exit(e)}function VM(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function YM(e){return e.length}function XM(e){return null==e?"":String(e)}function KM(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}VM.peek=function(){return"~"};const QM={}.hasOwnProperty;function ZM(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const a=r.handlers;if(t&&QM.call(t,e)){const n=String(t[e]);i=QM.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function JM(e,t,n){return">"+(n?"":" ")+e}function eR(e,t){return tR(e,t.inConstruct,!0)&&!tR(e,t.notInConstruct,!1)}function tR(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),o(),c}function uR(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(h+"]"),l}function hR(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}function pR(e,t,n,r){const i=iR(n),a='"'===i?"Quote":"Apostrophe",o=n.createTracker(r);let s,l;if(dR(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=o.move("<");return r+=o.move(n.containerPhrasing(e,{before:r,after:">",...o.current()})),r+=o.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),s(),c}function fR(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(h+"]"),l}function gR(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 mR(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}sR.peek=function(e,t,n){return n.options.emphasis||"*"},lR.peek=function(){return"<"},cR.peek=function(){return"!"},uR.peek=function(){return"!"},hR.peek=function(){return"`"},pR.peek=function(e,t,n){return dR(e,n)?"<":"["},fR.peek=function(){return"["};const yR=vC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vR(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),a=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),u=oR(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=aR(c)+l.slice(1));const h=l.charCodeAt(l.length-1),d=oR(r.after.charCodeAt(0),h,i);d.inside&&(l=l.slice(0,-1)+aR(h));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+l+p}vR.peek=function(e,t,n){return n.options.strong||"*"};const bR={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),JM);return i(),o},break:nR,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),a=e.value||"",o="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(a,rR);return e(),t}const s=n.createTracker(r),l=i.repeat(Math.max(wS(a,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${o}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),a&&(u+=s.move(a+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const i=iR(n),a='"'===i?"Quote":"Apostrophe",o=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),o(),c},emphasis:sR,hardBreak:nR,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(function(e,t){let n=!1;return CC(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,kC}),Boolean((!e.depth||e.depth<3)&&oT(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),o=n.containerPhrasing(e,{...a.current(),before:"\n",after:"\n"});return r(),t(),o+"\n"+(1===i?"=":"-").repeat(o.length-(Math.max(o.lastIndexOf("\r"),o.lastIndexOf("\n"))+1))}const o="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");a.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...a.current()});return/^[\t ]/.test(c)&&(c=aR(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),s(),c},html:lR,image:cR,imageReference:uR,inlineCode:hR,link:pR,linkReference:fR,list:function(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):gR(n);const s=e.ordered?"."===o?")":".":function(e){const t=gR(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}(n);let l=!(!t||!n.bulletLastUsed)&&o===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==o&&"-"!==o||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),mR(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let o=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));const s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(o))+e;return(n?a:a+" ".repeat(o-a.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o},root:function(e,t,n,r){const i=e.children.some(function(e){return yR(e)});return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:vR,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(mR(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function xR(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function wR(e){this.exit(e),this.data.inTable=void 0}function ER(e){this.enter({type:"tableRow",children:[]},e)}function kR(e){this.exit(e)}function TR(e){this.enter({type:"tableCell",children:[]},e)}function _R(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,CR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function CR(e,t){return"|"===t?t:e}function SR(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=bR.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const a=[],o=t.enter("table");for(;++ic&&(c=e[u].length);++al[a])&&(l[a]=e)}t.push(o)}o[u]=t,s[u]=r}let h=-1;if("object"==typeof r&&"length"in r)for(;++hl[h]&&(l[h]=i),p[h]=i),d[h]=o}o.splice(1,0,d),s.splice(1,0,p),u=-1;const f=[];for(;++u0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}FR[43]=BR,FR[45]=BR,FR[46]=BR,FR[95]=BR,FR[72]=[BR,$R],FR[104]=[BR,$R],FR[87]=[BR,PR],FR[119]=[BR,PR];const WR={tokenize:function(e,t,n){const r=this;return MT(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function VR(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const s=vT(r.sliceSerialize({start:o.end,end:r.now()}));if(94!==s.codePointAt(0)||!a.includes(s.slice(1)))return n(i);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)}}function YR(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function XR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(o>999||93===s&&!a||null===s||91===s||ST(s))return n(s);if(93===s){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(vT(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return ST(s)||(a=!0),o++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function KR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!o||null===t||91===t||ST(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=vT(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ST(t)||(o=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function h(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),MT(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function QR(e,t,n){return e.check(HT,t,e.attempt(WR,t,n))}function ZR(e){e.exit("gfmFootnoteDefinition")}function JR(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let o=0;return function(t){if(126===i&&"characterEscape"!==a[a.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(a){const l=$T(i);if(126===a)return o>1?r(a):(e.consume(a),o++,s);if(o<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=$T(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function tD(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?x:s;if(a===x&&r.parser.lazy[r.now().line])return n(e);return a(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return i=!0,o+=1,l(e)}(t)}function l(t){return null===t?n(t):CT(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h):n(t):AT(t)?MT(e,l,"whitespace")(t):(o+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||ST(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function h(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,AT(t)?MT(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):b(t)}function p(t){return AT(t)?MT(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(o+=1,g(t)):null===t||CT(t)?v(t):b(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),m(t)):b(t)}function m(t){return 45===t?(e.consume(t),m):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return AT(t)?MT(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?d(n):(null===n||CT(n))&&i&&a===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):b(n)}function b(e){return n(e)}function x(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||CT(n)?(e.exit("tableRow"),t(n)):AT(n)?MT(e,w,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||ST(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:E)}function k(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function rD(e,t){let n,r,i,a=-1,o=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,h=0;const d=new eD;for(;++an[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(a.end=Object.assign({},oD(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function aD(e,t,n,r,i){const a=[],o=oD(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function oD(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const sD={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i};function i(t){return ST(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return CT(r)?t(r):AT(r)?e.check({tokenize:lD},t,n)(r):n(r)}}};function lD(e,t,n){return MT(e,function(e){return null===e?n(e):t(e)},"whitespace")}const cD={};function uD(e){const t=e||cD,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return fT([{text:FR},{document:{91:{name:"gfmFootnoteDefinition",tokenize:KR,continuation:{tokenize:QR},exit:ZR}},text:{91:{name:"gfmFootnoteCall",tokenize:XR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:VR,resolveTo:YR}}},JR(e),{flow:{null:{name:"table",tokenize:nD,resolveAll:rD}}},{text:{91:sD}}])}(t)),i.push([{transforms:[AM],enter:{literalAutolink:EM,literalAutolinkEmail:kM,literalAutolinkHttp:kM,literalAutolinkWww:kM},exit:{literalAutolink:SM,literalAutolinkEmail:CM,literalAutolinkHttp:TM,literalAutolinkWww:_M}},{enter:{gfmFootnoteCallString:LM,gfmFootnoteCall:MM,gfmFootnoteDefinitionLabelString:RM,gfmFootnoteDefinition:DM},exit:{gfmFootnoteCallString:PM,gfmFootnoteCall:$M,gfmFootnoteDefinitionLabelString:BM,gfmFootnoteDefinition:FM}},{canContainEols:["delete"],enter:{strikethrough:qM},exit:{strikethrough:WM}},{enter:{table:xR,tableData:TR,tableHeader:TR,tableRow:ER},exit:{codeText:_R,table:wR,tableData:kR,tableHeader:kR,tableRow:kR}},{exit:{taskListCheckValueChecked:AR,taskListCheckValueUnchecked:AR,paragraph:NR}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xM,notInConstruct:wM},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xM,notInConstruct:wM},{character:":",before:"[ps]",after:"\\/",inConstruct:xM,notInConstruct:wM}]},jM(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GM}],handlers:{delete:VM}},SR(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IR}}]}}(t))}const hD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),fD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var mD="[0-9](_*[0-9])*",yD=`\\.(${mD})`,vD="[0-9a-fA-F](_*[0-9a-fA-F])*",bD={className:"number",variants:[{begin:`(\\b(${mD})((${yD})|\\.)?|(${yD}))[eE][+-]?(${mD})[fFdD]?\\b`},{begin:`\\b(${mD})((${yD})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${yD})[fFdD]?\\b`},{begin:`\\b(${mD})[fFdD]\\b`},{begin:`\\b0[xX]((${vD})\\.?|(${vD})?\\.(${vD}))[pP][+-]?(${mD})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vD})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function xD(e,t,n){return-1===n?"":e.replace(t,r=>xD(e,t,n-1))}const wD="[A-Za-z$_][0-9A-Za-z$_]*",ED=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],kD=["true","false","null","undefined","NaN","Infinity"],TD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_D=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],SD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],AD=[].concat(CD,TD,_D);var ND="[0-9](_*[0-9])*",ID=`\\.(${ND})`,OD="[0-9a-fA-F](_*[0-9a-fA-F])*",LD={className:"number",variants:[{begin:`(\\b(${ND})((${ID})|\\.)?|(${ID}))[eE][+-]?(${ND})[fFdD]?\\b`},{begin:`\\b(${ND})((${ID})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ID})[fFdD]?\\b`},{begin:`\\b(${ND})[fFdD]\\b`},{begin:`\\b0[xX]((${OD})\\.?|(${OD})?\\.(${OD}))[pP][+-]?(${ND})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${OD})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const MD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],RD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),DD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$D=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),BD=DD.concat(PD).sort().reverse();const FD=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],zD=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),jD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),HD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),UD=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function GD(e){return e?"string"==typeof e?e:e.source:null}function qD(e){return WD("(?=",e,")")}function WD(...e){const t=e.map(e=>GD(e)).join("");return t}function VD(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map(e=>GD(e)).join("|")+")";return n}const YD=e=>WD(/\b/,e,/\w$/.test(e)?/\b/:/\B/),XD=["Protocol","Type"].map(YD),KD=["init","self"].map(YD),QD=["Any","Self"],ZD=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],JD=["false","nil","true"],eP=["assignment","associativity","higherThan","left","lowerThan","none","right"],tP=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],nP=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],rP=VD(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),iP=VD(rP,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),aP=WD(rP,iP,"*"),oP=VD(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),sP=VD(oP,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),lP=WD(oP,sP,"*"),cP=WD(/[A-Z]/,sP,"*"),uP=["attached","autoclosure",WD(/convention\(/,VD("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",WD(/objc\(/,lP,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],hP=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const dP="[A-Za-z$_][0-9A-Za-z$_]*",pP=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],fP=["true","false","null","undefined","NaN","Infinity"],gP=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],mP=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yP=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vP=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],bP=[].concat(yP,gP,mP);function xP(e){const t=e.regex,n=dP,r="<>",i="",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,f,g,m,{match:/\$\d+/},u,E,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},T,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}}const wP={arduino:function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"",keywords:d,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n},bash:function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},c=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),u={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[c,e.SHEBANG(),u,l,a,o,{match:/(\/[a-z._-]+)+/},s,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},c:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:p.concat([{begin:/\(/,end:/\)/,keywords:d,contains:p.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:d,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:s,keywords:d}}},cpp:function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},p={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[p,c,o,n,e.C_BLOCK_COMMENT_MODE,l,s],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:d,relevance:0},{begin:h,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"",keywords:d,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},a=e.inherit(i,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},s=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,s]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]});o.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],s.contains=[u,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const h={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},p=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},h,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+p+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,d],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[h,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}},css:function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+pD.join("|")+")"},{begin:":(:)?("+fD.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gD.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:dD.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+hD.join("|")+")\\b"}]}},diff:function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:")?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},a={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,bD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},bD,a]}},javascript:function(e){const t=e.regex,n=wD,r="<>",i="",a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="`${e}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,f,g,m,{match:/\$\d+/},u,E,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},T,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}},json:function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},kotlin:function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},s={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},l=LD,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=u;return h.variants[1].contains=[u],u.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,o,s,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,o,s,a,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,s]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},less:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=BD,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",a=[],o=[],s=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:RD.join(" ")},u={begin:"\\(",end:"\\)",contains:o,keywords:c,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),d={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$D.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:o,relevance:0}},g={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+MD.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+DD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},y={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[m]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,g,y,p,m,d,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}},lua:function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}},makefile:function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},a=e.inherit(r,{contains:[]}),o=e.inherit(i,{contains:[]});r.contains.push(o),i.contains.push(a);let s=[t,n];return[r,i,a,o].forEach(e=>{e.contains=e.contains.concat(s)}),s=s.concat(r,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},s={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,i,s],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(e,r,i="\\1")=>{const a="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,n)},d=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),p=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...u,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...u,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}},php:function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},h="[ \t\n]",d={scope:"string",variants:[c,l,u,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},f=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],m=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:g,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(f),built_in:m},v=e=>e.map(e=>e.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",v(m).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},x=t.concat(r,"\\b(?!\\()"),w={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},E={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},k={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[E,o,w,e.C_BLOCK_COMMENT_MODE,d,p,b]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",v(g).join("\\b|"),"|",v(m).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[k]};k.contains.push(T);const _=[E,w,e.C_BLOCK_COMMENT_MODE,d,p,b],C={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:f,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:f,keyword:["new","array"]},contains:["self",..._]},..._,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[C,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,T,w,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",C,o,w,e.C_BLOCK_COMMENT_MODE,d,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},d,p]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,h=`\\b|${r.join("|")}`,d={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${h})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${c})[jJ](?=${h})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",a,d,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,d,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,d,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[d,f,l]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},h="[0-9](_?[0-9])*",d={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},f=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},d,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);c.contains=f,p.contains=f;const g=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:a,contains:f}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(l).concat(f)}},rust:function(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:s},illegal:""},a]}},scss:function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=HD,r=jD,i="@[a-z-]+",a={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+FD.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+UD.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:zD.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=r,a=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!r.includes(e)),o={match:t.concat(/\b/,t.either(...i),/\s*\(/),relevance:0,keywords:{built_in:i}};function s(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}const l={scope:"keyword",match:s(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}(a,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:s(["double precision","large object","with timezone","without timezone"])},l,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,VD(...XD,...KD)],className:{2:"keyword"}},a={match:WD(/\./,VD(...ZD)),relevance:0},o=ZD.filter(e=>"string"==typeof e).concat(["_|0"]),s={variants:[{className:"keyword",match:VD(...ZD.filter(e=>"string"!=typeof e).concat(QD).map(YD),...KD)}]},l={$pattern:VD(/\b\w+/,/#\w+/),keyword:o.concat(tP),literal:JD},c=[i,a,s],u=[{match:WD(/\./,VD(...nP)),relevance:0},{className:"built_in",match:WD(/\b/,VD(...nP),/(?=\()/)}],h={match:/->/,relevance:0},d=[h,{className:"operator",relevance:0,variants:[{match:aP},{match:`\\.(\\.|${iP})+`}]}],p="([0-9]_*)+",f="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},m=(e="")=>({className:"subst",variants:[{match:WD(/\\/,e,/[0\\tnr"']/)},{match:WD(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),y=(e="")=>({className:"subst",match:WD(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:WD(/\\/,e,/\(/),end:/\)/}),b=(e="")=>({begin:WD(e,/"""/),end:WD(/"""/,e),contains:[m(e),y(e),v(e)]}),x=(e="")=>({begin:WD(e,/"/),end:WD(/"/,e),contains:[m(e),v(e)]}),w={className:"string",variants:[b(),b("#"),b("##"),b("###"),x(),x("#"),x("##"),x("###")]},E=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},T=e=>{const t=WD(e,/\//),n=WD(/\//,e);return{begin:t,end:n,contains:[...E,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},_={scope:"regexp",variants:[T("###"),T("##"),T("#"),k]},C={match:WD(/`/,lP,/`/)},S=[C,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${sP}+`}],A=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:hP,contains:[...d,g,w]}]}},{scope:"keyword",match:WD(/@/,VD(...uP),qD(VD(/\(/,/\s+/)))},{scope:"meta",match:WD(/@/,lP)}],N={match:qD(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:WD(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,sP,"+")},{className:"type",match:cP,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:WD(/\s+&\s+/,qD(cP)),relevance:0}]},I={begin://,keywords:l,contains:[...r,...c,...A,h,N]};N.contains.push(I);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:WD(lP,/\s*:/),keywords:"_|0",relevance:0},...r,_,...c,...u,...d,g,w,...S,...A,N]},L={begin://,keywords:"repeat each",contains:[...r,N]},M={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:VD(qD(WD(lP,/\s*:/)),qD(WD(lP,/\s+/,lP,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:lP}]},...r,...c,...d,g,w,...A,N,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,VD(C.match,lP,aP)],className:{1:"keyword",3:"title.function"},contains:[L,M,t],illegal:[/\[/,/%/]},D={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[L,M,t],illegal:/\[|%/},P={match:[/operator/,/\s+/,aP],className:{1:"keyword",3:"title"}},$={begin:[/precedencegroup/,/\s+/,cP],className:{1:"keyword",3:"title"},contains:[N],keywords:[...eP,...JD],end:/}/},B={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,lP,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[L,...c,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:cP},...c],relevance:0}]};for(const e of w.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...u,...d,g,w,...S];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,R,D,{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},B,P,$,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},_,...c,...u,...d,g,w,...S,...A,N,O]}},typescript:function(e){const t=e.regex,n=xP(e),r=dP,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={$pattern:dP,keyword:pP.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:fP,built_in:bP.concat(i),"variable.language":vP},l={className:"meta",begin:"@"+r},c=(e,t,n)=>{const r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(n.keywords,s),n.exports.PARAMS_CONTAINS.push(l);const u=n.contains.find(e=>"attr"===e.scope),h=Object.assign({},u,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,u,h]),n.contains=n.contains.concat([l,a,o,h]),c(n,"shebang",e.SHEBANG()),c(n,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});const d=n.contains.find(e=>"func.def"===e.label);return d.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},vbnet:function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,o={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,a),/ *#/)}]},s=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},s,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},wasm:function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,s,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,s,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s={begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},a,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,l,{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},r],u=[...c];return u.pop(),u.push(i),o.contains=u,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}};function EP(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||EP(n)}),e}class kP{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function TP(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function _P(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const CP=e=>!!e.scope;class SP{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=TP(e)}openNode(e){if(!CP(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){CP(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}const AP=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class NP{constructor(){this.rootNode=AP(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=AP({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{NP._collapse(e)}))}}class IP extends NP{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new SP(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function OP(e){return e?"string"==typeof e?e:e.source:null}function LP(e){return DP("(?=",e,")")}function MP(e){return DP("(?:",e,")*")}function RP(e){return DP("(?:",e,")?")}function DP(...e){const t=e.map(e=>OP(e)).join("");return t}function PP(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map(e=>OP(e)).join("|")+")";return n}function $P(e){return new RegExp(e.toString()+"|").exec("").length-1}const BP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function FP(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let r=OP(e),i="";for(;r.length>0;){const e=BP.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}const zP="[a-zA-Z]\\w*",jP="[a-zA-Z_]\\w*",HP="\\b\\d+(\\.\\d+)?",UP="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GP="\\b(0b[01]+)",qP={begin:"\\\\[\\s\\S]",relevance:0},WP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[qP]},VP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[qP]},YP=function(e,t,n={}){const r=_P({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=PP("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:DP(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},XP=YP("//","$"),KP=YP("/\\*","\\*/"),QP=YP("#","$"),ZP={scope:"number",begin:HP,relevance:0},JP={scope:"number",begin:UP,relevance:0},e$={scope:"number",begin:GP,relevance:0},t$={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[qP,{begin:/\[/,end:/\]/,relevance:0,contains:[qP]}]},n$={scope:"title",begin:zP,relevance:0},r$={scope:"title",begin:jP,relevance:0},i$={begin:"\\.\\s*"+jP,relevance:0};var a$=Object.freeze({__proto__:null,APOS_STRING_MODE:WP,BACKSLASH_ESCAPE:qP,BINARY_NUMBER_MODE:e$,BINARY_NUMBER_RE:GP,COMMENT:YP,C_BLOCK_COMMENT_MODE:KP,C_LINE_COMMENT_MODE:XP,C_NUMBER_MODE:JP,C_NUMBER_RE:UP,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:QP,IDENT_RE:zP,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:i$,NUMBER_MODE:ZP,NUMBER_RE:HP,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:VP,REGEXP_MODE:t$,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=DP(t,/.*\b/,e.binary,/\b.*/)),_P({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:n$,UNDERSCORE_IDENT_RE:jP,UNDERSCORE_TITLE_MODE:r$});function o$(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function s$(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function l$(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=o$,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function c$(e,t){Array.isArray(e.illegal)&&(e.illegal=PP(...e.illegal))}function u$(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function h$(e,t){void 0===e.relevance&&(e.relevance=1)}const d$=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=DP(n.beforeMatch,LP(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},p$=["of","and","for","in","not","or","if","then","parent","list","value"];function f$(e,t,n="keyword"){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,f$(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,g$(n[0],n[1])]})}}function g$(e,t){return t?Number(t):function(e){return p$.includes(e.toLowerCase())}(e)?0:1}const m$={},y$=e=>{console.error(e)},v$=(e,...t)=>{console.log(`WARN: ${e}`,...t)},b$=(e,t)=>{m$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),m$[`${e}/${t}`]=!0)},x$=new Error;function w$(e,t,{key:n}){let r=0;const i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=$P(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function E$(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw y$("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),x$;if("object"!=typeof e.beginScope||null===e.beginScope)throw y$("beginScope must be object"),x$;w$(e,e.begin,{key:"beginScope"}),e.begin=FP(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw y$("skip, excludeEnd, returnEnd not compatible with endScope: {}"),x$;if("object"!=typeof e.endScope||null===e.endScope)throw y$("endScope must be object"),x$;w$(e,e.end,{key:"endScope"}),e.end=FP(e.end,{joinWith:""})}}(e)}function k$(e){function t(t,n){return new RegExp(OP(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=$P(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(FP(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=_P(e.classNameAliases||{}),function n(i,a){const o=i;if(i.isCompiled)return o;[s$,u$,E$,d$].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[l$,c$,h$].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),s=i.keywords.$pattern,delete i.keywords.$pattern),s=s||/\w+/,i.keywords&&(i.keywords=f$(i.keywords,e.case_insensitive)),o.keywordPatternRe=t(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=t(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=t(o.end)),o.terminatorEnd=OP(o.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return _P(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(T$(e))return _P(e,{starts:e.starts?_P(e.starts):null});if(Object.isFrozen(e))return _P(e);return e}("self"===e?i:e)})),i.contains.forEach(function(e){n(e,o)}),i.starts&&n(i.starts,a),o.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function T$(e){return!!e&&(e.endsWithParent||T$(e.starts))}class _$ extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const C$=TP,S$=_P,A$=Symbol("nomatch"),N$=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:IP};function l(e){return s.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(b$("10.7.0","highlight(lang, code, ...args) has been deprecated."),b$("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const a={code:r,language:i};v("before:highlight",a);const o=a.result?a.result:u(a.language,a.code,n);return o.code=a.code,v("after:highlight",o),o}function u(e,n,r,o){const l=Object.create(null);function c(e,t){return e.keywords[t]}function d(){if(!C.keywords)return void A.addText(N);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=k.case_insensitive?t[0].toLowerCase():t[0],i=c(C,r);if(i){const[e,a]=i;if(A.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(I+=a),e.startsWith("_"))n+=t[0];else{const n=k.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(N)}n+=N.substring(e),A.addText(n)}function p(){null!=C.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof C.subLanguage){if(!t[C.subLanguage])return void A.addText(N);e=u(C.subLanguage,N,!0,S[C.subLanguage]),S[C.subLanguage]=e._top}else e=h(N,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(I+=e.relevance),A.__addSublanguage(e._emitter,e.language)}():d(),N=""}function f(e,t){""!==e&&(A.startScope(t),A.addText(e),A.endScope())}function m(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=k.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(N=i,d(),N=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(N,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=""):e.beginScope._multi&&(m(e.beginScope,t),N="")),C=Object.create(e,{parent:{value:C}}),C}function v(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new kP(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,n)}function b(e){return 0===C.matcher.regexIndex?(N+=e[0],1):(M=!0,0)}function x(e){const t=e[0],r=n.substring(e.index),i=v(C,e,r);if(!i)return A$;const a=C;C.endScope&&C.endScope._wrap?(p(),f(t,C.endScope._wrap)):C.endScope&&C.endScope._multi?(p(),m(C.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do{C.scope&&A.closeNode(),C.skip||C.subLanguage||(I+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&y(i.starts,e),a.returnEnd?0:t.length}let w={};function E(t,a){const o=a&&a[0];if(N+=t,null==o)return p(),0;if("begin"===w.type&&"end"===a.type&&w.index===a.index&&""===o){if(N+=n.slice(a.index,a.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=a,"begin"===a.type)return function(e){const t=e[0],n=e.rule,r=new kP(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),n.returnBegin||n.excludeBegin||(N=t)),y(n,e),n.returnBegin?0:t.length}(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.scope||"")+'"');throw e.mode=C,e}if("end"===a.type){const e=x(a);if(e!==A$)return e}if("illegal"===a.type&&""===o)return N+="\n",1;if(L>1e5&&L>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return N+=o,o.length}const k=g(e);if(!k)throw y$(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const T=k$(k);let _="",C=o||T;const S={},A=new s.__emitter(s);!function(){const e=[];for(let t=C;t!==k;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>A.openNode(e))}();let N="",I=0,O=0,L=0,M=!1;try{if(k.__emitTokens)k.__emitTokens(n,A);else{for(C.matcher.considerAll();;){L++,M?M=!1:C.matcher.considerAll(),C.matcher.lastIndex=O;const e=C.matcher.exec(n);if(!e)break;const t=E(n.substring(O,e.index),e);O=e.index+t}E(n.substring(O))}return A.finalize(),_=A.toHTML(),{language:e,value:_,relevance:I,illegal:!1,_emitter:A,_top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:C$(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:O,context:n.slice(O-100,O+100),mode:t.mode,resultSoFar:_},_emitter:A};if(i)return{language:e,value:C$(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:C};throw t}}function h(e,n){n=n||s.languages||Object.keys(t);const r=function(e){const t={value:C$(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}(e),i=n.filter(g).filter(y).map(t=>u(t,e,!1));i.unshift(r);const a=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(g(e.language).supersetOf===t.language)return 1;if(g(t.language).supersetOf===e.language)return-1}return 0}),[l,c]=a,h=l;return h.secondBest=c,h}function d(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=s.languageDetectRe.exec(t);if(n){const t=g(n[1]);return t||(v$(a.replace("{}",n[1])),v$("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>l(e)||g(e))}(e);if(l(r))return;if(v("before:highlightElement",{el:e,language:r}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),s.throwUnescapedHTML)){throw new _$("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,o=r?c(i,{language:r,ignoreIllegals:!0}):h(i);e.innerHTML=o.value,e.dataset.highlighted="yes",function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),v("after:highlightElement",{el:e,result:o,text:i})}let p=!1;function f(){if("loading"===document.readyState)return p||window.addEventListener("DOMContentLoaded",function(){f()},!1),void(p=!0);document.querySelectorAll(s.cssSelector).forEach(d)}function g(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function m(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function y(e){const t=g(e);return t&&!t.disableAutodetect}function v(e,t){const n=e;r.forEach(function(e){e[n]&&e[n](t)})}Object.assign(e,{highlight:c,highlightAuto:h,highlightAll:f,highlightElement:d,highlightBlock:function(e){return b$("10.7.0","highlightBlock will be removed entirely in v12.0"),b$("10.7.0","Please use highlightElement now."),d(e)},configure:function(e){s=S$(s,e)},initHighlighting:()=>{f(),b$("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),b$("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let a=null;try{a=r(e)}catch(e){if(y$("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;y$(e),a=o}a.name||(a.name=n),t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&m(a.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:g,registerAliases:m,autoDetection:y,inherit:S$,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="11.11.1",e.regex={concat:DP,lookahead:LP,either:PP,optional:RP,anyNumberOfTimes:MP};for(const e in a$)"object"==typeof a$[e]&&EP(a$[e]);return Object.assign(e,a$),e},I$=N$({});I$.newInstance=()=>N$({});var O$=I$;I$.HighlightJS=I$,I$.default=I$;var L$=Zt(O$);const M$={};class R${constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r={type:"element",tagName:"span",properties:{className:n},children:[]};this.stack[this.stack.length-1].children.push(r),this.stack.push(r)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const D$={};function P$(e){const t=e||D$,n=t.aliases,r=t.detect||!1,i=t.languages||wP,a=t.plainText,o=t.prefix,s=t.subset;let l="hljs";const c=function(e){const t=L$.newInstance();return e&&i(e),{highlight:n,highlightAuto:function(e,i){const a=(i||M$).subset||r();let o,s=-1,l=0;for(;++sl&&(l=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:r,register:i,registerAlias:function(e,n){if("string"==typeof e)t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){const r=e[n];t.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(e){return Boolean(t.getLanguage(e))}};function n(e,n,r){const i=r||M$,a="string"==typeof i.prefix?i.prefix:"hljs-";if(!t.getLanguage(e))throw new Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:R$,classPrefix:a});const o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});const s=o._emitter.root,l=s.data;return l.language=o.language,l.relevance=o.relevance,s}function r(){return t.listLanguages()}function i(e,n){if("string"==typeof e)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}(i);if(n&&c.registerAlias(n),o){const e=o.indexOf("-");l=-1===e?o:o.slice(0,e)}return function(e,t){CC(e,"element",function(e,n,i){if("code"!==e.tagName||!i||"element"!==i.type||"pre"!==i.tagName)return;const u=function(e){const t=e.properties.className;let n,r=-1;if(!Array.isArray(t))return;for(;++r0&&(e.children=d.children)})}}function $$(e,t){const n=e.indexOf("\r",t),r=e.indexOf("\n",t);return-1===r?n:-1===n||n+1===r?r:n1?n[e.line-2]:0)+e.column-1;if(r-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(void 0===i){const e=$$(t,n[r-1]);i=-1===e?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}}}(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case"#documentType":return n={type:"doctype"},H$(e,t,n),n;case"#text":{const r=t;return n={type:"text",value:r.value},H$(e,r,n),n}default:return n=function(e,t){const n=e.schema;e.schema=t.namespaceURI===YL.svg?ak:ik;let r=-1;const i={};for(;++r"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),hB=cB({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function dB(e,t){return t in e?e[t]:t}function pB(e,t){return dB(e,t.toLowerCase())}const fB=cB({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:pB,properties:{xmlns:null,xmlnsXLink:null}}),gB=cB({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Q$,ariaAutoComplete:null,ariaBusy:Q$,ariaChecked:Q$,ariaColCount:J$,ariaColIndex:J$,ariaColSpan:J$,ariaControls:eB,ariaCurrent:null,ariaDescribedBy:eB,ariaDetails:null,ariaDisabled:Q$,ariaDropEffect:eB,ariaErrorMessage:null,ariaExpanded:Q$,ariaFlowTo:eB,ariaGrabbed:Q$,ariaHasPopup:null,ariaHidden:Q$,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eB,ariaLevel:J$,ariaLive:null,ariaModal:Q$,ariaMultiLine:Q$,ariaMultiSelectable:Q$,ariaOrientation:null,ariaOwns:eB,ariaPlaceholder:null,ariaPosInSet:J$,ariaPressed:Q$,ariaReadOnly:Q$,ariaRelevant:null,ariaRequired:Q$,ariaRoleDescription:eB,ariaRowCount:J$,ariaRowIndex:J$,ariaRowSpan:J$,ariaSelected:Q$,ariaSetSize:J$,ariaSort:null,ariaValueMax:J$,ariaValueMin:J$,ariaValueNow:J$,ariaValueText:null,role:null}}),mB=cB({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:pB,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tB,acceptCharset:eB,accessKey:eB,action:null,allow:null,allowFullScreen:K$,allowPaymentRequest:K$,allowUserMedia:K$,alt:null,as:null,async:K$,autoCapitalize:null,autoComplete:eB,autoFocus:K$,autoPlay:K$,blocking:eB,capture:null,charSet:null,checked:K$,cite:null,className:eB,cols:J$,colSpan:null,content:null,contentEditable:Q$,controls:K$,controlsList:eB,coords:J$|tB,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K$,defer:K$,dir:null,dirName:null,disabled:K$,download:Z$,draggable:Q$,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K$,formTarget:null,headers:eB,height:J$,hidden:K$,high:J$,href:null,hrefLang:null,htmlFor:eB,httpEquiv:eB,id:null,imageSizes:null,imageSrcSet:null,inert:K$,inputMode:null,integrity:null,is:null,isMap:K$,itemId:null,itemProp:eB,itemRef:eB,itemScope:K$,itemType:eB,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K$,low:J$,manifest:null,max:null,maxLength:J$,media:null,method:null,min:null,minLength:J$,multiple:K$,muted:K$,name:null,nonce:null,noModule:K$,noValidate:K$,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:K$,optimum:J$,pattern:null,ping:eB,placeholder:null,playsInline:K$,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K$,referrerPolicy:null,rel:eB,required:K$,reversed:K$,rows:J$,rowSpan:J$,sandbox:eB,scope:null,scoped:K$,seamless:K$,selected:K$,shadowRootClonable:K$,shadowRootDelegatesFocus:K$,shadowRootMode:null,shape:null,size:J$,sizes:null,slot:null,span:J$,spellCheck:Q$,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J$,step:null,style:null,tabIndex:J$,target:null,title:null,translate:null,type:null,typeMustMatch:K$,useMap:null,value:Q$,width:J$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eB,axis:null,background:null,bgColor:null,border:J$,borderColor:null,bottomMargin:J$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K$,declare:K$,event:null,face:null,frame:null,frameBorder:null,hSpace:J$,leftMargin:J$,link:null,longDesc:null,lowSrc:null,marginHeight:J$,marginWidth:J$,noResize:K$,noHref:K$,noShade:K$,noWrap:K$,object:null,profile:null,prompt:null,rev:null,rightMargin:J$,rules:null,scheme:null,scrolling:Q$,standby:null,summary:null,text:null,topMargin:J$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:K$,disableRemotePlayback:K$,prefix:null,property:null,results:J$,security:null,unselectable:null}}),yB=cB({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:dB,properties:{about:nB,accentHeight:J$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J$,amplitude:J$,arabicForm:null,ascent:J$,attributeName:null,attributeType:null,azimuth:J$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J$,by:null,calcMode:null,capHeight:J$,className:eB,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J$,diffuseConstant:J$,direction:null,display:null,dur:null,divisor:J$,dominantBaseline:null,download:K$,dx:null,dy:null,edgeMode:null,editable:null,elevation:J$,enableBackground:null,end:null,event:null,exponent:J$,externalResourcesRequired:null,fill:null,fillOpacity:J$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tB,g2:tB,glyphName:tB,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J$,horizOriginX:J$,horizOriginY:J$,id:null,ideographic:J$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J$,k:J$,k1:J$,k2:J$,k3:J$,k4:J$,kernelMatrix:nB,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J$,overlineThickness:J$,paintOrder:null,panose1:null,path:null,pathLength:J$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eB,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J$,pointsAtY:J$,pointsAtZ:J$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nB,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nB,rev:nB,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nB,requiredFeatures:nB,requiredFonts:nB,requiredFormats:nB,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J$,specularExponent:J$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J$,strikethroughThickness:J$,string:null,stroke:null,strokeDashArray:nB,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J$,strokeOpacity:J$,strokeWidth:null,style:null,surfaceScale:J$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nB,tabIndex:J$,tableValues:null,target:null,targetX:J$,targetY:J$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nB,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J$,underlineThickness:J$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J$,values:null,vAlphabetic:J$,vMathematical:J$,vectorEffect:null,vHanging:J$,vIdeographic:J$,version:null,vertAdvY:J$,vertOriginX:J$,vertOriginY:J$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),vB=/^data[-\w.:]+$/i,bB=/-[a-z]/g,xB=/[A-Z]/g;function wB(e){return"-"+e.toLowerCase()}function EB(e){return e.charAt(1).toUpperCase()}const kB=W$([hB,uB,fB,gB,mB],"html"),TB=W$([hB,uB,fB,gB,yB],"svg"),_B={},CB={}.hasOwnProperty,SB=ZM("type",{handlers:{root:function(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=NB(e.children,n,t),IB(e,n),n},element:function(e,t){const n=t;let r=n;"element"===e.type&&"svg"===e.tagName.toLowerCase()&&"html"===n.space&&(r=TB);const i=[];let a;if(e.properties)for(a in e.properties)if("children"!==a&&CB.call(e.properties,a)){const t=AB(r,a,e.properties[a]);t&&i.push(t)}const o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:YL[o],childNodes:[],parentNode:null};s.childNodes=NB(e.children,s,r),IB(e,s),"template"===e.tagName&&e.content&&(s.content=function(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=NB(e.children,n,t),IB(e,n),n}(e.content,r));return s},text:function(e){const t={nodeName:"#text",value:e.value,parentNode:null};return IB(e,t),t},comment:function(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return IB(e,t),t},doctype:function(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return IB(e,t),t}}});function AB(e,t,n){const r=function(e,t){const n=V$(t);let r=t,i=Y$;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&vB.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(bB,EB);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!bB.test(e)){let n=e.replace(xB,wB);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=oB}return new i(r,t)}(e,t);if(!1===n||null==n||"number"==typeof n&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?vE(n):sk(n));const i={name:r.attribute,value:!0===n?"":String(n)};if(r.space&&"html"!==r.space&&"svg"!==r.space){const e=i.name.indexOf(":");e<0?i.prefix="":(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=YL[r.space]}return i}function NB(e,t,n){let r=-1;const i=[];if(e)for(;++r=55296&&e<=57343}function HB(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159}function UB(e){return e>=64976&&e<=65007||LB.has(e)}var GB;!function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"}(GB||(GB={}));class qB{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){const{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,RB.EOF;return this._err(GB.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,RB.EOF;const n=this.html.charCodeAt(t);return n===RB.CARRIAGE_RETURN?RB.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,RB.EOF;let e=this.html.charCodeAt(this.pos);if(e===RB.CARRIAGE_RETURN)return this.isEol=!0,this.skipNextNewLine=!0,RB.LINE_FEED;if(e===RB.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine))return this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance();this.skipNextNewLine=!1,jB(e)&&(e=this._processSurrogate(e));return null===this.handler.onParseError||e>31&&e<127||e===RB.LINE_FEED||e===RB.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e}_checkForProblematicCharacters(e){HB(e)?this._err(GB.controlCharacterInInputStream):UB(e)&&this._err(GB.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}!function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"}(WB||(WB={}));const YB=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),XB=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var KB;!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(KB||(KB={}));var QB,ZB,JB,eF,tF,nF,rF,iF;function aF(e){return e>=KB.ZERO&&e<=KB.NINE}function oF(e){return e>=KB.UPPER_A&&e<=KB.UPPER_F||e>=KB.LOWER_A&&e<=KB.LOWER_F}function sF(e){return e===KB.EQUALS||function(e){return e>=KB.UPPER_A&&e<=KB.UPPER_Z||e>=KB.LOWER_A&&e<=KB.LOWER_Z||aF(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(QB||(QB={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(ZB||(ZB={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(JB||(JB={}));class lF{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ZB.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=JB.Strict}startEntity(e){this.decodeMode=e,this.state=ZB.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ZB.EntityStart:return e.charCodeAt(t)===KB.NUM?(this.state=ZB.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ZB.NamedEntity,this.stateNamedEntity(e,t));case ZB.NumericStart:return this.stateNumericStart(e,t);case ZB.NumericDecimal:return this.stateNumericDecimal(e,t);case ZB.NumericHex:return this.stateNumericHex(e,t);case ZB.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===KB.LOWER_X?(this.state=ZB.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ZB.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t=55296&&e<=57343||e>1114111?65533:null!==(t=XB.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==KB.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&QB.VALUE_LENGTH)>>14;for(;t>14,0!==i){if(a===KB.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==JB.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&QB.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~QB.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ZB.NamedEntity:return 0===this.result||this.decodeMode===JB.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case ZB.NumericDecimal:return this.emitNumericEntity(0,2);case ZB.NumericHex:return this.emitNumericEntity(0,3);case ZB.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ZB.EntityStart:return 0}}}function cF(e,t,n,r){const i=(t&QB.BRANCH_LENGTH)>>7,a=t&QB.JUMP_TABLE;if(0===i)return 0!==a&&r===a?n:-1;if(a){const t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){const t=o+s>>>1,n=e[t];if(nr))return e[t+i];s=t-1}}return-1}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"}(eF||(eF={})),function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"}(tF||(tF={})),function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"}(nF||(nF={})),function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"}(rF||(rF={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"}(iF||(iF={}));const uF=new Map([[rF.A,iF.A],[rF.ADDRESS,iF.ADDRESS],[rF.ANNOTATION_XML,iF.ANNOTATION_XML],[rF.APPLET,iF.APPLET],[rF.AREA,iF.AREA],[rF.ARTICLE,iF.ARTICLE],[rF.ASIDE,iF.ASIDE],[rF.B,iF.B],[rF.BASE,iF.BASE],[rF.BASEFONT,iF.BASEFONT],[rF.BGSOUND,iF.BGSOUND],[rF.BIG,iF.BIG],[rF.BLOCKQUOTE,iF.BLOCKQUOTE],[rF.BODY,iF.BODY],[rF.BR,iF.BR],[rF.BUTTON,iF.BUTTON],[rF.CAPTION,iF.CAPTION],[rF.CENTER,iF.CENTER],[rF.CODE,iF.CODE],[rF.COL,iF.COL],[rF.COLGROUP,iF.COLGROUP],[rF.DD,iF.DD],[rF.DESC,iF.DESC],[rF.DETAILS,iF.DETAILS],[rF.DIALOG,iF.DIALOG],[rF.DIR,iF.DIR],[rF.DIV,iF.DIV],[rF.DL,iF.DL],[rF.DT,iF.DT],[rF.EM,iF.EM],[rF.EMBED,iF.EMBED],[rF.FIELDSET,iF.FIELDSET],[rF.FIGCAPTION,iF.FIGCAPTION],[rF.FIGURE,iF.FIGURE],[rF.FONT,iF.FONT],[rF.FOOTER,iF.FOOTER],[rF.FOREIGN_OBJECT,iF.FOREIGN_OBJECT],[rF.FORM,iF.FORM],[rF.FRAME,iF.FRAME],[rF.FRAMESET,iF.FRAMESET],[rF.H1,iF.H1],[rF.H2,iF.H2],[rF.H3,iF.H3],[rF.H4,iF.H4],[rF.H5,iF.H5],[rF.H6,iF.H6],[rF.HEAD,iF.HEAD],[rF.HEADER,iF.HEADER],[rF.HGROUP,iF.HGROUP],[rF.HR,iF.HR],[rF.HTML,iF.HTML],[rF.I,iF.I],[rF.IMG,iF.IMG],[rF.IMAGE,iF.IMAGE],[rF.INPUT,iF.INPUT],[rF.IFRAME,iF.IFRAME],[rF.KEYGEN,iF.KEYGEN],[rF.LABEL,iF.LABEL],[rF.LI,iF.LI],[rF.LINK,iF.LINK],[rF.LISTING,iF.LISTING],[rF.MAIN,iF.MAIN],[rF.MALIGNMARK,iF.MALIGNMARK],[rF.MARQUEE,iF.MARQUEE],[rF.MATH,iF.MATH],[rF.MENU,iF.MENU],[rF.META,iF.META],[rF.MGLYPH,iF.MGLYPH],[rF.MI,iF.MI],[rF.MO,iF.MO],[rF.MN,iF.MN],[rF.MS,iF.MS],[rF.MTEXT,iF.MTEXT],[rF.NAV,iF.NAV],[rF.NOBR,iF.NOBR],[rF.NOFRAMES,iF.NOFRAMES],[rF.NOEMBED,iF.NOEMBED],[rF.NOSCRIPT,iF.NOSCRIPT],[rF.OBJECT,iF.OBJECT],[rF.OL,iF.OL],[rF.OPTGROUP,iF.OPTGROUP],[rF.OPTION,iF.OPTION],[rF.P,iF.P],[rF.PARAM,iF.PARAM],[rF.PLAINTEXT,iF.PLAINTEXT],[rF.PRE,iF.PRE],[rF.RB,iF.RB],[rF.RP,iF.RP],[rF.RT,iF.RT],[rF.RTC,iF.RTC],[rF.RUBY,iF.RUBY],[rF.S,iF.S],[rF.SCRIPT,iF.SCRIPT],[rF.SEARCH,iF.SEARCH],[rF.SECTION,iF.SECTION],[rF.SELECT,iF.SELECT],[rF.SOURCE,iF.SOURCE],[rF.SMALL,iF.SMALL],[rF.SPAN,iF.SPAN],[rF.STRIKE,iF.STRIKE],[rF.STRONG,iF.STRONG],[rF.STYLE,iF.STYLE],[rF.SUB,iF.SUB],[rF.SUMMARY,iF.SUMMARY],[rF.SUP,iF.SUP],[rF.TABLE,iF.TABLE],[rF.TBODY,iF.TBODY],[rF.TEMPLATE,iF.TEMPLATE],[rF.TEXTAREA,iF.TEXTAREA],[rF.TFOOT,iF.TFOOT],[rF.TD,iF.TD],[rF.TH,iF.TH],[rF.THEAD,iF.THEAD],[rF.TITLE,iF.TITLE],[rF.TR,iF.TR],[rF.TRACK,iF.TRACK],[rF.TT,iF.TT],[rF.U,iF.U],[rF.UL,iF.UL],[rF.SVG,iF.SVG],[rF.VAR,iF.VAR],[rF.WBR,iF.WBR],[rF.XMP,iF.XMP]]);function hF(e){var t;return null!==(t=uF.get(e))&&void 0!==t?t:iF.UNKNOWN}const dF=iF,pF={[eF.HTML]:new Set([dF.ADDRESS,dF.APPLET,dF.AREA,dF.ARTICLE,dF.ASIDE,dF.BASE,dF.BASEFONT,dF.BGSOUND,dF.BLOCKQUOTE,dF.BODY,dF.BR,dF.BUTTON,dF.CAPTION,dF.CENTER,dF.COL,dF.COLGROUP,dF.DD,dF.DETAILS,dF.DIR,dF.DIV,dF.DL,dF.DT,dF.EMBED,dF.FIELDSET,dF.FIGCAPTION,dF.FIGURE,dF.FOOTER,dF.FORM,dF.FRAME,dF.FRAMESET,dF.H1,dF.H2,dF.H3,dF.H4,dF.H5,dF.H6,dF.HEAD,dF.HEADER,dF.HGROUP,dF.HR,dF.HTML,dF.IFRAME,dF.IMG,dF.INPUT,dF.LI,dF.LINK,dF.LISTING,dF.MAIN,dF.MARQUEE,dF.MENU,dF.META,dF.NAV,dF.NOEMBED,dF.NOFRAMES,dF.NOSCRIPT,dF.OBJECT,dF.OL,dF.P,dF.PARAM,dF.PLAINTEXT,dF.PRE,dF.SCRIPT,dF.SECTION,dF.SELECT,dF.SOURCE,dF.STYLE,dF.SUMMARY,dF.TABLE,dF.TBODY,dF.TD,dF.TEMPLATE,dF.TEXTAREA,dF.TFOOT,dF.TH,dF.THEAD,dF.TITLE,dF.TR,dF.TRACK,dF.UL,dF.WBR,dF.XMP]),[eF.MATHML]:new Set([dF.MI,dF.MO,dF.MN,dF.MS,dF.MTEXT,dF.ANNOTATION_XML]),[eF.SVG]:new Set([dF.TITLE,dF.FOREIGN_OBJECT,dF.DESC]),[eF.XLINK]:new Set,[eF.XML]:new Set,[eF.XMLNS]:new Set},fF=new Set([dF.H1,dF.H2,dF.H3,dF.H4,dF.H5,dF.H6]);var gF;new Set([rF.STYLE,rF.SCRIPT,rF.XMP,rF.IFRAME,rF.NOEMBED,rF.NOFRAMES,rF.PLAINTEXT]),function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"}(gF||(gF={}));const mF={DATA:gF.DATA,RCDATA:gF.RCDATA,RAWTEXT:gF.RAWTEXT,SCRIPT_DATA:gF.SCRIPT_DATA,PLAINTEXT:gF.PLAINTEXT,CDATA_SECTION:gF.CDATA_SECTION};function yF(e){return e>=RB.LATIN_CAPITAL_A&&e<=RB.LATIN_CAPITAL_Z}function vF(e){return function(e){return e>=RB.LATIN_SMALL_A&&e<=RB.LATIN_SMALL_Z}(e)||yF(e)}function bF(e){return vF(e)||function(e){return e>=RB.DIGIT_0&&e<=RB.DIGIT_9}(e)}function xF(e){return e+32}function wF(e){return e===RB.SPACE||e===RB.LINE_FEED||e===RB.TABULATION||e===RB.FORM_FEED}function EF(e){return wF(e)||e===RB.SOLIDUS||e===RB.GREATER_THAN_SIGN}class kF{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=gF.DATA,this.returnState=gF.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new qB(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new lF(YB,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(GB.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(GB.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{const t=function(e){return e===RB.NULL?GB.nullCharacterReference:e>1114111?GB.characterReferenceOutsideUnicodeRange:jB(e)?GB.surrogateCharacterReference:UB(e)?GB.noncharacterCharacterReference:HB(e)||e===RB.CARRIAGE_RETURN?GB.controlCharacterReference:null}(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;null===(r=(n=this.handler).onParseError)||void 0===r||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==n||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(GB.endTagWithAttributes),e.selfClosing&&this._err(GB.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case WB.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case WB.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case WB.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:WB.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=wF(e)?WB.WHITESPACE_CHARACTER:e===RB.NULL?WB.NULL_CHARACTER:WB.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(WB.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=gF.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?JB.Attribute:JB.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===gF.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===gF.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===gF.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case gF.DATA:this._stateData(e);break;case gF.RCDATA:this._stateRcdata(e);break;case gF.RAWTEXT:this._stateRawtext(e);break;case gF.SCRIPT_DATA:this._stateScriptData(e);break;case gF.PLAINTEXT:this._statePlaintext(e);break;case gF.TAG_OPEN:this._stateTagOpen(e);break;case gF.END_TAG_OPEN:this._stateEndTagOpen(e);break;case gF.TAG_NAME:this._stateTagName(e);break;case gF.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case gF.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case gF.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case gF.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case gF.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case gF.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case gF.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case gF.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case gF.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case gF.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case gF.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case gF.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case gF.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case gF.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case gF.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case gF.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case gF.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case gF.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case gF.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case gF.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case gF.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case gF.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case gF.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case gF.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case gF.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case gF.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case gF.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case gF.BOGUS_COMMENT:this._stateBogusComment(e);break;case gF.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case gF.COMMENT_START:this._stateCommentStart(e);break;case gF.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case gF.COMMENT:this._stateComment(e);break;case gF.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case gF.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case gF.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case gF.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case gF.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case gF.COMMENT_END:this._stateCommentEnd(e);break;case gF.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case gF.DOCTYPE:this._stateDoctype(e);break;case gF.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case gF.DOCTYPE_NAME:this._stateDoctypeName(e);break;case gF.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case gF.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case gF.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case gF.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case gF.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case gF.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case gF.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case gF.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case gF.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case gF.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case gF.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case gF.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case gF.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case gF.CDATA_SECTION:this._stateCdataSection(e);break;case gF.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case gF.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case gF.CHARACTER_REFERENCE:this._stateCharacterReference();break;case gF.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case RB.LESS_THAN_SIGN:this.state=gF.TAG_OPEN;break;case RB.AMPERSAND:this._startCharacterReference();break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this._emitCodePoint(e);break;case RB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case RB.AMPERSAND:this._startCharacterReference();break;case RB.LESS_THAN_SIGN:this.state=gF.RCDATA_LESS_THAN_SIGN;break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this._emitChars(MB);break;case RB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case RB.LESS_THAN_SIGN:this.state=gF.RAWTEXT_LESS_THAN_SIGN;break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this._emitChars(MB);break;case RB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case RB.LESS_THAN_SIGN:this.state=gF.SCRIPT_DATA_LESS_THAN_SIGN;break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this._emitChars(MB);break;case RB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case RB.NULL:this._err(GB.unexpectedNullCharacter),this._emitChars(MB);break;case RB.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(vF(e))this._createStartTagToken(),this.state=gF.TAG_NAME,this._stateTagName(e);else switch(e){case RB.EXCLAMATION_MARK:this.state=gF.MARKUP_DECLARATION_OPEN;break;case RB.SOLIDUS:this.state=gF.END_TAG_OPEN;break;case RB.QUESTION_MARK:this._err(GB.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=gF.BOGUS_COMMENT,this._stateBogusComment(e);break;case RB.EOF:this._err(GB.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(GB.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=gF.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(vF(e))this._createEndTagToken(),this.state=gF.TAG_NAME,this._stateTagName(e);else switch(e){case RB.GREATER_THAN_SIGN:this._err(GB.missingEndTagName),this.state=gF.DATA;break;case RB.EOF:this._err(GB.eofBeforeTagName),this._emitChars("");break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this.state=gF.SCRIPT_DATA_ESCAPED,this._emitChars(MB);break;case RB.EOF:this._err(GB.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=gF.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===RB.SOLIDUS?this.state=gF.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:vF(e)?(this._emitChars("<"),this.state=gF.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=gF.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){vF(e)?(this.state=gF.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break;case RB.NULL:this._err(GB.unexpectedNullCharacter),this.state=gF.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(MB);break;case RB.EOF:this._err(GB.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=gF.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===RB.SOLIDUS?(this.state=gF.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=gF.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(BB,!1)&&EF(this.preprocessor.peek(BB.length))){this._emitCodePoint(e);for(let e=0;e0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1)}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==eF.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(MF,eF.HTML)}clearBackToTableBodyContext(){this.clearBackTo(LF,eF.HTML)}clearBackToTableRowContext(){this.clearBackTo(OF,eF.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===iF.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===iF.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case eF.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case eF.SVG:if(IF.has(r))return!1;break;case eF.MATHML:if(NF.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,CF)}hasInListItemScope(e){return this.hasInDynamicScope(e,SF)}hasInButtonScope(e){return this.hasInDynamicScope(e,AF)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case eF.HTML:if(fF.has(t))return!0;if(CF.has(t))return!1;break;case eF.SVG:if(IF.has(t))return!1;break;case eF.MATHML:if(NF.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===eF.HTML)switch(this.tagIDs[t]){case e:return!0;case iF.TABLE:case iF.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===eF.HTML)switch(this.tagIDs[e]){case iF.TBODY:case iF.THEAD:case iF.TFOOT:return!0;case iF.TABLE:case iF.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===eF.HTML)switch(this.tagIDs[t]){case e:return!0;case iF.OPTION:case iF.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&TF.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&_F.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;void 0!==this.currentTagId&&this.currentTagId!==e&&_F.has(this.currentTagId);)this.pop()}}var PF;!function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"}(PF||(PF={}));const $F={type:PF.Marker};class BF{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e[e.name,e.value]));let i=0;for(let e=0;er.get(e.name)===e.value)&&(i+=1,i>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift($F)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:PF.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:PF.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);-1!==t&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf($F);-1===e?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find(t=>t.type===PF.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===PF.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===PF.Element&&t.element===e)}}const FF={createDocument:()=>({nodeName:"#document",mode:nF.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,n)=>({nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),createTextNode:e=>({nodeName:"#text",value:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent:e=>e.content,setDocumentType(e,t,n,r){const i=e.childNodes.find(e=>"#documentType"===e.nodeName);if(i)i.name=t,i.publicId=n,i.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};FF.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(FF.isTextNode(n))return void(n.value+=t)}FF.appendChild(e,FF.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&FF.isTextNode(r)?r.value+=t:FF.insertBefore(e,FF.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(e=>e.name));for(let r=0;re.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},zF="html",jF=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],HF=[...jF,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],UF=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),GF=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],qF=[...GF,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function WF(e,t){return t.some(t=>e.startsWith(t))}const VF="text/html",YF="application/xhtml+xml",XF=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),KF=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:eF.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:eF.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:eF.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:eF.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:eF.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:eF.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:eF.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:eF.XML}],["xml:space",{prefix:"xml",name:"space",namespace:eF.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:eF.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:eF.XMLNS}]]),QF=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ZF=new Set([iF.B,iF.BIG,iF.BLOCKQUOTE,iF.BODY,iF.BR,iF.CENTER,iF.CODE,iF.DD,iF.DIV,iF.DL,iF.DT,iF.EM,iF.EMBED,iF.H1,iF.H2,iF.H3,iF.H4,iF.H5,iF.H6,iF.HEAD,iF.HR,iF.I,iF.IMG,iF.LI,iF.LISTING,iF.MENU,iF.META,iF.NOBR,iF.OL,iF.P,iF.PRE,iF.RUBY,iF.S,iF.SMALL,iF.SPAN,iF.STRONG,iF.STRIKE,iF.SUB,iF.SUP,iF.TABLE,iF.TT,iF.U,iF.UL,iF.VAR]);function JF(e){for(let t=0;t0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===eF.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&void 0!==e&&void 0!==t&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,eF.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=rz.TEXT}switchToPlaintextParsing(){this.insertionMode=rz.TEXT,this.originalInsertionMode=rz.IN_BODY,this.tokenizer.state=mF.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===rF.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===eF.HTML)switch(this.fragmentContextID){case iF.TITLE:case iF.TEXTAREA:this.tokenizer.state=mF.RCDATA;break;case iF.STYLE:case iF.XMP:case iF.IFRAME:case iF.NOEMBED:case iF.NOFRAMES:case iF.NOSCRIPT:this.tokenizer.state=mF.RAWTEXT;break;case iF.SCRIPT:this.tokenizer.state=mF.SCRIPT_DATA;break;case iF.PLAINTEXT:this.tokenizer.state=mF.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=t?t:this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,eF.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,eF.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(rF.HTML,eF.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,iF.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:n}=this._findFosterParentingLocation()),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),i=n?r.lastIndexOf(n):r.length,a=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===WB.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):({current:t,currentTagId:n}=this.openElements),(e.tagID!==iF.SVG||this.treeAdapter.getTagName(t)!==rF.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==eF.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===iF.MGLYPH||e.tagID===iF.MALIGNMARK)&&void 0!==n&&!this._isIntegrationPoint(n,t,eF.HTML))}_processToken(e){switch(e.type){case WB.CHARACTER:this.onCharacter(e);break;case WB.NULL_CHARACTER:this.onNullCharacter(e);break;case WB.COMMENT:this.onComment(e);break;case WB.DOCTYPE:this.onDoctype(e);break;case WB.START_TAG:this._processStartTag(e);break;case WB.END_TAG:this.onEndTag(e);break;case WB.EOF:this.onEof(e);break;case WB.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return nz(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(e=>e.type===PF.Marker||this.openElements.contains(e.element));for(let n=-1===t?e-1:t-1;n>=0;n--){const e=this.activeFormattingElements.entries[n];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=rz.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(iF.P),this.openElements.popUntilTagNamePopped(iF.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case iF.TR:return void(this.insertionMode=rz.IN_ROW);case iF.TBODY:case iF.THEAD:case iF.TFOOT:return void(this.insertionMode=rz.IN_TABLE_BODY);case iF.CAPTION:return void(this.insertionMode=rz.IN_CAPTION);case iF.COLGROUP:return void(this.insertionMode=rz.IN_COLUMN_GROUP);case iF.TABLE:return void(this.insertionMode=rz.IN_TABLE);case iF.BODY:return void(this.insertionMode=rz.IN_BODY);case iF.FRAMESET:return void(this.insertionMode=rz.IN_FRAMESET);case iF.SELECT:return void this._resetInsertionModeForSelect(e);case iF.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case iF.HTML:return void(this.insertionMode=this.headElement?rz.AFTER_HEAD:rz.BEFORE_HEAD);case iF.TD:case iF.TH:if(e>0)return void(this.insertionMode=rz.IN_CELL);break;case iF.HEAD:if(e>0)return void(this.insertionMode=rz.IN_HEAD)}this.insertionMode=rz.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===iF.TEMPLATE)break;if(e===iF.TABLE)return void(this.insertionMode=rz.IN_SELECT_IN_TABLE)}this.insertionMode=rz.IN_SELECT}_isElementCausesFosterParenting(e){return az.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case iF.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===eF.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case iF.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return pF[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e);else switch(this.insertionMode){case rz.INITIAL:yz(this,e);break;case rz.BEFORE_HTML:vz(this,e);break;case rz.BEFORE_HEAD:bz(this,e);break;case rz.IN_HEAD:Ez(this,e);break;case rz.IN_HEAD_NO_SCRIPT:kz(this,e);break;case rz.AFTER_HEAD:Tz(this,e);break;case rz.IN_BODY:case rz.IN_CAPTION:case rz.IN_CELL:case rz.IN_TEMPLATE:Sz(this,e);break;case rz.TEXT:case rz.IN_SELECT:case rz.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case rz.IN_TABLE:case rz.IN_TABLE_BODY:case rz.IN_ROW:Pz(this,e);break;case rz.IN_TABLE_TEXT:jz(this,e);break;case rz.IN_COLUMN_GROUP:qz(this,e);break;case rz.AFTER_BODY:ej(this,e);break;case rz.AFTER_AFTER_BODY:tj(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars=MB,e._insertCharacters(t)}(this,e);else switch(this.insertionMode){case rz.INITIAL:yz(this,e);break;case rz.BEFORE_HTML:vz(this,e);break;case rz.BEFORE_HEAD:bz(this,e);break;case rz.IN_HEAD:Ez(this,e);break;case rz.IN_HEAD_NO_SCRIPT:kz(this,e);break;case rz.AFTER_HEAD:Tz(this,e);break;case rz.TEXT:this._insertCharacters(e);break;case rz.IN_TABLE:case rz.IN_TABLE_BODY:case rz.IN_ROW:Pz(this,e);break;case rz.IN_COLUMN_GROUP:qz(this,e);break;case rz.AFTER_BODY:ej(this,e);break;case rz.AFTER_AFTER_BODY:tj(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)gz(this,e);else switch(this.insertionMode){case rz.INITIAL:case rz.BEFORE_HTML:case rz.BEFORE_HEAD:case rz.IN_HEAD:case rz.IN_HEAD_NO_SCRIPT:case rz.AFTER_HEAD:case rz.IN_BODY:case rz.IN_TABLE:case rz.IN_CAPTION:case rz.IN_COLUMN_GROUP:case rz.IN_TABLE_BODY:case rz.IN_ROW:case rz.IN_CELL:case rz.IN_SELECT:case rz.IN_SELECT_IN_TABLE:case rz.IN_TEMPLATE:case rz.IN_FRAMESET:case rz.AFTER_FRAMESET:gz(this,e);break;case rz.IN_TABLE_TEXT:Hz(this,e);break;case rz.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0])}(this,e);break;case rz.AFTER_AFTER_BODY:case rz.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document)}(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case rz.INITIAL:!function(e,t){e._setDocumentType(t);const n=t.forceQuirks?nF.QUIRKS:function(e){if(e.name!==zF)return nF.QUIRKS;const{systemId:t}=e;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return nF.QUIRKS;let{publicId:n}=e;if(null!==n){if(n=n.toLowerCase(),UF.has(n))return nF.QUIRKS;let e=null===t?HF:jF;if(WF(n,e))return nF.QUIRKS;if(e=null===t?GF:qF,WF(n,e))return nF.LIMITED_QUIRKS}return nF.NO_QUIRKS}(t);(function(e){return e.name===zF&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err(t,GB.nonConformingDoctype);e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=rz.BEFORE_HTML}(this,e);break;case rz.BEFORE_HEAD:case rz.IN_HEAD:case rz.IN_HEAD_NO_SCRIPT:case rz.AFTER_HEAD:this._err(e,GB.misplacedDoctype);break;case rz.IN_TABLE_TEXT:Hz(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,GB.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(function(e){const t=e.tagID,n=t===iF.FONT&&e.attrs.some(({name:e})=>e===tF.COLOR||e===tF.SIZE||e===tF.FACE);return n||ZF.has(t)}(t))nj(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===eF.MATHML?JF(t):r===eF.SVG&&(!function(e){const t=QF.get(e.tagName);null!=t&&(e.tagName=t,e.tagID=hF(e.tagName))}(t),ez(t)),tz(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case rz.INITIAL:yz(this,e);break;case rz.BEFORE_HTML:!function(e,t){t.tagID===iF.HTML?(e._insertElement(t,eF.HTML),e.insertionMode=rz.BEFORE_HEAD):vz(e,t)}(this,e);break;case rz.BEFORE_HEAD:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.HEAD:e._insertElement(t,eF.HTML),e.headElement=e.openElements.current,e.insertionMode=rz.IN_HEAD;break;default:bz(e,t)}}(this,e);break;case rz.IN_HEAD:xz(this,e);break;case rz.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.BASEFONT:case iF.BGSOUND:case iF.HEAD:case iF.LINK:case iF.META:case iF.NOFRAMES:case iF.STYLE:xz(e,t);break;case iF.NOSCRIPT:e._err(t,GB.nestedNoscriptInHead);break;default:kz(e,t)}}(this,e);break;case rz.AFTER_HEAD:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.BODY:e._insertElement(t,eF.HTML),e.framesetOk=!1,e.insertionMode=rz.IN_BODY;break;case iF.FRAMESET:e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_FRAMESET;break;case iF.BASE:case iF.BASEFONT:case iF.BGSOUND:case iF.LINK:case iF.META:case iF.NOFRAMES:case iF.SCRIPT:case iF.STYLE:case iF.TEMPLATE:case iF.TITLE:e._err(t,GB.abandonedHeadElementChild),e.openElements.push(e.headElement,iF.HEAD),xz(e,t),e.openElements.remove(e.headElement);break;case iF.HEAD:e._err(t,GB.misplacedStartTagForHeadElement);break;default:Tz(e,t)}}(this,e);break;case rz.IN_BODY:Lz(this,e);break;case rz.IN_TABLE:$z(this,e);break;case rz.IN_TABLE_TEXT:Hz(this,e);break;case rz.IN_CAPTION:!function(e,t){const n=t.tagID;Uz.has(n)?e.openElements.hasInTableScope(iF.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(iF.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=rz.IN_TABLE,$z(e,t)):Lz(e,t)}(this,e);break;case rz.IN_COLUMN_GROUP:Gz(this,e);break;case rz.IN_TABLE_BODY:Wz(this,e);break;case rz.IN_ROW:Yz(this,e);break;case rz.IN_CELL:!function(e,t){const n=t.tagID;Uz.has(n)?(e.openElements.hasInTableScope(iF.TD)||e.openElements.hasInTableScope(iF.TH))&&(e._closeTableCell(),Yz(e,t)):Lz(e,t)}(this,e);break;case rz.IN_SELECT:Kz(this,e);break;case rz.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===iF.CAPTION||n===iF.TABLE||n===iF.TBODY||n===iF.TFOOT||n===iF.THEAD||n===iF.TR||n===iF.TD||n===iF.TH?(e.openElements.popUntilTagNamePopped(iF.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Kz(e,t)}(this,e);break;case rz.IN_TEMPLATE:!function(e,t){switch(t.tagID){case iF.BASE:case iF.BASEFONT:case iF.BGSOUND:case iF.LINK:case iF.META:case iF.NOFRAMES:case iF.SCRIPT:case iF.STYLE:case iF.TEMPLATE:case iF.TITLE:xz(e,t);break;case iF.CAPTION:case iF.COLGROUP:case iF.TBODY:case iF.TFOOT:case iF.THEAD:e.tmplInsertionModeStack[0]=rz.IN_TABLE,e.insertionMode=rz.IN_TABLE,$z(e,t);break;case iF.COL:e.tmplInsertionModeStack[0]=rz.IN_COLUMN_GROUP,e.insertionMode=rz.IN_COLUMN_GROUP,Gz(e,t);break;case iF.TR:e.tmplInsertionModeStack[0]=rz.IN_TABLE_BODY,e.insertionMode=rz.IN_TABLE_BODY,Wz(e,t);break;case iF.TD:case iF.TH:e.tmplInsertionModeStack[0]=rz.IN_ROW,e.insertionMode=rz.IN_ROW,Yz(e,t);break;default:e.tmplInsertionModeStack[0]=rz.IN_BODY,e.insertionMode=rz.IN_BODY,Lz(e,t)}}(this,e);break;case rz.AFTER_BODY:!function(e,t){t.tagID===iF.HTML?Lz(e,t):ej(e,t)}(this,e);break;case rz.IN_FRAMESET:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.FRAMESET:e._insertElement(t,eF.HTML);break;case iF.FRAME:e._appendElement(t,eF.HTML),t.ackSelfClosing=!0;break;case iF.NOFRAMES:xz(e,t)}}(this,e);break;case rz.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.NOFRAMES:xz(e,t)}}(this,e);break;case rz.AFTER_AFTER_BODY:!function(e,t){t.tagID===iF.HTML?Lz(e,t):tj(e,t)}(this,e);break;case rz.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.NOFRAMES:xz(e,t)}}(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===iF.P||t.tagID===iF.BR)return nj(e),void e._endTagOutsideForeignContent(t);for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===eF.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case rz.INITIAL:yz(this,e);break;case rz.BEFORE_HTML:!function(e,t){const n=t.tagID;n!==iF.HTML&&n!==iF.HEAD&&n!==iF.BODY&&n!==iF.BR||vz(e,t)}(this,e);break;case rz.BEFORE_HEAD:!function(e,t){const n=t.tagID;n===iF.HEAD||n===iF.BODY||n===iF.HTML||n===iF.BR?bz(e,t):e._err(t,GB.endTagWithoutMatchingOpenElement)}(this,e);break;case rz.IN_HEAD:!function(e,t){switch(t.tagID){case iF.HEAD:e.openElements.pop(),e.insertionMode=rz.AFTER_HEAD;break;case iF.BODY:case iF.BR:case iF.HTML:Ez(e,t);break;case iF.TEMPLATE:wz(e,t);break;default:e._err(t,GB.endTagWithoutMatchingOpenElement)}}(this,e);break;case rz.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case iF.NOSCRIPT:e.openElements.pop(),e.insertionMode=rz.IN_HEAD;break;case iF.BR:kz(e,t);break;default:e._err(t,GB.endTagWithoutMatchingOpenElement)}}(this,e);break;case rz.AFTER_HEAD:!function(e,t){switch(t.tagID){case iF.BODY:case iF.HTML:case iF.BR:Tz(e,t);break;case iF.TEMPLATE:wz(e,t);break;default:e._err(t,GB.endTagWithoutMatchingOpenElement)}}(this,e);break;case rz.IN_BODY:Rz(this,e);break;case rz.TEXT:!function(e,t){var n;t.tagID===iF.SCRIPT&&(null===(n=e.scriptHandler)||void 0===n||n.call(e,e.openElements.current));e.openElements.pop(),e.insertionMode=e.originalInsertionMode}(this,e);break;case rz.IN_TABLE:Bz(this,e);break;case rz.IN_TABLE_TEXT:Hz(this,e);break;case rz.IN_CAPTION:!function(e,t){const n=t.tagID;switch(n){case iF.CAPTION:case iF.TABLE:e.openElements.hasInTableScope(iF.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(iF.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=rz.IN_TABLE,n===iF.TABLE&&Bz(e,t));break;case iF.BODY:case iF.COL:case iF.COLGROUP:case iF.HTML:case iF.TBODY:case iF.TD:case iF.TFOOT:case iF.TH:case iF.THEAD:case iF.TR:break;default:Rz(e,t)}}(this,e);break;case rz.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case iF.COLGROUP:e.openElements.currentTagId===iF.COLGROUP&&(e.openElements.pop(),e.insertionMode=rz.IN_TABLE);break;case iF.TEMPLATE:wz(e,t);break;case iF.COL:break;default:qz(e,t)}}(this,e);break;case rz.IN_TABLE_BODY:Vz(this,e);break;case rz.IN_ROW:Xz(this,e);break;case rz.IN_CELL:!function(e,t){const n=t.tagID;switch(n){case iF.TD:case iF.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=rz.IN_ROW);break;case iF.TABLE:case iF.TBODY:case iF.TFOOT:case iF.THEAD:case iF.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Xz(e,t));break;case iF.BODY:case iF.CAPTION:case iF.COL:case iF.COLGROUP:case iF.HTML:break;default:Rz(e,t)}}(this,e);break;case rz.IN_SELECT:Qz(this,e);break;case rz.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===iF.CAPTION||n===iF.TABLE||n===iF.TBODY||n===iF.TFOOT||n===iF.THEAD||n===iF.TR||n===iF.TD||n===iF.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(iF.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Qz(e,t)}(this,e);break;case rz.IN_TEMPLATE:!function(e,t){t.tagID===iF.TEMPLATE&&wz(e,t)}(this,e);break;case rz.AFTER_BODY:Jz(this,e);break;case rz.IN_FRAMESET:!function(e,t){t.tagID!==iF.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===iF.FRAMESET||(e.insertionMode=rz.AFTER_FRAMESET))}(this,e);break;case rz.AFTER_FRAMESET:!function(e,t){t.tagID===iF.HTML&&(e.insertionMode=rz.AFTER_AFTER_FRAMESET)}(this,e);break;case rz.AFTER_AFTER_BODY:tj(this,e)}}onEof(e){switch(this.insertionMode){case rz.INITIAL:yz(this,e);break;case rz.BEFORE_HTML:vz(this,e);break;case rz.BEFORE_HEAD:bz(this,e);break;case rz.IN_HEAD:Ez(this,e);break;case rz.IN_HEAD_NO_SCRIPT:kz(this,e);break;case rz.AFTER_HEAD:Tz(this,e);break;case rz.IN_BODY:case rz.IN_TABLE:case rz.IN_CAPTION:case rz.IN_COLUMN_GROUP:case rz.IN_TABLE_BODY:case rz.IN_ROW:case rz.IN_CELL:case rz.IN_SELECT:case rz.IN_SELECT_IN_TABLE:Dz(this,e);break;case rz.TEXT:!function(e,t){e._err(t,GB.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}(this,e);break;case rz.IN_TABLE_TEXT:Hz(this,e);break;case rz.IN_TEMPLATE:Zz(this,e);break;case rz.AFTER_BODY:case rz.IN_FRAMESET:case rz.AFTER_FRAMESET:case rz.AFTER_AFTER_BODY:case rz.AFTER_AFTER_FRAMESET:mz(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===RB.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case rz.IN_HEAD:case rz.IN_HEAD_NO_SCRIPT:case rz.AFTER_HEAD:case rz.TEXT:case rz.IN_COLUMN_GROUP:case rz.IN_SELECT:case rz.IN_SELECT_IN_TABLE:case rz.IN_FRAMESET:case rz.AFTER_FRAMESET:this._insertCharacters(e);break;case rz.IN_BODY:case rz.IN_CAPTION:case rz.IN_CELL:case rz.IN_TEMPLATE:case rz.AFTER_BODY:case rz.AFTER_AFTER_BODY:case rz.AFTER_AFTER_FRAMESET:Cz(this,e);break;case rz.IN_TABLE:case rz.IN_TABLE_BODY:case rz.IN_ROW:Pz(this,e);break;case rz.IN_TABLE_TEXT:zz(this,e)}}};function lz(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Mz(e,t),n}function cz(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function uz(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=3;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=hz(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function hz(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function dz(e,t,n){const r=hF(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);r===iF.TEMPLATE&&i===eF.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function pz(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function fz(e,t){for(let n=0;n<8;n++){const n=lz(e,t);if(!n)break;const r=cz(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;const i=uz(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&dz(e,a,i),pz(e,r,n)}}function gz(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function mz(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){const n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function yz(e,t){e._err(t,GB.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,nF.QUIRKS),e.insertionMode=rz.BEFORE_HTML,e._processToken(t)}function vz(e,t){e._insertFakeRootElement(),e.insertionMode=rz.BEFORE_HEAD,e._processToken(t)}function bz(e,t){e._insertFakeElement(rF.HEAD,iF.HEAD),e.headElement=e.openElements.current,e.insertionMode=rz.IN_HEAD,e._processToken(t)}function xz(e,t){switch(t.tagID){case iF.HTML:Lz(e,t);break;case iF.BASE:case iF.BASEFONT:case iF.BGSOUND:case iF.LINK:case iF.META:e._appendElement(t,eF.HTML),t.ackSelfClosing=!0;break;case iF.TITLE:e._switchToTextParsing(t,mF.RCDATA);break;case iF.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,mF.RAWTEXT):(e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_HEAD_NO_SCRIPT);break;case iF.NOFRAMES:case iF.STYLE:e._switchToTextParsing(t,mF.RAWTEXT);break;case iF.SCRIPT:e._switchToTextParsing(t,mF.SCRIPT_DATA);break;case iF.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=rz.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(rz.IN_TEMPLATE);break;case iF.HEAD:e._err(t,GB.misplacedStartTagForHeadElement);break;default:Ez(e,t)}}function wz(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==iF.TEMPLATE&&e._err(t,GB.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(iF.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,GB.endTagWithoutMatchingOpenElement)}function Ez(e,t){e.openElements.pop(),e.insertionMode=rz.AFTER_HEAD,e._processToken(t)}function kz(e,t){const n=t.type===WB.EOF?GB.openElementsLeftAfterEof:GB.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=rz.IN_HEAD,e._processToken(t)}function Tz(e,t){e._insertFakeElement(rF.BODY,iF.BODY),e.insertionMode=rz.IN_BODY,_z(e,t)}function _z(e,t){switch(t.type){case WB.CHARACTER:Sz(e,t);break;case WB.WHITESPACE_CHARACTER:Cz(e,t);break;case WB.COMMENT:gz(e,t);break;case WB.START_TAG:Lz(e,t);break;case WB.END_TAG:Rz(e,t);break;case WB.EOF:Dz(e,t)}}function Cz(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Sz(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Az(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,eF.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Nz(e){const t=VB(e,tF.TYPE);return null!=t&&"hidden"===t.toLowerCase()}function Iz(e,t){e._switchToTextParsing(t,mF.RAWTEXT)}function Oz(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML)}function Lz(e,t){switch(t.tagID){case iF.I:case iF.S:case iF.B:case iF.U:case iF.EM:case iF.TT:case iF.BIG:case iF.CODE:case iF.FONT:case iF.SMALL:case iF.STRIKE:case iF.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case iF.A:!function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(rF.A);n&&(fz(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case iF.H1:case iF.H2:case iF.H3:case iF.H4:case iF.H5:case iF.H6:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),void 0!==e.openElements.currentTagId&&fF.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,eF.HTML)}(e,t);break;case iF.P:case iF.DL:case iF.OL:case iF.UL:case iF.DIV:case iF.DIR:case iF.NAV:case iF.MAIN:case iF.MENU:case iF.ASIDE:case iF.CENTER:case iF.FIGURE:case iF.FOOTER:case iF.HEADER:case iF.HGROUP:case iF.DIALOG:case iF.DETAILS:case iF.ADDRESS:case iF.ARTICLE:case iF.SEARCH:case iF.SECTION:case iF.SUMMARY:case iF.FIELDSET:case iF.BLOCKQUOTE:case iF.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML)}(e,t);break;case iF.LI:case iF.DD:case iF.DT:!function(e,t){e.framesetOk=!1;const n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.tagIDs[t];if(n===iF.LI&&r===iF.LI||(n===iF.DD||n===iF.DT)&&(r===iF.DD||r===iF.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==iF.ADDRESS&&r!==iF.DIV&&r!==iF.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML)}(e,t);break;case iF.BR:case iF.IMG:case iF.WBR:case iF.AREA:case iF.EMBED:case iF.KEYGEN:Az(e,t);break;case iF.HR:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._appendElement(t,eF.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t);break;case iF.RB:case iF.RTC:!function(e,t){e.openElements.hasInScope(iF.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,eF.HTML)}(e,t);break;case iF.RT:case iF.RP:!function(e,t){e.openElements.hasInScope(iF.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(iF.RTC),e._insertElement(t,eF.HTML)}(e,t);break;case iF.PRE:case iF.LISTING:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}(e,t);break;case iF.XMP:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,mF.RAWTEXT)}(e,t);break;case iF.SVG:!function(e,t){e._reconstructActiveFormattingElements(),ez(t),tz(t),t.selfClosing?e._appendElement(t,eF.SVG):e._insertElement(t,eF.SVG),t.ackSelfClosing=!0}(e,t);break;case iF.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t);break;case iF.BASE:case iF.LINK:case iF.META:case iF.STYLE:case iF.TITLE:case iF.SCRIPT:case iF.BGSOUND:case iF.BASEFONT:case iF.TEMPLATE:xz(e,t);break;case iF.BODY:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t);break;case iF.FORM:!function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML),n||(e.formElement=e.openElements.current))}(e,t);break;case iF.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(iF.NOBR)&&(fz(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,eF.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case iF.MATH:!function(e,t){e._reconstructActiveFormattingElements(),JF(t),tz(t),t.selfClosing?e._appendElement(t,eF.MATHML):e._insertElement(t,eF.MATHML),t.ackSelfClosing=!0}(e,t);break;case iF.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==nF.QUIRKS&&e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML),e.framesetOk=!1,e.insertionMode=rz.IN_TABLE}(e,t);break;case iF.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,eF.HTML),Nz(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t);break;case iF.PARAM:case iF.TRACK:case iF.SOURCE:!function(e,t){e._appendElement(t,eF.HTML),t.ackSelfClosing=!0}(e,t);break;case iF.IMAGE:!function(e,t){t.tagName=rF.IMG,t.tagID=iF.IMG,Az(e,t)}(e,t);break;case iF.BUTTON:!function(e,t){e.openElements.hasInScope(iF.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(iF.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML),e.framesetOk=!1}(e,t);break;case iF.APPLET:case iF.OBJECT:case iF.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}(e,t);break;case iF.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,mF.RAWTEXT)}(e,t);break;case iF.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===rz.IN_TABLE||e.insertionMode===rz.IN_CAPTION||e.insertionMode===rz.IN_TABLE_BODY||e.insertionMode===rz.IN_ROW||e.insertionMode===rz.IN_CELL?rz.IN_SELECT_IN_TABLE:rz.IN_SELECT}(e,t);break;case iF.OPTION:case iF.OPTGROUP:!function(e,t){e.openElements.currentTagId===iF.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,eF.HTML)}(e,t);break;case iF.NOEMBED:case iF.NOFRAMES:Iz(e,t);break;case iF.FRAMESET:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_FRAMESET)}(e,t);break;case iF.TEXTAREA:!function(e,t){e._insertElement(t,eF.HTML),e.skipNextNewLine=!0,e.tokenizer.state=mF.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=rz.TEXT}(e,t);break;case iF.NOSCRIPT:e.options.scriptingEnabled?Iz(e,t):Oz(e,t);break;case iF.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(iF.P)&&e._closePElement(),e._insertElement(t,eF.HTML),e.tokenizer.state=mF.PLAINTEXT}(e,t);break;case iF.COL:case iF.TH:case iF.TD:case iF.TR:case iF.HEAD:case iF.FRAME:case iF.TBODY:case iF.TFOOT:case iF.THEAD:case iF.CAPTION:case iF.COLGROUP:break;default:Oz(e,t)}}function Mz(e,t){const n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==iF.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Rz(e,t){switch(t.tagID){case iF.A:case iF.B:case iF.I:case iF.S:case iF.U:case iF.EM:case iF.TT:case iF.BIG:case iF.CODE:case iF.FONT:case iF.NOBR:case iF.SMALL:case iF.STRIKE:case iF.STRONG:fz(e,t);break;case iF.P:!function(e){e.openElements.hasInButtonScope(iF.P)||e._insertFakeElement(rF.P,iF.P),e._closePElement()}(e);break;case iF.DL:case iF.UL:case iF.OL:case iF.DIR:case iF.DIV:case iF.NAV:case iF.PRE:case iF.MAIN:case iF.MENU:case iF.ASIDE:case iF.BUTTON:case iF.CENTER:case iF.FIGURE:case iF.FOOTER:case iF.HEADER:case iF.HGROUP:case iF.DIALOG:case iF.ADDRESS:case iF.ARTICLE:case iF.DETAILS:case iF.SEARCH:case iF.SECTION:case iF.SUMMARY:case iF.LISTING:case iF.FIELDSET:case iF.BLOCKQUOTE:case iF.FIGCAPTION:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case iF.LI:!function(e){e.openElements.hasInListItemScope(iF.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(iF.LI),e.openElements.popUntilTagNamePopped(iF.LI))}(e);break;case iF.DD:case iF.DT:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case iF.H1:case iF.H2:case iF.H3:case iF.H4:case iF.H5:case iF.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e);break;case iF.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(rF.BR,iF.BR),e.openElements.pop(),e.framesetOk=!1}(e);break;case iF.BODY:!function(e,t){if(e.openElements.hasInScope(iF.BODY)&&(e.insertionMode=rz.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}(e,t);break;case iF.HTML:!function(e,t){e.openElements.hasInScope(iF.BODY)&&(e.insertionMode=rz.AFTER_BODY,Jz(e,t))}(e,t);break;case iF.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(iF.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(iF.FORM):n&&e.openElements.remove(n))}(e);break;case iF.APPLET:case iF.OBJECT:case iF.MARQUEE:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}(e,t);break;case iF.TEMPLATE:wz(e,t);break;default:Mz(e,t)}}function Dz(e,t){e.tmplInsertionModeStack.length>0?Zz(e,t):mz(e,t)}function Pz(e,t){if(void 0!==e.openElements.currentTagId&&az.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=rz.IN_TABLE_TEXT,t.type){case WB.CHARACTER:jz(e,t);break;case WB.WHITESPACE_CHARACTER:zz(e,t)}else Fz(e,t)}function $z(e,t){switch(t.tagID){case iF.TD:case iF.TH:case iF.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(rF.TBODY,iF.TBODY),e.insertionMode=rz.IN_TABLE_BODY,Wz(e,t)}(e,t);break;case iF.STYLE:case iF.SCRIPT:case iF.TEMPLATE:xz(e,t);break;case iF.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(rF.COLGROUP,iF.COLGROUP),e.insertionMode=rz.IN_COLUMN_GROUP,Gz(e,t)}(e,t);break;case iF.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,eF.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t);break;case iF.TABLE:!function(e,t){e.openElements.hasInTableScope(iF.TABLE)&&(e.openElements.popUntilTagNamePopped(iF.TABLE),e._resetInsertionMode(),e._processStartTag(t))}(e,t);break;case iF.TBODY:case iF.TFOOT:case iF.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_TABLE_BODY}(e,t);break;case iF.INPUT:!function(e,t){Nz(t)?e._appendElement(t,eF.HTML):Fz(e,t),t.ackSelfClosing=!0}(e,t);break;case iF.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_CAPTION}(e,t);break;case iF.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,eF.HTML),e.insertionMode=rz.IN_COLUMN_GROUP}(e,t);break;default:Fz(e,t)}}function Bz(e,t){switch(t.tagID){case iF.TABLE:e.openElements.hasInTableScope(iF.TABLE)&&(e.openElements.popUntilTagNamePopped(iF.TABLE),e._resetInsertionMode());break;case iF.TEMPLATE:wz(e,t);break;case iF.BODY:case iF.CAPTION:case iF.COL:case iF.COLGROUP:case iF.HTML:case iF.TBODY:case iF.TD:case iF.TFOOT:case iF.TH:case iF.THEAD:case iF.TR:break;default:Fz(e,t)}}function Fz(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,_z(e,t),e.fosterParentingEnabled=n}function zz(e,t){e.pendingCharacterTokens.push(t)}function jz(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Hz(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===iF.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===iF.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===iF.OPTGROUP&&e.openElements.pop();break;case iF.OPTION:e.openElements.currentTagId===iF.OPTION&&e.openElements.pop();break;case iF.SELECT:e.openElements.hasInSelectScope(iF.SELECT)&&(e.openElements.popUntilTagNamePopped(iF.SELECT),e._resetInsertionMode());break;case iF.TEMPLATE:wz(e,t)}}function Zz(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(iF.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):mz(e,t)}function Jz(e,t){var n;if(t.tagID===iF.HTML){if(e.fragmentContext||(e.insertionMode=rz.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===iF.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(null===(n=e.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&e._setEndLocation(r,t)}}else ej(e,t)}function ej(e,t){e.insertionMode=rz.IN_BODY,_z(e,t)}function tj(e,t){e.insertionMode=rz.IN_BODY,_z(e,t)}function nj(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==eF.HTML&&void 0!==e.openElements.currentTagId&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}new Set([rF.AREA,rF.BASE,rF.BASEFONT,rF.BGSOUND,rF.BR,rF.COL,rF.EMBED,rF.FRAME,rF.HR,rF.IMG,rF.INPUT,rF.KEYGEN,rF.LINK,rF.META,rF.PARAM,rF.SOURCE,rF.TRACK,rF.WBR]);const rj=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ij=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),aj={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function oj(e,t){const n=function(e){const t="root"===e.type?e.children[0]:e;return Boolean(t&&("doctype"===t.type||"element"===t.type&&"html"===t.tagName.toLowerCase()))}(e),r=ZM("type",{handlers:{root:lj,element:cj,text:uj,comment:pj,doctype:hj,raw:fj},unknown:gj}),i={parser:n?new sz(aj):sz.getFragmentParser(void 0,aj),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),mj(i,Dk());const a=function(e,t){const n=t||{};return z$({file:n.file||void 0,location:!1,schema:"svg"===n.space?ak:ik,verbose:n.verbose||!1},e)}(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&CC(a,"comment",function(e,t,n){const r=e;if(r.value.stitch&&n&&void 0!==t){return n.children[t]=r.value.stitch,t}}),"root"===a.type&&1===a.children.length&&a.children[0].type===e.type?a.children[0]:a}function sj(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:WB.CHARACTER,chars:e.value,location:vj(e)};mj(t,Dk(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function hj(e,t){const n={type:WB.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:vj(e)};mj(t,Dk(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function dj(e,t){t.stitches=!0;const n=function(e){return gC("children"in e?{...e,children:[]}:e)}(e);if("children"in e&&"children"in n){const r=oj({type:"root",children:e.children},t.options);n.children=r.children}pj({type:"comment",value:{stitch:n}},t)}function pj(e,t){const n=e.value,r={type:WB.COMMENT,data:n,location:vj(e)};mj(t,Dk(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function fj(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,yj(t,Dk(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(rj,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),72===t.parser.tokenizer.state||78===t.parser.tokenizer.state){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function gj(e,t){const n=e;if(!t.options.passThrough||!t.options.passThrough.includes(n.type)){let e="";throw ij.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+e)}dj(n,t)}function mj(e,t){yj(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=mF.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function yj(e,t){if(t&&void 0!==t.offset){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=1-t.column,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function vj(e){const t=Dk(e)||{line:void 0,column:void 0,offset:void 0},n=Rk(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function bj(e){return function(t,n){return oj(t,{...e,file:n})}}const xj={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return 2.55*n;e/=360,t/=100;const i=(n/=100)<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case"r":return 255*xj.hue2rgb(a,i,e+1/3);case"g":return 255*xj.hue2rgb(a,i,e);case"b":return 255*xj.hue2rgb(a,i,e-1/3)}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;const i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if("l"===r)return 100*o;if(i===a)return 0;const s=i-a;if("s"===r)return 100*(o>.5?s/(2-i-a):s/(i+a));switch(i){case e:return 60*((t-n)/s+(tt>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(1e10*e)/1e10},Ej={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},kj={channel:xj,lang:wj,unit:Ej},Tj={};for(let e=0;e<=255;e++)Tj[e]=kj.unit.dec2hex(e);const _j=0,Cj=1,Sj=2;let Aj=class{constructor(){this.type=_j}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=_j}is(e){return this.type===e}};const Nj=new class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new Aj}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=_j,this}_ensureHSL(){const e=this.data,{h:t,s:n,l:r}=e;void 0===t&&(e.h=kj.channel.rgb2hsl(e,"h")),void 0===n&&(e.s=kj.channel.rgb2hsl(e,"s")),void 0===r&&(e.l=kj.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:t,g:n,b:r}=e;void 0===t&&(e.r=kj.channel.hsl2rgb(e,"r")),void 0===n&&(e.g=kj.channel.hsl2rgb(e,"g")),void 0===r&&(e.b=kj.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,t=e.r;return this.type.is(Sj)||void 0===t?(this._ensureHSL(),kj.channel.hsl2rgb(e,"r")):t}get g(){const e=this.data,t=e.g;return this.type.is(Sj)||void 0===t?(this._ensureHSL(),kj.channel.hsl2rgb(e,"g")):t}get b(){const e=this.data,t=e.b;return this.type.is(Sj)||void 0===t?(this._ensureHSL(),kj.channel.hsl2rgb(e,"b")):t}get h(){const e=this.data,t=e.h;return this.type.is(Cj)||void 0===t?(this._ensureRGB(),kj.channel.rgb2hsl(e,"h")):t}get s(){const e=this.data,t=e.s;return this.type.is(Cj)||void 0===t?(this._ensureRGB(),kj.channel.rgb2hsl(e,"s")):t}get l(){const e=this.data,t=e.l;return this.type.is(Cj)||void 0===t?(this._ensureRGB(),kj.channel.rgb2hsl(e,"l")):t}get a(){return this.data.a}set r(e){this.type.set(Cj),this.changed=!0,this.data.r=e}set g(e){this.type.set(Cj),this.changed=!0,this.data.g=e}set b(e){this.type.set(Cj),this.changed=!0,this.data.b=e}set h(e){this.type.set(Sj),this.changed=!0,this.data.h=e}set s(e){this.type.set(Sj),this.changed=!0,this.data.s=e}set l(e){this.type.set(Sj),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}({r:0,g:0,b:0,a:0},"transparent"),Ij={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(35!==e.charCodeAt(0))return;const t=e.match(Ij.re);if(!t)return;const n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,l=o?8:4,c=a?0:-1,u=o?255:15;return Nj.set({r:(r>>l*(c+3)&u)*s,g:(r>>l*(c+2)&u)*s,b:(r>>l*(c+1)&u)*s,a:a?(r&u)*s/255:1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`#${Tj[Math.round(t)]}${Tj[Math.round(n)]}${Tj[Math.round(r)]}${Tj[Math.round(255*i)]}`:`#${Tj[Math.round(t)]}${Tj[Math.round(n)]}${Tj[Math.round(r)]}`}},Oj={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Oj.hueRe);if(t){const[,e,n]=t;switch(n){case"grad":return kj.channel.clamp.h(.9*parseFloat(e));case"rad":return kj.channel.clamp.h(180*parseFloat(e)/Math.PI);case"turn":return kj.channel.clamp.h(360*parseFloat(e))}}return kj.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(104!==t&&72!==t)return;const n=e.match(Oj.re);if(!n)return;const[,r,i,a,o,s]=n;return Nj.set({h:Oj._hue2deg(r),s:kj.channel.clamp.s(parseFloat(i)),l:kj.channel.clamp.l(parseFloat(a)),a:o?kj.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${kj.lang.round(t)}, ${kj.lang.round(n)}%, ${kj.lang.round(r)}%, ${i})`:`hsl(${kj.lang.round(t)}, ${kj.lang.round(n)}%, ${kj.lang.round(r)}%)`}},Lj={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Lj.colors[e];if(t)return Ij.parse(t)},stringify:e=>{const t=Ij.stringify(e);for(const e in Lj.colors)if(Lj.colors[e]===t)return e}},Mj={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(114!==t&&82!==t)return;const n=e.match(Mj.re);if(!n)return;const[,r,i,a,o,s,l,c,u]=n;return Nj.set({r:kj.channel.clamp.r(i?2.55*parseFloat(r):parseFloat(r)),g:kj.channel.clamp.g(o?2.55*parseFloat(a):parseFloat(a)),b:kj.channel.clamp.b(l?2.55*parseFloat(s):parseFloat(s)),a:c?kj.channel.clamp.a(u?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${kj.lang.round(t)}, ${kj.lang.round(n)}, ${kj.lang.round(r)}, ${kj.lang.round(i)})`:`rgb(${kj.lang.round(t)}, ${kj.lang.round(n)}, ${kj.lang.round(r)})`}},Rj=e=>{if("string"!=typeof e)return e;const t=Ij.parse(e)||Mj.parse(e)||Oj.parse(e)||Lj.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},Dj=e=>!e.changed&&e.color?e.color:e.type.is(Sj)||void 0===e.data.r?Oj.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Mj.stringify(e):Ij.stringify(e),Pj=(e,t)=>{const n=Rj(e);for(const e in t)n[e]=kj.channel.clamp[e](t[e]);return Dj(n)},$j=(e,t,n=0,r=1)=>{if("number"!=typeof e)return Pj(e,{a:t});const i=Nj.set({r:kj.channel.clamp.r(e),g:kj.channel.clamp.g(t),b:kj.channel.clamp.b(n),a:kj.channel.clamp.a(r)});return Dj(i)},Bj=(e,t)=>kj.lang.round(Rj(e)[t]),Fj=e=>(e=>{const{r:t,g:n,b:r}=Rj(e),i=.2126*kj.channel.toLinear(t)+.7152*kj.channel.toLinear(n)+.0722*kj.channel.toLinear(r);return kj.lang.round(i)})(e)>=.5,zj=e=>!Fj(e),jj=(e,t,n)=>{const r=Rj(e),i=r[t],a=kj.channel.clamp[t](i+n);return i!==a&&(r[t]=a),Dj(r)},Hj=(e,t)=>jj(e,"l",t),Uj=(e,t)=>jj(e,"l",-t),Gj=(e,t)=>{const n=Rj(e),r={};for(const e in t)t[e]&&(r[e]=n[e]+t[e]);return Pj(e,r)},qj=(e,t=100)=>{const n=Rj(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,((e,t,n=50)=>{const{r:r,g:i,b:a,a:o}=Rj(e),{r:s,g:l,b:c,a:u}=Rj(t),h=n/100,d=2*h-1,p=o-u,f=((d*p===-1?d:(d+p)/(1+d*p))+1)/2,g=1-f;return $j(r*f+s*g,i*f+l*g,a*f+c*g,o*h+u*(1-h))})(n,e,t)},{entries:Wj,setPrototypeOf:Vj,isFrozen:Yj,getPrototypeOf:Xj,getOwnPropertyDescriptor:Kj}=Object;let{freeze:Qj,seal:Zj,create:Jj}=Object,{apply:eH,construct:tH}="undefined"!=typeof Reflect&&Reflect;Qj||(Qj=function(e){return e}),Zj||(Zj=function(e){return e}),eH||(eH=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:sH;Vj&&Vj(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(Yj(t)||(t[r]=e),i=e)}e[i]=!0}return e}function bH(e){for(let t=0;t/gm),DH=Zj(/\$\{[\w\W]*/gm),PH=Zj(/^data-[\-\w.\u00B7-\uFFFF]+$/),$H=Zj(/^aria-[\-\w]+$/),BH=Zj(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FH=Zj(/^(?:\w+script|data):/i),zH=Zj(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jH=Zj(/^html$/i),HH=Zj(/^[a-z][.\w]*(-[.\w]+)+$/i);var UH=Object.freeze({__proto__:null,ARIA_ATTR:$H,ATTR_WHITESPACE:zH,CUSTOM_ELEMENT:HH,DATA_ATTR:PH,DOCTYPE_NAME:jH,ERB_EXPR:RH,IS_ALLOWED_URI:BH,IS_SCRIPT_OR_DATA:FH,MUSTACHE_EXPR:MH,TMPLIT_EXPR:DH});const GH=1,qH=3,WH=7,VH=8,YH=9,XH=function(){return"undefined"==typeof window?null:window};var KH,QH=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:XH();const n=t=>e(t);if(n.version="3.3.0",n.removed=[],!t||!t.document||t.document.nodeType!==YH||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,a=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=t,g=c.prototype,m=wH(g,"cloneNode"),y=wH(g,"remove"),v=wH(g,"nextSibling"),b=wH(g,"childNodes"),x=wH(g,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,E="";const{implementation:k,createNodeIterator:T,createDocumentFragment:_,getElementsByTagName:C}=r,{importNode:S}=i;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Wj&&"function"==typeof x&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:N,ERB_EXPR:I,TMPLIT_EXPR:O,DATA_ATTR:L,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:P}=UH;let{IS_ALLOWED_URI:$}=UH,B=null;const F=vH({},[...EH,...kH,...TH,...CH,...AH]);let z=null;const j=vH({},[...NH,...IH,...OH,...LH]);let H=Object.seal(Jj(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,G=null;const q=Object.seal(Jj(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,V=!0,Y=!1,X=!0,K=!1,Q=!0,Z=!1,J=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!0,ae=!1,oe=!0,se=!1,le={},ce=null;const ue=vH({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let he=null;const de=vH({},["audio","video","img","source","image","track"]);let pe=null;const fe=vH({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ve=ye,be=!1,xe=null;const we=vH({},[ge,me,ye],lH);let Ee=vH({},["mi","mo","mn","ms","mtext"]),ke=vH({},["annotation-xml"]);const Te=vH({},["title","style","font","a","script"]);let _e=null;const Ce=["application/xhtml+xml","text/html"];let Se=null,Ae=null;const Ne=r.createElement("form"),Ie=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ae||Ae!==e){if(e&&"object"==typeof e||(e={}),e=xH(e),_e=-1===Ce.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Se="application/xhtml+xml"===_e?lH:sH,B=pH(e,"ALLOWED_TAGS")?vH({},e.ALLOWED_TAGS,Se):F,z=pH(e,"ALLOWED_ATTR")?vH({},e.ALLOWED_ATTR,Se):j,xe=pH(e,"ALLOWED_NAMESPACES")?vH({},e.ALLOWED_NAMESPACES,lH):we,pe=pH(e,"ADD_URI_SAFE_ATTR")?vH(xH(fe),e.ADD_URI_SAFE_ATTR,Se):fe,he=pH(e,"ADD_DATA_URI_TAGS")?vH(xH(de),e.ADD_DATA_URI_TAGS,Se):de,ce=pH(e,"FORBID_CONTENTS")?vH({},e.FORBID_CONTENTS,Se):ue,U=pH(e,"FORBID_TAGS")?vH({},e.FORBID_TAGS,Se):xH({}),G=pH(e,"FORBID_ATTR")?vH({},e.FORBID_ATTR,Se):xH({}),le=!!pH(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,Q=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,ae=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,$=e.ALLOWED_URI_REGEXP||BH,ve=e.NAMESPACE||ye,Ee=e.MATHML_TEXT_INTEGRATION_POINTS||Ee,ke=e.HTML_INTEGRATION_POINTS||ke,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(V=!1),ne&&(te=!0),le&&(B=vH({},AH),z=[],!0===le.html&&(vH(B,EH),vH(z,NH)),!0===le.svg&&(vH(B,kH),vH(z,IH),vH(z,LH)),!0===le.svgFilters&&(vH(B,TH),vH(z,IH),vH(z,LH)),!0===le.mathMl&&(vH(B,CH),vH(z,OH),vH(z,LH))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?q.tagCheck=e.ADD_TAGS:(B===F&&(B=xH(B)),vH(B,e.ADD_TAGS,Se))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?q.attributeCheck=e.ADD_ATTR:(z===j&&(z=xH(z)),vH(z,e.ADD_ATTR,Se))),e.ADD_URI_SAFE_ATTR&&vH(pe,e.ADD_URI_SAFE_ATTR,Se),e.FORBID_CONTENTS&&(ce===ue&&(ce=xH(ce)),vH(ce,e.FORBID_CONTENTS,Se)),oe&&(B["#text"]=!0),Z&&vH(B,["html","head","body"]),B.table&&(vH(B,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw gH('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw gH('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,E=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(f,a)),null!==w&&"string"==typeof E&&(E=w.createHTML(""));Qj&&Qj(e),Ae=e}},Le=vH({},[...kH,...TH,..._H]),Me=vH({},[...CH,...SH]),Re=function(e){aH(n.removed,{element:e});try{x(e).removeChild(e)}catch(t){y(e)}},De=function(e,t){try{aH(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){aH(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Pe=function(e){let t=null,n=null;if(ee)e=""+e;else{const t=cH(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&ve===ye&&(e=''+e+"");const i=w?w.createHTML(e):e;if(ve===ye)try{t=(new p).parseFromString(i,_e)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ve,"template",null);try{t.documentElement.innerHTML=be?E:i}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),ve===ye?C.call(t,Z?"html":"body")[0]:Z?t.documentElement:a},$e=function(e){return T.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Be=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Fe=function(e){return"function"==typeof l&&e instanceof l};function ze(e,t,r){nH(e,e=>{e.call(n,t,r,Ae)})}const je=function(e){let t=null;if(ze(A.beforeSanitizeElements,e,null),Be(e))return Re(e),!0;const r=Se(e.nodeName);if(ze(A.uponSanitizeElement,e,{tagName:r,allowedTags:B}),Q&&e.hasChildNodes()&&!Fe(e.firstElementChild)&&fH(/<[/\w!]/g,e.innerHTML)&&fH(/<[/\w!]/g,e.textContent))return Re(e),!0;if(e.nodeType===WH)return Re(e),!0;if(Q&&e.nodeType===VH&&fH(/<[/\w]/g,e.data))return Re(e),!0;if(!(q.tagCheck instanceof Function&&q.tagCheck(r))&&(!B[r]||U[r])){if(!U[r]&&Ue(r)){if(H.tagNameCheck instanceof RegExp&&fH(H.tagNameCheck,r))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(r))return!1}if(oe&&!ce[r]){const t=x(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=m(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,v(e))}}}return Re(e),!0}return e instanceof c&&!function(e){let t=x(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=sH(e.tagName),r=sH(t.tagName);return!!xe[e.namespaceURI]&&(e.namespaceURI===me?t.namespaceURI===ye?"svg"===n:t.namespaceURI===ge?"svg"===n&&("annotation-xml"===r||Ee[r]):Boolean(Le[n]):e.namespaceURI===ge?t.namespaceURI===ye?"math"===n:t.namespaceURI===me?"math"===n&&ke[r]:Boolean(Me[n]):e.namespaceURI===ye?!(t.namespaceURI===me&&!ke[r])&&!(t.namespaceURI===ge&&!Ee[r])&&!Me[n]&&(Te[n]||!Le[n]):!("application/xhtml+xml"!==_e||!xe[e.namespaceURI]))}(e)?(Re(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!fH(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&e.nodeType===qH&&(t=e.textContent,nH([N,I,O],e=>{t=uH(t,e," ")}),e.textContent!==t&&(aH(n.removed,{element:e.cloneNode()}),e.textContent=t)),ze(A.afterSanitizeElements,e,null),!1):(Re(e),!0)},He=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in r||n in Ne))return!1;if(V&&!G[t]&&fH(L,t));else if(W&&fH(M,t));else if(q.attributeCheck instanceof Function&&q.attributeCheck(t,e));else if(!z[t]||G[t]){if(!(Ue(e)&&(H.tagNameCheck instanceof RegExp&&fH(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&fH(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t,e))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&fH(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(pe[t]);else if(fH($,uH(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==hH(n,"data:")||!he[e]){if(Y&&!fH(R,uH(n,D,"")));else if(n)return!1}else;return!0},Ue=function(e){return"annotation-xml"!==e&&cH(e,P)},Ge=function(e){ze(A.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Be(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=t.length;for(;i--;){const a=t[i],{name:o,namespaceURI:s,value:l}=a,c=Se(o),u=l;let h="value"===o?u:dH(u);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,ze(A.uponSanitizeAttribute,e,r),h=r.attrValue,!ae||"id"!==c&&"name"!==c||(De(o,e),h="user-content-"+h),Q&&fH(/((--!?|])>)|<\/(style|title|textarea)/i,h)){De(o,e);continue}if("attributename"===c&&cH(h,"href")){De(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){De(o,e);continue}if(!X&&fH(/\/>/i,h)){De(o,e);continue}K&&nH([N,I,O],e=>{h=uH(h,e," ")});const d=Se(e.nodeName);if(He(d,c,h)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(d,c)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}if(h!==u)try{s?e.setAttributeNS(s,o,h):e.setAttribute(o,h),Be(e)?Re(e):iH(n.removed)}catch(t){De(o,e)}}else De(o,e)}ze(A.afterSanitizeAttributes,e,null)},qe=function e(t){let n=null;const r=$e(t);for(ze(A.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)ze(A.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof o&&e(n.content);ze(A.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,s=null,c=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Fe(e)){if("function"!=typeof e.toString)throw gH("toString is not a function");if("string"!=typeof(e=e.toString()))throw gH("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Oe(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Se(e.nodeName);if(!B[t]||U[t])throw gH("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Pe("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),a.nodeType===GH&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a);else{if(!te&&!K&&!Z&&-1===e.indexOf("<"))return w&&re?w.createHTML(e):e;if(r=Pe(e),!r)return te?null:re?E:""}r&&ee&&Re(r.firstChild);const u=$e(se?e:r);for(;s=u.nextNode();)je(s),Ge(s),s.content instanceof o&&qe(s.content);if(se)return e;if(te){if(ne)for(c=_.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(z.shadowroot||z.shadowrootmode)&&(c=S.call(i,c,!0)),c}let h=Z?r.outerHTML:r.innerHTML;return Z&&B["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&fH(jH,r.ownerDocument.doctype.name)&&(h="\n"+h),K&&nH([N,I,O],e=>{h=uH(h,e," ")}),w&&re?w.createHTML(h):h},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ae=null,J=!1},n.isValidAttribute=function(e,t,n){Ae||Oe({});const r=Se(e),i=Se(t);return He(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&aH(A[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=rH(A[e],t);return-1===n?void 0:oH(A[e],n,1)[0]}return iH(A[e])},n.removeHooks=function(e){A[e]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),ZH=Object.defineProperty,JH=(e,t)=>ZH(e,"name",{value:t,configurable:!0}),eU=(e,t)=>{for(var n in t)ZH(e,n,{get:t[n],enumerable:!0})},tU={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},nU={trace:JH((...e)=>{},"trace"),debug:JH((...e)=>{},"debug"),info:JH((...e)=>{},"info"),warn:JH((...e)=>{},"warn"),error:JH((...e)=>{},"error"),fatal:JH((...e)=>{},"fatal")},rU=JH(function(e="fatal"){let t=tU.fatal;"string"==typeof e?e.toLowerCase()in tU&&(t=tU[e]):"number"==typeof e&&(t=e),nU.trace=()=>{},nU.debug=()=>{},nU.info=()=>{},nU.warn=()=>{},nU.error=()=>{},nU.fatal=()=>{},t<=tU.fatal&&(nU.fatal=console.error?console.error.bind(console,iU("FATAL"),"color: orange"):console.log.bind(console,"",iU("FATAL"))),t<=tU.error&&(nU.error=console.error?console.error.bind(console,iU("ERROR"),"color: orange"):console.log.bind(console,"",iU("ERROR"))),t<=tU.warn&&(nU.warn=console.warn?console.warn.bind(console,iU("WARN"),"color: orange"):console.log.bind(console,"",iU("WARN"))),t<=tU.info&&(nU.info=console.info?console.info.bind(console,iU("INFO"),"color: lightblue"):console.log.bind(console,"",iU("INFO"))),t<=tU.debug&&(nU.debug=console.debug?console.debug.bind(console,iU("DEBUG"),"color: lightgreen"):console.log.bind(console,"",iU("DEBUG"))),t<=tU.trace&&(nU.trace=console.debug?console.debug.bind(console,iU("TRACE"),"color: lightgreen"):console.log.bind(console,"",iU("TRACE")))},"setLogLevel"),iU=JH(e=>`%c${Rm().format("ss.SSS")} : ${e} : `,"format"),aU=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,oU=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sU=/\s*%%.*\n/gm,lU=class extends Error{static{JH(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},cU={},uU=JH(function(e,t){e=e.replace(aU,"").replace(oU,"").replace(sU,"\n");for(const[n,{detector:r}]of Object.entries(cU)){if(r(e,t))return n}throw new lU(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),hU=JH((...e)=>{for(const{id:t,detector:n,loader:r}of e)dU(t,n,r)},"registerLazyLoadedDiagrams"),dU=JH((e,t,n)=>{cU[e]&&nU.warn(`Detector with key ${e} already exists. Overwriting.`),cU[e]={detector:t,loader:n},nU.debug(`Detector with key ${e} added${n?" with loader":""}`)},"addDetector"),pU=JH(e=>cU[e].loader,"getDiagramLoader"),fU=JH((e,t,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(t=>fU(e,t,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(t=>{e.includes(t)||e.push(t)}),e):void 0===e||n<=0?null!=e&&"object"==typeof e&&"object"==typeof t?Object.assign(e,t):t:(void 0!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(i=>{"object"!=typeof t[i]||void 0!==e[i]&&"object"!=typeof e[i]?(r||"object"!=typeof e[i]&&"object"!=typeof t[i])&&(e[i]=t[i]):(void 0===e[i]&&(e[i]=Array.isArray(t[i])?[]:{}),e[i]=fU(e[i],t[i],{depth:n-1,clobber:r}))}),e)},"assignWithDepth"),gU=fU,mU="#ffffff",yU="#f2f2f2",vU=JH((e,t)=>Gj(e,t?{s:-40,l:10}:{s:-40,l:-10}),"mkBorder"),bU=class{static{JH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Gj(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Gj(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||vU(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||vU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||vU(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||vU(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||qj(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||qj(this.tertiaryColor),this.lineColor=this.lineColor||qj(this.background),this.arrowheadColor=this.arrowheadColor||qj(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?Uj(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||Uj(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||qj(this.lineColor),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||Hj(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Uj(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Uj(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Hj(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Hj(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gj(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Gj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gj(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},xU=JH(e=>{const t=new bU;return t.calculate(e),t},"getThemeVariables"),wU=class{static{JH(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Hj(this.primaryColor,16),this.tertiaryColor=Gj(this.primaryColor,{h:-160}),this.primaryBorderColor=qj(this.background),this.secondaryBorderColor=vU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vU(this.tertiaryColor,this.darkMode),this.primaryTextColor=qj(this.primaryColor),this.secondaryTextColor=qj(this.secondaryColor),this.tertiaryTextColor=qj(this.tertiaryColor),this.lineColor=qj(this.background),this.textColor=qj(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Hj(qj("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=$j(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Uj("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Uj(this.sectionBkgColor,10),this.taskBorderColor=$j(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=$j(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Hj(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Uj(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Hj(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Hj(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Hj(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Gj(this.primaryColor,{h:64}),this.fillType3=Gj(this.secondaryColor,{h:64}),this.fillType4=Gj(this.primaryColor,{h:-64}),this.fillType5=Gj(this.secondaryColor,{h:-64}),this.fillType6=Gj(this.primaryColor,{h:128}),this.fillType7=Gj(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gj(this.primaryColor,{h:330});for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},EU=JH(e=>{const t=new wU;return t.calculate(e),t},"getThemeVariables"),kU=class{static{JH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Gj(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Gj(this.primaryColor,{h:-160}),this.primaryBorderColor=vU(this.primaryColor,this.darkMode),this.secondaryBorderColor=vU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vU(this.tertiaryColor,this.darkMode),this.primaryTextColor=qj(this.primaryColor),this.secondaryTextColor=qj(this.secondaryColor),this.tertiaryTextColor=qj(this.tertiaryColor),this.lineColor=qj(this.background),this.textColor=qj(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=$j(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gj(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Uj(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Uj(this.tertiaryColor,40);for(let e=0;e{"calculated"===this[e]&&(this[e]=void 0)}),"object"!=typeof e)return void this.updateColors();const t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},TU=JH(e=>{const t=new kU;return t.calculate(e),t},"getThemeVariables"),_U=class{static{JH(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Hj("#cde498",10),this.primaryBorderColor=vU(this.primaryColor,this.darkMode),this.secondaryBorderColor=vU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vU(this.tertiaryColor,this.darkMode),this.primaryTextColor=qj(this.primaryColor),this.secondaryTextColor=qj(this.secondaryColor),this.tertiaryTextColor=qj(this.primaryColor),this.lineColor=qj(this.background),this.textColor=qj(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=Uj(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Gj(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gj(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gj(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gj(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gj(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gj(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gj(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gj(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gj(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Uj(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Uj(this.tertiaryColor,40);for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},CU=JH(e=>{const t=new _U;return t.calculate(e),t},"getThemeVariables"),SU=class{static{JH(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Hj(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Gj(this.primaryColor,{h:-160}),this.primaryBorderColor=vU(this.primaryColor,this.darkMode),this.secondaryBorderColor=vU(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vU(this.tertiaryColor,this.darkMode),this.primaryTextColor=qj(this.primaryColor),this.secondaryTextColor=qj(this.secondaryColor),this.tertiaryTextColor=qj(this.tertiaryColor),this.lineColor=qj(this.background),this.textColor=qj(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Hj(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Hj(this.contrast,55),this.border2=this.contrast,this.actorBorder=Hj(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},AU={base:{getThemeVariables:xU},dark:{getThemeVariables:EU},default:{getThemeVariables:TU},forest:{getThemeVariables:CU},neutral:{getThemeVariables:JH(e=>{const t=new SU;return t.calculate(e),t},"getThemeVariables")}},NU={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},IU={...NU,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:AU.default.getThemeVariables(),sequence:{...NU.sequence,messageFont:JH(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:JH(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:JH(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...NU.gantt,tickInterval:void 0,useWidth:void 0},c4:{...NU.c4,useWidth:void 0,personFont:JH(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:JH(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:JH(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:JH(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:JH(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:JH(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:JH(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:JH(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:JH(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:JH(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:JH(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:JH(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:JH(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:JH(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:JH(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:JH(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:JH(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:JH(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:JH(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:JH(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:JH(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:JH(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...NU.pie,useWidth:984},xyChart:{...NU.xyChart,useWidth:void 0},requirement:{...NU.requirement,useWidth:void 0},packet:{...NU.packet},radar:{...NU.radar}},OU=JH((e,t="")=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:"object"==typeof e[r]&&null!==e[r]?[...n,t+r,...OU(e[r],"")]:[...n,t+r],[]),"keyify"),LU=new Set(OU(IU,"")),MU=IU,RU=JH(e=>{if(nU.debug("sanitizeDirective called with",e),"object"==typeof e&&null!=e)if(Array.isArray(e))e.forEach(e=>RU(e));else{for(const t of Object.keys(e)){if(nU.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!LU.has(t)||null==e[t]){nU.debug("sanitize deleting key: ",t),delete e[t];continue}if("object"==typeof e[t]){nU.debug("sanitizing object",t),RU(e[t]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)t.includes(r)&&(nU.debug("sanitizing css option",t),e[t]=DU(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const n=e.themeVariables[t];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}nU.debug("After sanitization",e)}},"sanitizeDirective"),DU=JH(e=>{let t=0,n=0;for(const r of e){if(t{let n=gU({},e),r={};for(const e of t)VU(e),r=gU(r,e);if(n=gU(n,r),r.theme&&r.theme in AU){const e=gU({},KH),t=gU(e.themeVariables||{},r.themeVariables);n.theme&&n.theme in AU&&(n.themeVariables=AU[n.theme].getThemeVariables(t))}return JU(FU=n),FU},"updateCurrentConfig"),jU=JH(e=>($U=gU({},PU),$U=gU($U,e),e.theme&&AU[e.theme]&&($U.themeVariables=AU[e.theme].getThemeVariables(e.themeVariables)),zU($U,BU),$U),"setSiteConfig"),HU=JH(e=>{KH=gU({},e)},"saveConfigFromInitialize"),UU=JH(e=>($U=gU($U,e),zU($U,BU),$U),"updateSiteConfig"),GU=JH(()=>gU({},$U),"getSiteConfig"),qU=JH(e=>(JU(e),gU(FU,e),WU()),"setConfig"),WU=JH(()=>gU({},FU),"getConfig"),VU=JH(e=>{e&&(["secure",...$U.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(nU.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{"string"==typeof e[t]&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],"object"==typeof e[t]&&VU(e[t])}))},"sanitize"),YU=JH(e=>{RU(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),BU.push(e),zU($U,BU)},"addDirective"),XU=JH((e=$U)=>{zU(e,BU=[])},"reset"),KU={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},QU={},ZU=JH(e=>{QU[e]||(nU.warn(KU[e]),QU[e]=!0)},"issueWarning"),JU=JH(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&ZU("LAZY_LOAD_DEPRECATED")},"checkConfig"),eG=//gi,tG=JH(e=>{if(!e)return[""];return hG(e).replace(/\\n/g,"#br#").split("#br#")},"getRows"),nG=(()=>{let e=!1;return()=>{e||(rG(),e=!0)}})();function rG(){const e="data-temp-href-target";QH.addHook("beforeSanitizeAttributes",t=>{t instanceof Element&&"A"===t.tagName&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),QH.addHook("afterSanitizeAttributes",t=>{t instanceof Element&&"A"===t.tagName&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),"_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener"))})}JH(rG,"setupDompurifyHooks");var iG=JH(e=>{nG();return QH.sanitize(e)},"removeScript"),aG=JH((e,t)=>{if(!1!==t.flowchart?.htmlLabels){const n=t.securityLevel;"antiscript"===n||"strict"===n?e=iG(e):"loose"!==n&&(e=(e=(e=hG(e)).replace(//g,">")).replace(/=/g,"="),e=uG(e))}return e},"sanitizeMore"),oG=JH((e,t)=>e?e=t.dompurifyConfig?QH.sanitize(aG(e,t),t.dompurifyConfig).toString():QH.sanitize(aG(e,t),{FORBID_TAGS:["style"]}).toString():e,"sanitizeText"),sG=JH((e,t)=>"string"==typeof e?oG(e,t):e.flat().map(e=>oG(e,t)),"sanitizeTextOrArray"),lG=JH(e=>eG.test(e),"hasBreaks"),cG=JH(e=>e.split(eG),"splitBreaks"),uG=JH(e=>e.replace(/#br#/g,"
    "),"placeholderToBreak"),hG=JH(e=>e.replace(eG,"#br#"),"breakToPlaceholder"),dG=JH(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=t.replaceAll(/\(/g,"\\("),t=t.replaceAll(/\)/g,"\\)")),t},"getUrl"),pG=JH(e=>!1!==e&&!["false","null","0"].includes(String(e).trim().toLowerCase()),"evaluate"),fG=JH(function(...e){const t=e.filter(e=>!isNaN(e));return Math.max(...t)},"getMax"),gG=JH(function(...e){const t=e.filter(e=>!isNaN(e));return Math.min(...t)},"getMin"),mG=JH(function(e){const t=e.split(/(,)/),n=[];for(let e=0;e0&&e+1Math.max(0,e.split(t).length-1),"countOccurrence"),vG=JH((e,t)=>{const n=yG(e,"~"),r=yG(t,"~");return 1===n&&1===r},"shouldCombineSets"),bG=JH(e=>{const t=yG(e,"~");let n=!1;if(t<=1)return e;t%2!=0&&e.startsWith("~")&&(e=e.substring(1),n=!0);const r=[...e];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")},"processSet"),xG=JH(()=>void 0!==window.MathMLElement,"isMathMLSupported"),wG=/\$\$(.*)\$\$/g,EG=JH(e=>(e.match(wG)?.length??0)>0,"hasKatex"),kG=JH(async(e,t)=>{e=await TG(e,t);const n=document.createElement("div");n.innerHTML=e,n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";const r=document.querySelector("body");r?.insertAdjacentElement("beforeend",n);const i={width:n.clientWidth,height:n.clientHeight};return n.remove(),i},"calculateMathMLDimensions"),TG=JH(async(e,t)=>{if(!EG(e))return e;if(!(xG()||t.legacyMathML||t.forceLegacyMathML))return e.replace(wG,"MathML is unsupported in this environment.");const{default:n}=await Promise.resolve().then(function(){return ML}),r=t.forceLegacyMathML||!xG()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(eG).map(e=>EG(e)?`
    ${e}
    `:`
    ${e}
    `).join("").replace(wG,(e,t)=>n.renderToString(t,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(//g,""))},"renderKatex"),_G={getRows:tG,sanitizeText:oG,sanitizeTextOrArray:sG,hasBreaks:lG,splitBreaks:cG,lineBreakRegex:eG,removeScript:iG,getUrl:dG,evaluate:pG,getMax:fG,getMin:gG},CG=JH(function(e,t){for(let n of t)e.attr(n[0],n[1])},"d3Attrs"),SG=JH(function(e,t,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},"calculateSvgSizeAttrs"),AG=JH(function(e,t,n,r){const i=SG(t,n,r);CG(e,i)},"configureSvgSize"),NG=JH(function(e,t,n,r){const i=t.node().getBBox(),a=i.width,o=i.height;nU.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;nU.info(`Graph bounds: ${s}x${l}`,e),s=a+2*n,l=o+2*n,nU.info(`Calculated bounds: ${s}x${l}`),AG(t,l,s,r);const c=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr("viewBox",c)},"setupGraphViewbox"),IG={},OG=JH((e,t,n)=>{let r="";return e in IG&&IG[e]?r=IG[e](n):nU.warn(`No theme found for ${e}`),` & {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n fill: ${n.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\n }\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${n.errorBkgColor};\n }\n & .error-text {\n fill: ${n.errorTextColor};\n stroke: ${n.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${n.lineColor};\n stroke: ${n.lineColor};\n }\n & .marker.cross {\n stroke: ${n.lineColor};\n }\n\n & svg {\n font-family: ${n.fontFamily};\n font-size: ${n.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${r}\n\n ${t}\n`},"getStyles"),LG=JH((e,t)=>{void 0!==t&&(IG[e]=t)},"addStylesForDiagram"),MG=OG,RG={};eU(RG,{clear:()=>FG,getAccDescription:()=>UG,getAccTitle:()=>jG,getDiagramTitle:()=>qG,setAccDescription:()=>HG,setAccTitle:()=>zG,setDiagramTitle:()=>GG});var DG="",PG="",$G="",BG=JH(e=>oG(e,WU()),"sanitizeText"),FG=JH(()=>{DG="",$G="",PG=""},"clear"),zG=JH(e=>{DG=BG(e).replace(/^\s+/g,"")},"setAccTitle"),jG=JH(()=>DG,"getAccTitle"),HG=JH(e=>{$G=BG(e).replace(/\n\s+/g,"\n")},"setAccDescription"),UG=JH(()=>$G,"getAccDescription"),GG=JH(e=>{PG=BG(e)},"setDiagramTitle"),qG=JH(()=>PG,"getDiagramTitle"),WG=nU,VG=rU,YG=WU,XG=qU,KG=PU,QG=JH(e=>oG(e,YG()),"sanitizeText"),ZG=NG,JG=JH(()=>RG,"getCommonDb"),eq={},tq=JH((e,t,n)=>{eq[e]&&WG.warn(`Diagram with id ${e} already registered. Overwriting.`),eq[e]=t,n&&dU(e,n),LG(e,t.styles),t.injectUtils?.(WG,VG,YG,QG,ZG,JG(),()=>{})},"registerDiagram"),nq=JH(e=>{if(e in eq)return eq[e];throw new rq(e)},"getDiagram"),rq=class extends Error{static{JH(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}};function iq(e){return null==e}function aq(e){return"object"==typeof e&&null!==e}function oq(e){return Array.isArray(e)?e:iq(e)?[]:[e]}function sq(e,t){var n,r,i,a;if(t)for(n=0,r=(a=Object.keys(t)).length;ns&&(t=r-s+(a=" ... ").length),n-r>s&&(n=r+s-(o=" ...").length),{str:a+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+a.length}}function gq(e,t){return uq.repeat(" ",t-e.length)+e}function mq(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],a=[],o=-1;n=r.exec(e.buffer);)a.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s,l,c="",u=Math.min(e.line+t.linesAfter,a.length).toString().length,h=t.maxLength-(t.indent+u+3);for(s=1;s<=t.linesBefore&&!(o-s<0);s++)l=fq(e.buffer,i[o-s],a[o-s],e.position-(i[o]-i[o-s]),h),c=uq.repeat(" ",t.indent)+gq((e.line-s+1).toString(),u)+" | "+l.str+"\n"+c;for(l=fq(e.buffer,i[o],a[o],e.position,h),c+=uq.repeat(" ",t.indent)+gq((e.line+1).toString(),u)+" | "+l.str+"\n",c+=uq.repeat("-",t.indent+u+3+l.pos)+"^\n",s=1;s<=t.linesAfter&&!(o+s>=a.length);s++)l=fq(e.buffer,i[o+s],a[o+s],e.position-(i[o]-i[o+s]),h),c+=uq.repeat(" ",t.indent)+gq((e.line+s+1).toString(),u)+" | "+l.str+"\n";return c.replace(/\n$/,"")}JH(fq,"getLine"),JH(gq,"padStart"),JH(mq,"makeSnippet");var yq=mq,vq=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],bq=["scalar","sequence","mapping"];function xq(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function wq(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===vq.indexOf(t))throw new pq('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=xq(t.styleAliases||null),-1===bq.indexOf(this.kind))throw new pq('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}JH(xq,"compileStyleAliases"),JH(wq,"Type$1");var Eq=wq;function kq(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function Tq(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(JH(r,"collectType"),e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:JH(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:JH(function(e){return e.toString(10)},"decimal"),hexadecimal:JH(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Wq=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Vq(e){return null!==e&&!(!Wq.test(e)||"_"===e[e.length-1])}function Yq(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)}JH(Vq,"resolveYamlFloat"),JH(Yq,"constructYamlFloat");var Xq=/^[-+]?[0-9]+e/;function Kq(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(uq.isNegativeZero(e))return"-0.0";return n=e.toString(10),Xq.test(n)?n.replace("e",".e"):n}function Qq(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||uq.isNegativeZero(e))}JH(Kq,"representYamlFloat"),JH(Qq,"isFloat");var Zq=new Eq("tag:yaml.org,2002:float",{kind:"scalar",resolve:Vq,construct:Yq,predicate:Qq,represent:Kq,defaultStyle:"lowercase"}),Jq=Iq.extend({implicit:[Rq,Bq,qq,Zq]}),eW=Jq,tW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),nW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function rW(e){return null!==e&&(null!==tW.exec(e)||null!==nW.exec(e))}function iW(e){var t,n,r,i,a,o,s,l,c=0,u=null;if(null===(t=tW.exec(e))&&(t=nW.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,r,i,a,o,s,c)),u&&l.setTime(l.getTime()-u),l}function aW(e){return e.toISOString()}JH(rW,"resolveYamlTimestamp"),JH(iW,"constructYamlTimestamp"),JH(aW,"representYamlTimestamp");var oW=new Eq("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:rW,construct:iW,instanceOf:Date,represent:aW});function sW(e){return"<<"===e||null===e}JH(sW,"resolveYamlMerge");var lW=new Eq("tag:yaml.org,2002:merge",{kind:"scalar",resolve:sW}),cW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function uW(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=cW;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0}function hW(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=cW,o=0,s=[];for(t=0;t>16&255),s.push(o>>8&255),s.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)):18===n?(s.push(o>>10&255),s.push(o>>2&255)):12===n&&s.push(o>>4&255),new Uint8Array(s)}function dW(e){var t,n,r="",i=0,a=e.length,o=cW;for(t=0;t>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return 0===(n=a%3)?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}function pW(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}JH(uW,"resolveYamlBinary"),JH(hW,"constructYamlBinary"),JH(dW,"representYamlBinary"),JH(pW,"isBinary");var fW=new Eq("tag:yaml.org,2002:binary",{kind:"scalar",resolve:uW,construct:hW,predicate:pW,represent:dW}),gW=Object.prototype.hasOwnProperty,mW=Object.prototype.toString;function yW(e){if(null===e)return!0;var t,n,r,i,a,o=[],s=e;for(t=0,n=s.length;t>10),56320+(e-65536&1023))}JH(DW,"_class"),JH(PW,"is_EOL"),JH($W,"is_WHITE_SPACE"),JH(BW,"is_WS_OR_EOL"),JH(FW,"is_FLOW_INDICATOR"),JH(zW,"fromHexCode"),JH(jW,"escapedHexLen"),JH(HW,"fromDecimalCode"),JH(UW,"simpleEscapeSequence"),JH(GW,"charFromCodepoint");var qW,WW=new Array(256),VW=new Array(256);for(qW=0;qW<256;qW++)WW[qW]=UW(qW)?1:0,VW[qW]=UW(qW);function YW(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||AW,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function XW(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=yq(n),new pq(t,n)}function KW(e,t){throw XW(e,t)}function QW(e,t){e.onWarning&&e.onWarning.call(null,XW(e,t))}JH(YW,"State$1"),JH(XW,"generateError"),JH(KW,"throwError"),JH(QW,"throwWarning");var ZW={YAML:JH(function(e,t,n){var r,i,a;null!==e.version&&KW(e,"duplication of %YAML directive"),1!==n.length&&KW(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&KW(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&KW(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,1!==a&&2!==a&&QW(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:JH(function(e,t,n){var r,i;2!==n.length&&KW(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],MW.test(r)||KW(e,"ill-formed tag handle (first argument) of the TAG directive"),NW.call(e.tagMap,r)&&KW(e,'there is a previously declared suffix for "'+r+'" tag handle'),RW.test(i)||KW(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){KW(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i},"handleTagDirective")};function JW(e,t,n,r){var i,a,o,s;if(t1&&(e.result+=uq.repeat("\n",t-1))}function oV(e,t,n){var r,i,a,o,s,l,c,u,h=e.kind,d=e.result;if(BW(u=e.input.charCodeAt(e.position))||FW(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(BW(r=e.input.charCodeAt(e.position+1))||n&&FW(r)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,o=!1;0!==u;){if(58===u){if(BW(r=e.input.charCodeAt(e.position+1))||n&&FW(r))break}else if(35===u){if(BW(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&iV(e)||n&&FW(u))break;if(PW(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,rV(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=a,e.line=s,e.lineStart=l,e.lineIndent=c;break}}o&&(JW(e,i,a,!1),aV(e,e.line-s),i=a=e.position,o=!1),$W(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return JW(e,i,a,!1),!!e.result||(e.kind=h,e.result=d,!1)}function sV(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(JW(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else PW(n)?(JW(e,r,i,!0),aV(e,rV(e,!1,t)),r=i=e.position):e.position===e.lineStart&&iV(e)?KW(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);KW(e,"unexpected end of the stream within a single quoted scalar")}function lV(e,t){var n,r,i,a,o,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return JW(e,n,e.position,!0),e.position++,!0;if(92===s){if(JW(e,n,e.position,!0),PW(s=e.input.charCodeAt(++e.position)))rV(e,!1,t);else if(s<256&&WW[s])e.result+=VW[s],e.position++;else if((o=jW(s))>0){for(i=o,a=0;i>0;i--)(o=zW(s=e.input.charCodeAt(++e.position)))>=0?a=(a<<4)+o:KW(e,"expected hexadecimal character");e.result+=GW(a),e.position++}else KW(e,"unknown escape sequence");n=r=e.position}else PW(s)?(JW(e,n,r,!0),aV(e,rV(e,!1,t)),n=r=e.position):e.position===e.lineStart&&iV(e)?KW(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}KW(e,"unexpected end of the stream within a double quoted scalar")}function cV(e,t){var n,r,i,a,o,s,l,c,u,h,d,p,f=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(p=e.input.charCodeAt(e.position)))o=93,c=!1,a=[];else{if(123!==p)return!1;o=125,c=!0,a={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),p=e.input.charCodeAt(++e.position);0!==p;){if(rV(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=g,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=a,!0;f?44===p&&KW(e,"expected the node content, but found ','"):KW(e,"missed comma between flow collection entries"),d=null,s=l=!1,63===p&&BW(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,rV(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,mV(e,t,1,!1,!0),h=e.tag,u=e.result,rV(e,!0,t),p=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==p||(s=!0,p=e.input.charCodeAt(++e.position),rV(e,!0,t),mV(e,t,1,!1,!0),d=e.result),c?tV(e,a,y,h,u,d,n,r,i):s?a.push(tV(e,null,y,h,u,d,n,r,i)):a.push(u),rV(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(f=!0,p=e.input.charCodeAt(++e.position)):f=!1}KW(e,"unexpected end of the stream within a flow collection")}function uV(e,t){var n,r,i,a,o=1,s=!1,l=!1,c=t,u=0,h=!1;if(124===(a=e.input.charCodeAt(e.position)))r=!1;else{if(62!==a)return!1;r=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===o?o=43===a?3:2:KW(e,"repeat of a chomping mode identifier");else{if(!((i=HW(a))>=0))break;0===i?KW(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?KW(e,"repeat of an indentation width identifier"):(c=t+i-1,l=!0)}if($W(a)){do{a=e.input.charCodeAt(++e.position)}while($W(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!PW(a)&&0!==a)}for(;0!==a;){for(nV(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndentc&&(c=e.lineIndent),PW(a))u++;else{if(e.lineIndentt)&&0!==r)KW(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(y&&(o=e.line,s=e.lineStart,l=e.position),mV(e,t,4,!0,i)&&(y?g=e.result:m=e.result),y||(tV(e,d,p,f,g,m,o,s,l),f=g=m=null),rV(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&0!==c)KW(e,"bad indentation of a mapping entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),l=0,c=e.implicitTypes.length;l"),null!==e.result&&h.kind!==e.kind&&KW(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):KW(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function yV(e){var t,n,r,i,a=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(rV(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!BW(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&KW(e,"directive name must not be less than one character in length");0!==i;){for(;$W(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!PW(i));break}if(PW(i))break;for(t=e.position;0!==i&&!BW(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&nV(e),NW.call(ZW,n)?ZW[n](e,n,r):QW(e,'unknown document directive "'+n+'"')}rV(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,rV(e,!0,-1)):o&&KW(e,"directives end mark is expected"),mV(e,e.lineIndent-1,4,!1,!0),rV(e,!0,-1),e.checkLineBreaks&&OW.test(e.input.slice(a,e.position))&&QW(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&iV(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,rV(e,!0,-1)):e.position=55296&&r<=56319&&t+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function zV(e){return/^\n* /.test(e)}JH(NV,"State"),JH(IV,"indentString"),JH(OV,"generateNextLine"),JH(LV,"testImplicitResolving"),JH(MV,"isWhitespace"),JH(RV,"isPrintable"),JH(DV,"isNsCharOrWhitespace"),JH(PV,"isPlainSafe"),JH($V,"isPlainSafeFirst"),JH(BV,"isPlainSafeLast"),JH(FV,"codePointAt"),JH(zV,"needIndentIndicator");function jV(e,t,n,r,i,a,o,s){var l,c=0,u=null,h=!1,d=!1,p=-1!==r,f=-1,g=$V(FV(e,0))&&BV(FV(e,e.length-1));if(t||o)for(l=0;l=65536?l+=2:l++){if(!RV(c=FV(e,l)))return 5;g=g&&PV(c,u,s),u=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=FV(e,l)))h=!0,p&&(d=d||l-f-1>r&&" "!==e[f+1],f=l);else if(!RV(c))return 5;g=g&&PV(c,u,s),u=c}d=d||p&&l-f-1>r&&" "!==e[f+1]}return h||d?n>9&&zV(e)?5:o?2===a?5:2:d?4:3:!g||o||i(e)?2===a?5:2:1}function HV(e,t,n,r,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==_V.indexOf(t)||CV.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function l(t){return LV(e,t)}switch(JH(l,"testAmbiguity"),jV(t,s,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+UV(t,e.indent)+GV(IV(t,a));case 4:return">"+UV(t,e.indent)+GV(IV(qV(t,o),a));case 5:return'"'+VV(t)+'"';default:throw new pq("impossible error: invalid scalar style")}}()}function UV(e,t){var n=zV(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function GV(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function qV(e,t){for(var n,r,i,a=/(\n+)([^\n]*)/g,o=(n=-1!==(n=e.indexOf("\n"))?n:e.length,a.lastIndex=n,WV(e.slice(0,n),t)),s="\n"===e[0]||" "===e[0];i=a.exec(e);){var l=i[1],c=i[2];r=" "===c[0],o+=l+(s||r||""===c?"":"\n")+WV(c,t),s=r}return o}function WV(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,a=0,o=0,s=0,l="";n=i.exec(e);)(s=n.index)-a>t&&(r=o>a?o:s,l+="\n"+e.slice(a,r),a=r+1),o=s;return l+="\n",e.length-a>t&&o>a?l+=e.slice(a,o)+"\n"+e.slice(o+1):l+=e.slice(a),l.slice(1)}function VV(e){for(var t,n="",r=0,i=0;i=65536?i+=2:i++)r=FV(e,i),!(t=TV[r])&&RV(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||AV(r);return n}function YV(e,t,n){var r,i,a,o="",s=e.tag;for(r=0,i=n.length;r1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),JV(e,t,o,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}function QV(e,t,n,r){var i,a,o,s,l,c,u="",h=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new pq("sortKeys must be a boolean or a function");for(i=0,a=d.length;i1024)&&(e.dump&&10===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,l&&(c+=OV(e,t)),JV(e,t+1,s,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=h,e.dump=u||"{}"}function ZV(e,t,n){var r,i,a,o,s,l;for(a=0,o=(i=n?e.explicitTypes:e.implicitTypes).length;a tag resolver accepts not "'+l+'" style');r=s.represent[l](t,l)}e.dump=r}return!0}return!1}function JV(e,t,n,r,i,a,o){e.tag=null,e.dump=n,ZV(e,n,!1)||ZV(e,n,!0);var s,l=wV.call(e.dump),c=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var u,h,d="[object Object]"===l||"[object Array]"===l;if(d&&(h=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(i=!1),h&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&h&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===l)r&&0!==Object.keys(e.dump).length?(QV(e,t,e.dump,i),h&&(e.dump="&ref_"+u+e.dump)):(KV(e,t,e.dump),h&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===l)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?XV(e,t-1,e.dump,i):XV(e,t,e.dump,i),h&&(e.dump="&ref_"+u+e.dump)):(YV(e,t,e.dump),h&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(e.skipInvalid)return!1;throw new pq("unacceptable kind of an object to dump "+l)}"?"!==e.tag&&HV(e,e.dump,t,a,c)}null!==e.tag&&"?"!==e.tag&&(s=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),s="!"===e.tag[0]?"!"+s:"tag:yaml.org,2002:"===s.slice(0,18)?"!!"+s.slice(18):"!<"+s+">",e.dump=s+" "+e.dump)}return!0}function eY(e,t){var n,r,i=[],a=[];for(tY(e,i,a),n=0,r=a.length;nArray.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),sY=JH(e=>({x:JH(function(t,n,r){let i=0;const a=oY(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(iY,e.arrowTypeEnd)){const{angle:t,deltaX:n}=aY(r[r.length-1],r[r.length-2]);i=iY[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}const o=Math.abs(oY(t).x-oY(r[r.length-1]).x),s=Math.abs(oY(t).y-oY(r[r.length-1]).y),l=Math.abs(oY(t).x-oY(r[0]).x),c=Math.abs(oY(t).y-oY(r[0]).y),u=iY[e.arrowTypeStart],h=iY[e.arrowTypeEnd];if(o0&&s0&&c=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(iY,e.arrowTypeEnd)){const{angle:t,deltaY:n}=aY(r[r.length-1],r[r.length-2]);i=iY[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}const o=Math.abs(oY(t).y-oY(r[r.length-1]).y),s=Math.abs(oY(t).x-oY(r[r.length-1]).x),l=Math.abs(oY(t).y-oY(r[0]).y),c=Math.abs(oY(t).x-oY(r[0]).x),u=iY[e.arrowTypeStart],h=iY[e.arrowTypeEnd];if(o0&&s0&&c{const t=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:t+n}},"getSubGraphTitleMargins");const cY=Object.freeze({left:0,top:0,width:16,height:16}),uY=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hY=Object.freeze({...cY,...uY}),dY=Object.freeze({...hY,body:"",hidden:!1}),pY=Object.freeze({width:null,height:null}),fY=Object.freeze({...pY,...uY}),gY=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name);function mY(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}(e,t);for(const r in dY)r in uY?r in e&&!(r in n)&&(n[r]=uY[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function yY(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let a={};function o(e){a=mY(r[e]||i[e],a)}return o(t),n.forEach(o),mY(e,a)}function vY(e,t){if(e.icons[t])return yY(e,t,[]);const n=function(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);return(t||Object.keys(n).concat(Object.keys(r))).forEach(function e(t){if(n[t])return i[t]=[];if(!(t in i)){i[t]=null;const n=r[t]&&r[t].parent,a=n&&e(n);a&&(i[t]=[n].concat(a))}return i[t]}),i}(e,[t])[t];return n?yY(e,t,n):null}const bY=/(-?[0-9.]*[0-9]+[0-9.]*)/g,xY=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function wY(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const r=e.split(bY);if(null===r||!r.length)return e;const i=[];let a=r.shift(),o=xY.test(a);for(;;){if(o){const e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),void 0===a)return i.join("");o=!o}}const EY=/\sid="(\S+)"/g,kY="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let TY=0;var _Y={body:'?',height:80,width:80},CY=new Map,SY=new Map,AY=JH(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(nU.debug("Registering icon pack:",t.name),"loader"in t)SY.set(t.name,t.loader);else{if(!("icons"in t))throw nU.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');CY.set(t.name,t.icons)}}},"registerIconPacks"),NY=JH(async(e,t)=>{const n=((e,t,n,r="")=>{const i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const e=i.pop(),t=i.pop(),n={provider:i.length>0?i[0]:r,prefix:t,name:e};return gY(n)?n:null}const a=i[0],o=a.split("-");if(o.length>1){const e={provider:r,prefix:o.shift(),name:o.join("-")};return gY(e)?e:null}if(n&&""===r){const e={provider:r,prefix:"",name:a};return gY(e,n)?e:null}return null})(e,0,void 0!==t);if(!n)throw new Error(`Invalid icon name: ${e}`);const r=n.prefix||t;if(!r)throw new Error(`Icon name must contain a prefix: ${e}`);let i=CY.get(r);if(!i){const e=SY.get(r);if(!e)throw new Error(`Icon set not found: ${n.prefix}`);try{i={...await e(),prefix:r},CY.set(r,i)}catch(e){throw nU.error(e),new Error(`Failed to load icon set: ${n.prefix}`)}}const a=vY(i,n.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),IY=JH(async(e,t)=>{let n;try{n=await NY(e,t?.fallbackPrefix)}catch(e){nU.error(e),n=_Y}const r=function(e,t){const n={...hY,...e},r={...fY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach(e=>{const t=[],n=e.hFlip,r=e.vFlip;let o,s=e.rotate;switch(n?r?s+=2:(t.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),t.push("scale(-1 1)"),i.top=i.left=0):r&&(t.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),t.push("scale(1 -1)"),i.top=i.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:o=i.height/2+i.top,t.unshift("rotate(90 "+o.toString()+" "+o.toString()+")");break;case 2:t.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:o=i.width/2+i.left,t.unshift("rotate(-90 "+o.toString()+" "+o.toString()+")")}s%2==1&&(i.left!==i.top&&(o=i.left,i.left=i.top,i.top=o),i.width!==i.height&&(o=i.width,i.width=i.height,i.height=o)),t.length&&(a=function(e,t,n){const r=function(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),a=e.indexOf("",a);if(-1===o)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}(e);return function(e,t){return e?""+e+""+t:t}(r.defs,t+r.content+n)}(a,'',""))});const o=r.width,s=r.height,l=i.width,c=i.height;let u,h;null===o?(h=null===s?"1em":"auto"===s?c:s,u=wY(h,l/c)):(u="auto"===o?l:o,h=null===s?wY(u,c/l):"auto"===s?c:s);const d={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(d[e]=t.toString())};p("width",u),p("height",h);const f=[i.left,i.top,l,c];return d.viewBox=f.join(" "),{attributes:d,viewBox:f,body:a}}(n,t),i=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)n+=" "+e+'="'+t[e]+'"';return'"+e+""}(function(e,t=kY){const n=[];let r;for(;r=EY.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const r="function"==typeof t?t(n):t+(TY++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),e=e.replace(new RegExp(i,"g"),"")}(r.body),r.attributes);return i},"getIconSVG"),OY={},LY={};Object.defineProperty(LY,"__esModule",{value:!0}),LY.BLANK_URL=LY.relativeFirstCharacters=LY.whitespaceEscapeCharsRegex=LY.urlSchemeRegex=LY.ctrlCharactersRegex=LY.htmlCtrlEntityRegex=LY.htmlEntitiesRegex=LY.invalidProtocolRegex=void 0,LY.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,LY.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,LY.htmlCtrlEntityRegex=/&(newline|tab);/gi,LY.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,LY.urlSchemeRegex=/^.+(:|:)/gim,LY.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,LY.relativeFirstCharacters=[".","/"],LY.BLANK_URL="about:blank",Object.defineProperty(OY,"__esModule",{value:!0});var MY=OY.sanitizeUrl=void 0,RY=LY;function DY(e){return e.replace(RY.ctrlCharactersRegex,"").replace(RY.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function PY(e){try{return decodeURIComponent(e)}catch(t){return e}}function $Y(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function BY(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function FY(e){let t,n,r;function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i$Y(e(t),n),r=(t,n)=>e(t)-n):(t=e===$Y||e===BY?e:zY,n=e,r=e),{left:i,center:function(e,t,n=0,a=e.length){const o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o},right:function(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(i0);var r=n;if(!r)return RY.BLANK_URL;if(function(e){return RY.relativeFirstCharacters.indexOf(e[0])>-1}(r))return r;var i=r.trimStart(),a=i.match(RY.urlSchemeRegex);if(!a)return r;var o=a[0].toLowerCase().trim();if(RY.invalidProtocolRegex.test(o))return RY.BLANK_URL;var s=i.replace(/\\/g,"/");if("mailto:"===o||o.includes("://"))return s;if("http:"===o||"https:"===o){if(!function(e){return URL.canParse(e)}(s))return RY.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s};const jY=FY($Y).right;FY(function(e){return null===e?NaN:+e}).center;class HY extends Map{constructor(e,t=GY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(UY(this,e))}has(e){return super.has(UY(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function UY({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GY(e){return null!==e&&"object"==typeof e?e.valueOf():e}const qY=Math.sqrt(50),WY=Math.sqrt(10),VY=Math.sqrt(2);function YY(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=qY?10:a>=WY?5:a>=VY?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),l=Math.round(t*c),s/ct&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),l=Math.round(t/c),s*ct&&--l),l=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function ZY(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function JY(e){return e}var eX=1e-6;function tX(e){return"translate("+e+",0)"}function nX(e){return"translate(0,"+e+")"}function rX(e){return t=>+e(t)}function iX(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function aX(){return!this.__axis}function oX(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===e||4===e?-1:1,u=4===e||2===e?"x":"y",h=1===e||3===e?tX:nX;function d(d){var p=null==r?t.ticks?t.ticks.apply(t,n):t.domain():r,f=null==i?t.tickFormat?t.tickFormat.apply(t,n):JY:i,g=Math.max(a,0)+s,m=t.range(),y=+m[0]+l,v=+m[m.length-1]+l,b=(t.bandwidth?iX:rX)(t.copy(),l),x=d.selection?d.selection():d,w=x.selectAll(".domain").data([null]),E=x.selectAll(".tick").data(p,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),_=E.select("line"),C=E.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),_=_.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),C=C.merge(T.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),d!==x&&(w=w.transition(d),E=E.transition(d),_=_.transition(d),C=C.transition(d),k=k.transition(d).attr("opacity",eX).attr("transform",function(e){return isFinite(e=b(e))?h(e+l):this.getAttribute("transform")}),T.attr("opacity",eX).attr("transform",function(e){var t=this.parentNode.__axis;return h((t&&isFinite(t=t(e))?t:b(e))+l)})),k.remove(),w.attr("d",4===e||2===e?o?"M"+c*o+","+y+"H"+l+"V"+v+"H"+c*o:"M"+l+","+y+"V"+v:o?"M"+y+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+y+","+l+"H"+v),E.attr("opacity",1).attr("transform",function(e){return h(b(e)+l)}),_.attr(u+"2",c*a),C.attr(u,c*g).text(f),x.filter(aX).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),x.each(function(){this.__axis=b})}return d.scale=function(e){return arguments.length?(t=e,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(e){return arguments.length?(n=null==e?[]:Array.from(e),d):n.slice()},d.tickValues=function(e){return arguments.length?(r=null==e?null:Array.from(e),d):r&&r.slice()},d.tickFormat=function(e){return arguments.length?(i=e,d):i},d.tickSize=function(e){return arguments.length?(a=o=+e,d):a},d.tickSizeInner=function(e){return arguments.length?(a=+e,d):a},d.tickSizeOuter=function(e){return arguments.length?(o=+e,d):o},d.tickPadding=function(e){return arguments.length?(s=+e,d):s},d.offset=function(e){return arguments.length?(l=+e,d):l},d}var sX={value:()=>{}};function lX(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}(e+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),a=0;a=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),pX.hasOwnProperty(t)?{space:pX[t],local:e}:e}function gX(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===dX&&t.documentElement.namespaceURI===dX?t.createElement(e):t.createElementNS(n,e)}}function mX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yX(e){var t=fX(e);return(t.local?mX:gX)(t)}function vX(){}function bX(e){return null==e?vX:function(){return this.querySelector(e)}}function xX(){return[]}function wX(e){return null==e?xX:function(){return this.querySelectorAll(e)}}function EX(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}function kX(e){return function(){return this.matches(e)}}function TX(e){return function(t){return t.matches(e)}}var _X=Array.prototype.find;function CX(){return this.firstElementChild}var SX=Array.prototype.filter;function AX(){return Array.from(this.children)}function NX(e){return new Array(e.length)}function IX(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function OX(e,t,n,r,i,a){for(var o,s=0,l=t.length,c=a.length;st?1:e>=t?0:NaN}function PX(e){return function(){this.removeAttribute(e)}}function $X(e){return function(){this.removeAttributeNS(e.space,e.local)}}function BX(e,t){return function(){this.setAttribute(e,t)}}function FX(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function zX(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function jX(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function HX(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function UX(e){return function(){this.style.removeProperty(e)}}function GX(e,t,n){return function(){this.style.setProperty(e,t,n)}}function qX(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function WX(e,t){return e.style.getPropertyValue(t)||HX(e).getComputedStyle(e,null).getPropertyValue(t)}function VX(e){return function(){delete this[e]}}function YX(e,t){return function(){this[e]=t}}function XX(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function KX(e){return e.trim().split(/^|\s+/)}function QX(e){return e.classList||new ZX(e)}function ZX(e){this._node=e,this._names=KX(e.getAttribute("class")||"")}function JX(e,t){for(var n=QX(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var wK=[null];function EK(e,t){this._groups=e,this._parents=t}function kK(){return new EK([[document.documentElement]],wK)}function TK(e){return"string"==typeof e?new EK([[document.querySelector(e)]],[document.documentElement]):new EK([[e]],wK)}function _K(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function CK(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function SK(){}EK.prototype=kK.prototype={constructor:EK,select:function(e){"function"!=typeof e&&(e=bX(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=x&&(x=b+1);!(v=m[x])&&++x=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=DX);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?UX:"function"==typeof t?qX:GX)(e,t,null==n?"":n)):WX(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?VX:"function"==typeof t?XX:YX)(e,t)):this.node()[e]},classed:function(e,t){var n=KX(e+"");if(arguments.length<2){for(var r=QX(this.node()),i=-1,a=n.length;++i=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),o=a.length;if(!(arguments.length<2)){for(s=t?yK:mK,r=0;r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?qK(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?qK(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=RK.exec(e))?new YK(t[1],t[2],t[3],1):(t=DK.exec(e))?new YK(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=PK.exec(e))?qK(t[1],t[2],t[3],t[4]):(t=$K.exec(e))?qK(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=BK.exec(e))?eQ(t[1],t[2]/100,t[3]/100,1):(t=FK.exec(e))?eQ(t[1],t[2]/100,t[3]/100,t[4]):zK.hasOwnProperty(e)?GK(zK[e]):"transparent"===e?new YK(NaN,NaN,NaN,0):null}function GK(e){return new YK(e>>16&255,e>>8&255,255&e,1)}function qK(e,t,n,r){return r<=0&&(e=t=n=NaN),new YK(e,t,n,r)}function WK(e){return e instanceof SK||(e=UK(e)),e?new YK((e=e.rgb()).r,e.g,e.b,e.opacity):new YK}function VK(e,t,n,r){return 1===arguments.length?WK(e):new YK(e,t,n,null==r?1:r)}function YK(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function XK(){return`#${JK(this.r)}${JK(this.g)}${JK(this.b)}`}function KK(){const e=QK(this.opacity);return`${1===e?"rgb(":"rgba("}${ZK(this.r)}, ${ZK(this.g)}, ${ZK(this.b)}${1===e?")":`, ${e})`}`}function QK(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ZK(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function JK(e){return((e=ZK(e))<16?"0":"")+e.toString(16)}function eQ(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nQ(e,t,n,r)}function tQ(e){if(e instanceof nQ)return new nQ(e.h,e.s,e.l,e.opacity);if(e instanceof SK||(e=UK(e)),!e)return new nQ;if(e instanceof nQ)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(n-r)/s+6*(n0&&l<1?0:o,new nQ(o,s,l,e.opacity)}function nQ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function rQ(e){return(e=(e||0)%360)<0?e+360:e}function iQ(e){return Math.max(0,Math.min(1,e||0))}function aQ(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_K(SK,UK,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jK,formatHex:jK,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tQ(this).formatHsl()},formatRgb:HK,toString:HK}),_K(YK,VK,CK(SK,{brighter(e){return e=null==e?NK:Math.pow(NK,e),new YK(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?AK:Math.pow(AK,e),new YK(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new YK(ZK(this.r),ZK(this.g),ZK(this.b),QK(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XK,formatHex:XK,formatHex8:function(){return`#${JK(this.r)}${JK(this.g)}${JK(this.b)}${JK(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:KK,toString:KK})),_K(nQ,function(e,t,n,r){return 1===arguments.length?tQ(e):new nQ(e,t,n,null==r?1:r)},CK(SK,{brighter(e){return e=null==e?NK:Math.pow(NK,e),new nQ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?AK:Math.pow(AK,e),new nQ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new YK(aQ(e>=240?e-240:e+120,i,r),aQ(e,i,r),aQ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new nQ(rQ(this.h),iQ(this.s),iQ(this.l),QK(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=QK(this.opacity);return`${1===e?"hsl(":"hsla("}${rQ(this.h)}, ${100*iQ(this.s)}%, ${100*iQ(this.l)}%${1===e?")":`, ${e})`}`}}));const oQ=Math.PI/180,sQ=180/Math.PI,lQ=.96422,cQ=.82521,uQ=4/29,hQ=6/29,dQ=3*hQ*hQ,pQ=hQ*hQ*hQ;function fQ(e){if(e instanceof gQ)return new gQ(e.l,e.a,e.b,e.opacity);if(e instanceof wQ)return EQ(e);e instanceof YK||(e=WK(e));var t,n,r=bQ(e.r),i=bQ(e.g),a=bQ(e.b),o=mQ((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?t=n=o:(t=mQ((.4360747*r+.3850649*i+.1430804*a)/lQ),n=mQ((.0139322*r+.0971045*i+.7141733*a)/cQ)),new gQ(116*o-16,500*(t-o),200*(o-n),e.opacity)}function gQ(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function mQ(e){return e>pQ?Math.pow(e,1/3):e/dQ+uQ}function yQ(e){return e>hQ?e*e*e:dQ*(e-uQ)}function vQ(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bQ(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xQ(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof wQ)return new wQ(e.h,e.c,e.l,e.opacity);if(e instanceof gQ||(e=fQ(e)),0===e.a&&0===e.b)return new wQ(NaN,0()=>e;function TQ(e,t){return function(n){return e+n*t}}function _Q(e){return 1===(e=+e)?CQ:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):kQ(isNaN(t)?n:t)}}function CQ(e,t){var n=t-e;return n?TQ(e,n):kQ(isNaN(e)?t:e)}var SQ=function e(t){var n=_Q(t);function r(e,t){var r=n((e=VK(e)).r,(t=VK(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=CQ(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function AQ(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(n=0;na&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:OQ(n,r)})),a=RQ.lastIndex;return a180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:OQ(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:OQ(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,s,l),function(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:OQ(e,n)},{i:s-2,x:OQ(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,n=-1,r=l.length;++n180||n<-180?n-360*Math.round(n/360):n):kQ(isNaN(e)?t:e)}),YQ=0,XQ=0,KQ=0,QQ=0,ZQ=0,JQ=0,eZ="object"==typeof performance&&performance.now?performance:Date,tZ="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nZ(){return ZQ||(tZ(rZ),ZQ=eZ.now()+JQ)}function rZ(){ZQ=0}function iZ(){this._call=this._time=this._next=null}function aZ(e,t,n){var r=new iZ;return r.restart(e,t,n),r}function oZ(){ZQ=(QQ=eZ.now())+JQ,YQ=XQ=0;try{!function(){nZ(),++YQ;for(var e,t=qQ;t;)(e=ZQ-t._time)>=0&&t._call.call(void 0,e),t=t._next;--YQ}()}finally{YQ=0,function(){var e,t,n=qQ,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:qQ=t);WQ=e,lZ(r)}(),ZQ=0}}function sZ(){var e=eZ.now(),t=e-QQ;t>1e3&&(JQ-=t,QQ=e)}function lZ(e){YQ||(XQ&&(XQ=clearTimeout(XQ)),e-ZQ>24?(e<1/0&&(XQ=setTimeout(oZ,e-eZ.now()-JQ)),KQ&&(KQ=clearInterval(KQ))):(KQ||(QQ=eZ.now(),KQ=setInterval(sZ,1e3)),YQ=1,tZ(oZ)))}function cZ(e,t,n){var r=new iZ;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}iZ.prototype=aZ.prototype={constructor:iZ,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?nZ():+n)+(null==t?0:+t),this._next||WQ===this||(WQ?WQ._next=this:qQ=this,WQ=this),this._call=e,this._time=n,lZ()},stop:function(){this._call&&(this._call=null,this._time=1/0,lZ())}};var uZ=lX("start","end","cancel","interrupt"),hZ=[];function dZ(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var c,u,h,d;if(1!==n.state)return l();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return cZ(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function fZ(e,t){var n=gZ(e,t);if(n.state>3)throw new Error("too late; already running");return n}function gZ(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function mZ(e,t){var n,r;return function(){var i=fZ(this,e),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?pZ:fZ;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=fX(e),r="transform"===n?GQ:bZ;return this.attrTween(e,"function"==typeof t?(n.local?_Z:TZ)(n,r,vZ(this,"attr."+e,t)):null==t?(n.local?wZ:xZ)(n):(n.local?kZ:EZ)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=fX(e);return this.tween(n,(r.local?CZ:SZ)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?UQ:bZ;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=WX(this,e),o=(this.style.removeProperty(e),WX(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,MZ(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=WX(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=WX(this,e)),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}(e,r,vZ(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,s="end."+o;return function(){var l=fZ(this,e),c=l.on,u=null==l.value[o]?a||(a=MZ(t)):void 0;c===n&&i===u||(r=(n=c).copy()).on(s,i=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=WX(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(vZ(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=gZ(this.node(),n).tween,a=0,o=i.length;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete e.__transition}}(this,e)})},kK.prototype.transition=function(e){var t,n;e instanceof DZ?(t=e._id,e=e._name):(t=PZ(),(n=BZ).time=nZ(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a=0))throw new Error(`invalid digits: ${e}`);if(t>15)return GZ;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tHZ)if(Math.abs(u*s-l*c)>HZ&&i){let d=n-a,p=r-o,f=s*s+l*l,g=d*d+p*p,m=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((zZ-Math.acos((f+h-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>HZ&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*d>c*p)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,a){if(e=+e,t=+t,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,c=t+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>HZ||Math.abs(this._y1-c)>HZ)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%jZ+jZ),h>UZ?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>HZ&&this._append`A${n},${n},0,${+(h>=zZ)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function WZ(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function VZ(e){return(e=WZ(Math.abs(e)))?e[1]:NaN}var YZ,XZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function KZ(e){if(!(t=XZ.exec(e)))throw new Error("invalid format: "+e);var t;return new QZ({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]})}function QZ(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ZZ(e,t){var n=WZ(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}KZ.prototype=QZ.prototype,QZ.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var JZ={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ZZ(100*e,t),r:ZZ,s:function(e,t){var n=WZ(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(YZ=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+WZ(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eJ(e){return e}var tJ,nJ,rJ,iJ=Array.prototype.map,aJ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oJ(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?eJ:(t=iJ.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?eJ:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(iJ.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=KZ(e)).fill,n=e.align,h=e.sign,d=e.symbol,p=e.zero,f=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):JZ[v]||(void 0===m&&(m=12),y=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?a:/[%p]/.test(v)?l:"",w=JZ[v],E=/[defgprs%]/.test(v);function k(e){var i,a,l,d=b,k=x;if("c"===v)k=w(e)+k,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0===+e&&"+"!==h&&(T=!1),d=(T?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===v?aJ[8+YZ/3]:"")+k+(T&&"("===h?")":""),E)for(i=-1,a=e.length;++i(l=e.charCodeAt(i))||l>57){k=(46===l?o+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!p&&(e=r(e,1/0));var _=d.length+e.length+k.length,C=_>1)+d+e+k+C.slice(_);break;default:e=C+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=KZ(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(VZ(t)/3))),i=Math.pow(10,-r),a=aJ[8+r/3];return function(e){return n(i*e)+a}}}}function sJ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}!function(e){tJ=oJ(e),nJ=tJ.format,rJ=tJ.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const lJ=Symbol("implicit");function cJ(){var e=new HY,t=[],n=[],r=lJ;function i(i){let a=e.get(i);if(void 0===a){if(r!==lJ)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new HY;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return cJ(t,n).unknown(r)},sJ.apply(i,arguments),i}function uJ(){var e,t,n=cJ().unknown(void 0),r=n.domain,i=n.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(o[0],o[e-1])),r=e>2?mJ:gJ,i=a=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(o.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((a||(a=r(s,o.map(e),OQ)))(n)))},h.domain=function(e){return arguments.length?(o=Array.from(e,hJ),u()):o.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=$Q,u()},h.clamp=function(e){return arguments.length?(c=!!e||pJ,u()):c!==pJ},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,u()}}function bJ(){return vJ()(pJ,pJ)}function xJ(e,t,n,r){var i,a=KY(e,t,n);switch((r=KZ(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(VZ(t)/3)))-VZ(Math.abs(e)))}(a,o))||(r.precision=i),rJ(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,VZ(t)-VZ(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-VZ(Math.abs(e)))}(a))||(r.precision=i-2*("%"===r.type))}return nJ(r)}function wJ(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let e=0;e0;){if((i=XY(l,c,n))===r)return a[o]=l,a[s]=c,t(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function EJ(){var e=bJ();return e.copy=function(){return yJ(e,EJ())},sJ.apply(e,arguments),wJ(e)}const kJ=new Date,TJ=new Date;function _J(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,a)=>{const o=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n0))return o;let s;do{o.push(s=new Date(+n)),t(n,a),e(n)}while(s_J(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(kJ.setTime(+t),TJ.setTime(+r),e(kJ),e(TJ),Math.floor(n(kJ,TJ))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const CJ=_J(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);CJ.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?_J(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):CJ:null),CJ.range;const SJ=1e3,AJ=6e4,NJ=36e5,IJ=864e5,OJ=6048e5,LJ=2592e6,MJ=31536e6,RJ=_J(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*SJ)},(e,t)=>(t-e)/SJ,e=>e.getUTCSeconds());RJ.range;const DJ=_J(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*SJ)},(e,t)=>{e.setTime(+e+t*AJ)},(e,t)=>(t-e)/AJ,e=>e.getMinutes());DJ.range;const PJ=_J(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*AJ)},(e,t)=>(t-e)/AJ,e=>e.getUTCMinutes());PJ.range;const $J=_J(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*SJ-e.getMinutes()*AJ)},(e,t)=>{e.setTime(+e+t*NJ)},(e,t)=>(t-e)/NJ,e=>e.getHours());$J.range;const BJ=_J(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*NJ)},(e,t)=>(t-e)/NJ,e=>e.getUTCHours());BJ.range;const FJ=_J(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AJ)/IJ,e=>e.getDate()-1);FJ.range;const zJ=_J(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/IJ,e=>e.getUTCDate()-1);zJ.range;const jJ=_J(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/IJ,e=>Math.floor(e/IJ));function HJ(e){return _J(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AJ)/OJ)}jJ.range;const UJ=HJ(0),GJ=HJ(1),qJ=HJ(2),WJ=HJ(3),VJ=HJ(4),YJ=HJ(5),XJ=HJ(6);function KJ(e){return _J(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/OJ)}UJ.range,GJ.range,qJ.range,WJ.range,VJ.range,YJ.range,XJ.range;const QJ=KJ(0),ZJ=KJ(1),JJ=KJ(2),e0=KJ(3),t0=KJ(4),n0=KJ(5),r0=KJ(6);QJ.range,ZJ.range,JJ.range,e0.range,t0.range,n0.range,r0.range;const i0=_J(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());i0.range;const a0=_J(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());a0.range;const o0=_J(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());o0.every=e=>isFinite(e=Math.floor(e))&&e>0?_J(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,o0.range;const s0=_J(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());s0.every=e=>isFinite(e=Math.floor(e))&&e>0?_J(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,s0.range;const[l0,c0]=function(e,t,n,r,i,a){const o=[[RJ,1,SJ],[RJ,5,5e3],[RJ,15,15e3],[RJ,30,3e4],[a,1,AJ],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,NJ],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,IJ],[r,2,1728e5],[n,1,OJ],[t,1,LJ],[t,3,7776e6],[e,1,MJ]];function s(t,n,r){const i=Math.abs(n-t)/r,a=FY(([,,e])=>e).right(o,i);if(a===o.length)return e.every(KY(t/MJ,n/MJ,r));if(0===a)return CJ.every(Math.max(KY(t,n,r),1));const[s,l]=o[i/o[a-1][2][e.toLowerCase(),t]))}function k0(e,t,n){var r=m0.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function T0(e,t,n){var r=m0.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function _0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function C0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function S0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function A0(e,t,n){var r=m0.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function N0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function I0(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function O0(e,t,n){var r=m0.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function L0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function M0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function R0(e,t,n){var r=m0.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function D0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function P0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $0(e,t,n){var r=m0.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function B0(e,t,n){var r=m0.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function F0(e,t,n){var r=m0.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function z0(e,t,n){var r=y0.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function j0(e,t,n){var r=m0.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function H0(e,t,n){var r=m0.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function U0(e,t){return b0(e.getDate(),t,2)}function G0(e,t){return b0(e.getHours(),t,2)}function q0(e,t){return b0(e.getHours()%12||12,t,2)}function W0(e,t){return b0(1+FJ.count(o0(e),e),t,3)}function V0(e,t){return b0(e.getMilliseconds(),t,3)}function Y0(e,t){return V0(e,t)+"000"}function X0(e,t){return b0(e.getMonth()+1,t,2)}function K0(e,t){return b0(e.getMinutes(),t,2)}function Q0(e,t){return b0(e.getSeconds(),t,2)}function Z0(e){var t=e.getDay();return 0===t?7:t}function J0(e,t){return b0(UJ.count(o0(e)-1,e),t,2)}function e1(e){var t=e.getDay();return t>=4||0===t?VJ(e):VJ.ceil(e)}function t1(e,t){return e=e1(e),b0(VJ.count(o0(e),e)+(4===o0(e).getDay()),t,2)}function n1(e){return e.getDay()}function r1(e,t){return b0(GJ.count(o0(e)-1,e),t,2)}function i1(e,t){return b0(e.getFullYear()%100,t,2)}function a1(e,t){return b0((e=e1(e)).getFullYear()%100,t,2)}function o1(e,t){return b0(e.getFullYear()%1e4,t,4)}function s1(e,t){var n=e.getDay();return b0((e=n>=4||0===n?VJ(e):VJ.ceil(e)).getFullYear()%1e4,t,4)}function l1(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+b0(t/60|0,"0",2)+b0(t%60,"0",2)}function c1(e,t){return b0(e.getUTCDate(),t,2)}function u1(e,t){return b0(e.getUTCHours(),t,2)}function h1(e,t){return b0(e.getUTCHours()%12||12,t,2)}function d1(e,t){return b0(1+zJ.count(s0(e),e),t,3)}function p1(e,t){return b0(e.getUTCMilliseconds(),t,3)}function f1(e,t){return p1(e,t)+"000"}function g1(e,t){return b0(e.getUTCMonth()+1,t,2)}function m1(e,t){return b0(e.getUTCMinutes(),t,2)}function y1(e,t){return b0(e.getUTCSeconds(),t,2)}function v1(e){var t=e.getUTCDay();return 0===t?7:t}function b1(e,t){return b0(QJ.count(s0(e)-1,e),t,2)}function x1(e){var t=e.getUTCDay();return t>=4||0===t?t0(e):t0.ceil(e)}function w1(e,t){return e=x1(e),b0(t0.count(s0(e),e)+(4===s0(e).getUTCDay()),t,2)}function E1(e){return e.getUTCDay()}function k1(e,t){return b0(ZJ.count(s0(e)-1,e),t,2)}function T1(e,t){return b0(e.getUTCFullYear()%100,t,2)}function _1(e,t){return b0((e=x1(e)).getUTCFullYear()%100,t,2)}function C1(e,t){return b0(e.getUTCFullYear()%1e4,t,4)}function S1(e,t){var n=e.getUTCDay();return b0((e=n>=4||0===n?t0(e):t0.ceil(e)).getUTCFullYear()%1e4,t,4)}function A1(){return"+0000"}function N1(){return"%"}function I1(e){return+e}function O1(e){return Math.floor(+e/1e3)}function L1(e){return new Date(e)}function M1(e){return e instanceof Date?+e:+new Date(+e)}function R1(e,t,n,r,i,a,o,s,l,c){var u=bJ(),h=u.invert,d=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(l(e)=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:I1,s:O1,S:Q0,u:Z0,U:J0,V:t1,w:n1,W:r1,x:null,X:null,y:i1,Y:o1,Z:l1,"%":N1},x={a:function(e){return o[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:c1,e:c1,f:f1,g:_1,G:S1,H:u1,I:h1,j:d1,L:p1,m:g1,M:m1,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:I1,s:O1,S:y1,u:v1,U:b1,V:w1,w:E1,W:k1,x:null,X:null,y:T1,Y:C1,Z:A1,"%":N1},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return T(e,t,n,r)},d:M0,e:M0,f:F0,g:N0,G:A0,H:D0,I:D0,j:R0,L:B0,m:L0,M:P0,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:O0,Q:j0,s:H0,S:$0,u:T0,U:_0,V:C0,w:k0,W:S0,x:function(e,t,r){return T(e,n,t,r)},X:function(e,t,n){return T(e,r,t,n)},y:N0,Y:A0,Z:I0,"%":z0};function E(e,t){return function(n){var r,i,a,o=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=h0(d0(a.y,0,1))).getUTCDay(),r=i>4||0===i?ZJ.ceil(r):ZJ(r),r=zJ.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=u0(d0(a.y,0,1))).getDay(),r=i>4||0===i?GJ.ceil(r):GJ(r),r=FJ.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?h0(d0(a.y,0,1)).getUTCDay():u0(d0(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,h0(a)):u0(a)}}function T(e,t,n,r){for(var i,a,o=0,s=t.length,l=n.length;o=l)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=w[i in g0?t.charAt(o++):i])||(r=a(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),x.x=E(n,x),x.X=E(r,x),x.c=E(t,x),{format:function(e){var t=E(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=E(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}(e),f0=p0.format,p0.parse,p0.utcFormat,p0.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var P1=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r=1?V1:e<=-1?-V1:Math.asin(e)}function K1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new qZ(t)}function Q1(e){return e.innerRadius}function Z1(e){return e.outerRadius}function J1(e){return e.startAngle}function e2(e){return e.endAngle}function t2(e){return e&&e.padAngle}function n2(e,t,n,r,i,a,o){var s=e-n,l=t-r,c=(o?a:-a)/G1(s*s+l*l),u=c*l,h=-c*s,d=e+u,p=t+h,f=n+u,g=r+h,m=(d+f)/2,y=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,w=i-a,E=d*g-f*p,k=(b<0?-1:1)*G1(j1(0,w*w*x-E*E)),T=(E*b-v*k)/x,_=(-E*v-b*k)/x,C=(E*b+v*k)/x,S=(-E*v+b*k)/x,A=T-m,N=_-y,I=C-m,O=S-y;return A*A+N*N>I*I+O*O&&(T=C,_=S),{cx:T,cy:_,x01:-u,y01:-h,x11:T*(i/w-1),y11:_*(i/w-1)}}function r2(){var e=Q1,t=Z1,n=$1(0),r=null,i=J1,a=e2,o=t2,s=null,l=K1(c);function c(){var c,u,h=+e.apply(this,arguments),d=+t.apply(this,arguments),p=i.apply(this,arguments)-V1,f=a.apply(this,arguments)-V1,g=B1(f-p),m=f>p;if(s||(s=c=l()),dq1)if(g>Y1-q1)s.moveTo(d*z1(p),d*U1(p)),s.arc(0,0,d,p,f,!m),h>q1&&(s.moveTo(h*z1(f),h*U1(f)),s.arc(0,0,h,f,p,m));else{var y,v,b=p,x=f,w=p,E=f,k=g,T=g,_=o.apply(this,arguments)/2,C=_>q1&&(r?+r.apply(this,arguments):G1(h*h+d*d)),S=H1(B1(d-h)/2,+n.apply(this,arguments)),A=S,N=S;if(C>q1){var I=X1(C/h*U1(_)),O=X1(C/d*U1(_));(k-=2*I)>q1?(w+=I*=m?1:-1,E-=I):(k=0,w=E=(p+f)/2),(T-=2*O)>q1?(b+=O*=m?1:-1,x-=O):(T=0,b=x=(p+f)/2)}var L=d*z1(b),M=d*U1(b),R=h*z1(E),D=h*U1(E);if(S>q1){var P,$=d*z1(x),B=d*U1(x),F=h*z1(w),z=h*U1(w);if(g1?0:e<-1?W1:Math.acos(e)}((j*U+H*G)/(G1(j*j+H*H)*G1(U*U+G*G)))/2),W=G1(P[0]*P[0]+P[1]*P[1]);A=H1(S,(h-W)/(q-1)),N=H1(S,(d-W)/(q+1))}else A=N=0}T>q1?N>q1?(y=n2(F,z,L,M,d,N,m),v=n2($,B,R,D,d,N,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),Nq1&&k>q1?A>q1?(y=n2(R,D,$,B,h,-A,m),v=n2(L,M,F,z,h,-A,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Ae?1:t>=e?0:NaN}function h2(e){return e}a2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};class d2{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function p2(e){return new d2(e,!0)}function f2(e){return new d2(e,!1)}function g2(){}function m2(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function y2(e){this._context=e}function v2(e){return new y2(e)}function b2(e){this._context=e}function x2(e){this._context=e}function w2(e,t){this._basis=new y2(e),this._beta=t}y2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:m2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:m2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},b2.prototype={areaStart:g2,areaEnd:g2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:m2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},x2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:m2(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},w2.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],a=t[0],o=e[n]-i,s=t[n]-a,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+r*o),this._beta*t[l]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var E2=function e(t){function n(e){return 1===t?new y2(e):new w2(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function k2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function T2(e,t){this._context=e,this._k=(1-t)/6}T2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:k2(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:k2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _2=function e(t){function n(e){return new T2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function C2(e,t){this._context=e,this._k=(1-t)/6}C2.prototype={areaStart:g2,areaEnd:g2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:k2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var S2=function e(t){function n(e){return new C2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function A2(e,t){this._context=e,this._k=(1-t)/6}A2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:k2(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var N2=function e(t){function n(e){return new A2(e,t)}return n.tension=function(t){return e(+t)},n}(0);function I2(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>q1){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>q1){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function O2(e,t){this._context=e,this._alpha=t}O2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:I2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var L2=function e(t){function n(e){return t?new O2(e,t):new T2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function M2(e,t){this._context=e,this._alpha=t}M2.prototype={areaStart:g2,areaEnd:g2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:I2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var R2=function e(t){function n(e){return t?new M2(e,t):new C2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function D2(e,t){this._context=e,this._alpha=t}D2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I2(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var P2=function e(t){function n(e){return t?new D2(e,t):new A2(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function $2(e){this._context=e}function B2(e){return e<0?-1:1}function F2(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(B2(a)+B2(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function z2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function j2(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function H2(e){this._context=e}function U2(e){this._context=new G2(e)}function G2(e){this._context=e}function q2(e){return new H2(e)}function W2(e){return new U2(e)}function V2(e){this._context=e}function Y2(e){var t,n,r=e.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},e4.prototype={constructor:e4,scale:function(e){return 1===e?this:new e4(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new e4(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},e4.prototype;var t4="object"==typeof global&&global&&global.Object===Object&&global,n4="object"==typeof self&&self&&self.Object===Object&&self,r4=t4||n4||Function("return this")(),i4=r4.Symbol,a4=Object.prototype,o4=a4.hasOwnProperty,s4=a4.toString,l4=i4?i4.toStringTag:void 0;var c4=Object.prototype.toString;var u4=i4?i4.toStringTag:void 0;function h4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u4&&u4 in Object(e)?function(e){var t=o4.call(e,l4),n=e[l4];try{e[l4]=void 0;var r=!0}catch(e){}var i=s4.call(e);return r&&(t?e[l4]=n:delete e[l4]),i}(e):function(e){return c4.call(e)}(e)}function d4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function p4(e){if(!d4(e))return!1;var t=h4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var f4,g4=r4["__core-js_shared__"],m4=(f4=/[^.]+$/.exec(g4&&g4.keys&&g4.keys.IE_PROTO||""))?"Symbol(src)_1."+f4:"";var y4=Function.prototype.toString;function v4(e){if(null!=e){try{return y4.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var b4=/^\[object .+?Constructor\]$/,x4=Function.prototype,w4=Object.prototype,E4=x4.toString,k4=w4.hasOwnProperty,T4=RegExp("^"+E4.call(k4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _4(e){return!(!d4(e)||function(e){return!!m4&&m4 in e}(e))&&(p4(e)?T4:b4).test(v4(e))}function C4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _4(n)?n:void 0}var S4=C4(Object,"create");var A4=Object.prototype.hasOwnProperty;var N4=Object.prototype.hasOwnProperty;function I4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},R4.prototype.set=function(e,t){var n=this.__data__,r=L4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var D4=C4(r4,"Map");function P4(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function $4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}function f3(e){return null!=e&&p3(e.length)&&!p4(e)}function g3(e){return o3(e)&&f3(e)}var m3="object"==typeof exports&&exports&&!exports.nodeType&&exports,y3=m3&&"object"==typeof module&&module&&!module.nodeType&&module,v3=y3&&y3.exports===m3?r4.Buffer:void 0,b3=(v3?v3.isBuffer:void 0)||function(){return!1},x3=Function.prototype,w3=Object.prototype,E3=x3.toString,k3=w3.hasOwnProperty,T3=E3.call(Object);var _3={};function C3(e){return function(t){return e(t)}}_3["[object Float32Array]"]=_3["[object Float64Array]"]=_3["[object Int8Array]"]=_3["[object Int16Array]"]=_3["[object Int32Array]"]=_3["[object Uint8Array]"]=_3["[object Uint8ClampedArray]"]=_3["[object Uint16Array]"]=_3["[object Uint32Array]"]=!0,_3["[object Arguments]"]=_3["[object Array]"]=_3["[object ArrayBuffer]"]=_3["[object Boolean]"]=_3["[object DataView]"]=_3["[object Date]"]=_3["[object Error]"]=_3["[object Function]"]=_3["[object Map]"]=_3["[object Number]"]=_3["[object Object]"]=_3["[object RegExp]"]=_3["[object Set]"]=_3["[object String]"]=_3["[object WeakMap]"]=!1;var S3="object"==typeof exports&&exports&&!exports.nodeType&&exports,A3=S3&&"object"==typeof module&&module&&!module.nodeType&&module,N3=A3&&A3.exports===S3&&t4.process,I3=function(){try{var e=A3&&A3.require&&A3.require("util").types;return e||N3&&N3.binding&&N3.binding("util")}catch(e){}}(),O3=I3&&I3.isTypedArray,L3=O3?C3(O3):function(e){return o3(e)&&p3(e.length)&&!!_3[h4(e)]};function M3(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var R3=Object.prototype.hasOwnProperty;function D3(e,t,n){var r=e[t];R3.call(e,t)&&O4(r,n)&&(void 0!==n||t in e)||j4(e,t,n)}function P3(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(K3);function J3(e,t){return Z3(Y3(e,t,W3),e+"")}function e5(e,t,n){if(!d4(n))return!1;var r=typeof t;return!!("number"==r?f3(n)&&B3(t,n.length):"string"==r&&t in n)&&O4(n[t],e)}function t5(e){return J3(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&e5(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++re.args);RU(e),r=gU(r,[...e])}else r=n.args;if(!r)return;let i=uU(e,t);const a="config";return void 0!==r[a]&&("flowchart-v2"===i&&(i="flowchart"),r[i]=r[a],delete r[a]),r},"detectInit"),o5=JH(function(e,t=null){try{const n=new RegExp(`[%]{2}(?![{]${i5.source})(?=[}][%]{2}).*\n`,"ig");let r;e=e.trim().replace(n,"").replace(/'/gm,'"'),nU.debug(`Detecting diagram directive${null!==t?" type:"+t:""} based on the text:${e}`);const i=[];for(;null!==(r=oU.exec(e));)if(r.index===oU.lastIndex&&oU.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){const e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return 0===i.length?{type:e,args:null}:1===i.length?i[0]:i}catch(n){return nU.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),s5=JH(function(e){return e.replace(oU,"")},"removeDirectives"),l5=JH(function(e,t){for(const[n,r]of t.entries())if(r.match(e))return n;return-1},"isSubstringInArray");function c5(e,t){if(!e)return t;const n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return r5[n]??t}function u5(e,t){const n=e.trim();if(n)return"loose"!==t.securityLevel?MY(n):n}JH(c5,"interpolateToCurve"),JH(u5,"formatUrl");var h5=JH((e,...t)=>{const n=e.split("."),r=n.length-1,i=n[r];let a=window;for(let t=0;t{n+=d5(e,t),t=e});return m5(e,n/2)}function f5(e){return 1===e.length?e[0]:p5(e)}JH(d5,"distance"),JH(p5,"traverseEdge"),JH(f5,"calcLabelPosition");var g5=JH((e,t=2)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},"roundNumber"),m5=JH((e,t)=>{let n,r=t;for(const t of e){if(n){const e=d5(t,n);if(0===e)return n;if(e=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:g5((1-i)*n.x+i*t.x,5),y:g5((1-i)*n.y+i*t.y,5)}}}n=t}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),y5=JH((e,t,n)=>{nU.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());const r=m5(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},"calcCardinalityPosition");function v5(e,t,n){const r=structuredClone(n);nU.info("our points",r),"start_left"!==t&&"start_right"!==t&&r.reverse();const i=m5(r,25+e),a=10+.5*e,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return"start_left"===t?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):"end_right"===t?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):"end_left"===t?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}function b5(e){let t="",n="";for(const r of e)void 0!==r&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":t=t+r+";");return{style:t,labelStyle:n}}JH(v5,"calcTerminalLabelPosition"),JH(b5,"getStylesFromArray");var x5=0,w5=JH(()=>(x5++,"id-"+Math.random().toString(36).substr(2,12)+"-"+x5),"generateId");function E5(e){let t="";const n="0123456789abcdef";for(let r=0;rE5(e.length),"random"),T5=JH(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"),_5=JH(function(e,t){const n=t.text.replace(_G.lineBreakRegex," "),[,r]=P5(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",r),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),void 0!==t.class&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.attr("fill",t.fill),a.text(n),i},"drawSimpleText"),C5=B4((e,t,n)=>{if(!e)return e;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
    "},n),_G.lineBreakRegex.test(e))return e;const r=e.split(" ").filter(Boolean),i=[];let a="";return r.forEach((e,o)=>{const s=N5(`${e} `,n),l=N5(a,n);if(s>t){const{hyphenatedStrings:r,remainingWord:o}=S5(e,t,"-",n);i.push(a,...r),a=o}else l+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(" ");o+1===r.length&&i.push(a)}),i.filter(e=>""!==e).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),S5=B4((e,t,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...e],a=[];let o="";return i.forEach((e,s)=>{const l=`${o}${e}`;if(N5(l,r)>=t){const e=s+1,t=i.length===e,r=`${l}${n}`;a.push(t?l:r),o=""}else o=l}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n="-",r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function A5(e,t){return O5(e,t).height}function N5(e,t){return O5(e,t).width}JH(A5,"calculateTextHeight"),JH(N5,"calculateTextWidth");var I5,O5=B4((e,t)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,a]=P5(n),o=["sans-serif",r],s=e.split(_G.lineBreakRegex),l=[],c=TK("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const u=c.append("svg");for(const e of o){let t=0;const n={width:0,height:0,lineHeight:0};for(const r of s){const o=T5();o.text=r||"​";const s=_5(u,o).style("font-size",a).style("font-weight",i).style("font-family",e),l=(s._groups||s)[0][0].getBBox();if(0===l.width&&0===l.height)throw new Error("svg element not in render tree");n.width=Math.round(Math.max(n.width,l.width)),t=Math.round(l.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}l.push(n)}u.remove();return l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),L5=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{JH(this,"InitIDGenerator")}},M5=JH(function(e){return I5=I5||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),I5.innerHTML=e,unescape(I5.textContent)},"entityDecode");function R5(e){return"str"in e}JH(R5,"isDetailedError");var D5=JH((e,t,n,r)=>{if(!r)return;const i=e.node()?.getBBox();i&&e.append("text").text(r).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-n).attr("class",t)},"insertTitle"),P5=JH(e=>{if("number"==typeof e)return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function $5(e,t){return n5({},e,t)}JH($5,"cleanAndMerge");var B5={assignWithDepth:gU,wrapLabel:C5,calculateTextHeight:A5,calculateTextWidth:N5,calculateTextDimensions:O5,cleanAndMerge:$5,detectInit:a5,detectDirective:o5,isSubstringInArray:l5,interpolateToCurve:c5,calcLabelPosition:f5,calcCardinalityPosition:y5,calcTerminalLabelPosition:v5,formatUrl:u5,getStylesFromArray:b5,generateId:w5,random:k5,runFunc:h5,entityDecode:M5,insertTitle:D5,parseFontSize:P5,InitIDGenerator:L5},F5=JH(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){const t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?"fl°°"+t+"¶ß":"fl°"+t+"¶ß"}),t},"encodeEntities"),z5=JH(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),j5=JH((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:""}${e}_${t}_${n}${i?`_${i}`:""}`,"getEdgeId");function H5(e){return e??null}function U5(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}JH(H5,"handleUndefinedAttr");var G5={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function q5(e){G5=e}var W5={exec:()=>null};function V5(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Y5.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Y5={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
    /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},X5=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,K5=/(?:[*+-]|\d{1,9}[.)])/,Q5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Z5=V5(Q5).replace(/bull/g,K5).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),J5=V5(Q5).replace(/bull/g,K5).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),e6=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,t6=/(?!\s*\])(?:\\.|[^\[\]\\])+/,n6=V5(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",t6).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),r6=V5(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,K5).getRegex(),i6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",a6=/|$))/,o6=V5("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",a6).replace("tag",i6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),s6=V5(e6).replace("hr",X5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",i6).getRegex(),l6={blockquote:V5(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",s6).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:n6,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:X5,html:o6,lheading:Z5,list:r6,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:s6,table:W5,text:/^[^\n]+/},c6=V5("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",X5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",i6).getRegex(),u6={...l6,lheading:J5,table:c6,paragraph:V5(e6).replace("hr",X5).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",c6).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",i6).getRegex()},h6={...l6,html:V5("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",a6).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:W5,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:V5(e6).replace("hr",X5).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Z5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},d6=/^( {2,}|\\)\n(?!\s*$)/,p6=/[\p{P}\p{S}]/u,f6=/[\s\p{P}\p{S}]/u,g6=/[^\s\p{P}\p{S}]/u,m6=V5(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,f6).getRegex(),y6=/(?!~)[\p{P}\p{S}]/u,v6=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,b6=V5(v6,"u").replace(/punct/g,p6).getRegex(),x6=V5(v6,"u").replace(/punct/g,y6).getRegex(),w6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",E6=V5(w6,"gu").replace(/notPunctSpace/g,g6).replace(/punctSpace/g,f6).replace(/punct/g,p6).getRegex(),k6=V5(w6,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,y6).getRegex(),T6=V5("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,g6).replace(/punctSpace/g,f6).replace(/punct/g,p6).getRegex(),_6=V5(/\\(punct)/,"gu").replace(/punct/g,p6).getRegex(),C6=V5(/^<(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(),S6=V5(a6).replace("(?:--\x3e|$)","--\x3e").getRegex(),A6=V5("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",S6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),N6=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,I6=V5(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",N6).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O6=V5(/^!?\[(label)\]\[(ref)\]/).replace("label",N6).replace("ref",t6).getRegex(),L6=V5(/^!?\[(ref)\](?:\[\])?/).replace("ref",t6).getRegex(),M6={_backpedal:W5,anyPunctuation:_6,autolink:C6,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:d6,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:W5,emStrongLDelim:b6,emStrongRDelimAst:E6,emStrongRDelimUnd:T6,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:I6,nolink:L6,punctuation:m6,reflink:O6,reflinkSearch:V5("reflink|nolink(?!\\()","g").replace("reflink",O6).replace("nolink",L6).getRegex(),tag:A6,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},z6=e=>F6[e];function j6(e,t){if(t){if(Y5.escapeTest.test(e))return e.replace(Y5.escapeReplace,z6)}else if(Y5.escapeTestNoEncode.test(e))return e.replace(Y5.escapeReplaceNoEncode,z6);return e}function H6(e){try{e=encodeURI(e).replace(Y5.percentDecode,"%")}catch{return null}return e}function U6(e,t){const n=e.replace(Y5.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}),r=n.split(Y5.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:G6(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const i=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=i.length?e.slice(i.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=G6(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:G6(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=G6(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const a=[];let o;for(o=0;o1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const a=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let n=!1,r="",s="";if(!(t=a.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!l.trim(),h=0;if(this.options.pedantic?(h=2,s=l.trimStart()):u?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,s=l.slice(h),h+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),a=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h);for(;e;){const d=e.split("\n",1)[0];let p;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(a.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=h||!c.trim())s+="\n"+p.slice(h);else{if(u)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(a.test(l))break;if(n.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),r+=d+"\n",e=e.substring(d.length+1),l=p.slice(h)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let d,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(d="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!p,checked:d,loose:!1,text:s,tokens:[]}),i.raw+=r}const s=i.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));i.loose=n}if(i.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=G6(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),q6(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return q6(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let i,a,o=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},V6=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G5,this.options.tokenizer=this.options.tokenizer||new W6,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:Y5,block:$6.normal,inline:B6.normal};this.options.pedantic?(t.block=$6.pedantic,t.inline=B6.pedantic):this.options.gfm&&(t.block=$6.gfm,this.options.breaks?t.inline=B6.breaks:t.inline=B6.gfm),this.tokenizer.rules=t}static get rules(){return{block:$6,inline:B6}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Y5.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const a=t.at(-1);n&&"paragraph"===a?.type?(a.raw+="\n"+r.raw,a.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){let r;if(i||(a=""),i=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(a=r.raw.slice(-1)),i=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Y6=class{options;parser;constructor(e){this.options=e||G5}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(Y5.notSpaceStart)?.[0],i=e.replace(Y5.endingNewline,"")+"\n";return r?'
    '+(n?i:j6(i,!0))+"
    \n":"
    "+(n?i:j6(i,!0))+"
    \n"}blockquote({tokens:e}){return`
    \n${this.parser.parse(e)}
    \n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
    \n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+j6(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${j6(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=H6(e);if(null===i)return r;let a='
    ",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=H6(e);if(null===i)return j6(n);let a=`${n}{const i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Y6(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new W6(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Q6;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,i=e.hooks[r],a=t[r];Q6.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));const n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return V6.lex(e,t??this.defaults)}parser(e,t){return K6.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const o=i.hooks?i.hooks.provideLexer():e?V6.lex:V6.lexInline,s=i.hooks?i.hooks.provideParser():e?K6.parse:K6.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+j6(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function J6(e,t){return Z6.parse(e,t)}function e7(e){for(var t=[],n=1;n/g,"\n").replace(/\n{2,}/g,"\n"));return!1===t?n.replace(/ /g," "):n}function n7(e,t={}){const n=t7(e,t),r=J6.lexer(n),i=[[]];let a=0;function o(e,t="normal"){if("text"===e.type){e.text.split("\n").forEach((e,n)=>{0!==n&&(a++,i.push([])),e.split(" ").forEach(e=>{(e=e.replace(/'/g,"'"))&&i[a].push({content:e,type:t})})})}else"strong"===e.type||"em"===e.type?e.tokens.forEach(t=>{o(t,e.type)}):"html"===e.type&&i[a].push({content:e.text,type:"normal"})}return JH(o,"processNode"),r.forEach(e=>{"paragraph"===e.type?e.tokens?.forEach(e=>{o(e)}):"html"===e.type&&i[a].push({content:e.text,type:"normal"})}),i}function r7(e,{markdownAutoWrap:t}={}){const n=J6.lexer(e);function r(e){return"text"===e.type?!1===t?e.text.replace(/\n */g,"
    ").replace(/ /g," "):e.text.replace(/\n */g,"
    "):"strong"===e.type?`${e.tokens?.map(r).join("")}`:"em"===e.type?`${e.tokens?.map(r).join("")}`:"paragraph"===e.type?`

    ${e.tokens?.map(r).join("")}

    `:"space"===e.type?"":"html"===e.type?`${e.text}`:"escape"===e.type?e.text:`Unsupported markdown: ${e.type}`}return JH(r,"output"),n.map(r).join("")}function i7(e){return Intl.Segmenter?[...(new Intl.Segmenter).segment(e)].map(e=>e.segment):[...e]}function a7(e,t){return o7(e,[],i7(t.content),t.type)}function o7(e,t,n,r){if(0===n.length)return[{content:t.join(""),type:r},{content:"",type:r}];const[i,...a]=n,o=[...t,i];return e([{content:o.join(""),type:r}])?o7(e,o,a,r):(0===t.length&&i&&(t.push(i),n.shift()),[{content:t.join(""),type:r},{content:n.join(""),type:r}])}function s7(e,t){if(e.some(({content:e})=>e.includes("\n")))throw new Error("splitLineToFitWidth does not support newlines in the line");return l7(e,t)}function l7(e,t,n=[],r=[]){if(0===e.length)return r.length>0&&n.push(r),n.length>0?n:[];let i="";" "===e[0].content&&(i=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},o=[...r];if(""!==i&&o.push({content:i,type:"normal"}),o.push(a),t(o))return l7(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){const[r,i]=a7(t,a);n.push([r]),i.content&&e.unshift(i)}return l7(e,t,n)}function c7(e,t){t&&e.attr("style",t)}async function u7(e,t,n,r,i=!1){const a=e.append("foreignObject");a.attr("width",10*n+"px"),a.attr("height",10*n+"px");const o=a.append("xhtml:div");let s=t.label;t.label&&EG(t.label)&&(s=await TG(t.label.replace(_G.lineBreakRegex,"\n"),YG()));const l=t.isNode?"nodeLabel":"edgeLabel",c=o.append("span");c.html(s),c7(c,t.labelStyle),c.attr("class",`${l} ${r}`),c7(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",n+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let u=o.node().getBoundingClientRect();return u.width===n&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",n+"px"),u=o.node().getBoundingClientRect()),a.node()}function h7(e,t,n){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*n-.1+"em").attr("dy",n+"em")}function d7(e,t,n){const r=e.append("text"),i=h7(r,1,t);g7(i,n);const a=i.node().getComputedTextLength();return r.remove(),a}function p7(e,t,n){const r=e.append("text"),i=h7(r,1,t);g7(i,[{content:n,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}function f7(e,t,n,r=!1){const i=t.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");let s=0;for(const t of n){const n=JH(t=>d7(i,1.1,t)<=e,"checkWidth"),r=n(t)?[t]:s7(t,n);for(const e of r){g7(h7(o,s,1.1),e),s++}}if(r){const e=o.node().getBBox(),t=2;return a.attr("x",e.x-t).attr("y",e.y-t).attr("width",e.width+2*t).attr("height",e.height+2*t),i.node()}return o.node()}function g7(e,t){e.text(""),t.forEach((t,n)=>{const r=e.append("tspan").attr("font-style","em"===t.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===t.type?"bold":"normal");0===n?r.text(t.content):r.text(" "+t.content)})}function m7(e){return e.replace(/fa[bklrs]?:fa-[\w-]+/g,e=>``)}J6.options=J6.setOptions=function(e){return Z6.setOptions(e),J6.defaults=Z6.defaults,q5(J6.defaults),J6},J6.getDefaults=U5,J6.defaults=G5,J6.use=function(...e){return Z6.use(...e),J6.defaults=Z6.defaults,q5(J6.defaults),J6},J6.walkTokens=function(e,t){return Z6.walkTokens(e,t)},J6.parseInline=Z6.parseInline,J6.Parser=K6,J6.parser=K6.parse,J6.Renderer=Y6,J6.TextRenderer=X6,J6.Lexer=V6,J6.lexer=V6.lex,J6.Tokenizer=W6,J6.Hooks=Q6,J6.parse=J6,J6.options,J6.setOptions,J6.use,J6.walkTokens,J6.parseInline,K6.parse,V6.lex,JH(t7,"preprocessMarkdown"),JH(n7,"markdownToLines"),JH(r7,"markdownToHTML"),JH(i7,"splitTextToChars"),JH(a7,"splitWordToFitWidth"),JH(o7,"splitWordToFitWidthRecursion"),JH(s7,"splitLineToFitWidth"),JH(l7,"splitLineToFitWidthRecursion"),JH(c7,"applyStyle"),JH(u7,"addHtmlSpan"),JH(h7,"createTspan"),JH(d7,"computeWidthOfText"),JH(p7,"computeDimensionOfText"),JH(f7,"createFormattedText"),JH(g7,"updateTextContentAndStyles"),JH(m7,"replaceIconSubstring");var y7=JH(async(e,t="",{style:n="",isTitle:r=!1,classes:i="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:l=!1}={},c)=>{if(nU.debug("XYZ createText",t,n,r,i,a,o,"addSvgBackground: ",l),a){const r=r7(t,c),a=m7(z5(r)),u=t.replace(/\\\\/g,"\\"),h={isNode:o,label:EG(t)?u:a,labelStyle:n.replace("fill:","color:")};return await u7(e,h,s,i,l)}{const r=f7(s,e,n7(t.replace(//g,"
    ").replace("
    ","
    "),c),!!t&&l);if(o){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");TK(r).attr("style",e)}else{const e=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");TK(r).select("rect").attr("style",e.replace(/background:/g,"fill:"));const t=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");TK(r).select("text").attr("style",t)}return r}},"createText");function v7(e,t,n){if(e&&e.length){const[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(const t of e){const[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function b7(e,t){return e[0]===t[0]&&e[1]===t[1]}function x7(e,t,n,r=1){const i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&"number"==typeof e[0][0]?[e]:e,s=[0,0];if(i)for(const e of o)v7(e,s,i);const l=function(e,t,n){const r=[];for(const t of e){const e=[...t];b7(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}const i=[];t=Math.max(t,.1);const a=[];for(const e of r)for(let t=0;te.ymint.ymin?1:e.xt.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!a.length)return i;let o=[],s=a[0].ymin,l=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;ts);t++)e=t;a.splice(0,e+1).forEach(e=>{o.push({s:s,edge:e})})}if(o=o.filter(e=>!(e.edge.ymax<=s)),o.sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),(1!==n||l%t==0)&&o.length>1)for(let e=0;e=o.length)break;const n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach(e=>{e.edge.x=e.edge.x+n*e.edge.islope}),l++}return i}(o,a,r);if(i){for(const e of o)v7(e,s,-i);!function(e,t,n){const r=[];e.forEach(e=>r.push(...e)),v7(r,t,n)}(l,s,-i)}return l}function w7(e,t){var n;const r=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&((null===(n=t.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(a=i),x7(e,i,r,a||1)}class E7{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=w7(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}function k7(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class T7 extends E7{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=w7(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k7([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(a,t)}}}class _7 extends E7{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}let C7=class{constructor(e){this.helper=e}fillPolygons(e,t){const n=w7(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const a=r/4;for(const o of e){const e=k7(o),s=e/r,l=Math.ceil(s)-1,c=e-l*r,u=(o[0][0]+o[1][0])/2-r/4,h=Math.min(o[0][1],o[1][1]);for(let e=0;e{const a=k7(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e{const i=k7(e),a=Math.round(i/(2*t));let o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);const l=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;er%2?e+n:e+t);a.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":a.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":a.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":a.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":a.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],a.push({key:"T",data:[t,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=r,n=i}return a}function D7(e){const t=[];let n="",r=0,i=0,a=0,o=0,s=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,i]=u,[a,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],i=u[5],s=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,i]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,i]});break;case"V":i=u[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,a=0;"C"===n||"S"===n?(e=r+(r-s),a=i+(i-l)):(e=r,a=i),t.push({key:"C",data:[e,a,...u]}),s=u[0],l=u[1],r=u[2],i=u[3];break}case"T":{const[e,a]=u;let o=0,c=0;"Q"===n||"T"===n?(o=r+(r-s),c=i+(i-l)):(o=r,c=i);const h=r+2*(o-r)/3,d=i+2*(c-i)/3,p=e+2*(o-e)/3,f=a+2*(c-a)/3;t.push({key:"C",data:[h,d,p,f,e,a]}),s=o,l=c,r=e,i=a;break}case"Q":{const[e,n,a,o]=u,c=r+2*(e-r)/3,h=i+2*(n-i)/3,d=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:"C",data:[c,h,d,p,a,o]}),s=e,l=n,r=a,i=o;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],l=u[5],c=u[6];0===e||0===n?(t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c):r===l&&i===c||($7(r,i,l,c,e,n,a,o,s).forEach(function(e){t.push({key:"C",data:e})}),r=l,i=c);break}case"Z":t.push({key:"Z",data:[]}),r=a,i=o}n=c}return t}function P7(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function $7(e,t,n,r,i,a,o,s,l,c){const u=(h=o,Math.PI*h/180);var h;let d=[],p=0,f=0,g=0,m=0;if(c)[p,f,g,m]=c;else{[e,t]=P7(e,t,-u),[n,r]=P7(n,r,-u);const o=(e-n)/2,c=(t-r)/2;let h=o*o/(i*i)+c*c/(a*a);h>1&&(h=Math.sqrt(h),i*=h,a*=h);const d=i*i,y=a*a,v=d*y-d*c*c-y*o*o,b=d*c*c+y*o*o,x=(s===l?-1:1)*Math.sqrt(Math.abs(v/b));g=x*i*c/a+(e+n)/2,m=x*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-m)/a).toFixed(9))),f=Math.asin(parseFloat(((r-m)/a).toFixed(9))),ef&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let y=f-p;if(Math.abs(y)>120*Math.PI/180){const e=f,t=n,s=r;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=$7(n=g+i*Math.cos(f),r=m+a*Math.sin(f),t,s,i,a,o,0,l,[f,e,g,m])}y=f-p;const v=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),E=Math.tan(y/4),k=4/3*i*E,T=4/3*a*E,_=[e,t],C=[e+k*b,t-T*v],S=[n+k*w,r-T*x],A=[n,r];if(C[0]=2*_[0]-C[0],C[1]=2*_[1]-C[1],c)return[C,S,A].concat(d);{d=[C,S,A].concat(d);const e=[];for(let t=0;t2){const i=[];for(let t=0;t2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(f-p)/2),y=r8(m,c,u,h,d,p,f,1,l);if(!l.disableMultiStroke){const e=r8(m,c,u,h,d,p,f,1.5,l);y.push(...e)}return o&&(s?y.push(...Z7(c,u,c+h*Math.cos(p),u+d*Math.sin(p),l),...Z7(c,u,c+h*Math.cos(f),u+d*Math.sin(f),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(p),u+d*Math.sin(p)]})),{type:"path",ops:y}}function q7(e,t){const n=D7(R7(M7(e))),r=[];let i=[0,0],a=[0,0];for(const{key:e,data:o}of n)switch(e){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":r.push(...Z7(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case"C":{const[e,n,i,s,l,c]=o;r.push(...i8(e,n,i,s,l,c,a,t)),a=[l,c];break}case"Z":r.push(...Z7(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:r}}function W7(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+Q7(e,t),r[0][1]+Q7(e,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=l/10);const h=u/2,d=.2+.2*X7(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,f=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=Q7(p,i,c),f=Q7(f,i,c);const g=[],m=()=>Q7(h,i,c),y=()=>Q7(u,i,c),v=i.preserveVertices;return o?g.push({op:"move",data:[e+(v?0:m()),t+(v?0:m())]}):g.push({op:"move",data:[e+(v?0:Q7(u,i,c)),t+(v?0:Q7(u,i,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*d+m(),f+t+(r-t)*d+m(),p+e+2*(n-e)*d+m(),f+t+2*(r-t)*d+m(),n+(v?0:m()),r+(v?0:m())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*d+y(),f+t+(r-t)*d+y(),p+e+2*(n-e)*d+y(),f+t+2*(r-t)*d+y(),n+(v?0:y()),r+(v?0:y())]}),g}function e8(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+Q7(t,n),e[0][1]+Q7(t,n)]),r.push([e[0][0]+Q7(t,n),e[0][1]+Q7(t,n)]);for(let i=1;i3){const t=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&i.push(n)):i.push(n),i.push(e[t+3])}else{const r=.5,a=e[t+0],o=e[t+1],s=e[t+2],l=e[t+3],c=c8(a,o,r),u=c8(o,s,r),h=c8(s,l,r),d=c8(c,u,r),p=c8(u,h,r),f=c8(d,p,r);u8([a,c,d,f],0,n,i),u8([f,p,h,l],0,n,i)}var a,o;return i}function h8(e,t){return d8(e,0,e.length,t)}function d8(e,t,n,r,i){const a=i||[],o=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;rl&&(l=t,c=r)}return Math.sqrt(l)>r?(d8(e,t,c+1,r,a),d8(e,c,n,r,a)):(a.length||a.push(o),a.push(s)),a}function p8(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n0?d8(r,0,r.length,n):r}const f8="none";class g8{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const a=this._o(i);return this._d("line",[F7(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){const a=this._o(i),o=[],s=function(e,t,n,r,i){return function(e,t){return z7(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}(e,t,n,r,a);if(a.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===a.fillStyle?o.push(W7([i],a)):o.push(V7([i],a))}return a.stroke!==f8&&o.push(s),this._d("rectangle",o,a)}ellipse(e,t,n,r,i){const a=this._o(i),o=[],s=H7(n,r,a),l=U7(e,t,a,s);if(a.fill)if("solid"===a.fillStyle){const n=U7(e,t,a,s).opset;n.type="fillPath",o.push(n)}else o.push(V7([l.estimatedPoints],a));return a.stroke!==f8&&o.push(l.opset),this._d("ellipse",o,a)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[z7(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){const l=this._o(s),c=[],u=G7(e,t,n,r,i,a,o,!0,l);if(o&&l.fill)if("solid"===l.fillStyle){const o=Object.assign({},l);o.disableMultiStroke=!0;const s=G7(e,t,n,r,i,a,!0,!1,o);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,a,o){const s=e,l=t;let c=Math.abs(n/2),u=Math.abs(r/2);c+=Q7(.01*c,o),u+=Q7(.01*u,o);let h=i,d=a;for(;h<0;)h+=2*Math.PI,d+=2*Math.PI;d-h>2*Math.PI&&(h=0,d=2*Math.PI);const p=(d-h)/o.curveStepCount,f=[];for(let e=h;e<=d;e+=p)f.push([s+c*Math.cos(e),l+u*Math.sin(e)]);return f.push([s+c*Math.cos(d),l+u*Math.sin(d)]),f.push([s,l]),V7([f],o)}(e,t,n,r,i,a,l));return l.stroke!==f8&&c.push(u),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=j7(e,n);if(n.fill&&n.fill!==f8)if("solid"===n.fillStyle){const t=j7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(t.ops)})}else{const t=[],i=e;if(i.length){const e="number"==typeof i[0][0]?[i]:i;for(const r of e)r.length<3?t.push(...r):3===r.length?t.push(...p8(o8([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...p8(o8(r),10,(1+n.roughness)/2))}t.length&&r.push(V7([t],n))}return n.stroke!==f8&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=z7(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(W7([e],n)):r.push(V7([e],n))),n.stroke!==f8&&r.push(i),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==f8,a=n.stroke!==f8,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=D7(R7(M7(e))),i=[];let a=[],o=[0,0],s=[];const l=()=>{s.length>=4&&a.push(...p8(s,1)),s=[]},c=()=>{l(),a.length&&(i.push(a),a=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),o=[t[0],t[1]],a.push(o);break;case"L":l(),a.push([t[0],t[1]]);break;case"C":if(!s.length){const e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),a.push([o[0],o[1]])}if(c(),!n)return i;const u=[];for(const e of i){const t=h8(e,n);t.length&&u.push(t)}return u}(e,0,o?4-4*(n.simplification||1):(1+n.roughness)/2),l=q7(e,n);if(i)if("solid"===n.fillStyle)if(1===s.length){const t=q7(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:"fillPath",ops:this._mergedShape(t.ops)})}else r.push(W7(s,n));else r.push(V7(s,n));return a&&(o?s.forEach(e=>{r.push(z7(e,!1,n))}):r.push(l)),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map(e=>+e.toFixed(t)):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:f8};break;case"fillPath":t={d:this.opsToPath(e),stroke:f8,strokeWidth:0,fill:n.fill||f8};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||f8,strokeWidth:n,fill:f8}}_mergedShape(e){return e.filter((e,t)=>0===t||"move"!==e.op)}}const m8="http://www.w3.org/2000/svg";class y8{constructor(e,t){this.svg=e,this.gen=new g8(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(m8,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of t){let t=null;switch(o.type){case"path":t=r.createElementNS(m8,"path"),t.setAttribute("d",this.opsToPath(o,a)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(m8,"path"),t.setAttribute("d",this.opsToPath(o,a)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(m8,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){const a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){const a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){const l=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}var v8=(e,t)=>new y8(e,t),b8=JH(async(e,t,n)=>{let r;const i=t.useHtmlLabels||pG(YG()?.htmlLabels);r=n||"node default";const a=e.insert("g").attr("class",r).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",H5(t.labelStyle));let s;s=void 0===t.label?"":"string"==typeof t.label?t.label:t.label[0];const l=await y7(o,oG(z5(s),YG()),{useHtmlLabels:i,width:t.width||YG().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let c=l.getBBox();const u=(t?.padding??0)/2;if(i){const e=l.children[0],t=TK(l),n=e.getElementsByTagName("img");if(n){const e=""===s.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=YG().fontSize?YG().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[r=MU.fontSize]=P5(e),i=r*n+"px";t.style.minWidth=i,t.style.maxWidth=i}else t.style.width="100%";n(t)}JH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}return i?o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):o.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:c,halfPadding:u,label:o}},"labelHelper"),x8=JH(async(e,t,n)=>{const r=n.useHtmlLabels||pG(YG()?.flowchart?.htmlLabels),i=e.insert("g").attr("class","label").attr("style",n.labelStyle||""),a=await y7(i,oG(z5(t),YG()),{useHtmlLabels:r,width:n.width||YG()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img});let o=a.getBBox();const s=n.padding/2;if(pG(YG()?.flowchart?.htmlLabels)){const e=a.children[0],t=TK(a);o=e.getBoundingClientRect(),t.attr("width",o.width),t.attr("height",o.height)}return r?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),n.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:o,halfPadding:s,label:i}},"insertLabel"),w8=JH((e,t)=>{const n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),E8=JH((e,t)=>("handDrawn"===e.look?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function k8(e){const t=e.map((e,t)=>`${0===t?"M":"L"}${e.x},${e.y}`);return t.push("Z"),t.join(" ")}function T8(e,t,n,r,i,a){const o=[],s=n-e,l=r-t,c=s/a,u=2*Math.PI/c,h=t+l/2;for(let t=0;t<=50;t++){const n=e+t/50*s,r=h+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}function _8(e,t,n,r,i,a){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i{var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=0===s?0:c*o/s,r=c):(o<0&&(l=-l),n=l,r=0===o?0:l*s/o),{x:i+n,y:a+r}},"intersectRect"),S8=C8;function A8(e,t){t&&e.attr("style",t)}async function N8(e){const t=TK(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=t.append("xhtml:div");let r=e.label;e.label&&EG(e.label)&&(r=await TG(e.label.replace(_G.lineBreakRegex,"\n"),YG()));const i=e.isNode?"nodeLabel":"edgeLabel";return n.html('"+r+""),A8(n,e.labelStyle),n.style("display","inline-block"),n.style("padding-right","1px"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}JH(A8,"applyStyle"),JH(N8,"addHtmlLabel");var I8=JH(async(e,t,n,r)=>{let i=e||"";if("object"==typeof i&&(i=i[0]),pG(YG().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),nU.info("vertexText"+i);const e={isNode:r,label:z5(i).replace(/fa[blrs]?:fa-[\w-]+/g,e=>``),labelStyle:t?t.replace("fill:","color:"):t};return await N8(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",t.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const t of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)}return e}},"createLabel"),O8=I8,L8=JH((e,t,n,r,i)=>["M",e+i,t,"H",e+n-i,"A",i,i,0,0,1,e+n,t+i,"V",t+r-i,"A",i,i,0,0,1,e+n-i,t+r,"H",e+i,"A",i,i,0,0,1,e,t+r-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD"),M8=JH(e=>{const{handDrawnSeed:t}=YG();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),R8=JH(e=>{const t=D8([...e.cssCompiledStyles||[],...e.cssStyles||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),D8=JH(e=>{const t=new Map;return e.forEach(e=>{const[n,r]=e.split(":");t.set(n.trim(),r?.trim())}),t},"styles2Map"),P8=JH(e=>"color"===e||"font-size"===e||"font-family"===e||"font-weight"===e||"font-style"===e||"text-decoration"===e||"text-align"===e||"text-transform"===e||"line-height"===e||"letter-spacing"===e||"word-spacing"===e||"text-shadow"===e||"text-overflow"===e||"white-space"===e||"word-wrap"===e||"word-break"===e||"overflow-wrap"===e||"hyphens"===e,"isLabelStyle"),$8=JH(e=>{const{stylesArray:t}=R8(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{const t=e[0];P8(t)?n.push(e.join(":")+" !important"):(r.push(e.join(":")+" !important"),t.includes("stroke")&&i.push(e.join(":")+" !important"),"fill"===t&&a.push(e.join(":")+" !important"))}),{labelStyles:n.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),B8=JH((e,t)=>{const{themeVariables:n,handDrawnSeed:r}=YG(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:o}=R8(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:r,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},t)},"userNodeOverrides"),F8=JH(async(e,t)=>{nU.info("Creating subgraph rect for ",t.id,t);const n=YG(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:u}=$8(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=pG(n.flowchart.htmlLabels),p=h.insert("g").attr("class","cluster-label "),f=await y7(p,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0});let g=f.getBBox();if(pG(n.flowchart.htmlLabels)){const e=f.children[0],t=TK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,v=t.x-m/2,b=t.y-y/2;let x;if(nU.trace("Data ",t,JSON.stringify(t)),"handDrawn"===t.look){const e=v8(h),n=B8(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),r=e.path(L8(v,b,m,y,0),n);x=h.insert(()=>(nU.debug("Rough node insert CXC",r),r),":first-child"),x.select("path:nth-child(2)").attr("style",c.join(";")),x.select("path").attr("style",u.join(";").replace("fill","stroke"))}else x=h.insert("rect",":first-child"),x.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",v).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=lY(n);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){const e=p.select("span");e&&e.attr("style",s)}const E=x.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return S8(t,e)},{cluster:h,labelBBox:g}},"rect"),z8=JH((e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return S8(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},"noteGroup"),j8=JH(async(e,t)=>{const n=YG(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:l}=r,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),u=c.insert("g",":first-child"),h=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const p=h.node().appendChild(await O8(t.label,t.labelStyle,void 0,!0));let f=p.getBBox();if(pG(n.flowchart.htmlLabels)){const e=p.children[0],t=TK(p);f=e.getBoundingClientRect(),t.attr("width",f.width),t.attr("height",f.height)}const g=0*t.padding,m=g/2,y=(t.width<=f.width+t.padding?f.width+t.padding:t.width)+g;t.width<=f.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const v=t.height+g,b=t.height+g-f.height-6,x=t.x-y/2,w=t.y-v/2;t.width=y;const E=t.y-t.height/2-m+f.height+2;let k;if("handDrawn"===t.look){const e=t.cssClasses.includes("statediagram-cluster-alt"),n=v8(c),r=t.rx||t.ry?n.path(L8(x,w,y,v,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):n.rectangle(x,w,y,v,{seed:i});k=c.insert(()=>r,":first-child");const u=n.rectangle(x,E,y,b,{fill:e?a:o,fillStyle:e?"hachure":"solid",stroke:l,seed:i});k=c.insert(()=>r,":first-child"),d=c.insert(()=>u)}else{k=u.insert("rect",":first-child");const e="outer";k.attr("class",e).attr("x",x).attr("y",w).attr("width",y).attr("height",v).attr("data-look",t.look),d.attr("class","inner").attr("x",x).attr("y",E).attr("width",y).attr("height",b)}h.attr("transform",`translate(${t.x-f.width/2}, ${w+1-(pG(n.flowchart.htmlLabels)?0:3)})`);const T=k.node().getBBox();return t.height=T.height,t.offsetX=0,t.offsetY=f.height-t.padding/2,t.labelBBox=f,t.intersect=function(e){return S8(t,e)},{cluster:c,labelBBox:f}},"roundedWithTitle"),H8=JH(async(e,t)=>{nU.info("Creating subgraph rect for ",t.id,t);const n=YG(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:u}=$8(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),d=pG(n.flowchart.htmlLabels),p=h.insert("g").attr("class","cluster-label "),f=await y7(p,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width});let g=f.getBBox();if(pG(n.flowchart.htmlLabels)){const e=f.children[0],t=TK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,v=t.x-m/2,b=t.y-y/2;let x;if(nU.trace("Data ",t,JSON.stringify(t)),"handDrawn"===t.look){const e=v8(h),n=B8(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),r=e.path(L8(v,b,m,y,t.rx),n);x=h.insert(()=>(nU.debug("Rough node insert CXC",r),r),":first-child"),x.select("path:nth-child(2)").attr("style",c.join(";")),x.select("path").attr("style",u.join(";").replace("fill","stroke"))}else x=h.insert("rect",":first-child"),x.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",v).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=lY(n);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){const e=p.select("span");e&&e.attr("style",s)}const E=x.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return S8(t,e)},{cluster:h,labelBBox:g}},"kanbanSection"),U8=JH((e,t)=>{const n=YG(),{themeVariables:r,handDrawnSeed:i}=n,{nodeBorder:a}=r,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),s=o.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const u=t.height+l,h=t.x-c/2,d=t.y-u/2;let p;if(t.width=c,"handDrawn"===t.look){const e=v8(o).rectangle(h,d,c,u,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=o.insert(()=>e,":first-child")}else{p=s.insert("rect",":first-child");const e="divider";p.attr("class",e).attr("x",h).attr("y",d).attr("width",c).attr("height",u).attr("data-look",t.look)}const f=p.node().getBBox();return t.height=f.height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return S8(t,e)},{cluster:o,labelBBox:{}}},"divider"),G8={rect:F8,squareRect:F8,roundedWithTitle:j8,noteGroup:z8,divider:U8,kanbanSection:H8},q8=new Map,W8=JH(async(e,t)=>{const n=t.shape||"rect",r=await G8[n](e,t);return q8.set(t.id,r),r},"insertCluster"),V8=JH(()=>{q8=new Map},"clear");function Y8(e,t){return e.intersect(t)}JH(Y8,"intersectNode");var X8=Y8;function K8(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,l=Math.sqrt(t*t*s*s+n*n*o*o),c=Math.abs(t*n*o/l);r.x0}JH(e9,"intersectLine"),JH(t9,"sameSign");var n9=e9;function r9(e,t,n){let r=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof t.forEach?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let l=r-e.width/2-o,c=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,l=Math.sqrt(o*o+s*s);return ac,":first-child");return u.attr("class","anchor").attr("style",H5(o)),w8(t,u),t.intersect=function(e){return nU.info("Circle intersect",t,1,e),i9.circle(t,1,e)},a}function o9(e,t,n,r,i,a,o){const s=(e+n)/2,l=(t+r)/2,c=Math.atan2(r-t,n-e),u=(n-e)/2/i,h=(r-t)/2/a,d=Math.sqrt(u**2+h**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),f=s+p*a*Math.sin(c)*(o?-1:1),g=l-p*i*Math.cos(c)*(o?-1:1),m=Math.atan2((t-g)/a,(e-f)/i);let y=Math.atan2((r-g)/a,(n-f)/i)-m;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);const v=[];for(let e=0;e<20;e++){const t=m+e/19*y,n=f+i*Math.cos(t),r=g+a*Math.sin(t);v.push({x:n,y:r})}return v}async function s9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.width+t.padding+20,s=a.height+t.padding,l=s/2,c=l/(2.5+s/50),{cssStyles:u}=t,h=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...o9(-o/2,-s/2,-o/2,s/2,c,l,!1),{x:o/2,y:s/2},...o9(o/2,s/2,o/2,-s/2,c,l,!0)],d=v8(i),p=B8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=k8(h),g=d.path(f,p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${c/2}, 0)`),w8(t,m),t.intersect=function(e){return i9.polygon(t,h,e)},i}function l9(e,t,n,r){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+n/2+")")}async function c9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.height+t.padding,s=a.width+t.padding+12,l=-o,c=[{x:12,y:l},{x:s,y:l},{x:s,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let u;const{cssStyles:h}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=k8(c),a=e.path(r,n);u=i.insert(()=>a,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&u.attr("style",h)}else u=l9(i,s,o,c);return r&&u.attr("style",r),w8(t,u),t.intersect=function(e){return i9.polygon(t,c,e)},i}function u9(e,t){const{nodeStyles:n}=$8(t);t.label="";const r=e.insert("g").attr("class",E8(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=v8(r),l=B8(t,{});"handDrawn"!==t.look&&(l.roughness=0,l.fillStyle="solid");const c=k8(o),u=s.path(c,l),h=r.insert(()=>u,":first-child");return i&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",i),n&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",n),t.width=28,t.height=28,t.intersect=function(e){return i9.polygon(t,o,e)},r}async function h9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:o}=await b8(e,t,E8(t)),s=a.width/2+o;let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=e.circle(0,0,2*s,n);l=i.insert(()=>r,":first-child"),l.attr("class","basic label-container").attr("style",H5(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",r).attr("r",s).attr("cx",0).attr("cy",0);return w8(t,l),t.intersect=function(e){return nU.info("Circle intersect",t,s,e),i9.circle(t,s,e)},i}function d9(e){const t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=2*e;return`M ${-r/2*t},${r/2*n} L ${r/2*t},${-r/2*n}\n M ${r/2*t},${r/2*n} L ${-r/2*t},${-r/2*n}`}function p9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n,t.label="";const i=e.insert("g").attr("class",E8(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=v8(i),l=B8(t,{});"handDrawn"!==t.look&&(l.roughness=0,l.fillStyle="solid");const c=s.circle(0,0,2*a,l),u=d9(a),h=s.path(u,l),d=i.insert(()=>c,":first-child");return d.insert(()=>h),o&&"handDrawn"!==t.look&&d.selectAll("path").attr("style",o),r&&"handDrawn"!==t.look&&d.selectAll("path").attr("style",r),w8(t,d),t.intersect=function(e){nU.info("crossedCircle intersect",t,{radius:a,point:e});return i9.circle(t,a,e)},i}function f9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iv,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),u&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${c}, 0)`),o.attr("transform",`translate(${-s/2+c-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),w8(t,b),t.intersect=function(e){return i9.polygon(t,d,e)},i}function m9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iv,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),u&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(${-c}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),w8(t,b),t.intersect=function(e){return i9.polygon(t,d,e)},i}function v9(e,t,n,r=100,i=0,a=180){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;iw,":first-child").attr("stroke-opacity",0),E.insert(()=>y,":first-child"),E.insert(()=>b,":first-child"),E.attr("class","text"),u&&"handDrawn"!==t.look&&E.selectAll("path").attr("style",u),r&&"handDrawn"!==t.look&&E.selectAll("path").attr("style",r),E.attr("transform",`translate(${c-c/4}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)/2-(a.y-(a.top??0))})`),w8(t,E),t.intersect=function(e){return i9.polygon(t,p,e)},i}async function x9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(80,1.25*(a.width+2*(t.padding??0)),t?.width??0),s=Math.max(20,a.height+2*(t.padding??0),t?.height??0),l=s/2,{cssStyles:c}=t,u=v8(i),h=B8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=o-l,p=s/4,f=[{x:d,y:0},{x:p,y:0},{x:0,y:s/2},{x:p,y:s},{x:d,y:s},..._8(-d,-s/2,l,50,270,90)],g=k8(f),m=u.path(g,h),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",c),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(${-o/2}, ${-s/2})`),w8(t,y),t.intersect=function(e){return i9.polygon(t,f,e)},i}JH(a9,"anchor"),JH(o9,"generateArcPoints"),JH(s9,"bowTieRect"),JH(l9,"insertPolygonShape"),JH(c9,"card"),JH(u9,"choice"),JH(h9,"circle"),JH(d9,"createLine"),JH(p9,"crossedCircle"),JH(f9,"generateCirclePoints"),JH(g9,"curlyBraceLeft"),JH(m9,"generateCirclePoints"),JH(y9,"curlyBraceRight"),JH(v9,"generateCirclePoints"),JH(b9,"curlyBraces"),JH(x9,"curvedTrapezoid");var w9=JH((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" "),"createCylinderPathD"),E9=JH((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r].join(" "),"createOuterCylinderPathD"),k9=JH((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createInnerCylinderPathD");async function T9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+t.padding,t.width??0),l=s/2,c=l/(2.5+s/50),u=Math.max(a.height+c+t.padding,t.height??0);let h;const{cssStyles:d}=t;if("handDrawn"===t.look){const e=v8(i),n=E9(0,0,s,u,l,c),r=k9(0,c,s,u,l,c),a=e.path(n,B8(t,{})),o=e.path(r,B8(t,{fill:"none"}));h=i.insert(()=>o,":first-child"),h=i.insert(()=>a,":first-child"),h.attr("class","basic label-container"),d&&h.attr("style",d)}else{const e=w9(0,0,s,u,l,c);h=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",H5(d)).attr("style",r)}return h.attr("label-offset-y",c),h.attr("transform",`translate(${-s/2}, ${-(u/2+c)})`),w8(t,h),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(e){const n=i9.rect(t,e),r=n.x-(t.x??0);if(0!=l&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}async function _9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=a.width+t.padding,l=a.height+t.padding,c=.2*l,u=-s/2,h=-l/2-c/2,{cssStyles:d}=t,p=v8(i),f=B8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=[{x:u,y:h+c},{x:-u,y:h+c},{x:-u,y:-h},{x:u,y:-h},{x:u,y:h},{x:-u,y:h},{x:-u,y:h+c}],m=p.polygon(g.map(e=>[e.x,e.y]),f),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",d),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${u+(t.padding??0)/2-(a.x-(a.left??0))}, ${h+c+(t.padding??0)/2-(a.y-(a.top??0))})`),w8(t,y),t.intersect=function(e){return i9.rect(t,e)},i}async function C9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,halfPadding:o}=await b8(e,t,E8(t)),s=a.width/2+o+5,l=a.width/2+o;let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{roughness:.2,strokeWidth:2.5}),r=B8(t,{roughness:.2,strokeWidth:1.5}),a=e.circle(0,0,2*s,n),o=e.circle(0,0,2*l,r);c=i.insert("g",":first-child"),c.attr("class",H5(t.cssClasses)).attr("style",H5(u)),c.node()?.appendChild(a),c.node()?.appendChild(o)}else{c=i.insert("g",":first-child");const e=c.insert("circle",":first-child"),t=c.insert("circle");c.attr("class","basic label-container").attr("style",r),e.attr("class","outer-circle").attr("style",r).attr("r",s).attr("cx",0).attr("cy",0),t.attr("class","inner-circle").attr("style",r).attr("r",l).attr("cx",0).attr("cy",0)}return w8(t,c),t.intersect=function(e){return nU.info("DoubleCircle intersect",t,s,e),i9.circle(t,s,e)},i}function S9(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=$8(t);t.label="",t.labelStyle=r;const a=e.insert("g").attr("class",E8(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=v8(a),{nodeBorder:l}=n,c=B8(t,{fillStyle:"solid"});"handDrawn"!==t.look&&(c.roughness=0);const u=s.circle(0,0,14,c),h=a.insert(()=>u,":first-child");return h.selectAll("path").attr("style",`fill: ${l} !important;`),o&&o.length>0&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",o),i&&"handDrawn"!==t.look&&h.selectAll("path").attr("style",i),w8(t,h),t.intersect=function(e){nU.info("filledCircle intersect",t,{radius:7,point:e});return i9.circle(t,7,e)},a}async function A9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=a.width+(t.padding??0),l=s+a.height,c=s+a.height,u=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:h}=t,d=v8(i),p=B8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=k8(u),g=d.path(f,p),m=i.insert(()=>g,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return h&&"handDrawn"!==t.look&&m.selectChildren("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectChildren("path").attr("style",r),t.width=s,t.height=l,w8(t,m),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(e){return nU.info("Triangle intersect",t,u,e),i9.polygon(t,u,e)},i}function N9(e,t,{dir:n,config:{state:r,themeVariables:i}}){const{nodeStyles:a}=$8(t);t.label="";const o=e.insert("g").attr("class",E8(t)).attr("id",t.domId??t.id),{cssStyles:s}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);"LR"===n&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const u=-1*l/2,h=-1*c/2,d=v8(o),p=B8(t,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=d.rectangle(u,h,l,c,p),g=o.insert(()=>f,":first-child");s&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",s),a&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",a),w8(t,g);const m=r?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(e){return i9.rect(t,e)},o}async function I9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(80,a.width+2*(t.padding??0),t?.width??0),s=Math.max(50,a.height+2*(t.padding??0),t?.height??0),l=s/2,{cssStyles:c}=t,u=v8(i),h=B8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=[{x:-o/2,y:-s/2},{x:o/2-l,y:-s/2},..._8(-o/2+l,0,l,50,90,270),{x:o/2-l,y:s/2},{x:-o/2,y:s/2}],p=k8(d),f=u.path(p,h),g=i.insert(()=>f,":first-child");return g.attr("class","basic label-container"),c&&"handDrawn"!==t.look&&g.selectChildren("path").attr("style",c),r&&"handDrawn"!==t.look&&g.selectChildren("path").attr("style",r),w8(t,g),t.intersect=function(e){nU.info("Pill intersect",t,{radius:l,point:e});return i9.polygon(t,d,e)},i}JH(T9,"cylinder"),JH(_9,"dividedRectangle"),JH(C9,"doublecircle"),JH(S9,"filledCircle"),JH(A9,"flippedTriangle"),JH(N9,"forkJoin"),JH(I9,"halfRoundedRectangle");var O9=JH((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createHexagonPathD");async function L9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.height+t.padding,s=o/4,l=a.width+2*s+t.padding,c=[{x:s,y:0},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:s,y:-o},{x:0,y:-o/2}];let u;const{cssStyles:h}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=O9(0,0,l,o,s),a=e.path(r,n);u=i.insert(()=>a,":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),h&&u.attr("style",h)}else u=l9(i,l,o,c);return r&&u.attr("style",r),t.width=l,t.height=o,w8(t,u),t.intersect=function(e){return i9.polygon(t,c,e)},i}async function M9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.label="",t.labelStyle=n;const{shapeSvg:i}=await b8(e,t,E8(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,l=v8(i),c=B8(t,{});"handDrawn"!==t.look&&(c.roughness=0,c.fillStyle="solid");const u=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],h=k8(u),d=l.path(h,c),p=i.insert(()=>d,":first-child");return p.attr("class","basic label-container"),s&&"handDrawn"!==t.look&&p.selectChildren("path").attr("style",s),r&&"handDrawn"!==t.look&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-a/2}, ${-o/2})`),w8(t,p),t.intersect=function(e){nU.info("Pill intersect",t,{points:u});return i9.polygon(t,u,e)},i}async function R9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=$8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,label:h}=await b8(e,t,"icon-shape default"),d="t"===t.pos,p=s,f=s,{nodeBorder:g}=n,{stylesMap:m}=R8(t),y=-f/2,v=-p/2,b=t.label?8:0,x=v8(c),w=B8(t,{stroke:"none",fill:"none"});"handDrawn"!==t.look&&(w.roughness=0,w.fillStyle="solid");const E=x.rectangle(y,v,f,p,w),k=Math.max(f,u.width),T=p+u.height+b,_=x.rectangle(-k/2,-T/2,k,T,{...w,fill:"transparent",stroke:"none"}),C=c.insert(()=>E,":first-child"),S=c.insert(()=>_);if(t.icon){const e=c.append("g");e.html(`${await IY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${d?u.height/2+b/2-i/2-o:-u.height/2-b/2-i/2-o})`),e.attr("style",`color: ${m.get("stroke")??g};`)}return h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${d?-T/2:T/2-u.height})`),C.attr("transform",`translate(0,${d?u.height/2+b/2:-u.height/2-b/2})`),w8(t,S),t.intersect=function(e){if(nU.info("iconSquare intersect",t,e),!t.label)return i9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=d?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+b},{x:n+f/2,y:r-i/2+u.height+b},{x:n+f/2,y:r+i/2},{x:n-f/2,y:r+i/2},{x:n-f/2,y:r-i/2+u.height+b},{x:n-u.width/2,y:r-i/2+u.height+b}]:[{x:n-f/2,y:r-i/2},{x:n+f/2,y:r-i/2},{x:n+f/2,y:r-i/2+p},{x:n+u.width/2,y:r-i/2+p},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+p},{x:n-f/2,y:r-i/2+p}];return i9.polygon(t,a,e)},c}async function D9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=$8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,label:h}=await b8(e,t,"icon-shape default"),d=t.label?8:0,p="t"===t.pos,{nodeBorder:f,mainBkg:g}=n,{stylesMap:m}=R8(t),y=v8(c),v=B8(t,{});"handDrawn"!==t.look&&(v.roughness=0,v.fillStyle="solid");const b=m.get("fill");v.stroke=b??g;const x=c.append("g");t.icon&&x.html(`${await IY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const w=x.node().getBBox(),E=w.width,k=w.height,T=w.x,_=w.y,C=Math.max(E,k)*Math.SQRT2+40,S=y.circle(0,0,C,v),A=Math.max(C,u.width),N=C+u.height+d,I=y.rectangle(-A/2,-N/2,A,N,{...v,fill:"transparent",stroke:"none"}),O=c.insert(()=>S,":first-child"),L=c.insert(()=>I);return x.attr("transform",`translate(${-E/2-T},${p?u.height/2+d/2-k/2-_:-u.height/2-d/2-k/2-_})`),x.attr("style",`color: ${m.get("stroke")??f};`),h.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-N/2:N/2-u.height})`),O.attr("transform",`translate(0,${p?u.height/2+d/2:-u.height/2-d/2})`),w8(t,L),t.intersect=function(e){nU.info("iconSquare intersect",t,e);return i9.rect(t,e)},c}async function P9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=$8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:d}=await b8(e,t,"icon-shape default"),p="t"===t.pos,f=s+2*h,g=s+2*h,{nodeBorder:m,mainBkg:y}=n,{stylesMap:v}=R8(t),b=-g/2,x=-f/2,w=t.label?8:0,E=v8(c),k=B8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=v.get("fill");k.stroke=T??y;const _=E.path(L8(b,x,g,f,5),k),C=Math.max(g,u.width),S=f+u.height+w,A=E.rectangle(-C/2,-S/2,C,S,{...k,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child").attr("class","icon-shape2"),I=c.insert(()=>A);if(t.icon){const e=c.append("g");e.html(`${await IY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${p?u.height/2+w/2-i/2-o:-u.height/2-w/2-i/2-o})`),e.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-S/2:S/2-u.height})`),N.attr("transform",`translate(0,${p?u.height/2+w/2:-u.height/2-w/2})`),w8(t,I),t.intersect=function(e){if(nU.info("iconSquare intersect",t,e),!t.label)return i9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+w},{x:n+g/2,y:r-i/2+u.height+w},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+u.height+w},{x:n-u.width/2,y:r-i/2+u.height+w}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+f},{x:n+u.width/2,y:r-i/2+f},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+f},{x:n-g/2,y:r-i/2+f}];return i9.polygon(t,a,e)},c}async function $9(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=$8(t);t.labelStyle=i;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:u,halfPadding:h,label:d}=await b8(e,t,"icon-shape default"),p="t"===t.pos,f=s+2*h,g=s+2*h,{nodeBorder:m,mainBkg:y}=n,{stylesMap:v}=R8(t),b=-g/2,x=-f/2,w=t.label?8:0,E=v8(c),k=B8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=v.get("fill");k.stroke=T??y;const _=E.path(L8(b,x,g,f,.1),k),C=Math.max(g,u.width),S=f+u.height+w,A=E.rectangle(-C/2,-S/2,C,S,{...k,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child"),I=c.insert(()=>A);if(t.icon){const e=c.append("g");e.html(`${await IY(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr("transform",`translate(${-r/2-a},${p?u.height/2+w/2-i/2-o:-u.height/2-w/2-i/2-o})`),e.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-S/2:S/2-u.height})`),N.attr("transform",`translate(0,${p?u.height/2+w/2:-u.height/2-w/2})`),w8(t,I),t.intersect=function(e){if(nU.info("iconSquare intersect",t,e),!t.label)return i9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+w},{x:n+g/2,y:r-i/2+u.height+w},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+u.height+w},{x:n-u.width/2,y:r-i/2+u.height+w}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+f},{x:n+u.width/2,y:r-i/2+f},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+f},{x:n-g/2,y:r-i/2+f}];return i9.polygon(t,a,e)},c}async function B9(e,t,{config:{flowchart:n}}){const r=new Image;r.src=t?.img??"",await r.decode();const i=Number(r.naturalWidth.toString().replace("px","")),a=Number(r.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;const{labelStyles:o}=$8(t);t.labelStyle=o;const s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;const l=Math.max(t.label?s??0:0,t?.assetWidth??i),c="on"===t.constraint&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,u="on"===t.constraint?c/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(c,s??0);const{shapeSvg:h,bbox:d,label:p}=await b8(e,t,"image-shape default"),f="t"===t.pos,g=-c/2,m=-u/2,y=t.label?8:0,v=v8(h),b=B8(t,{});"handDrawn"!==t.look&&(b.roughness=0,b.fillStyle="solid");const x=v.rectangle(g,m,c,u,b),w=Math.max(c,d.width),E=u+d.height+y,k=v.rectangle(-w/2,-E/2,w,E,{...b,fill:"none",stroke:"none"}),T=h.insert(()=>x,":first-child"),_=h.insert(()=>k);if(t.img){const e=h.append("image");e.attr("href",t.img),e.attr("width",c),e.attr("height",u),e.attr("preserveAspectRatio","none"),e.attr("transform",`translate(${-c/2},${f?E/2-u:-E/2})`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${f?-u/2-d.height/2-y/2:u/2-d.height/2+y/2})`),T.attr("transform",`translate(0,${f?d.height/2+y/2:-d.height/2-y/2})`),w8(t,_),t.intersect=function(e){if(nU.info("iconSquare intersect",t,e),!t.label)return i9.rect(t,e);const n=t.x??0,r=t.y??0,i=t.height??0;let a=[];a=f?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+y},{x:n+c/2,y:r-i/2+d.height+y},{x:n+c/2,y:r+i/2},{x:n-c/2,y:r+i/2},{x:n-c/2,y:r-i/2+d.height+y},{x:n-d.width/2,y:r-i/2+d.height+y}]:[{x:n-c/2,y:r-i/2},{x:n+c/2,y:r-i/2},{x:n+c/2,y:r-i/2+u},{x:n+d.width/2,y:r-i/2+u},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+u},{x:n-c/2,y:r-i/2+u}];return i9.polygon(t,a,e)},h}async function F9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=k8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=l9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,w8(t,c),t.intersect=function(e){return i9.polygon(t,l,e)},i}async function z9(e,t,n){const{labelStyles:r,nodeStyles:i}=$8(t);t.labelStyle=r;const{shapeSvg:a,bbox:o}=await b8(e,t,E8(t)),s=Math.max(o.width+2*n.labelPaddingX,t?.width||0),l=Math.max(o.height+2*n.labelPaddingY,t?.height||0),c=-s/2,u=-l/2;let h,{rx:d,ry:p}=t;const{cssStyles:f}=t;if(n?.rx&&n.ry&&(d=n.rx,p=n.ry),"handDrawn"===t.look){const e=v8(a),n=B8(t,{}),r=d||p?e.path(L8(c,u,s,l,d||0),n):e.rectangle(c,u,s,l,n);h=a.insert(()=>r,":first-child"),h.attr("class","basic label-container").attr("style",H5(f))}else h=a.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",H5(d)).attr("ry",H5(p)).attr("x",c).attr("y",u).attr("width",s).attr("height",l);return w8(t,h),t.intersect=function(e){return i9.rect(t,e)},a}async function j9(e,t){const{shapeSvg:n,bbox:r,label:i}=await b8(e,t,"label"),a=n.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),n.attr("class","label edgeLabel"),i.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-r.height/2-(r.y-(r.top??0))})`),w8(t,a),t.intersect=function(e){return i9.rect(t,e)},n}async function H9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),l=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-3*s/6,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=k8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=l9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,w8(t,c),t.intersect=function(e){return i9.polygon(t,l,e)},i}async function U9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),l=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=k8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=l9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,w8(t,c),t.intersect=function(e){return i9.polygon(t,l,e)},i}function G9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.label="",t.labelStyle=n;const i=e.insert("g").attr("class",E8(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),l=[{x:o,y:0},{x:0,y:s+3.5},{x:o-14,y:s+3.5},{x:0,y:2*s},{x:o,y:s-3.5},{x:14,y:s-3.5}],c=v8(i),u=B8(t,{});"handDrawn"!==t.look&&(u.roughness=0,u.fillStyle="solid");const h=k8(l),d=c.path(h,u),p=i.insert(()=>d,":first-child");return a&&"handDrawn"!==t.look&&p.selectAll("path").attr("style",a),r&&"handDrawn"!==t.look&&p.selectAll("path").attr("style",r),p.attr("transform",`translate(-${o/2},${-s})`),w8(t,p),t.intersect=function(e){nU.info("lightningBolt intersect",t,e);return i9.polygon(t,l,e)},i}JH(L9,"hexagon"),JH(M9,"hourglass"),JH(R9,"icon"),JH(D9,"iconCircle"),JH(P9,"iconRounded"),JH($9,"iconSquare"),JH(B9,"imageSquare"),JH(F9,"inv_trapezoid"),JH(z9,"drawRect"),JH(j9,"labelRect"),JH(H9,"lean_left"),JH(U9,"lean_right"),JH(G9,"lightningBolt");var q9=JH((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createCylinderPathD"),W9=JH((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,"l0,"+-r,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createOuterCylinderPathD"),V9=JH((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(" "),"createInnerCylinderPathD");async function Y9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+(t.padding??0),t.width??0),l=s/2,c=l/(2.5+s/50),u=Math.max(a.height+c+(t.padding??0),t.height??0),h=.1*u;let d;const{cssStyles:p}=t;if("handDrawn"===t.look){const e=v8(i),n=W9(0,0,s,u,l,c,h),r=V9(0,c,s,u,l,c),a=B8(t,{}),o=e.path(n,a),f=e.path(r,a);i.insert(()=>f,":first-child").attr("class","line"),d=i.insert(()=>o,":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{const e=q9(0,0,s,u,l,c,h);d=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",H5(p)).attr("style",r)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-s/2}, ${-(u/2+c)})`),w8(t,d),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+c-(a.y-(a.top??0))})`),t.intersect=function(e){const n=i9.rect(t,e),r=n.x-(t.x??0);if(0!=l&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-c)){let i=c*c*(1-r*r/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}async function X9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=l+c,{cssStyles:h}=t,d=v8(i),p=B8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=[{x:-s/2-s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:u/2},...T8(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,c,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2},{x:-s/2,y:-u/2},{x:-s/2,y:u/2*1.1},{x:-s/2,y:-u/2}],g=d.polygon(f.map(e=>[e.x,e.y]),p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),w8(t,m),t.intersect=function(e){return i9.polygon(t,f,e)},i}async function K9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=v8(i),p=B8(t,{}),f=[{x:c-5,y:u+5},{x:c-5,y:u+l+5},{x:c+s-5,y:u+l+5},{x:c+s-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u+l-5},{x:c+s+5,y:u+l-5},{x:c+s+5,y:u-5},{x:c+5,y:u-5},{x:c+5,y:u},{x:c,y:u},{x:c,y:u+5}],g=[{x:c,y:u+5},{x:c+s-5,y:u+5},{x:c+s-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u},{x:c,y:u}];"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const m=k8(f),y=d.path(m,p),v=k8(g),b=d.path(v,{...p,fill:"none"}),x=i.insert(()=>b,":first-child");return x.insert(()=>y,":first-child"),x.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&x.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&x.selectAll("path").attr("style",r),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),w8(t,x),t.intersect=function(e){return i9.polygon(t,f,e)},i}async function Q9(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=l+c,h=-s/2,d=-u/2,{cssStyles:p}=t,f=T8(h-5,d+u+5,h+s-5,d+u+5,c,.8),g=f?.[f.length-1],m=[{x:h-5,y:d+5},{x:h-5,y:d+u+5},...f,{x:h+s-5,y:g.y-5},{x:h+s,y:g.y-5},{x:h+s,y:g.y-10},{x:h+s+5,y:g.y-10},{x:h+s+5,y:d-5},{x:h+5,y:d-5},{x:h+5,y:d},{x:h,y:d},{x:h,y:d+5}],y=[{x:h,y:d+5},{x:h+s-5,y:d+5},{x:h+s-5,y:g.y-5},{x:h+s,y:g.y-5},{x:h+s,y:d},{x:h,y:d}],v=v8(i),b=B8(t,{});"handDrawn"!==t.look&&(b.roughness=0,b.fillStyle="solid");const x=k8(m),w=v.path(x,b),E=k8(y),k=v.path(E,b),T=i.insert(()=>w,":first-child");return T.insert(()=>k),T.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-c/2-(a.y-(a.top??0))})`),w8(t,T),t.intersect=function(e){return i9.polygon(t,m,e)},i}async function Z9(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=$8(t);t.labelStyle=r;t.useHtmlLabels||!1!==WU().flowchart?.htmlLabels||(t.centerLabel=!0);const{shapeSvg:a,bbox:o}=await b8(e,t,E8(t)),s=Math.max(o.width+2*(t.padding??0),t?.width??0),l=Math.max(o.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=v8(a),p=B8(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=d.rectangle(c,u,s,l,p),g=a.insert(()=>f,":first-child");return g.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",h),i&&"handDrawn"!==t.look&&g.selectAll("path").attr("style",i),w8(t,g),t.intersect=function(e){return i9.rect(t,e)},a}JH(Y9,"linedCylinder"),JH(X9,"linedWaveEdgedRect"),JH(K9,"multiRect"),JH(Q9,"multiWaveEdgedRectangle"),JH(Z9,"note");var J9=JH((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function eee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.width+t.padding+(a.height+t.padding),s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=J9(0,0,o),a=e.path(r,n);l=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${o/2})`),c&&l.attr("style",c)}else l=l9(i,o,o,s);return r&&l.attr("style",r),w8(t,l),t.intersect=function(e){return nU.debug("APA12 Intersect called SPLIT\npoint:",e,"\nnode:\n",t,"\nres:",i9.polygon(t,s,e)),i9.polygon(t,s,e)},i}async function tee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=-Math.max(a.width+(t.padding??0),t?.width??0)/2,l=-Math.max(a.height+(t.padding??0),t?.height??0)/2,c=l/2,u=[{x:s+c,y:l},{x:s,y:0},{x:s+c,y:-l},{x:-s,y:-l},{x:-s,y:l}],{cssStyles:h}=t,d=v8(i),p=B8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=k8(u),g=d.path(f,p),m=i.insert(()=>g,":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&m.selectAll("path").attr("style",r),m.attr("transform",`translate(${-c/2},0)`),o.attr("transform",`translate(${-c/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),w8(t,m),t.intersect=function(e){return i9.polygon(t,u,e)},i}async function nee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);let i;t.labelStyle=n,i=t.cssClasses?"node "+t.cssClasses:"node default";const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",r),l=t.description,c=t.label,u=s.node().appendChild(await O8(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(pG(YG()?.flowchart?.htmlLabels)){const e=u.children[0],t=TK(u);h=e.getBoundingClientRect(),t.attr("width",h.width),t.attr("height",h.height)}nU.info("Text 2",l);const d=l||[],p=u.getBBox(),f=s.node().appendChild(await O8(d.join?d.join("
    "):d,t.labelStyle,!0,!0)),g=f.children[0],m=TK(f);h=g.getBoundingClientRect(),m.attr("width",h.width),m.attr("height",h.height);const y=(t.padding||0)/2;TK(f).attr("transform","translate( "+(h.width>p.width?0:(p.width-h.width)/2)+", "+(p.height+y+5)+")"),TK(u).attr("transform","translate( "+(h.width(nU.debug("Rough node insert CXC",r),i),":first-child"),E=a.insert(()=>(nU.debug("Rough node insert CXC",r),r),":first-child")}else E=o.insert("rect",":first-child"),k=o.insert("line"),E.attr("class","outer title-state").attr("style",r).attr("x",-h.width/2-y).attr("y",-h.height/2-y).attr("width",h.width+(t.padding||0)).attr("height",h.height+(t.padding||0)),k.attr("class","divider").attr("x1",-h.width/2-y).attr("x2",h.width/2+y).attr("y1",-h.height/2-y+p.height+y).attr("y2",-h.height/2-y+p.height+y);return w8(t,E),t.intersect=function(e){return i9.rect(t,e)},a}async function ree(e,t){return z9(e,t,{rx:5,ry:5,labelPaddingX:1*(t?.padding||0),labelPaddingY:1*(t?.padding||0)})}async function iee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=t?.padding??0,l=Math.max(a.width+2*(t.padding??0),t?.width??0),c=Math.max(a.height+2*(t.padding??0),t?.height??0),u=-a.width/2-s,h=-a.height/2-s,{cssStyles:d}=t,p=v8(i),f=B8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=[{x:u,y:h},{x:u+l+8,y:h},{x:u+l+8,y:h+c},{x:u-8,y:h+c},{x:u-8,y:h},{x:u,y:h},{x:u,y:h+c}],m=p.polygon(g.map(e=>[e.x,e.y]),f),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container").attr("style",H5(d)),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),d&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${-l/2+4+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-(a.y-(a.top??0))})`),w8(t,y),t.intersect=function(e){return i9.rect(t,e)},i}async function aee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=v8(i),p=B8(t,{});"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const f=[{x:c,y:u},{x:c,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u-l/2}],g=k8(f),m=d.path(g,p),y=i.insert(()=>m,":first-child");return y.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",h),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),y.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-l/4+(t.padding??0)-(a.y-(a.top??0))})`),w8(t,y),t.intersect=function(e){return i9.polygon(t,f,e)},i}async function oee(e,t){return z9(e,t,{rx:0,ry:0,labelPaddingX:2*(t?.padding||0),labelPaddingY:1*(t?.padding||0)})}async function see(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.height+t.padding,s=a.width+o/4+t.padding;let l;const{cssStyles:c}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=L8(-s/2,-o/2,s,o,o/2),a=e.path(r,n);l=i.insert(()=>a,":first-child"),l.attr("class","basic label-container").attr("style",H5(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",r).attr("rx",o/2).attr("ry",o/2).attr("x",-s/2).attr("y",-o/2).attr("width",s).attr("height",o);return w8(t,l),t.intersect=function(e){return i9.rect(t,e)},i}async function lee(e,t){return z9(e,t,{rx:5,ry:5})}function cee(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=$8(t);t.labelStyle=r;const{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:l}=n,c=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),u=v8(c),h=B8(t,{});"handDrawn"!==t.look&&(h.roughness=0,h.fillStyle="solid");const d=u.circle(0,0,14,{...h,stroke:o,strokeWidth:2}),p=s??l,f=u.circle(0,0,5,{...h,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),g=c.insert(()=>d,":first-child");return g.insert(()=>f),a&&g.selectAll("path").attr("style",a),i&&g.selectAll("path").attr("style",i),w8(t,g),t.intersect=function(e){return i9.circle(t,7,e)},c}function uee(e,t,{config:{themeVariables:n}}){const{lineColor:r}=n,i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if("handDrawn"===t.look){const e=v8(i).circle(0,0,14,M8(r));a=i.insert(()=>e),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return w8(t,a),t.intersect=function(e){return i9.circle(t,7,e)},i}async function hee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=(t?.padding||0)/2,s=a.width+t.padding,l=a.height+t.padding,c=-a.width/2-o,u=-a.height/2-o,h=[{x:0,y:0},{x:s,y:0},{x:s,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=e.rectangle(c-8,u,s+16,l,n),a=e.line(c,u,c,u+l,n),o=e.line(c+s,u,c+s,u+l,n);i.insert(()=>a,":first-child"),i.insert(()=>o,":first-child");const h=i.insert(()=>r,":first-child"),{cssStyles:d}=t;h.attr("class","basic label-container").attr("style",H5(d)),w8(t,h)}else{const e=l9(i,s,l,h);r&&e.attr("style",r),w8(t,e)}return t.intersect=function(e){return i9.polygon(t,h,e)},i}async function dee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=-o/2,c=-s/2,u=.2*s,h=.2*s,{cssStyles:d}=t,p=v8(i),f=B8(t,{}),g=[{x:l-u/2,y:c},{x:l+o+u/2,y:c},{x:l+o+u/2,y:c+s},{x:l-u/2,y:c+s}],m=[{x:l+o-u/2,y:c+s},{x:l+o+u/2,y:c+s},{x:l+o+u/2,y:c+s-h}];"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const y=k8(g),v=p.path(y,f),b=k8(m),x=p.path(b,{...f,fillStyle:"solid"}),w=i.insert(()=>x,":first-child");return w.insert(()=>v,":first-child"),w.attr("class","basic label-container"),d&&"handDrawn"!==t.look&&w.selectAll("path").attr("style",d),r&&"handDrawn"!==t.look&&w.selectAll("path").attr("style",r),w8(t,w),t.intersect=function(e){return i9.polygon(t,g,e)},i}async function pee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/4,u=.2*s,h=.2*l,d=l+c,{cssStyles:p}=t,f=v8(i),g=B8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-s/2-s/2*.1,y:d/2},...T8(-s/2-s/2*.1,d/2,s/2+s/2*.1,d/2,c,.8),{x:s/2+s/2*.1,y:-d/2},{x:-s/2-s/2*.1,y:-d/2}],y=-s/2+s/2*.1,v=-d/2-.4*h,b=[{x:y+s-u,y:1.4*(v+l)},{x:y+s,y:v+l-h},{x:y+s,y:.9*(v+l)},...T8(y+s,1.3*(v+l),y+s-u,1.5*(v+l),.03*-l,.5)],x=k8(m),w=f.path(x,g),E=k8(b),k=f.path(E,{...g,fillStyle:"solid"}),T=i.insert(()=>k,":first-child");return T.insert(()=>w,":first-child"),T.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&T.selectAll("path").attr("style",r),T.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),w8(t,T),t.intersect=function(e){return i9.polygon(t,m,e)},i}async function fee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+t.padding,t?.width||0),s=Math.max(a.height+t.padding,t?.height||0),l=-o/2,c=-s/2,u=i.insert("rect",":first-child");return u.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",o).attr("height",s),w8(t,u),t.intersect=function(e){return i9.rect(t,e)},i}JH(eee,"question"),JH(tee,"rect_left_inv_arrow"),JH(nee,"rectWithTitle"),JH(ree,"roundedRect"),JH(iee,"shadedProcess"),JH(aee,"slopedRect"),JH(oee,"squareRect"),JH(see,"stadium"),JH(lee,"state"),JH(cee,"stateEnd"),JH(uee,"stateStart"),JH(hee,"subroutine"),JH(dee,"taggedRect"),JH(pee,"taggedWaveEdgedRectangle"),JH(fee,"text");var gee=JH((e,t,n,r,i,a)=>`M${e},${t}\n a${i},${a} 0,0,1 0,${-r}\n l${n},0\n a${i},${a} 0,0,1 0,${r}\n M${n},${-r}\n a${i},${a} 0,0,0 0,${r}\n l${-n},0`,"createCylinderPathD"),mee=JH((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(" "),"createOuterCylinderPathD"),yee=JH((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(" "),"createInnerCylinderPathD");async function vee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o,halfPadding:s}=await b8(e,t,E8(t)),l="neo"===t.look?2*s:s,c=a.height+l,u=c/2,h=u/(2.5+c/50),d=a.width+h+l,{cssStyles:p}=t;let f;if("handDrawn"===t.look){const e=v8(i),n=mee(0,0,d,c,h,u),r=yee(0,0,d,c,h,u),a=e.path(n,B8(t,{})),o=e.path(r,B8(t,{fill:"none"}));f=i.insert(()=>o,":first-child"),f=i.insert(()=>a,":first-child"),f.attr("class","basic label-container"),p&&f.attr("style",p)}else{const e=gee(0,0,d,c,h,u);f=i.insert("path",":first-child").attr("d",e).attr("class","basic label-container").attr("style",H5(p)).attr("style",r),f.attr("class","basic label-container"),p&&f.selectAll("path").attr("style",p),r&&f.selectAll("path").attr("style",r)}return f.attr("label-offset-x",h),f.attr("transform",`translate(${-d/2}, ${c/2} )`),o.attr("transform",`translate(${-a.width/2-h-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),w8(t,f),t.intersect=function(e){const n=i9.rect(t,e),r=n.y-(t.y??0);if(0!=u&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-h)){let i=h*h*(1-r*r/(u*u));0!=i&&(i=Math.sqrt(Math.abs(i))),i=h-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},i}async function bee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=a.width+t.padding,s=a.height+t.padding,l=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let c;const{cssStyles:u}=t;if("handDrawn"===t.look){const e=v8(i),n=B8(t,{}),r=k8(l),a=e.path(r,n);c=i.insert(()=>a,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&c.attr("style",u)}else c=l9(i,o,s,l);return r&&c.attr("style",r),t.width=o,t.height=s,w8(t,c),t.intersect=function(e){return i9.polygon(t,l,e)},i}async function xee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(60,a.width+2*(t.padding??0),t?.width??0),s=Math.max(20,a.height+2*(t.padding??0),t?.height??0),{cssStyles:l}=t,c=v8(i),u=B8(t,{});"handDrawn"!==t.look&&(u.roughness=0,u.fillStyle="solid");const h=[{x:-o/2*.8,y:-s/2},{x:o/2*.8,y:-s/2},{x:o/2,y:-s/2*.6},{x:o/2,y:s/2},{x:-o/2,y:s/2},{x:-o/2,y:-s/2*.6}],d=k8(h),p=c.path(d,u),f=i.insert(()=>p,":first-child");return f.attr("class","basic label-container"),l&&"handDrawn"!==t.look&&f.selectChildren("path").attr("style",l),r&&"handDrawn"!==t.look&&f.selectChildren("path").attr("style",r),w8(t,f),t.intersect=function(e){return i9.polygon(t,h,e)},i}async function wee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=pG(YG().flowchart?.htmlLabels),l=a.width+(t.padding??0),c=l+a.height,u=l+a.height,h=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-c}],{cssStyles:d}=t,p=v8(i),f=B8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=k8(h),m=p.path(g,f),y=i.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",d),r&&"handDrawn"!==t.look&&y.selectChildren("path").attr("style",r),t.width=l,t.height=c,w8(t,y),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${c/2-(a.height+(t.padding??0)/(s?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(e){return nU.info("Triangle intersect",t,h,e),i9.polygon(t,h,e)},i}async function Eee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=l/8,u=l+c,{cssStyles:h}=t,d=70-s,p=d>0?d/2:0,f=v8(i),g=B8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-s/2-p,y:u/2},...T8(-s/2-p,u/2,s/2+p,u/2,c,.8),{x:s/2+p,y:-u/2},{x:-s/2-p,y:-u/2}],y=k8(m),v=f.path(y,g),b=i.insert(()=>v,":first-child");return b.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),b.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c-(a.y-(a.top??0))})`),w8(t,b),t.intersect=function(e){return i9.polygon(t,m,e)},i}async function kee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a}=await b8(e,t,E8(t)),o=Math.max(a.width+2*(t.padding??0),t?.width??0),s=Math.max(a.height+2*(t.padding??0),t?.height??0),l=o/s;let c=o,u=s;c>u*l?u=c/l:c=u*l,c=Math.max(c,100),u=Math.max(u,50);const h=Math.min(.2*u,u/4),d=u+2*h,{cssStyles:p}=t,f=v8(i),g=B8(t,{});"handDrawn"!==t.look&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-c/2,y:d/2},...T8(-c/2,d/2,c/2,d/2,h,1),{x:c/2,y:-d/2},...T8(c/2,-d/2,-c/2,-d/2,h,-1)],y=k8(m),v=f.path(y,g),b=i.insert(()=>v,":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",p),r&&"handDrawn"!==t.look&&b.selectAll("path").attr("style",r),w8(t,b),t.intersect=function(e){return i9.polygon(t,m,e)},i}async function Tee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const{shapeSvg:i,bbox:a,label:o}=await b8(e,t,E8(t)),s=Math.max(a.width+2*(t.padding??0),t?.width??0),l=Math.max(a.height+2*(t.padding??0),t?.height??0),c=-s/2,u=-l/2,{cssStyles:h}=t,d=v8(i),p=B8(t,{}),f=[{x:c-5,y:u-5},{x:c-5,y:u+l},{x:c+s,y:u+l},{x:c+s,y:u-5}],g=`M${c-5},${u-5} L${c+s},${u-5} L${c+s},${u+l} L${c-5},${u+l} L${c-5},${u-5}\n M${c-5},${u} L${c+s},${u}\n M${c},${u-5} L${c},${u+l}`;"handDrawn"!==t.look&&(p.roughness=0,p.fillStyle="solid");const m=d.path(g,p),y=i.insert(()=>m,":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),h&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",h),r&&"handDrawn"!==t.look&&y.selectAll("path").attr("style",r),o.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),w8(t,y),t.intersect=function(e){return i9.polygon(t,f,e)},i}async function _ee(e,t){const n=t;if(n.alias&&(t.label=n.alias),"handDrawn"===t.look){const{themeVariables:n}=WU(),{background:r}=n,i={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${r}`]};await _ee(e,i)}const r=WU();t.useHtmlLabels=r.htmlLabels;let i=r.er?.diagramPadding??10,a=r.er?.entityPadding??6;const{cssStyles:o}=t,{labelStyles:s}=$8(t);if(0===n.attributes.length&&t.label){const n={rx:0,ry:0,labelPaddingX:i,labelPaddingY:1.5*i};N5(t.label,r)+2*n.labelPaddingX0){const e=u.width+2*i-(p+f+g+m);p+=e/b,f+=e/b,g>0&&(g+=e/b),m>0&&(m+=e/b)}const w=p+f+g+m,E=v8(c),k=B8(t,{});"handDrawn"!==t.look&&(k.roughness=0,k.fillStyle="solid");const T=Math.max(x.width+2*i,t?.width||0,w),_=Math.max(x.height+(d[0]||h)+a,t?.height||0),C=-T/2,S=-_/2;c.selectAll("g:not(:first-child)").each((e,t,n)=>{const r=TK(n[t]),o=r.attr("transform");let s=0,l=0;if(o){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[1]),l=parseFloat(e[2]),r.attr("class").includes("attribute-name")?s+=p:r.attr("class").includes("attribute-keys")?s+=p+f:r.attr("class").includes("attribute-comment")&&(s+=p+f+g))}r.attr("transform",`translate(${C+i/2+s}, ${l+S+u.height+a/2})`)}),c.select(".name").attr("transform","translate("+-u.width/2+", "+(S+a/2)+")");const A=E.rectangle(C,S,T,_,k),N=c.insert(()=>A,":first-child").attr("style",o.join("")),{themeVariables:I}=WU(),{rowEven:O,rowOdd:L,nodeBorder:M}=I;d.push(0);for(const[e,t]of d.entries()){if(0===e&&d.length>1)continue;const n=e%2==0&&0!==t,r=E.rectangle(C,u.height+S+t,T,u.height,{...k,fill:n?O:L,stroke:M});c.insert(()=>r,"g.label").attr("style",o.join("")).attr("class","row-rect-"+(e%2==0?"even":"odd"))}let R=E.line(C,u.height+S,T+C,u.height+S,k);c.insert(()=>R).attr("class","divider"),R=E.line(p+C,u.height+S,p+C,_+S,k),c.insert(()=>R).attr("class","divider"),y&&(R=E.line(p+f+C,u.height+S,p+f+C,_+S,k),c.insert(()=>R).attr("class","divider")),v&&(R=E.line(p+f+g+C,u.height+S,p+f+g+C,_+S,k),c.insert(()=>R).attr("class","divider"));for(const e of d)R=E.line(C,u.height+S+e,T+C,u.height+S+e,k),c.insert(()=>R).attr("class","divider");return w8(t,N),t.intersect=function(e){return i9.rect(t,e)},c}async function Cee(e,t,n,r=0,i=0,a=[],o=""){const s=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${r}, ${i})`).attr("style",o);t!==mG(t)&&(t=(t=mG(t)).replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await y7(s,t,{width:N5(t,n)+100,style:o,useHtmlLabels:n.htmlLabels},n));if(t.includes("<")||t.includes(">")){let e=l.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(pG(n.htmlLabels)){const e=l.children[0];e.style.textAlign="start";const t=TK(l);c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}return c}async function See(e,t,n,r,i=n.class.padding??12){const a=r?0:3,o=e.insert("g").attr("class",E8(t)).attr("id",t.domId||t.id);let s=null,l=null,c=null,u=null,h=0,d=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const e=t.annotations[0];await Aee(s,{text:`«${e}»`},0);h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await Aee(l,t,0,["font-weight: bolder"]);const f=l.node().getBBox();d=f.height,c=o.insert("g").attr("class","members-group text");let g=0;for(const e of t.members){g+=await Aee(c,e,g,[e.parseClassifier()])+a}p=c.node().getBBox().height,p<=0&&(p=i/2),u=o.insert("g").attr("class","methods-group text");let m=0;for(const e of t.methods){m+=await Aee(u,e,m,[e.parseClassifier()])+a}let y=o.node().getBBox();if(null!==s){const e=s.node().getBBox();s.attr("transform",`translate(${-e.width/2})`)}return l.attr("transform",`translate(${-f.width/2}, ${h})`),y=o.node().getBBox(),c.attr("transform",`translate(0, ${h+d+2*i})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${h+d+(p?p+4*i:2*i)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}async function Aee(e,t,n,r=[]){const i=e.insert("g").attr("class","label").attr("style",r.join("; ")),a=WU();let o="useHtmlLabels"in t?t.useHtmlLabels:pG(a.htmlLabels)??!0,s="";s="text"in t?t.text:t.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),EG(s)&&(o=!0);const l=await y7(i,QG(z5(s)),{width:N5(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let c,u=1;if(o){const e=l.children[0],t=TK(l);u=e.innerHTML.split("
    ").length,e.innerHTML.includes("")&&(u+=e.innerHTML.split("").length-1);const n=e.getElementsByTagName("img");if(n){const e=""===s.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(e,10)*n+"px";t.style.minWidth=r,t.style.maxWidth=r}else t.style.width="100%";n(t)}JH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}else{r.includes("font-weight: bolder")&&TK(l).selectAll("tspan").attr("font-weight",""),u=l.children.length;const e=l.children[0];if(""===l.textContent||l.textContent.includes(">")){e.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim();" "===s[1]&&(e.textContent=e.textContent[0]+" "+e.textContent.substring(1))}"undefined"===e.textContent&&(e.textContent=""),c=l.getBBox()}return i.attr("transform","translate(0,"+(-c.height/(2*u)+n)+")"),c.height}async function Nee(e,t){const n=YG(),r=n.class.padding??12,i=r,a=t.useHtmlLabels??pG(n.htmlLabels)??!0,o=t;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:s,bbox:l}=await See(e,t,n,a,i),{labelStyles:c,nodeStyles:u}=$8(t);t.labelStyle=c,t.cssStyles=o.styles||"";const h=o.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=h.replaceAll("!important","").split(";"));const d=0===o.members.length&&0===o.methods.length&&!n.class?.hideEmptyMembersBox,p=v8(s),f=B8(t,{});"handDrawn"!==t.look&&(f.roughness=0,f.fillStyle="solid");const g=l.width;let m=l.height;0===o.members.length&&0===o.methods.length?m+=i:o.members.length>0&&0===o.methods.length&&(m+=2*i);const y=-g/2,v=-m/2,b=p.rectangle(y-r,v-r-(d?r:0===o.members.length&&0===o.methods.length?-r/2:0),g+2*r,m+2*r+(d?2*r:0===o.members.length&&0===o.methods.length?-r:0),f),x=s.insert(()=>b,":first-child");x.attr("class","basic label-container");const w=x.node().getBBox();s.selectAll(".text").each((e,t,n)=>{const i=TK(n[t]),l=i.attr("transform");let c=0;if(l){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);e&&(c=parseFloat(e[2]))}let u=c+v+r-(d?r:0===o.members.length&&0===o.methods.length?-r/2:0);a||(u-=4);let h=y;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(h=-i.node()?.getBBox().width/2||0,s.selectAll("text").each(function(e,t,n){"middle"===window.getComputedStyle(n[t]).textAnchor&&(h=0)})),i.attr("transform",`translate(${h}, ${u})`)});const E=s.select(".annotation-group").node().getBBox().height-(d?r/2:0)||0,k=s.select(".label-group").node().getBBox().height-(d?r/2:0)||0,T=s.select(".members-group").node().getBBox().height-(d?r/2:0)||0;if(o.members.length>0||o.methods.length>0||d){const e=p.line(w.x,E+k+v+r,w.x+w.width,E+k+v+r,f);s.insert(()=>e).attr("class","divider").attr("style",h)}if(d||o.members.length>0||o.methods.length>0){const e=p.line(w.x,E+k+T+v+2*i+r,w.x+w.width,E+k+T+v+r+2*i,f);s.insert(()=>e).attr("class","divider").attr("style",h)}if("handDrawn"!==o.look&&s.selectAll("path").attr("style",h),x.select(":nth-child(2)").attr("style",h),s.selectAll(".divider").select("path").attr("style",h),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",h),!a){const e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(h);if(t){const e=t[0].replace("color","fill");s.selectAll("tspan").attr("style",e)}else if(c){const t=e.exec(c);if(t){const e=t[0].replace("color","fill");s.selectAll("tspan").attr("style",e)}}}return w8(t,x),t.intersect=function(e){return i9.rect(t,e)},s}async function Iee(e,t){const{labelStyles:n,nodeStyles:r}=$8(t);t.labelStyle=n;const i=t,a=t,o="verifyMethod"in t,s=E8(t),l=e.insert("g").attr("class",s).attr("id",t.domId??t.id);let c;c=o?await Oee(l,`<<${i.type}>>`,0,t.labelStyle):await Oee(l,"<<Element>>",0,t.labelStyle);let u=c;const h=await Oee(l,i.name,u,t.labelStyle+"; font-weight: bold;");if(u+=h+20,o){u+=await Oee(l,""+(i.requirementId?`Id: ${i.requirementId}`:""),u,t.labelStyle);u+=await Oee(l,""+(i.text?`Text: ${i.text}`:""),u,t.labelStyle);u+=await Oee(l,""+(i.risk?`Risk: ${i.risk}`:""),u,t.labelStyle),await Oee(l,""+(i.verifyMethod?`Verification: ${i.verifyMethod}`:""),u,t.labelStyle)}else{u+=await Oee(l,""+(a.type?`Type: ${a.type}`:""),u,t.labelStyle),await Oee(l,""+(a.docRef?`Doc Ref: ${a.docRef}`:""),u,t.labelStyle)}const d=(l.node()?.getBBox().width??200)+20,p=(l.node()?.getBBox().height??200)+20,f=-d/2,g=-p/2,m=v8(l),y=B8(t,{});"handDrawn"!==t.look&&(y.roughness=0,y.fillStyle="solid");const v=m.rectangle(f,g,d,p,y),b=l.insert(()=>v,":first-child");if(b.attr("class","basic label-container").attr("style",r),l.selectAll(".label").each((e,t,n)=>{const r=TK(n[t]),i=r.attr("transform");let a=0,o=0;if(i){const e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]))}const s=o-p/2;let l=f+10;0!==t&&1!==t||(l=a),r.attr("transform",`translate(${l}, ${s+20})`)}),u>c+h+20){const e=m.line(f,g+c+h+20,f+d,g+c+h+20,y);l.insert(()=>e).attr("style",r)}return w8(t,b),t.intersect=function(e){return i9.rect(t,e)},l}async function Oee(e,t,n,r=""){if(""===t)return 0;const i=e.insert("g").attr("class","label").attr("style",r),a=YG(),o=a.htmlLabels??!0,s=await y7(i,QG(z5(t)),{width:N5(t,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:r},a);let l;if(o){const e=s.children[0],t=TK(s);l=e.getBoundingClientRect(),t.attr("width",l.width),t.attr("height",l.height)}else{const e=s.children[0];for(const t of e.children)t.textContent=t.textContent.replaceAll(">",">").replaceAll("<","<"),r&&t.setAttribute("style",r);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+n})`),l.height}JH(vee,"tiltedCylinder"),JH(bee,"trapezoid"),JH(xee,"trapezoidalPentagon"),JH(wee,"triangle"),JH(Eee,"waveEdgedRectangle"),JH(kee,"waveRectangle"),JH(Tee,"windowPane"),JH(_ee,"erBox"),JH(Cee,"addText"),JH(See,"textHelper"),JH(Aee,"addText"),JH(Nee,"classBox"),JH(Iee,"requirementBox"),JH(Oee,"addText");var Lee=JH(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Mee(e,t,{config:n}){const{labelStyles:r,nodeStyles:i}=$8(t);t.labelStyle=r||"";const a=t.width;t.width=(t.width??200)-10;const{shapeSvg:o,bbox:s,label:l}=await b8(e,t,E8(t)),c=t.padding||10;let u,h="";"ticket"in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(h=n?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",h).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,f;({label:p,bbox:f}=u?await x8(u,"ticket"in t&&t.ticket||"",d):await x8(o,"ticket"in t&&t.ticket||"",d));const{label:g,bbox:m}=await x8(o,"assigned"in t&&t.assigned||"",d);t.width=a;const y=t?.width||0,v=Math.max(f.height,m.height)/2,b=Math.max(s.height+20,t?.height||0)+v,x=-y/2,w=-b/2;let E;l.attr("transform","translate("+(c-y/2)+", "+(-v-s.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-v+s.height/2)+")"),g.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-v+s.height/2)+")");const{rx:k,ry:T}=t,{cssStyles:_}=t;if("handDrawn"===t.look){const e=v8(o),n=B8(t,{}),r=k||T?e.path(L8(x,w,y,b,k||0),n):e.rectangle(x,w,y,b,n);E=o.insert(()=>r,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",k??5).attr("ry",T??5).attr("x",x).attr("y",w).attr("width",y).attr("height",b);const e="priority"in t&&t.priority;if(e){const t=o.append("line"),n=x+2,r=w+Math.floor((k??0)/2),i=w+b-Math.floor((k??0)/2);t.attr("x1",n).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width","4").attr("stroke",Lee(e))}}return w8(t,E),t.height=b,t.intersect=function(e){return i9.rect(t,e)},o}JH(Mee,"kanbanItem");var Ree=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:oee},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ree},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:see},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:hee},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:T9},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:h9},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:eee},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:L9},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:U9},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:H9},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:bee},{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:F9},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:C9},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:fee},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:c9},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:iee},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:uee},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:cee},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:N9},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:M9},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:g9},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:y9},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:b9},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:G9},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Eee},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:I9},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:vee},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Y9},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:x9},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:_9},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:wee},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Tee},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:S9},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:xee},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:A9},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:aee},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Q9},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:K9},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:s9},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:p9},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:pee},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:dee},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:kee},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tee},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:X9}],Dee=JH(()=>{const e={state:lee,choice:u9,note:Z9,rectWithTitle:nee,labelRect:j9,iconSquare:$9,iconCircle:D9,icon:R9,iconRounded:P9,imageSquare:B9,anchor:a9,kanbanItem:Mee,classBox:Nee,erBox:_ee,requirementBox:Iee},t=[...Object.entries(e),...Ree.flatMap(e=>[e.shortName,..."aliases"in e?e.aliases:[],..."internalAliases"in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Pee=Dee();function $ee(e){return e in Pee}JH($ee,"isValidShape");var Bee=new Map;async function Fee(e,t,n){let r,i;"rect"===t.shape&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?Pee[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;"sandbox"===n.config.securityLevel?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return t.tooltip&&i.attr("title",t.tooltip),Bee.set(t.id,r),t.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}JH(Fee,"insertNode");var zee=JH((e,t)=>{Bee.set(t.id,e)},"setNodeElem"),jee=JH(()=>{Bee.clear()},"clear"),Hee=JH(e=>{const t=Bee.get(e.id);nU.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-8)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode"),Uee=JH((e,t,n,r,i,a)=>{t.arrowTypeStart&&qee(e,"start",t.arrowTypeStart,n,r,i,a),t.arrowTypeEnd&&qee(e,"end",t.arrowTypeEnd,n,r,i,a)},"addEdgeMarkers"),Gee={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},qee=JH((e,t,n,r,i,a,o)=>{const s=Gee[n];if(!s)return void nU.warn(`Unknown arrow type: ${n}`);const l=`${i}_${a}-${s.type}${"start"===t?"Start":"End"}`;if(o&&""!==o.trim()){const n=`${l}_${o.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(n)){const e=document.getElementById(l);if(e){const t=e.cloneNode(!0);t.id=n;t.querySelectorAll("path, circle, line").forEach(e=>{e.setAttribute("stroke",o),s.fill&&e.setAttribute("fill",o)}),e.parentNode?.appendChild(t)}}e.attr(`marker-${t}`,`url(${r}#${n})`)}else e.attr(`marker-${t}`,`url(${r}#${l})`)},"addEdgeMarker"),Wee=new Map,Vee=new Map,Yee=JH(()=>{Wee.clear(),Vee.clear()},"clear"),Xee=JH(e=>{let t=e?e.reduce((e,t)=>e+";"+t,""):"";return t},"getLabelStyles"),Kee=JH(async(e,t)=>{let n=pG(YG().flowchart.htmlLabels);const r=await y7(e,t.label,{style:Xee(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1});nU.info("abc82",t,t.labelType);const i=e.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(r);let o,s=r.getBBox();if(n){const e=r.children[0],t=TK(r);s=e.getBoundingClientRect(),t.attr("width",s.width),t.attr("height",s.height)}if(a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),Wee.set(t.id,i),t.width=s.width,t.height=s.height,t.startLabelLeft){const n=await O8(t.startLabelLeft,Xee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Vee.get(t.id)||Vee.set(t.id,{}),Vee.get(t.id).startLeft=r,Qee(o,t.startLabelLeft)}if(t.startLabelRight){const n=await O8(t.startLabelRight,Xee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Vee.get(t.id)||Vee.set(t.id,{}),Vee.get(t.id).startRight=r,Qee(o,t.startLabelRight)}if(t.endLabelLeft){const n=await O8(t.endLabelLeft,Xee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),Vee.get(t.id)||Vee.set(t.id,{}),Vee.get(t.id).endLeft=r,Qee(o,t.endLabelLeft)}if(t.endLabelRight){const n=await O8(t.endLabelRight,Xee(t.labelStyle)),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");o=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),Vee.get(t.id)||Vee.set(t.id,{}),Vee.get(t.id).endRight=r,Qee(o,t.endLabelRight)}return r},"insertEdgeLabel");function Qee(e,t){YG().flowchart.htmlLabels&&e&&(e.style.width=9*t.length+"px",e.style.height="12px")}JH(Qee,"setTerminalWidth");var Zee=JH((e,t)=>{nU.debug("Moving label abc88 ",e.id,e.label,Wee.get(e.id),t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=YG(),{subGraphTitleTotalMargin:i}=lY(r);if(e.label){const r=Wee.get(e.id);let a=e.x,o=e.y;if(n){const r=B5.calcLabelPosition(n);nU.debug("Moving label "+e.label+" from (",a,",",o,") to (",r.x,",",r.y,") abc88"),t.updatedPath&&(a=r.x,o=r.y)}r.attr("transform",`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){const t=Vee.get(e.id).startLeft;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.startLabelRight){const t=Vee.get(e.id).startRight;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelLeft){const t=Vee.get(e.id).endLeft;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelRight){const t=Vee.get(e.id).endRight;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}},"positionEdgeLabel"),Jee=JH((e,t)=>{const n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},"outsideNode"),ete=JH((e,t,n)=>{nU.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(t)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2;let s=n.xMath.abs(r-t.x)*l){let e=n.y{nU.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(nU.info("abc88 checking point",e,t),Jee(t,e)||i)nU.warn("abc88 outside",e,r),r=e,i||n.push(e);else{const a=ete(t,r,e);nU.debug("abc88 inside",e,r,a),nU.debug("abc88 intersection",a,t);let o=!1;n.forEach(e=>{o=o||e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)?nU.warn("abc88 no intersect",a,n):n.push(a),i=!0}}),nU.debug("returning points",n),n},"cutPathAtIntersect");function nte(e){const t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}JH(nte,"extractCornerPoints");var rte=JH(function(e,t,n){const r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},"findAdjacentPoint"),ite=JH(function(e){const{cornerPointPositions:t}=nte(e),n=[];for(let r=0;r10&&Math.abs(i.y-t.y)>=10){nU.debug("Corner point fixing",Math.abs(i.x-t.x),Math.abs(i.y-t.y));const e=5;h=a.x===o.x?{x:l<0?o.x-e+u:o.x+e-u,y:c<0?o.y-u:o.y+u}:{x:l<0?o.x-u:o.x+u,y:c<0?o.y-e+u:o.y+e-u}}else nU.debug("Corner point skipping fixing",Math.abs(i.x-t.x),Math.abs(i.y-t.y));n.push(h,s)}else n.push(e[r]);return n},"fixCorners"),ate=JH(function(e,t,n,r,i,a,o){const{handDrawnSeed:s}=YG();let l=t.points,c=!1;const u=i;var h=a;const d=[];for(const e in t.cssCompiledStyles)P8(e)||d.push(t.cssCompiledStyles[e]);h.intersect&&u.intersect&&(l=l.slice(1,t.points.length-1),l.unshift(u.intersect(l[0])),nU.debug("Last point APA12",t.start,"--\x3e",t.end,l[l.length-1],h,h.intersect(l[l.length-1])),l.push(h.intersect(l[l.length-1]))),t.toCluster&&(nU.info("to cluster abc88",n.get(t.toCluster)),l=tte(t.points,n.get(t.toCluster).node),c=!0),t.fromCluster&&(nU.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(l,null,2)),l=tte(l.reverse(),n.get(t.fromCluster).node).reverse(),c=!0);let p=l.filter(e=>!Number.isNaN(e.y));p=ite(p);let f=v2;switch(f=o2,t.curve){case"linear":f=o2;break;case"basis":default:f=v2;break;case"cardinal":f=_2;break;case"bumpX":f=p2;break;case"bumpY":f=f2;break;case"catmullRom":f=L2;break;case"monotoneX":f=q2;break;case"monotoneY":f=W2;break;case"natural":f=X2;break;case"step":f=Q2;break;case"stepAfter":f=J2;break;case"stepBefore":f=Z2}const{x:g,y:m}=sY(t),y=c2().x(g).y(m).curve(f);let v,b;switch(t.thickness){case"normal":default:v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-invisible"}switch(t.pattern){case"solid":default:v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed"}let x=y(p);const w=Array.isArray(t.style)?t.style:[t.style];let E=w.find(e=>e?.startsWith("stroke:"));if("handDrawn"===t.look){const n=v8(e);Object.assign([],p);v+=" transition",b=TK(n.path(x,{roughness:.3,seed:s})).select("path").attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")).attr("style",w?w.reduce((e,t)=>e+";"+t,""):"");let r=b.attr("d");b.attr("d",r),e.node().appendChild(b.node())}else{const n=d.join(";"),r=w?w.reduce((e,t)=>e+t+";",""):"";let i="";t.animate&&(i=" edge-animation-fast"),t.animation&&(i=" edge-animation-"+t.animation);const a=n?n+";"+r+";":r;b=e.append("path").attr("d",x).attr("id",t.id).attr("class"," "+v+(t.classes?" "+t.classes:"")+(i??"")).attr("style",a),E=a.match(/stroke:([^;]+)/)?.[1]}let k="";(YG().flowchart.arrowMarkerAbsolute||YG().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),nU.info("arrowTypeStart",t.arrowTypeStart),nU.info("arrowTypeEnd",t.arrowTypeEnd),Uee(b,t,k,o,r,E);let T={};return c&&(T.updatedPath=l),T.originalPath=t.points,T},"insertEdge"),ote=JH((e,t,n,r)=>{t.forEach(t=>{Ete[t](e,n,r)})},"insertMarkers"),ste=JH((e,t,n)=>{nU.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),lte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),cte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),ute=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),hte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),dte=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),pte=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),fte=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),gte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),mte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),yte=JH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),vte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),bte=JH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),xte=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")},"requirement_arrow"),wte=JH((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Ete={extension:ste,composition:lte,aggregation:cte,dependency:ute,lollipop:hte,point:dte,circle:pte,cross:fte,barb:gte,only_one:mte,zero_or_one:yte,one_or_more:vte,zero_or_more:bte,requirement_arrow:xte,requirement_contains:wte},kte=ote,Tte={common:_G,getConfig:WU,insertCluster:W8,insertEdge:ate,insertEdgeLabel:Kee,insertMarkers:kte,insertNode:Fee,interpolateToCurve:c5,labelHelper:b8,log:nU,positionEdgeLabel:Zee},_te={},Cte=JH(e=>{for(const t of e)_te[t.name]=t},"registerLayoutLoaders");JH(()=>{Cte([{name:"dagre",loader:JH(async()=>await Promise.resolve().then(function(){return Nce}),"loader")}])},"registerDefaultLayoutLoaders")();var Ste=JH(async(e,t)=>{if(!(e.layoutAlgorithm in _te))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=_te[e.layoutAlgorithm];return(await n.loader()).render(e,t,Tte,{algorithm:n.algorithm})},"render"),Ate=JH((e="",{fallback:t="dagre"}={})=>{if(e in _te)return e;if(t in _te)return nU.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"),Nte="11.6.0",Ite=JH(e=>{const{securityLevel:t}=YG();let n=TK("body");if("sandbox"===t){const t=TK(`#i${e}`);n=TK((t.node()?.contentDocument??document).body)}return n.select(`#${e}`)},"selectSvgElement"),Ote=t3(Object.keys,Object),Lte=Object.prototype.hasOwnProperty;function Mte(e){if(!i3(e))return Ote(e);var t=[];for(var n in Object(e))Lte.call(e,n)&&"constructor"!=n&&t.push(n);return t}var Rte=C4(r4,"DataView"),Dte=C4(r4,"Promise"),Pte=C4(r4,"Set"),$te=C4(r4,"WeakMap"),Bte="[object Map]",Fte="[object Promise]",zte="[object Set]",jte="[object WeakMap]",Hte="[object DataView]",Ute=v4(Rte),Gte=v4(D4),qte=v4(Dte),Wte=v4(Pte),Vte=v4($te),Yte=h4;(Rte&&Yte(new Rte(new ArrayBuffer(1)))!=Hte||D4&&Yte(new D4)!=Bte||Dte&&Yte(Dte.resolve())!=Fte||Pte&&Yte(new Pte)!=zte||$te&&Yte(new $te)!=jte)&&(Yte=function(e){var t=h4(e),n="[object Object]"==t?e.constructor:void 0,r=n?v4(n):"";if(r)switch(r){case Ute:return Hte;case Gte:return Bte;case qte:return Fte;case Wte:return zte;case Vte:return jte}return t});var Xte=Object.prototype.hasOwnProperty;function Kte(e){if(null==e)return!0;if(f3(e)&&(d3(e)||"string"==typeof e||"function"==typeof e.splice||b3(e)||L3(e)||h3(e)))return!e.length;var t=Yte(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(i3(e))return!Mte(e).length;for(var n in e)if(Xte.call(e,n))return!1;return!0}var Qte={id:"c4",detector:JH(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return lhe});return{id:"c4",diagram:e}},"loader")},Zte="flowchart",Jte=JH((e,t)=>"dagre-wrapper"!==t?.flowchart?.defaultRenderer&&"elk"!==t?.flowchart?.defaultRenderer&&/^\s*graph/.test(e),"detector"),ene={id:Zte,detector:Jte,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return The});return{id:Zte,diagram:e}},"loader")},tne="flowchart-v2",nne=JH((e,t)=>"dagre-d3"!==t?.flowchart?.defaultRenderer&&("elk"===t?.flowchart?.defaultRenderer&&(t.layout="elk"),!(!/^\s*graph/.test(e)||"dagre-wrapper"!==t?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(e)),"detector"),rne={id:tne,detector:nne,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return The});return{id:tne,diagram:e}},"loader")},ine={id:"er",detector:JH(e=>/^\s*erDiagram/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return Mhe});return{id:"er",diagram:e}},"loader")},ane="gitGraph",one={id:ane,detector:JH(e=>/^\s*gitGraph/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return JTe});return{id:ane,diagram:e}},"loader")},sne="gantt",lne={id:sne,detector:JH(e=>/^\s*gantt/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return SCe});return{id:sne,diagram:e}},"loader")},cne="info",une={id:cne,detector:JH(e=>/^\s*info/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return MCe});return{id:cne,diagram:e}},"loader")},hne={id:"pie",detector:JH(e=>/^\s*pie/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return XCe});return{id:"pie",diagram:e}},"loader")},dne="quadrantChart",pne={id:dne,detector:JH(e=>/^\s*quadrantChart/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return TSe});return{id:dne,diagram:e}},"loader")},fne="xychart",gne={id:fne,detector:JH(e=>/^\s*xychart-beta/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return xAe});return{id:fne,diagram:e}},"loader")},mne="requirement",yne={id:mne,detector:JH(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return AAe});return{id:mne,diagram:e}},"loader")},vne="sequence",bne={id:vne,detector:JH(e=>/^\s*sequenceDiagram/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return BNe});return{id:vne,diagram:e}},"loader")},xne="class",wne=JH((e,t)=>"dagre-wrapper"!==t?.class?.defaultRenderer&&/^\s*classDiagram/.test(e),"detector"),Ene={id:xne,detector:wne,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return JNe});return{id:xne,diagram:e}},"loader")},kne="classDiagram",Tne=JH((e,t)=>!(!/^\s*classDiagram/.test(e)||"dagre-wrapper"!==t?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(e),"detector"),_ne={id:kne,detector:Tne,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return tIe});return{id:kne,diagram:e}},"loader")},Cne="state",Sne=JH((e,t)=>"dagre-wrapper"!==t?.state?.defaultRenderer&&/^\s*stateDiagram/.test(e),"detector"),Ane={id:Cne,detector:Sne,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return _Oe});return{id:Cne,diagram:e}},"loader")},Nne="stateDiagram",Ine=JH((e,t)=>!!/^\s*stateDiagram-v2/.test(e)||!(!/^\s*stateDiagram/.test(e)||"dagre-wrapper"!==t?.state?.defaultRenderer),"detector"),One={id:Nne,detector:Ine,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return SOe});return{id:Nne,diagram:e}},"loader")},Lne="journey",Mne={id:Lne,detector:JH(e=>/^\s*journey/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return fLe});return{id:Lne,diagram:e}},"loader")},Rne=JH((e,t,n)=>{nU.debug("rendering svg for syntax error\n");const r=Ite(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),AG(r,100,512,!0),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),Dne={draw:Rne},Pne=Dne,$ne={db:{},renderer:Dne,parser:{parse:JH(()=>{},"parse")}},Bne="flowchart-elk",Fne=JH((e,t={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*flowchart|graph/.test(e)&&"elk"===t?.flowchart?.defaultRenderer)&&(t.layout="elk",!0),"detector"),zne={id:Bne,detector:Fne,loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return The});return{id:Bne,diagram:e}},"loader")},jne="timeline",Hne={id:jne,detector:JH(e=>/^\s*timeline/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return rMe});return{id:jne,diagram:e}},"loader")},Une="mindmap",Gne={id:Une,detector:JH(e=>/^\s*mindmap/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return zVe});return{id:Une,diagram:e}},"loader")},qne="kanban",Wne={id:qne,detector:JH(e=>/^\s*kanban/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return uYe});return{id:qne,diagram:e}},"loader")},Vne="sankey",Yne={id:Vne,detector:JH(e=>/^\s*sankey-beta/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return hXe});return{id:Vne,diagram:e}},"loader")},Xne="packet",Kne={id:Xne,detector:JH(e=>/^\s*packet-beta/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return SXe});return{id:Xne,diagram:e}},"loader")},Qne="radar",Zne={id:Qne,detector:JH(e=>/^\s*radar-beta/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return nKe});return{id:Qne,diagram:e}},"loader")},Jne="block",ere={id:Jne,detector:JH(e=>/^\s*block-beta/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return CZe});return{id:Jne,diagram:e}},"loader")},tre="architecture",nre={id:tre,detector:JH(e=>/^\s*architecture/.test(e),"detector"),loader:JH(async()=>{const{diagram:e}=await Promise.resolve().then(function(){return RJe});return{id:tre,diagram:e}},"loader")},rre=!1,ire=JH(()=>{rre||(rre=!0,tq("error",$ne,e=>"error"===e.toLowerCase().trim()),tq("---",{db:{clear:JH(()=>{},"clear")},styles:{},renderer:{draw:JH(()=>{},"draw")},parser:{parse:JH(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:JH(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hU(Qte,Wne,_ne,Ene,ine,lne,une,hne,yne,bne,zne,rne,ene,Gne,Hne,one,One,Ane,Mne,pne,Yne,Kne,gne,ere,nre,Zne))},"addDiagrams"),are=JH(async()=>{nU.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(cU).map(async([e,{detector:t,loader:n}])=>{if(n)try{nq(e)}catch{try{const{diagram:e,id:r}=await n();tq(r,e,t)}catch(t){throw nU.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete cU[e],t}}}))).filter(e=>"rejected"===e.status);if(e.length>0){nU.error(`Failed to load ${e.length} external diagrams`);for(const t of e)nU.error(t);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function ore(e,t){e.attr("role","graphics-document document"),""!==t&&e.attr("aria-roledescription",t)}function sre(e,t,n,r){if(void 0!==e.insert){if(n){const t=`chart-desc-${r}`;e.attr("aria-describedby",t),e.insert("desc",":first-child").attr("id",t).text(n)}if(t){const n=`chart-title-${r}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}JH(ore,"setA11yDiagramInfo"),JH(sre,"addSVGa11yTitleDescription");var lre=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{JH(this,"Diagram")}static async fromText(t,n={}){const r=WU(),i=uU(t,r);t=F5(t)+"\n";try{nq(i)}catch{const e=pU(i);if(!e)throw new lU(`Diagram ${i} not found.`);const{id:t,diagram:n}=await e();tq(t,n)}const{db:a,parser:o,renderer:s,init:l}=nq(i);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},cre=[],ure=JH(()=>{cre.forEach(e=>{e()}),cre=[]},"attachFunctions"),hre=JH(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function dre(e){const t=e.match(aU);if(!t)return{text:e,metadata:{}};let n=rY(t[1],{schema:nY})??{};n="object"!=typeof n||Array.isArray(n)?{}:n;const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}JH(dre,"extractFrontMatter");var pre=JH(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,t,n)=>"<"+t+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),fre=JH(e=>{const{text:t,metadata:n}=dre(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:t}},"processFrontmatter"),gre=JH(e=>{const t=B5.detectInit(e)??{},n=B5.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:e})=>"wrap"===e):"wrap"===n?.type&&(t.wrap=!0),{text:s5(e),directive:t}},"processDirectives");function mre(e){const t=pre(e),n=fre(t),r=gre(n.text),i=$5(n.config,r.directive);return{code:e=hre(r.text),title:n.title,config:i}}function yre(e){const t=(new TextEncoder).encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join("");return btoa(n)}JH(mre,"preprocessDiagram"),JH(yre,"toBase64");var vre=["foreignobject"],bre=["dominant-baseline"];function xre(e){const t=mre(e);return XU(),YU(t.config??{}),t}async function wre(e,t){ire();try{const{code:t,config:n}=xre(e);return{diagramType:(await Lre(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}JH(xre,"processAndSetConfigs"),JH(wre,"parse");var Ere=JH((e,t,n=[])=>`\n.${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),kre=JH((e,t=new Map)=>{let n="";if(void 0!==e.themeCSS&&(n+=`\n${e.themeCSS}`),void 0!==e.fontFamily&&(n+=`\n:root { --mermaid-font-family: ${e.fontFamily}}`),void 0!==e.altFontFamily&&(n+=`\n:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const r=e.htmlLabels??e.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(e=>{Kte(e.styles)||r.forEach(t=>{n+=Ere(e.id,t,e.styles)}),Kte(e.textStyles)||(n+=Ere(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))))})}return n},"createCssStyles"),Tre=JH((e,t,n,r)=>{const i=kre(e,n);return Mt(At(`${r}{${MG(t,i,e.themeVariables)}}`),Rt)},"createUserStyles"),_re=JH((e="",t,n)=>{let r=e;return n||t||(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=z5(r),r=r.replace(/
    /g,"
    "),r},"cleanUpSvgCode"),Cre=JH((e="",t)=>``,"putIntoIFrame"),Sre=JH((e,t,n,r,i)=>{const a=e.append("div");a.attr("id",n),r&&a.attr("style",r);const o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function Are(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}JH(Are,"sandboxedIframe");var Nre=JH((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},"removeExistingElements"),Ire=JH(async function(e,t,n){ire();const r=xre(t);t=r.code;const i=WU();nU.debug(i),t.length>(i?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const a="#"+e,o="i"+e,s="#"+o,l="d"+e,c="#"+l,u=JH(()=>{const e=TK(d?s:c).node();e&&"remove"in e&&e.remove()},"removeTempElements");let h=TK("body");const d="sandbox"===i.securityLevel,p="loose"===i.securityLevel,f=i.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),d){const e=Are(TK(n),o);h=TK(e.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=TK(n);Sre(h,e,l,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(Nre(document,e,l,o),d){const e=Are(TK("body"),o);h=TK(e.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=TK("body");Sre(h,e,l)}let g,m;try{g=await lre.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;g=await lre.fromText("error"),m=e}const y=h.select(c).node(),v=g.type,b=y.firstChild,x=b.firstChild,w=g.renderer.getClasses?.(t,g),E=Tre(i,v,w,a),k=document.createElement("style");k.innerHTML=E,b.insertBefore(k,x);try{await g.renderer.draw(t,e,Nte,g)}catch(n){throw i.suppressErrorRendering?u():Pne.draw(t,e,Nte),n}const T=h.select(`${c} svg`),_=g.db.getAccTitle?.(),C=g.db.getAccDescription?.();Mre(v,T,_,C),h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let S=h.select(c).node().innerHTML;if(nU.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),S=_re(S,d,pG(i.arrowMarkerAbsolute)),d){const e=h.select(c+" svg").node();S=Cre(S,e)}else p||(S=QH.sanitize(S,{ADD_TAGS:vre,ADD_ATTR:bre,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(ure(),m)throw m;return u(),{diagramType:v,svg:S,bindFunctions:g.db.bindFunctions}},"render");function Ore(e={}){const t=gU({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),HU(t),t?.theme&&t.theme in AU?t.themeVariables=AU[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=AU.default.getThemeVariables(t.themeVariables));const n="object"==typeof t?jU(t):GU();rU(n.logLevel),ire()}JH(Ore,"initialize");var Lre=JH((e,t={})=>{const{code:n}=mre(e);return lre.fromText(n,t)},"getDiagramFromText");function Mre(e,t,n,r){ore(t,e),sre(t,n,r,t.attr("id"))}JH(Mre,"addA11yInfo");var Rre=Object.freeze({render:Ire,parse:wre,getDiagramFromText:Lre,initialize:Ore,getConfig:WU,setConfig:qU,getSiteConfig:GU,updateSiteConfig:UU,reset:JH(()=>{XU()},"reset"),globalReset:JH(()=>{XU(PU)},"globalReset"),defaultConfig:PU});rU(WU().logLevel),XU(WU());var Dre=JH((e,t,n)=>{nU.warn(e),R5(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Pre=JH(async function(e={querySelector:".mermaid"}){try{await $re(e)}catch(t){if(R5(t)&&nU.error(t.str),Yre.parseError&&Yre.parseError(t),!e.suppressErrors)throw nU.error("Use the suppressErrors option to suppress these errors"),t}},"run"),$re=JH(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){const r=Rre.getConfig();let i;if(nU.debug((e?"":"No ")+"Callback function found"),n)i=n;else{if(!t)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(t)}nU.debug(`Found ${i.length} diagrams`),void 0!==r?.startOnLoad&&(nU.debug("Start On Load: "+r?.startOnLoad),Rre.updateSiteConfig({startOnLoad:r?.startOnLoad}));const a=new B5.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let o;const s=[];for(const t of Array.from(i)){if(nU.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const n=`mermaid-${a.next()}`;o=t.innerHTML,o=e7(B5.entityDecode(o)).trim().replace(//gi,"
    ");const r=B5.detectInit(o);r&&nU.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:i}=await Vre(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){Dre(e,s,Yre.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),Bre=JH(function(e){Rre.initialize(e)},"initialize"),Fre=JH(async function(e,t,n){nU.warn("mermaid.init is deprecated. Please use run instead."),e&&Bre(e);const r={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof t?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await Pre(r)},"init"),zre=JH(async(e,{lazyLoad:t=!0}={})=>{ire(),hU(...e),!1===t&&await are()},"registerExternalDiagrams"),jre=JH(function(){if(Yre.startOnLoad){const{startOnLoad:e}=Rre.getConfig();e&&Yre.run().catch(e=>nU.error("Mermaid failed to initialize",e))}},"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",jre,!1);var Hre=JH(function(e){Yre.parseError=e},"setParseErrorHandler"),Ure=[],Gre=!1,qre=JH(async()=>{if(!Gre){for(Gre=!0;Ure.length>0;){const e=Ure.shift();if(e)try{await e()}catch(e){nU.error("Error executing queue",e)}}Gre=!1}},"executeQueue"),Wre=JH(async(e,t)=>new Promise((n,r)=>{const i=JH(()=>new Promise((i,a)=>{Rre.parse(e,t).then(e=>{i(e),n(e)},e=>{nU.error("Error parsing",e),Yre.parseError?.(e),a(e),r(e)})}),"performCall");Ure.push(i),qre().catch(r)}),"parse"),Vre=JH((e,t,n)=>new Promise((r,i)=>{const a=JH(()=>new Promise((a,o)=>{Rre.render(e,t,n).then(e=>{a(e),r(e)},e=>{nU.error("Error parsing",e),Yre.parseError?.(e),o(e),i(e)})}),"performCall");Ure.push(a),qre().catch(i)}),"render"),Yre={startOnLoad:!0,mermaidAPI:Rre,parse:Wre,render:Vre,init:Fre,run:Pre,registerExternalDiagrams:zre,registerLayoutLoaders:Cte,initialize:Bre,parseError:void 0,contentLoaded:jre,setParseErrorHandler:Hre,detectType:uU,registerIconPacks:AY},Xre=Yre;function Kre(e){const t=onull,[n,r]=d(!1);return l(()=>{e.code&&t.current&&Xre.run({nodes:[t.current],suppressErrors:!0}).catch(e=>{r(!0),console.error("[Mermaid] ",e.message)})},[e.code]),n?null:Ow.jsx("div",{className:fE("no-dark","mermaid"),style:{cursor:"pointer",overflow:"auto"},ref:t,onClick:()=>{t.current?.querySelector("svg")},children:e.code})}const Qre=u((e,t)=>{const[n,r]=d(""),i= /*! Check if previously processed */ /*! * Wait for document loaded before starting the execution */ -function(e,t,n){var r=this,i=o(null),a=o(0),s=o(null),c=o([]),u=o(),d=o(),p=o(e),f=o(!0);p.current=e;var g="undefined"!=typeof window,m=!t&&0!==t&&g;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,b="maxWait"in n,x="debounceOnServer"in n&&!!n.debounceOnServer,w=b?Math.max(+n.maxWait||0,t):null;l(function(){return f.current=!0,function(){f.current=!1}},[]);var E=h(function(){var e=function(e){var t=c.current,n=u.current;return c.current=u.current=null,a.current=e,d.current=p.current.apply(n,t)},n=function(e,t){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(e):setTimeout(e,t)},o=function(e){if(!f.current)return!1;var n=e-i.current;return!i.current||n>=t||n<0||b&&e-a.current>=w},l=function(t){return s.current=null,v&&c.current?e(t):(c.current=u.current=null,d.current)},h=function e(){var r=Date.now();if(o(r))return l(r);if(f.current){var s=t-(r-i.current),c=b?Math.min(s,w-(r-a.current)):s;n(e,c)}},E=function(){if(g||x){var l=Date.now(),p=o(l);if(c.current=[].slice.call(arguments),u.current=r,i.current=l,p){if(!s.current&&f.current)return a.current=i.current,n(h,t),y?e(i.current):d.current;if(b)return n(h,t),e(i.current)}return s.current||n(h,t),d.current}};return E.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,c.current=i.current=u.current=s.current=null},E.isPending=function(){return!!s.current},E.flush=function(){return s.current?l(Date.now()):d.current},E},[y,b,t,w,v,m,g,x]);return E}(()=>{if(!t?.current)return;const e=t.current.querySelector("code.language-mermaid");e&&r(e.innerText)},600);return l(()=>{if(t?.current){const e=t.current.querySelectorAll("code"),n=["","md","markdown","text","txt","plaintext","tex","latex"];e.forEach(e=>{let t=e.className.match(/language-(\w+)/),r=t?t[1]:"";n.includes(r)&&(e.style.whiteSpace="pre-wrap")}),setTimeout(i,1)}},[t?.current]),Iw.jsxs(Iw.Fragment,{children:[Iw.jsxs("pre",{ref:t,children:[Iw.jsx("span",{className:"copy-code-button",onClick:()=>{}}),e.children]}),n.length>0&&Iw.jsx(Yre,{code:n},n)]})}),Kre=u((e,t)=>{const[n,r]=d(!0),[i,a]=d(!1);l(()=>{if(t?.current){const e=t.current.scrollHeight;a(e>400),t.current.scrollTop=t.current.scrollHeight}},[t?.current]);return Iw.jsxs(Iw.Fragment,{children:[Iw.jsx("code",{className:pE(e?.className),ref:t,style:{maxHeight:"none",overflowY:"hidden"},children:e.children}),null]})});function Qre(e){const t=h(()=>function(e){return e.replace(/([`]*?)(\w*?)([\n\r]*?)()/g,(e,t,n)=>t?e:"\n```html\n"+n).replace(/(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*)([`]*)([\n\r]*?)/g,(e,t,n,r,i)=>i?e:t+n+r+"\n```\n")}(function(e){return e.replace(/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g,(e,t,n,r)=>t||(n?`$$${n}$$`:r?`$${r}$`:e))}(e.content)),[e.content]);return Iw.jsx(yS,{remarkPlugins:[ML,lD,BL],rehypePlugins:[yj,mM,[R$,{detect:!1,ignoreMissing:!0}]],components:{pre:Xre,code:Kre,p:e=>Iw.jsx("p",{...e,dir:"auto"}),a:e=>{const t=e.href||"";if(/\.(aac|mp3|opus|wav)$/.test(t))return Iw.jsx("figure",{children:Iw.jsx("audio",{controls:!0,src:t})});if(/\.(3gp|3g2|webm|ogv|mpeg|mp4|avi)$/.test(t))return Iw.jsx("video",{controls:!0,width:"99.9%",children:Iw.jsx("source",{src:t})});const n=/^\/#/i.test(t)?"_self":e.target??"_blank";return Iw.jsx("a",{...e,target:n})}},children:t})}const Zre=t.memo(Qre);function Jre(e){const t=o(null);return Iw.jsx("div",{className:"coco-chat",children:Iw.jsx("div",{className:"markdown-body",style:{fontSize:`${e.fontSize??14}px`,fontFamily:e.fontFamily||"inherit"},ref:t,onContextMenu:e.onContextMenu,onDoubleClickCapture:e.onDoubleClickCapture,dir:"auto",children:Iw.jsx(Zre,{content:e.content})})})}function eie(e){const{getContainer:t,data:n={},isMobile:r,children:i}=e,[a,o]=d(!1),s=()=>{o(!1)};return Iw.jsxs(Iw.Fragment,{children:[m(i,{onClick:()=>{o(!0)}}),Iw.jsxs(Cv,{title:n.source?.name||" ",onClose:s,open:a,width:r?"100%":724,closeIcon:null,extra:Iw.jsx(eE,{className:"color-[#bbb] cursor-pointer",onClick:s}),rootClassName:sE,getContainer:t,children:[Iw.jsxs("div",{className:"h-full overflow-auto px-24px",children:[Iw.jsx("div",{className:"color-[#027ffe] text-16px mb-8px",children:n.title}),Iw.jsx("div",{className:"color-[#999] mb-16px",children:n.url}),n.tags?.length>0&&Iw.jsxs("div",{className:"color-[#999] mb-16px flex items-center gap-8px mb-24px flex-wrap",children:[Iw.jsx(Zw,{className:"text-24px"}),n.tags.map((e,t)=>Iw.jsx(_x,{className:"bg-#E8E8E8 color-#101010 border-0",children:e},t))]}),n.thumbnail&&Iw.jsx("div",{className:"flex justify-center items-center w-full bg-#F6F8FA rounded-lg mb-16px",children:Iw.jsx("img",{src:n.thumbnail,className:"max-w-full max-h-full object-contain"})}),Iw.jsx("div",{className:"leading-[24px] text-12px",children:Iw.jsx(Jre,{content:n.content})})]}),Iw.jsxs("div",{className:"absolute bottom-0 w-full pb-24px px-24px",children:[Iw.jsx("div",{className:"bg-#f5f5f5 rounded-20px mb-24px py-24px px-16px",children:Iw.jsx(ov,{column:2,colon:!1,items:[{key:"type",label:"Type",children:n.type||"-"},{key:"size",label:"Size",children:n.size||"-"},{key:"created_at",label:"Created At",children:n.created?uE(n.created)?hE(n.created):n.created:"-"},{key:"created_by",label:"Created by",children:n.owner?.username||"-"},{key:"updated_at",label:"Updated at",children:n.last_updated_by?.timestamp?uE(n.last_updated_by?.timestamp)?hE(n.last_updated_by?.timestamp):n.last_updated_by?.timestamp:"-"},{key:"updated_by",label:"Updated by",children:n.last_updated_by?.user?.username||"-"}]})}),Iw.jsxs("div",{className:"flex gap-8px",children:[Iw.jsxs(qc,{size:"large",className:"w-50% rounded-36px",onClick:()=>n.url&&window.open(n.url,"_blank"),children:[Iw.jsx(Qw,{className:"w-14px"})," Open"]}),Iw.jsxs(qc,{size:"large",type:"primary",className:"w-50% rounded-36px",children:[Iw.jsx(Hw,{className:"w-14px"})," AI 解读"]})]})]})]})]})}function tie(e,t,n="highlight-text"){if(!e||"string"!=typeof e)return e;if(!t||"string"!=typeof t||""===t.trim())return e;const r=t.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(${r})`,"gi");if(!i.test(e))return e;i.lastIndex=0;return e.split(i).map((e,t)=>e&&i.test(e)?(i.lastIndex=0,Iw.jsx("span",{className:n,style:{backgroundColor:"#fff3cd",color:"#856404",padding:"2px 6px",borderRadius:"4px",boxShadow:"0 1px 3px rgba(255, 227, 205, 0.4)",display:"inline-block",lineHeight:"1.3",margin:"0 1px",transition:"all 0.2s ease-in-out"},children:e},t)):e)}var nie="NormalList-module__list___Dxu8i";function rie(e){const{getDetailContainer:t,from:n,size:r,hits:i,onSearch:a,isMobile:o,query:s}=e,l=s||"";return Iw.jsx("div",{className:nie,children:Iw.jsx(ux,{itemLayout:"vertical",size:"large",pagination:{onChange:(e,t)=>{a((e-1)*t,t)},pageSize:r,current:Math.round(n/r+1),total:i?.total||0},dataSource:i?.hits||[],renderItem:(e,n)=>Iw.jsx(eie,{getContainer:t,data:e,isMobile:o,children:Iw.jsxs(ux.Item,{actions:[],className:"mb-24px",extra:e.thumbnail?Iw.jsx("img",{width:"100%",src:e.thumbnail}):null,children:[Iw.jsx(ux.Item.Meta,{title:Iw.jsxs("a",{title:e.title,className:"flex items-center text-base text-[#333]",children:[e.icon?.startsWith("http")&&Iw.jsx("img",{src:e.icon,className:"mr-1 w-4 h-4"}),tie(e.title,l)]}),description:e.summary?Iw.jsx(xw.Text,{ellipsis:{suffix:"...",ellipsis:!0,rows:3,expanded:!0},className:"text-[#999]",children:tie(e.summary,l)}):null}),Iw.jsxs("div",{className:"flex items-center mb-6px",children:[e.source?.name&&Iw.jsx(_x,{color:"#58a65c",className:"text-xs",children:tie(e.source.name,l)}),Iw.jsx(_x,{bordered:!1,color:"blue",className:"text-[##101010]",children:tie(e.type,l)}),e.last_updated_by?.user?.username&&e.last_updated_by?.timestamp?Iw.jsxs("span",{className:"text-[##101010]",children:["Last updated by ",tie(e.last_updated_by.user.username,l)," ",uE(e.last_updated_by?.timestamp)?hE(e.last_updated_by?.timestamp):`at ${e.last_updated_by?.timestamp}`]}):e.created&&Iw.jsxs("span",{className:"text-[##101010]",children:["Created"," ",uE(e.created)?hE(e.created):`at ${e.created}`]})]}),e.url&&Iw.jsx("div",{className:"mb-6px",children:e.url&&Iw.jsxs("a",{className:"truncate w-full inline-block align-middle",href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),children:[Iw.jsx(Qw,{className:"relative top-2px w-14px h-14px mr-1"}),tie(e.url,l)]})})]})},e.id)})})}const iie=[{type:"normal",component:v(rie)}],aie=e=>{const t={took:e?.took||0,total:e?.hits?.total?.value||0,hits:e?.hits?.hits?e?.hits?.hits.map(e=>({...e._source})):[]},n=[];if(e?.aggregations){Object.keys(e?.aggregations).forEach(t=>{const r=e?.aggregations[t]?.buckets||[];n.push({key:t,list:r.map(e=>({count:e.doc_count,key:e.key,name:e.top?.hits?.hits?.[0]?._source?.source?.name||""}))})})}return{hits:t,aggregations:n}};function oie(e){const{text:t}=e;return t?Iw.jsx("div",{className:"w-full text-center color-#999 leading-[24px]",children:t}):null}var sie={};function lie(e){return lie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lie(e)}Object.defineProperty(sie,"__esModule",{value:!0}),sie.CopyToClipboard=void 0;var cie=die(t),uie=die(jx),hie=["text","onCopy","options","children"];function die(e){return e&&e.__esModule?e:{default:e}}function pie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fie(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mie(e,t,n){return t&&function(e,t){for(var n=0;n{const[a,o]=d(!1),[s,l]=d(!1),c=_ie.includes(e),u="p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg transition-colors border-0 bg-transparent cursor-pointer";return Iw.jsxs("div",{className:pE("flex items-center gap-1 mt-2",n),children:[!c&&Iw.jsx(Tie.CopyToClipboard,{text:t,onCopy:()=>(async()=>{o(!0);const e=setTimeout(()=>{o(!1),clearTimeout(e)},1e3)})(),children:Iw.jsx("button",{id:i,className:u,children:a?Iw.jsx(Gw,{className:"w-4 h-4 text-[#38C200] dark:text-[#38C200]",style:{width:r,height:r}}):Iw.jsx(qw,{className:"w-4 h-4 text-[#666666] dark:text-[#A3A3A3]",style:{width:r,height:r}})})}),!c&&Iw.jsx("button",{onClick:()=>{if("speechSynthesis"in window){if(s)return window.speechSynthesis.cancel(),void l(!1);const e=new SpeechSynthesisUtterance(t);e.lang="zh-CN",e.onend=()=>{l(!1)},l(!0),window.speechSynthesis.speak(e)}},className:u,children:Iw.jsx(Jw,{className:"w-4 h-4 "+(s?"text-[#1990FF] dark:text-[#1990FF]":"text-[#666666] dark:text-[#A3A3A3]"),style:{width:r,height:r}})})]})},Sie=v(function({message:e,isTyping:t,response:n,onResend:r,actionClassName:i,actionIconSize:a,copyButtonId:o,showActions:s=!0,output:l="markdown"}){const c=e?._source?.message||"",u=e?._source?.question||"",h=c||n?.message_chunk||"",d=s&&!1===t&&!!h;return Iw.jsx("div",{className:"flex justify-start",children:Iw.jsx("div",{className:"flex gap-4 w-full",children:Iw.jsx("div",{className:"w-full space-y-2 text-left",children:Iw.jsx("div",{className:"w-full max-w-none",children:Iw.jsx("div",{className:"w-full text-[#333] leading-relaxed",children:(()=>{let n;return"markdown"===l?n=Iw.jsx(Jre,{content:h,loading:t,onDoubleClickCapture:()=>{}}):"html"===l?n=Iw.jsx("div",{dangerouslySetInnerHTML:{__html:h}}):"text"===l&&(n=h),Iw.jsxs(Iw.Fragment,{children:[n,t&&Iw.jsx("div",{className:"inline-block w-1.5 h-5 ml-0.5 -mb-0.5 bg-[#666666] dark:bg-[#A3A3A3] rounded-sm animate-typing"}),d&&Iw.jsx(Cie,{id:e._id,content:h,question:u,actionClassName:i,actionIconSize:a,copyButtonId:o,onResend:()=>{r&&r(u)}})]})})()})})})})})}),Aie=e=>{const{config:t={},data:n,loading:r,visible:i,setVisible:a}=e,s=o(null),[c,u]=d(!0);l(()=>{c&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[n,c]);return n&&n.response&&i?Iw.jsxs("div",{className:"flex flex-col gap-2 relative p-4 rounded-3 text-[#333] bg-white shadow-[0_4px_8px_rgba(0,0,0,0.1)] dark:shadow-[0_4px_20px_rgba(255,255,255,0.2)]",style:{maxHeight:t.height?t.height:"auto"},children:[Iw.jsx("div",{className:"absolute top-2 right-2 flex items-center justify-center size-[20px] border rounded-md cursor-pointer dark:border-[#282828]",onClick:()=>{a(!1)},children:Iw.jsx(eE,{className:"size-4"})}),t.title&&Iw.jsxs("div",{className:"flex item-center gap-1",children:[t.logo?.light?Iw.jsx("img",{src:t.logo.light,className:"size-4"}):Iw.jsx(Kw,{className:"size-4 text-[#881c94]"}),t.title&&Iw.jsx("span",{className:"text-xs font-semibold",children:t.title})]}),Iw.jsx("div",{ref:s,onScroll:()=>{const e=s.current;if(e){const t=e.scrollHeight-e.scrollTop<=e.clientHeight+100;u(t)}},className:"flex-1 overflow-auto text-sm",children:Iw.jsx(Sie,{message:{_id:"current",_source:{type:"assistant",message:"",question:""}},...n,isTyping:r,rootClassName:"!py-0",actionClassName:"absolute bottom-3 left-3 !m-0",actionIconSize:12,showActions:t.showActions,output:t.output},"current")}),Iw.jsx("div",{className:pE("min-h-[20px]",{hidden:r||!1===t.showActions})})]}):null},Nie=e=>{const{askBody:t,config:n,onAsk:r}=e,[i,a]=d(),[o,s]=d(!1),[c,u]=d(!0),h=(e,t)=>{const n=e.chunk_type,r=t?.[n];let i=r?r.message_chunk:"";return i+="deep_read"===n?"&"+e.message_chunk:e.message_chunk,{...t||{},[n]:{...r||{},message_chunk:i}}};return l(()=>{((e,t)=>{e&&t.assistant&&(a(),r(t.assistant,e,e=>{a(t=>h(e,t))},s))})(t?.message,n)},[t?.message,t?._t,n]),l(()=>{t?._t&&u(!0)},[t?._t]),Iw.jsx(Aie,{config:n,data:i,loading:o,visible:c,setVisible:u})};const Iie=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r{const{logo:t={},placeholder:n,welcome:r,type:i,aiOverview:a,widgets:s=[],onSearch:c,onAsk:u,config:p={},root:f,isFirst:g=!1,rightMenuWidth:m,queryParams:y={},setQueryParams:v}=e,[b,x]=d(aie()),[w,E]=d(),[k,T]=d(!1),[_,C]=d(!1),S=o(!0),A=(e,t)=>{S.current=t,v({...e,t:(new Date).valueOf()})};l(()=>{const e=()=>{C(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{if(y.query){const e=y.filter&&0===Object.keys(y.filter).length;c(y,e=>{let t;e&&!e.error?(t=aie(e),x(n=>({...t,aggregations:e?.aggregations?t.aggregations:n.aggregations}))):x(aie()),S.current&&(S.current=!1,E({message:JSON.stringify({query:y.query,result:t.hits}),t:(new Date).valueOf()}))},T,e)}},[y]),l(()=>(window.onsearch=e=>A({...y,from:0,query:e},!0),()=>{window.onsearch=void 0}),[y]);const N=h(()=>{if(iie&&0!==iie.length)return iie.find(e=>e.type===i)||iie[0]},[i]),I={isMobile:_},{query:O,from:L,size:M,filter:R}=y,{hits:D,aggregations:P}=b;return Iw.jsx(Mw,{rootID:Iie,isFirst:g,loading:k,logo:Iw.jsx(nE,{isFirst:g,...I,...t}),welcome:r?Iw.jsx(oie,{...I,text:r}):null,searchbox:Iw.jsx(tE,{...I,placeholder:n,query:O,onSearch:e=>A({...y,from:0,query:e},!0)}),rightMenuWidth:m,aggregations:Iw.jsx(aE,{...I,config:p.aggregations,aggregations:P,filter:R,onSearch:e=>A({...y,filter:e})}),resultHeader:Iw.jsx(oE,{hits:D,...I}),aiOverview:a?.enabled?null:Iw.jsx(Nie,{askBody:w,config:a,onAsk:u}),resultList:N?Iw.jsx(N.component,{...I,getDetailContainer:()=>f.getElementById(Iie),from:L,size:M,hits:D,query:O,onSearch:(e,t)=>A({...y,from:e,size:t})}):null,widgets:Iw.jsx(Iw.Fragment,{children:s.map((e,t)=>Iw.jsx(Nie,{askBody:w,config:e,onAsk:u},t))}),...I})},Lie=e=>{const{onSearch:t,queryParams:n}=e,[r,i]=d(!0),a=o(!0);return Iw.jsx(Oie,{...e,isFirst:!n.query&&r,onSearch:(e,n,r,o)=>{a.current&&(i(!1),a.current=!1),t(e,n,r,o)}})};function Mie(e){const{placeholder:t}=e,n=o(null),r=o(null),[i,a]=d({key:!0,placeholder:!0});return l(()=>{n.current&&n.current.disconnect();const e=r.current;if(e)return n.current=new ResizeObserver(e=>{for(const t of e)t.target.offsetWidth<48?a({key:!1,placeholder:!1}):t.target.offsetWidth<120?a({key:!1,placeholder:!0}):a({key:!0,placeholder:!0})}),n.current.observe(e),()=>{n.current.disconnect()}},[t,r.current]),Iw.jsxs(qc,{ref:r,size:"large",className:"min-w-42px max-w-100% flex items-center justify-between px-12px",children:[Iw.jsx(Xw,{className:"w-16px h-16px"}),i.placeholder&&Iw.jsx("div",{className:"text-left truncate w-[calc(100%-64px)]",children:t}),i.key&&Iw.jsxs("div",{className:"flex gap-12px items-center",children:[Iw.jsx(Yw,{className:"w-16px h-16px"}),Iw.jsx(qc,{className:"w-20px h-20px rounded-50% p-0",type:"primary",children:Iw.jsx(Ww,{className:"w-10px h-10px"})})]})]})}const Rie=e=>{const{children:t,...n}=e,{root:r}=n,[i,a]=d(!1);return Iw.jsxs(Iw.Fragment,{children:[t?m(t,{onClick:()=>a(!0)}):Iw.jsx("div",{style:{minWidth:42,maxWidth:"100%"},onClick:()=>a(!0),children:Iw.jsx(Mie,{placeholder:e.placeholder})}),Iw.jsx(fx,{open:i,style:{top:0,margin:0,padding:0,maxWidth:"100vw"},width:"100%",onCancel:()=>a(!1),destroyOnClose:!0,getContainer:r,footer:null,styles:{content:{padding:0,minHeight:"100vh"}},keyboard:!0,children:Iw.jsx(Lie,{...n})})]})},Die=e=>{const{shadow:n}=e;return Iw.jsx(t.StrictMode,{children:Iw.jsx(fe,{container:n,children:Iw.jsx(Lie,{...e,root:n||document})})})},Pie=e=>{const{shadow:n}=e;return Iw.jsx(t.StrictMode,{children:Iw.jsx(fe,{container:n,children:Iw.jsx(Rie,{...e,root:n||document})})})};function $ie(e){return"symbol"==typeof e||i3(e)&&"[object Symbol]"==c4(e)}function Bie(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n-1}function iae(e){return d3(e)?B3(e):Ote(e)}var aae=Object.prototype.hasOwnProperty,oae=J3(function(e,t){if(n3(t)||d3(t))R3(t,iae(t),e);else for(var n in t)aae.call(t,n)&&M3(e,n,t[n])}),sae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lae=/^\w*$/;function cae(e,t){if(u3(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$ie(e))||(lae.test(e)||!sae.test(e)||null!=t&&e in Object(t))}var uae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hae=/\\(\\)?/g,dae=function(e){var t=P4(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(uae,function(e,n,r,i){t.push(r?i.replace(hae,"$1"):n||e)}),t});function pae(e){return null==e?"":jie(e)}function fae(e,t){return u3(e)?e:cae(e,t)?[e]:dae(pae(e))}function gae(e){if("string"==typeof e||$ie(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function mae(e,t){for(var n=0,r=(t=fae(t,e)).length;null!=e&&ni?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,p=2&n?new Kae:void 0;for(a.set(e,t),a.set(t,e);++h2?t[2]:void 0;for(i&&Z3(t[0],t[1],i)&&(r=1);++n=200&&(a=Zae,o=!1,t=new Kae(t));e:for(;++i-1?r[i?e[a]:a]:void 0});function Hoe(e){return e&&e.length?e[0]:void 0}function Uoe(e,t){var n=-1,r=d3(e)?Array(e.length):[];return koe(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Goe(e,t){return(u3(e)?Bie:Uoe)(e,boe(t))}function qoe(e,t){return xae(Goe(e,t))}var Woe,Voe,Yoe=Object.prototype.hasOwnProperty,Xoe=(Woe=function(e,t,n){Yoe.call(e,n)?e[n].push(t):F4(e,n,[t])},function(e,t){var n=u3(e)?xoe:Toe,r=Voe?Voe():{};return n(e,Woe,boe(t),r)});function Koe(e,t){return e>t}var Qoe=Object.prototype.hasOwnProperty;function Zoe(e,t){return null!=e&&Qoe.call(e,t)}function Joe(e,t){return null!=e&&goe(e,t,Zoe)}function ese(e){return"string"==typeof e||!u3(e)&&i3(e)&&"[object String]"==c4(e)}function tse(e){return null==e?[]:function(e,t){return Bie(t,function(t){return e[t]})}(e,iae(e))}var nse=Math.max;function rse(e,t,n,r){e=d3(e)?e:tse(e),n=n?Qie(n):0;var i=e.length;return n<0&&(n=nse(i+n,0)),ese(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&nae(e,t,n)>-1}function ise(e,t,n){if(!(null==e?0:e.length))return-1;return nae(e,t,0)}var ase=A3&&A3.isRegExp,ose=ase?T3(ase):function(e){return i3(e)&&"[object RegExp]"==c4(e)};function sse(e){return void 0===e}function lse(e,t){return et||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&e=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}var bse=function(e){return K3(W3(e,void 0,wae),e+"")}(function(e,t){return null==e?{}:function(e,t){return gse(e,t,function(t,n){return moe(e,n)})}(e,t)}),xse=Math.ceil,wse=Math.max;var Ese=function(e,t,n){return n&&"number"!=typeof n&&Z3(e,t,n)&&(t=n=void 0),e=Kie(e),void 0===t?(t=e,e=0):t=Kie(t),function(e,t,n){for(var r=-1,i=wse(xse((t-e)/(n||1)),0),a=Array(i);i--;)a[++r]=e,e+=n;return a}(e,t,n=void 0===n?e1&&Z3(e,t[0],t[1])?t=[]:n>2&&Z3(t[0],t[1],t[2])&&(t=[t[0]]),vse(e,xae(t),[])}),Nse=Rte&&1/toe(new Rte([,-0]))[1]==1/0?function(e){return new Rte(e)}:Zie;function Ise(e,t,n){var r=-1,i=rae,a=e.length,o=!0,s=[],l=s;if(a>=200){var c=t?null:Nse(e);if(c)return toe(c);o=!1,i=Zae,l=new Kae}else l=t?[]:s;e:for(;++r1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Dse,this._children[e]={},this._children[Dse][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Moe(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),Moe(iae(this._in[e]),t),delete this._in[e],delete this._preds[e],Moe(iae(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(sse(t))t=Dse;else{for(var n=t+="";!sse(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==Dse)return t}}children(e){if(sse(e)&&(e=Dse),this._isCompound){var t=this._children[e];if(t)return iae(t)}else{if(e===Dse)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return iae(t)}successors(e){var t=this._sucs[e];if(t)return iae(t)}neighbors(e){var t=this.predecessors(e);if(t)return Ose(t,this.successors(e))}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Moe(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),Moe(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return void 0===a||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&Moe(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return h4(e)||(e=V3(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return tse(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return Tse(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=""+e,t=""+t,sse(n)||(n=""+n);var o=Fse(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!sse(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=function(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};r&&(s.name=r);return s}(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,$se(this._preds[t],e),$se(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=1===arguments.length?zse(this._isDirected,arguments[0]):Fse(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=1===arguments.length?zse(this._isDirected,arguments[0]):Fse(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=1===arguments.length?zse(this._isDirected,arguments[0]):Fse(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Bse(this._preds[t],e),Bse(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=tse(n);return t?Boe(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=tse(n);return t?Boe(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}function $se(e,t){e[t]?e[t]++:e[t]=1}function Bse(e,t){--e[t]||delete e[t]}function Fse(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}return i+""+a+""+(sse(r)?"\0":r)}function zse(e,t){return Fse(e,t.v,t.w,t.name)}Pse.prototype._nodeCount=0,Pse.prototype._edgeCount=0;class jse{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return Hse(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&Hse(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Use)),n=n._prev;return"["+e.join(", ")+"]"}}function Hse(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Use(e,t){if("_next"!==e&&"_prev"!==e)return t}var Gse=V3(1);function qse(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new Pse,r=0,i=0;Moe(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),Moe(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=Ese(i+r+3).map(function(){return new jse}),o=r+1;return Moe(n.nodes(),function(e){Vse(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}(e,t||Gse),r=function(e,t,n){var r,i=[],a=t[t.length-1],o=t[0];for(;e.nodeCount();){for(;r=o.dequeue();)Wse(e,t,n,r);for(;r=a.dequeue();)Wse(e,t,n,r);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(r=t[s].dequeue()){i=i.concat(Wse(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return wae(Goe(r,function(t){return e.outEdges(t.v,t.w)}))}function Wse(e,t,n,r,i){var a=i?[]:void 0;return Moe(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Vse(t,n,s)}),Moe(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Vse(t,n,o)}),e.removeNode(r.v),a}function Vse(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Yse(e){var t="greedy"===e.graph().acyclicer?qse(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,Moe(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return Moe(e.nodes(),i),t}(e);Moe(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Rse("rev"))})}function Xse(e,t,n,r){var i;do{i=Rse(r)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function Kse(e){var t=new Pse({multigraph:e.isMultigraph()}).setGraph(e.graph());return Moe(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),Moe(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function Qse(e,t){var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=c*o/s,r=c):(o<0&&(l=-l),n=l,r=l*s/o),{x:i+n,y:a+r}}function Zse(e){var t=Goe(Ese(ele(e)+1),function(){return[]});return Moe(e.nodes(),function(n){var r=e.node(n),i=r.rank;sse(i)||(t[i][r.order]=n)}),t}function Jse(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Xse(e,"border",i,t)}function ele(e){return hse(Goe(e.nodes(),function(t){var n=e.node(t).rank;if(!sse(n))return n}))}function tle(e,t){return t()}function nle(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],l=Xse(e,"border",o,n);i[t][a]=l,e.setParent(l,r),s&&e.setEdge(s,l,{weight:1})}function rle(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){Moe(e.nodes(),function(t){ole(e.node(t))}),Moe(e.edges(),function(t){var n=e.edge(t);Moe(n.points,ole),Object.prototype.hasOwnProperty.call(n,"y")&&ole(n)})}(e),"lr"!==t&&"rl"!==t||(!function(e){Moe(e.nodes(),function(t){sle(e.node(t))}),Moe(e.edges(),function(t){var n=e.edge(t);Moe(n.points,sle),Object.prototype.hasOwnProperty.call(n,"x")&&sle(n)})}(e),ile(e))}function ile(e){Moe(e.nodes(),function(t){ale(e.node(t))}),Moe(e.edges(),function(t){ale(e.edge(t))})}function ale(e){var t=e.width;e.width=e.height,e.height=t}function ole(e){e.y=-e.y}function sle(e){var t=e.x;e.x=e.y,e.y=t}function lle(e){e.graph().dummyChains=[],Moe(e.edges(),function(t){!function(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a===r+1)return;e.removeEdge(t);var c,u,h=void 0;for(u=0,++r;ro.lim&&(s=o,l=!0);var c=Boe(t.edges(),function(t){return l===_le(e,e.node(t.v),s)&&l!==_le(e,e.node(t.w),s)});return pse(c,function(e){return ule(t,e)})}function Tle(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),xle(e),vle(e,t),function(e,t){var n=joe(e.nodes(),function(e){return!t.node(e).parent}),r=function(e,t){return gle(e,t,"pre")}(e,n);Moe(r=r.slice(1),function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}(e,t)}function _le(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Cle(e){switch(e.graph().ranker){case"network-simplex":default:Ale(e);break;case"tight-tree":!function(e){cle(e),hle(e)}(e);break;case"longest-path":Sle(e)}}new Error,yle.initLowLimValues=xle,yle.initCutValues=vle,yle.calcCutValue=ble,yle.leaveEdge=Ele,yle.enterEdge=kle,yle.exchangeEdges=Tle;var Sle=cle;function Ale(e){yle(e)}function Nle(e){var t=Xse(e,"root",{},"_root"),n=function(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&Moe(a,function(e){n(e,i+1)}),t[r]=i}return Moe(e.children(),function(e){n(e,1)}),t}(e),r=hse(tse(n))-1,i=2*r+1;e.graph().nestingRoot=t,Moe(e.edges(),function(t){e.edge(t).minlen*=i});var a=function(e){return Tse(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;Moe(e.children(),function(o){Ile(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Ile(e,t,n,r,i,a,o){var s=e.children(o);if(s.length){var l=Jse(e,"_bt"),c=Jse(e,"_bb"),u=e.node(o);e.setParent(l,o),u.borderTop=l,e.setParent(c,o),u.borderBottom=c,Moe(s,function(s){Ile(e,t,n,r,i,a,s);var u=e.node(s),h=u.borderTop?u.borderTop:s,d=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,f=h!==d?1:i-a[o]+1;e.setEdge(l,h,{weight:p,minlen:f,nestingEdge:!0}),e.setEdge(d,c,{weight:p,minlen:f,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}else o!==t&&e.setEdge(t,o,{weight:0,minlen:n})}function Ole(e,t,n){var r=function(e){var t;for(;e.hasNode(t=Rse("_root")););return t}(e),i=new Pse({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return Moe(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),Moe(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=sse(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Lle(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),s[t=t-1>>1]+=e.weight;l+=e.weight*n})),l}function Rle(e,t){var n={};return Moe(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};sse(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),Moe(t.edges(),function(e){var t=n[e.v],r=n[e.w];sse(t)||sse(r)||(r.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){t.merged||(sse(t.barycenter)||sse(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function r(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),Moe(i.in.reverse(),n(i)),Moe(i.out,r(i))}return Goe(Boe(t,function(e){return!e.merged}),function(e){return bse(e,["vs","i","barycenter","weight"])})}(Boe(n,function(e){return!e.indegree}))}function Dle(e,t){var n,r=function(e,t){var n={lhs:[],rhs:[]};return Moe(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}(e,function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}),i=r.lhs,a=Ase(r.rhs,function(e){return-e.i}),o=[],s=0,l=0,c=0;i.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),c=Ple(o,a,c),Moe(i,function(e){c+=e.vs.length,o.push(e.vs),s+=e.barycenter*e.weight,l+=e.weight,c=Ple(o,a,c)});var u={vs:wae(o)};return l&&(u.barycenter=s/l,u.weight=l),u}function Ple(e,t,n){for(var r;t.length&&(r=Noe(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function $le(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=Boe(i,function(e){return e!==o&&e!==s}));var c=function(e,t){return Goe(t,function(t){var n=e.inEdges(t);if(n.length){var r=Tse(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}(e,i);Moe(c,function(t){if(e.children(t.v).length){var i=$le(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&function(e,t){sse(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}(t,i)}});var u=Rle(c,n);!function(e,t){Moe(e,function(e){e.vs=wae(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}(u,l);var h=Dle(u,r);if(o&&(h.vs=wae([o,h.vs,s]),e.predecessors(o).length)){var d=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+d.order+p.order)/(h.weight+2),h.weight+=2}return h}function Ble(e){var t=ele(e),n=Fle(e,Ese(1,t+1),"inEdges"),r=Fle(e,Ese(t-1,-1,-1),"outEdges"),i=function(e){var t={},n=Boe(e.nodes(),function(t){return!e.children(t).length}),r=hse(Goe(n,function(t){return e.node(t).rank})),i=Goe(Ese(r+1),function(){return[]}),a=Ase(n,function(t){return e.node(t).rank});return Moe(a,function n(r){if(!Joe(t,r)){t[r]=!0;var a=e.node(r);i[a.rank].push(r),Moe(e.successors(r),n)}}),i}(e);jle(e,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,l=0;l<4;++s,++l){zle(s%2?n:r,s%4>=2);var c=Lle(e,i=Zse(e));cl||c>t[i].lim));a=i,i=r;for(;(i=e.parent(i))!==a;)s.push(i);return{path:o.concat(s.reverse()),lca:a}}(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,c=o[l],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(c=o[l])!==s&&e.node(c).maxRankn){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function qle(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Wle(e,t,n,r,i){var a={},o=function(e,t,n,r){var i=new Pse,a=e.graph(),o=function(e,t,n){return function(r,i,a){var o,s=r.node(i),l=r.node(a),c=0;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":o=-s.width/2;break;case"r":o=s.width/2}if(o&&(c+=n?o:-o),o=0,c+=(s.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":o=l.width/2;break;case"r":o=-l.width/2}return o&&(c+=n?o:-o),o=0,c}}(a.nodesep,a.edgesep,r);return Moe(t,function(t){var r;Moe(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],l=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),l||0))}r=t})}),i}(e,t,n,i),s=i?"borderLeft":"borderRight";function l(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return l(function(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)},o.predecessors.bind(o)),l(function(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[t]=Math.max(a[t],n))},o.successors.bind(o)),Moe(r,function(e){a[e]=a[n[e]]}),a}function Vle(e,t){return pse(tse(t),function(t){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return function(e,t){null==e||j4(e,Loe(t),j3)}(t,function(t,i){var a=function(e,t){return e.node(t).width}(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Yle(e){var t,n=Zse(e),r=e5(Ule(e,n),function(e,t){var n={};function r(t,r,i,a,o){var s;Moe(Ese(r,i),function(r){s=t[r],e.node(s).dummy&&Moe(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.ordero)&&Gle(n,t,s)})})}return Tse(t,function(t,n){var i,a=-1,o=0;return Moe(n,function(s,l){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(i=e.node(c[0]).order,r(n,o,l,a,i),o=l,a=i)}r(n,o,n.length,i,t.length)}),n}),n}(e,n)),i={};Moe(["u","d"],function(a){t="u"===a?n:tse(n).reverse(),Moe(["l","r"],function(n){"r"===n&&(t=Goe(t,function(e){return tse(e).reverse()}));var o=("u"===a?e.predecessors:e.successors).bind(e),s=function(e,t,n,r){var i={},a={},o={};return Moe(t,function(e){Moe(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),Moe(t,function(e){var t=-1;Moe(e,function(e){var s=r(e);if(s.length){s=Ase(s,function(e){return o[e]});for(var l=(s.length-1)/2,c=Math.floor(l),u=Math.ceil(l);c<=u;++c){var h=s[c];a[e]===e&&t{var t=n(" buildLayoutGraph",()=>function(e){var t=new Pse({multigraph:!0,compound:!0}),n=oce(e.graph());return t.setGraph(e5({},Zle,ace(n,Qle),bse(n,Jle))),Moe(e.nodes(),function(n){var r=oce(e.node(n));t.setNode(n,Soe(ace(r,ece),tce)),t.setParent(n,e.parent(n))}),Moe(e.edges(),function(n){var r=oce(e.edge(n));t.setEdge(n,e5({},rce,ace(r,nce),bse(r,ice)))}),t}(e));n(" runLayout",()=>function(e,t){t(" makeSpaceForEdgeLabels",()=>function(e){var t=e.graph();t.ranksep/=2,Moe(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)),t(" removeSelfEdges",()=>function(e){Moe(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)),t(" acyclic",()=>Yse(e)),t(" nestingGraph.run",()=>Nle(e)),t(" rank",()=>Cle(Kse(e))),t(" injectEdgeLabelProxies",()=>function(e){Moe(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};Xse(e,"edge-proxy",i,"_ep")}})}(e)),t(" removeEmptyRanks",()=>function(e){var t=dse(Goe(e.nodes(),function(t){return e.node(t).rank})),n=[];Moe(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;Moe(n,function(t,n){sse(t)&&n%i!==0?--r:r&&Moe(t,function(t){e.node(t).rank+=r})})}(e)),t(" nestingGraph.cleanup",()=>function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,Moe(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}(e)),t(" normalizeRanks",()=>function(e){var t=dse(Goe(e.nodes(),function(t){return e.node(t).rank}));Moe(e.nodes(),function(n){var r=e.node(n);Joe(r,"rank")&&(r.rank-=t)})}(e)),t(" assignRankMinMax",()=>function(e){var t=0;Moe(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=hse(t,r.maxRank))}),e.graph().maxRank=t}(e)),t(" removeEdgeLabelProxies",()=>function(e){Moe(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)),t(" normalize.run",()=>lle(e)),t(" parentDummyChains",()=>Hle(e)),t(" addBorderSegments",()=>function(e){Moe(e.children(),function t(n){var r=e.children(n),i=e.node(n);if(r.length&&Moe(r,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;aBle(e)),t(" insertSelfEdges",()=>function(e){var t=Zse(e);Moe(t,function(t){var n=0;Moe(t,function(t,r){var i=e.node(t);i.order=r+n,Moe(i.selfEdges,function(t){Xse(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},"_se")}),delete i.selfEdges})})}(e)),t(" adjustCoordinateSystem",()=>function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||ile(e)}(e)),t(" position",()=>Xle(e)),t(" positionSelfEdges",()=>function(e){Moe(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}(e)),t(" removeBorderNodes",()=>function(e){Moe(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(Noe(n.borderLeft)),o=e.node(Noe(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),Moe(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)),t(" normalize.undo",()=>function(e){Moe(e.graph().dummyChains,function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)})}(e)),t(" fixupEdgeLabelCoords",()=>function(e){Moe(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)),t(" undoCoordinateSystem",()=>rle(e)),t(" translateGraph",()=>function(e){var t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(e){var a=e.x,o=e.y,s=e.width,l=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-l/2),i=Math.max(i,o+l/2)}Moe(e.nodes(),function(t){l(e.node(t))}),Moe(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,"x")&&l(n)}),t-=o,r-=s,Moe(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),Moe(e.edges(),function(n){var i=e.edge(n);Moe(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}(e)),t(" assignNodeIntersects",()=>function(e){Moe(e.edges(),function(t){var n,r,i=e.edge(t),a=e.node(t.v),o=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=a),i.points.unshift(Qse(a,n)),i.points.push(Qse(o,r))})}(e)),t(" reversePoints",()=>function(e){Moe(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)),t(" acyclic.undo",()=>function(e){Moe(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}(e))}(t,n)),n(" updateInputGraph",()=>function(e,t){Moe(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),Moe(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t))})}var Qle=["nodesep","edgesep","ranksep","marginx","marginy"],Zle={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Jle=["acyclicer","ranker","rankdir","align"],ece=["width","height"],tce={width:0,height:0},nce=["minlen","weight","width","height","labeloffset"],rce={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ice=["labelpos"];function ace(e,t){return cse(bse(e,t),Number)}function oce(e){var t={};return Moe(e,function(e,n){t[n.toLowerCase()]=e}),t}function sce(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:lce(e),edges:cce(e)};return sse(e.graph())||(t.value=Vae(e.graph())),t}function lce(e){return Goe(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return sse(n)||(i.value=n),sse(r)||(i.parent=r),i})}function cce(e){return Goe(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return sse(t.name)||(r.name=t.name),sse(n)||(r.value=n),r})}var uce=new Map,hce=new Map,dce=new Map,pce=QH(()=>{hce.clear(),dce.clear(),uce.clear()},"clear"),fce=QH((e,t)=>{const n=hce.get(t)||[];return eU.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),gce=QH((e,t)=>{const n=hce.get(t)||[];return eU.info("Descendants of ",t," is ",n),eU.info("Edge is ",e),e.v!==t&&e.w!==t&&(n?n.includes(e.v)||fce(e.v,t)||fce(e.w,t)||n.includes(e.w):(eU.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),mce=QH((e,t,n,r)=>{eU.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),eU.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(i=>{if(t.children(i).length>0)mce(i,t,n,r);else{const a=t.node(i);eU.info("cp ",i," to ",r," with parent ",e),n.setNode(i,a),r!==t.parent(i)&&(eU.warn("Setting parent",i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(eU.debug("Setting parent",i,e),n.setParent(i,e)):(eU.info("In copy ",e,"root",r,"data",t.node(e),r),eU.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const o=t.edges(i);eU.debug("Copying Edges",o),o.forEach(i=>{eU.info("Edge",i);const a=t.edge(i.v,i.w,i.name);eU.info("Edge data",a,r);try{gce(i,r)?(eU.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),eU.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):eU.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(e){eU.error(e)}})}eU.debug("Removing node",i),t.removeNode(i)})},"copy"),yce=QH((e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)dce.set(i,e),r=[...r,...yce(i,t)];return r},"extractDescendants"),vce=QH((e,t,n)=>{const r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},"findCommonEdges"),bce=QH((e,t,n)=>{const r=t.children(e);if(eU.trace("Searching children of id ",e,r),r.length<1)return e;let i;for(const e of r){const r=bce(e,t,n),a=vce(t,n,r);if(r){if(!(a.length>0))return r;i=r}}return i},"findNonClusterChild"),xce=QH(e=>uce.has(e)&&uce.get(e).externalConnections&&uce.has(e)?uce.get(e).id:e,"getAnchorId"),wce=QH((e,t)=>{if(!e||t>10)eU.debug("Opting out, no graph ");else{eU.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(eU.warn("Cluster identified",t," Replacement id in edges: ",bce(t,e,t)),hce.set(t,yce(t,e)),uce.set(t,{id:bce(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const n=e.children(t),r=e.edges();n.length>0?(eU.debug("Cluster identified",t,hce),r.forEach(e=>{fce(e.v,t)^fce(e.w,t)&&(eU.warn("Edge: ",e," leaves cluster ",t),eU.warn("Descendants of XXX ",t,": ",hce.get(t)),uce.get(t).externalConnections=!0)})):eU.debug("Not a cluster ",t,hce)});for(let t of uce.keys()){const n=uce.get(t).id,r=e.parent(n);r!==t&&uce.has(r)&&!uce.get(r).externalConnections&&(uce.get(t).id=r)}e.edges().forEach(function(t){const n=e.edge(t);eU.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),eU.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(eU.warn("Fix XXX",uce,"ids:",t.v,t.w,"Translating: ",uce.get(t.v)," --- ",uce.get(t.w)),uce.get(t.v)||uce.get(t.w)){if(eU.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),r=xce(t.v),i=xce(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){const i=e.parent(r);uce.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){const r=e.parent(i);uce.get(r).externalConnections=!0,n.toCluster=t.w}eU.warn("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,n,t.name)}}),eU.warn("Adjusted Graph",sce(e)),Ece(e,0),eU.trace(uce)}},"adjustClustersAndEdges"),Ece=QH((e,t)=>{if(eU.warn("extractor - ",t,sce(e),e.children("D")),t>10)return void eU.error("Bailing out");let n=e.nodes(),r=!1;for(const t of n){const n=e.children(t);r=r||n.length>0}if(r){eU.debug("Nodes = ",n,t);for(const r of n)if(eU.debug("Extracting node",r,uce,uce.has(r)&&!uce.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),uce.has(r))if(!uce.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){eU.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";uce.get(r)?.clusterData?.dir&&(n=uce.get(r).clusterData.dir,eU.warn("Fixing dir",uce.get(r).clusterData.dir,n));const i=new Pse({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});eU.warn("Old graph before copy",sce(e)),mce(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:uce.get(r).clusterData,label:uce.get(r).label,graph:i}),eU.warn("New graph after copy node: (",r,")",sce(i)),eU.debug("Old graph after copy",sce(e))}else eU.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!uce.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),eU.debug(uce);else eU.debug("Not a cluster",r,t);n=e.nodes(),eU.warn("New list of nodes",n);for(const r of n){const n=e.node(r);eU.warn(" Now next level",r,n),n?.clusterNode&&Ece(n.graph,t+1)}}else eU.debug("Done, no node has children",e.nodes())},"extractor"),kce=QH((e,t)=>{if(0===t.length)return[];let n=Object.assign([],t);return t.forEach(t=>{const r=e.children(t),i=kce(e,r);n=[...n,...i]}),n},"sorter"),Tce=QH(e=>kce(e,e.children()),"sortNodesByHierarchy"),_ce=QH(async(e,t,n,r,i,a)=>{eU.warn("Graph in recursive render:XAX",sce(t),i);const o=t.graph().rankdir;eU.trace("Dir in recursive render - dir:",o);const s=e.insert("g").attr("class","root");t.nodes()?eU.info("Recursive render XXX",t.nodes()):eU.info("No nodes found for",t),t.edges().length>0&&eU.info("Recursive edges",t.edge(t.edges()[0]));const l=s.insert("g").attr("class","clusters"),c=s.insert("g").attr("class","edgePaths"),u=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(e){const s=t.node(e);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));eU.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",n.height,"\nParent cluster",i.height),t.setNode(i.id,n),t.parent(e)||(eU.trace("Setting parent",e,i.id),t.setParent(e,i.id,n))}if(eU.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),s?.clusterNode){eU.info("Cluster identified XBX",e,s.width,t.node(e));const{ranksep:i,nodesep:o}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:i+25,nodesep:o});const l=await _ce(h,s.graph,n,r,t.node(e),a),c=l.elem;b8(s,c),s.diff=l.diff||0,eU.info("New compound node after recursive render XAX",e,"width",s.width,"height",s.height),Bee(c,s)}else t.children(e).length>0?(eU.trace("Cluster - the non recursive path XBX",e,s.id,s,s.width,"Graph:",t),eU.trace(bce(s.id,t)),uce.set(s.id,{id:bce(s.id,t),node:s})):(eU.trace("Node - the non recursive path XAX",e,h,t.node(e),o),await $ee(h,t.node(e),{config:a,dir:o}))}));const d=QH(async()=>{const e=t.edges().map(async function(e){const n=t.edge(e.v,e.w,e.name);eU.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),eU.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),eU.info("Fix",uce,"ids:",e.v,e.w,"Translating: ",uce.get(e.v),uce.get(e.w)),await Yee(u,n)});await Promise.all(e)},"processEdges");await d(),eU.info("Graph before layout:",JSON.stringify(sce(t))),eU.info("############################################# XXX"),eU.info("### Layout ### XXX"),eU.info("############################################# XXX"),Kle(t),eU.info("Graph after layout:",JSON.stringify(sce(t)));let p=0,{subGraphTitleTotalMargin:f}=oY(a);return await Promise.all(Tce(t).map(async function(e){const n=t.node(e);if(eU.info("Position XBX => "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=f,eU.info("A tainted cluster node XBX1",e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),uce.get(n.id).node=n,zee(n);else if(t.children(e).length>0){eU.info("A pure cluster node XBX1",e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=f,t.node(n.parentId);const r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;eU.debug("OffsetY",a,"labelHeight",i,"halfPadding",r),await G8(l,n),uce.get(n.id).node=n}else{const e=t.node(n.parentId);n.y+=f/2,eU.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",e,e?.offsetY,n),zee(n)}})),t.edges().forEach(function(e){const i=t.edge(e);eU.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(i),i),i.points.forEach(e=>e.y+=f/2);const a=t.node(e.v);var o=t.node(e.w);const s=rte(c,i,uce,n,a,o,r);Kee(i,s)}),t.nodes().forEach(function(e){const n=t.node(e);eU.info(e,n.type,n.diff),n.isGroup&&(p=n.diff)}),eU.warn("Returning from recursive render XAX",s,p),{elem:s,diff:p}},"recursiveRender"),Cce=QH(async(e,t)=>{const n=new Pse({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),r=t.select("g");wte(r,e.markers,e.type,e.diagramId),Fee(),Wee(),q8(),pce(),e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),eU.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const t=e.start,r=t+"---"+t+"---1",i=t+"---"+t+"---2",a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(i,a.parentId);const o=structuredClone(e),s=structuredClone(e),l=structuredClone(e);o.label="",o.arrowTypeEnd="none",o.id=t+"-cyclic-special-1",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=t+"-cyclic-special-mid",l.label="",a.isGroup&&(o.fromCluster=t,l.toCluster=t),l.id=t+"-cyclic-special-2",l.arrowTypeStart="none",n.setEdge(t,r,o,t+"-cyclic-special-0"),n.setEdge(r,i,s,t+"-cyclic-special-1"),n.setEdge(i,t,l,t+"-cyc{const n=e.append("rect");if(n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),t.name&&n.attr("name",t.name),t.rx&&n.attr("rx",t.rx),t.ry&&n.attr("ry",t.ry),void 0!==t.attrs)for(const e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr("class",t.class),n},"drawRect"),Nce=QH((e,t)=>{const n={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};Ace(e,n).lower()},"drawBackgroundRect"),Ice=QH((e,t)=>{const n=t.text.replace(ZU," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const i=r.append("tspan");return i.attr("x",t.x+2*t.textMargin),i.text(n),r},"drawText"),Oce=QH((e,t,n,r)=>{const i=e.append("image");i.attr("x",t),i.attr("y",n);const a=OY(r);i.attr("xlink:href",a)},"drawImage"),Lce=QH((e,t,n,r)=>{const i=e.append("use");i.attr("x",t),i.attr("y",n);const a=OY(r);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Mce=QH(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Rce=QH(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Dce=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,24],n=[1,25],r=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],p=[1,69],f=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],b=[1,34],x=[1,35],w=[1,36],E=[1,37],k=[1,38],T=[1,39],_=[1,40],C=[1,41],S=[1,42],A=[1,43],N=[1,44],I=[1,45],O=[1,46],L=[1,47],M=[1,48],R=[1,50],D=[1,51],P=[1,52],$=[1,53],B=[1,54],F=[1,55],z=[1,56],j=[1,57],H=[1,58],U=[1,59],G=[1,60],q=[14,42],W=[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],V=[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],Y=[1,82],X=[1,83],K=[1,84],Q=[1,85],Z=[12,14,42],J=[12,14,33,42],ee=[12,14,33,42,76,77,79,80],te=[12,33],ne=[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],re={trace:QH(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:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection("TB");break;case 4:r.setDirection("BT");break;case 5:r.setDirection("RL");break;case 6:r.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,"SYSTEM"),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,"CONTAINER"),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode("node",...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode("nodeL",...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode("nodeR",...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem("person",...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem("external_person",...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem("system",...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem("system_db",...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem("system_queue",...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem("external_system",...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem("external_system_db",...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem("external_system_queue",...a[s]),this.$=a[s];break;case 47:r.addContainer("container",...a[s]),this.$=a[s];break;case 48:r.addContainer("container_db",...a[s]),this.$=a[s];break;case 49:r.addContainer("container_queue",...a[s]),this.$=a[s];break;case 50:r.addContainer("external_container",...a[s]),this.$=a[s];break;case 51:r.addContainer("external_container_db",...a[s]),this.$=a[s];break;case 52:r.addContainer("external_container_queue",...a[s]),this.$=a[s];break;case 53:r.addComponent("component",...a[s]),this.$=a[s];break;case 54:r.addComponent("component_db",...a[s]),this.$=a[s];break;case 55:r.addComponent("component_queue",...a[s]),this.$=a[s];break;case 56:r.addComponent("external_component",...a[s]),this.$=a[s];break;case 57:r.addComponent("external_component_db",...a[s]),this.$=a[s];break;case 58:r.addComponent("external_component_queue",...a[s]),this.$=a[s];break;case 60:r.addRel("rel",...a[s]),this.$=a[s];break;case 61:r.addRel("birel",...a[s]),this.$=a[s];break;case 62:r.addRel("rel_u",...a[s]),this.$=a[s];break;case 63:r.addRel("rel_d",...a[s]),this.$=a[s];break;case 64:r.addRel("rel_l",...a[s]),this.$=a[s];break;case 65:r.addRel("rel_r",...a[s]),this.$=a[s];break;case 66:r.addRel("rel_b",...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel("rel",...a[s]),this.$=a[s];break;case 68:r.updateElStyle("update_el_style",...a[s]),this.$=a[s];break;case 69:r.updateRelStyle("update_rel_style",...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig("update_layout_config",...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=""}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:70,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:71,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:72,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:73,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{14:[1,74]},e(q,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:h,40:d,41:p,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G}),e(q,[2,14]),e(W,[2,16],{12:[1,76]}),e(q,[2,36],{12:[1,77]}),e(V,[2,19]),e(V,[2,20]),{25:[1,78]},{27:[1,79]},e(V,[2,23]),{35:80,75:81,76:Y,77:X,79:K,80:Q},{35:86,75:81,76:Y,77:X,79:K,80:Q},{35:87,75:81,76:Y,77:X,79:K,80:Q},{35:88,75:81,76:Y,77:X,79:K,80:Q},{35:89,75:81,76:Y,77:X,79:K,80:Q},{35:90,75:81,76:Y,77:X,79:K,80:Q},{35:91,75:81,76:Y,77:X,79:K,80:Q},{35:92,75:81,76:Y,77:X,79:K,80:Q},{35:93,75:81,76:Y,77:X,79:K,80:Q},{35:94,75:81,76:Y,77:X,79:K,80:Q},{35:95,75:81,76:Y,77:X,79:K,80:Q},{35:96,75:81,76:Y,77:X,79:K,80:Q},{35:97,75:81,76:Y,77:X,79:K,80:Q},{35:98,75:81,76:Y,77:X,79:K,80:Q},{35:99,75:81,76:Y,77:X,79:K,80:Q},{35:100,75:81,76:Y,77:X,79:K,80:Q},{35:101,75:81,76:Y,77:X,79:K,80:Q},{35:102,75:81,76:Y,77:X,79:K,80:Q},{35:103,75:81,76:Y,77:X,79:K,80:Q},{35:104,75:81,76:Y,77:X,79:K,80:Q},e(Z,[2,59]),{35:105,75:81,76:Y,77:X,79:K,80:Q},{35:106,75:81,76:Y,77:X,79:K,80:Q},{35:107,75:81,76:Y,77:X,79:K,80:Q},{35:108,75:81,76:Y,77:X,79:K,80:Q},{35:109,75:81,76:Y,77:X,79:K,80:Q},{35:110,75:81,76:Y,77:X,79:K,80:Q},{35:111,75:81,76:Y,77:X,79:K,80:Q},{35:112,75:81,76:Y,77:X,79:K,80:Q},{35:113,75:81,76:Y,77:X,79:K,80:Q},{35:114,75:81,76:Y,77:X,79:K,80:Q},{35:115,75:81,76:Y,77:X,79:K,80:Q},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:Y,77:X,79:K,80:Q},{35:120,75:81,76:Y,77:X,79:K,80:Q},{35:121,75:81,76:Y,77:X,79:K,80:Q},{35:122,75:81,76:Y,77:X,79:K,80:Q},{35:123,75:81,76:Y,77:X,79:K,80:Q},{35:124,75:81,76:Y,77:X,79:K,80:Q},{35:125,75:81,76:Y,77:X,79:K,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(q,[2,15]),e(W,[2,17],{21:22,19:130,22:t,23:n,24:r,26:i,28:a}),e(q,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:n,24:r,26:i,28:a,34:o,36:s,37:l,38:u,39:h,40:d,41:p,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G}),e(V,[2,21]),e(V,[2,22]),e(Z,[2,39]),e(J,[2,71],{75:81,35:132,76:Y,77:X,79:K,80:Q}),e(ee,[2,73]),{78:[1,133]},e(ee,[2,75]),e(ee,[2,76]),e(Z,[2,40]),e(Z,[2,41]),e(Z,[2,42]),e(Z,[2,43]),e(Z,[2,44]),e(Z,[2,45]),e(Z,[2,46]),e(Z,[2,47]),e(Z,[2,48]),e(Z,[2,49]),e(Z,[2,50]),e(Z,[2,51]),e(Z,[2,52]),e(Z,[2,53]),e(Z,[2,54]),e(Z,[2,55]),e(Z,[2,56]),e(Z,[2,57]),e(Z,[2,58]),e(Z,[2,60]),e(Z,[2,61]),e(Z,[2,62]),e(Z,[2,63]),e(Z,[2,64]),e(Z,[2,65]),e(Z,[2,66]),e(Z,[2,67]),e(Z,[2,68]),e(Z,[2,69]),e(Z,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(te,[2,28]),e(te,[2,29]),e(te,[2,30]),e(te,[2,31]),e(te,[2,32]),e(te,[2,33]),e(te,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(W,[2,18]),e(q,[2,38]),e(J,[2,72]),e(ee,[2,74]),e(Z,[2,24]),e(Z,[2,35]),e(ne,[2,25]),e(ne,[2,26],{12:[1,138]}),e(ne,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ie=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:QH(function(e,t,n,r){switch(n){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:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;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: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:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58: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:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80: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 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\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,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,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return e}();function ae(){this.yy={}}return re.lexer=ie,QH(ae,"Parser"),ae.prototype=re,re.Parser=ae,new ae}();Dce.parser=Dce;var Pce,$ce=Dce,Bce=[],Fce=[""],zce="global",jce="",Hce=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Uce=[],Gce="",qce=!1,Wce=4,Vce=2,Yce=QH(function(){return Pce},"getC4Type"),Xce=QH(function(e){let t=iG(e,WG());Pce=t},"setC4Type"),Kce=QH(function(e,t,n,r,i,a,o,s,l){if(null==e||null==t||null==n||null==r)return;let c={};const u=Uce.find(e=>e.from===t&&e.to===n);if(u?c=u:Uce.push(c),c.type=e,c.from=t,c.to=n,c.label={text:r},null==i)c.techn={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];c[e]={text:t}}else c.techn={text:i};if(null==a)c.descr={text:""};else if("object"==typeof a){let[e,t]=Object.entries(a)[0];c[e]={text:t}}else c.descr={text:a};if("object"==typeof o){let[e,t]=Object.entries(o)[0];c[e]=t}else c.sprite=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];c[e]=t}else c.tags=s;if("object"==typeof l){let[e,t]=Object.entries(l)[0];c[e]=t}else c.link=l;c.wrap=bue()},"addRel"),Qce=QH(function(e,t,n,r,i,a,o){if(null===t||null===n)return;let s={};const l=Bce.find(e=>e.alias===t);if(l&&t===l.alias?s=l:(s.alias=t,Bce.push(s)),s.label=null==n?{text:""}:{text:n},null==r)s.descr={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];s[e]={text:t}}else s.descr={text:r};if("object"==typeof i){let[e,t]=Object.entries(i)[0];s[e]=t}else s.sprite=i;if("object"==typeof a){let[e,t]=Object.entries(a)[0];s[e]=t}else s.tags=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];s[e]=t}else s.link=o;s.typeC4Shape={text:e},s.parentBoundary=zce,s.wrap=bue()},"addPersonOrSystem"),Zce=QH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=Bce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,Bce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof a){let[e,t]=Object.entries(a)[0];l[e]=t}else l.sprite=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.wrap=bue(),l.typeC4Shape={text:e},l.parentBoundary=zce},"addContainer"),Jce=QH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=Bce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,Bce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof a){let[e,t]=Object.entries(a)[0];l[e]=t}else l.sprite=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.wrap=bue(),l.typeC4Shape={text:e},l.parentBoundary=zce},"addComponent"),eue=QH(function(e,t,n,r,i){if(null===e||null===t)return;let a={};const o=Hce.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Hce.push(a)),a.label=null==t?{text:""}:{text:t},null==n)a.type={text:"system"};else if("object"==typeof n){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};if("object"==typeof r){let[e,t]=Object.entries(r)[0];a[e]=t}else a.tags=r;if("object"==typeof i){let[e,t]=Object.entries(i)[0];a[e]=t}else a.link=i;a.parentBoundary=zce,a.wrap=bue(),jce=zce,zce=e,Fce.push(jce)},"addPersonOrSystemBoundary"),tue=QH(function(e,t,n,r,i){if(null===e||null===t)return;let a={};const o=Hce.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Hce.push(a)),a.label=null==t?{text:""}:{text:t},null==n)a.type={text:"container"};else if("object"==typeof n){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};if("object"==typeof r){let[e,t]=Object.entries(r)[0];a[e]=t}else a.tags=r;if("object"==typeof i){let[e,t]=Object.entries(i)[0];a[e]=t}else a.link=i;a.parentBoundary=zce,a.wrap=bue(),jce=zce,zce=e,Fce.push(jce)},"addContainerBoundary"),nue=QH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=Hce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,Hce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.type={text:"node"};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.type={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.nodeType=e,l.parentBoundary=zce,l.wrap=bue(),jce=zce,zce=t,Fce.push(jce)},"addDeploymentNode"),rue=QH(function(){zce=jce,Fce.pop(),jce=Fce.pop(),Fce.push(jce)},"popBoundaryParseStack"),iue=QH(function(e,t,n,r,i,a,o,s,l,c,u){let h=Bce.find(e=>e.alias===t);if(void 0!==h||(h=Hce.find(e=>e.alias===t),void 0!==h)){if(null!=n)if("object"==typeof n){let[e,t]=Object.entries(n)[0];h[e]=t}else h.bgColor=n;if(null!=r)if("object"==typeof r){let[e,t]=Object.entries(r)[0];h[e]=t}else h.fontColor=r;if(null!=i)if("object"==typeof i){let[e,t]=Object.entries(i)[0];h[e]=t}else h.borderColor=i;if(null!=a)if("object"==typeof a){let[e,t]=Object.entries(a)[0];h[e]=t}else h.shadowing=a;if(null!=o)if("object"==typeof o){let[e,t]=Object.entries(o)[0];h[e]=t}else h.shape=o;if(null!=s)if("object"==typeof s){let[e,t]=Object.entries(s)[0];h[e]=t}else h.sprite=s;if(null!=l)if("object"==typeof l){let[e,t]=Object.entries(l)[0];h[e]=t}else h.techn=l;if(null!=c)if("object"==typeof c){let[e,t]=Object.entries(c)[0];h[e]=t}else h.legendText=c;if(null!=u)if("object"==typeof u){let[e,t]=Object.entries(u)[0];h[e]=t}else h.legendSprite=u}},"updateElStyle"),aue=QH(function(e,t,n,r,i,a,o){const s=Uce.find(e=>e.from===t&&e.to===n);if(void 0!==s){if(null!=r)if("object"==typeof r){let[e,t]=Object.entries(r)[0];s[e]=t}else s.textColor=r;if(null!=i)if("object"==typeof i){let[e,t]=Object.entries(i)[0];s[e]=t}else s.lineColor=i;if(null!=a)if("object"==typeof a){let[e,t]=Object.entries(a)[0];s[e]=parseInt(t)}else s.offsetX=parseInt(a);if(null!=o)if("object"==typeof o){let[e,t]=Object.entries(o)[0];s[e]=parseInt(t)}else s.offsetY=parseInt(o)}},"updateRelStyle"),oue=QH(function(e,t,n){let r=Wce,i=Vce;if("object"==typeof t){const e=Object.values(t)[0];r=parseInt(e)}else r=parseInt(t);if("object"==typeof n){const e=Object.values(n)[0];i=parseInt(e)}else i=parseInt(n);r>=1&&(Wce=r),i>=1&&(Vce=i)},"updateLayoutConfig"),sue=QH(function(){return Wce},"getC4ShapeInRow"),lue=QH(function(){return Vce},"getC4BoundaryInRow"),cue=QH(function(){return zce},"getCurrentBoundaryParse"),uue=QH(function(){return jce},"getParentBoundaryParse"),hue=QH(function(e){return null==e?Bce:Bce.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),due=QH(function(e){return Bce.find(t=>t.alias===e)},"getC4Shape"),pue=QH(function(e){return Object.keys(hue(e))},"getC4ShapeKeys"),fue=QH(function(e){return null==e?Hce:Hce.filter(t=>t.parentBoundary===e)},"getBoundaries"),gue=fue,mue=QH(function(){return Uce},"getRels"),yue=QH(function(){return Gce},"getTitle"),vue=QH(function(e){qce=e},"setWrap"),bue=QH(function(){return qce},"autoWrap"),xue=QH(function(){Bce=[],Hce=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],jce="",zce="global",Fce=[""],Uce=[],Fce=[""],Gce="",qce=!1,Wce=4,Vce=2},"clear"),wue=QH(function(e){let t=iG(e,WG());Gce=t},"setTitle"),Eue={addPersonOrSystem:Qce,addPersonOrSystemBoundary:eue,addContainer:Zce,addContainerBoundary:tue,addComponent:Jce,addDeploymentNode:nue,popBoundaryParseStack:rue,addRel:Kce,updateElStyle:iue,updateRelStyle:aue,updateLayoutConfig:oue,autoWrap:bue,setWrap:vue,getC4ShapeArray:hue,getC4Shape:due,getC4ShapeKeys:pue,getBoundaries:fue,getBoundarys:gue,getCurrentBoundaryParse:cue,getParentBoundaryParse:uue,getRels:mue,getTitle:yue,getC4Type:Yce,getC4ShapeInRow:sue,getC4BoundaryInRow:lue,setAccTitle:BG,getAccTitle:FG,getAccDescription:jG,setAccDescription:zG,getConfig:QH(()=>WG().c4,"getConfig"),clear:xue,LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:wue,setC4Type:Xce},kue=QH(function(e,t){return Ace(e,t)},"drawRect"),Tue=QH(function(e,t,n,r,i,a){const o=e.append("image");o.attr("width",t),o.attr("height",n),o.attr("x",r),o.attr("y",i);let s=a.startsWith("data:image/png;base64")?a:OY(a);o.attr("xlink:href",s)},"drawImage"),_ue=QH((e,t,n)=>{const r=e.append("g");let i=0;for(let e of t){let t=e.textColor?e.textColor:"#444444",a=e.lineColor?e.lineColor:"#444444",o=e.offsetX?parseInt(e.offsetX):0,s=e.offsetY?parseInt(e.offsetY):0,l="";if(0===i){let t=r.append("line");t.attr("x1",e.startPoint.x),t.attr("y1",e.startPoint.y),t.attr("x2",e.endPoint.x),t.attr("y2",e.endPoint.y),t.attr("stroke-width","1"),t.attr("stroke",a),t.style("fill","none"),"rel_b"!==e.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==e.type&&"rel_b"!==e.type||t.attr("marker-start","url("+l+"#arrowend)"),i=-1}else{let t=r.append("path");t.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",e.startPoint.x).replaceAll("starty",e.startPoint.y).replaceAll("controlx",e.startPoint.x+(e.endPoint.x-e.startPoint.x)/2-(e.endPoint.x-e.startPoint.x)/4).replaceAll("controly",e.startPoint.y+(e.endPoint.y-e.startPoint.y)/2).replaceAll("stopx",e.endPoint.x).replaceAll("stopy",e.endPoint.y)),"rel_b"!==e.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==e.type&&"rel_b"!==e.type||t.attr("marker-start","url("+l+"#arrowend)")}let c=n.messageFont();$ue(n)(e.label.text,r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+o,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+s,e.label.width,e.label.height,{fill:t},c),e.techn&&""!==e.techn.text&&(c=n.messageFont(),$ue(n)("["+e.techn.text+"]",r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+o,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+n.messageFontSize+5+s,Math.max(e.label.width,e.techn.width),e.techn.height,{fill:t,"font-style":"italic"},c))}},"drawRels"),Cue=QH(function(e,t,n){const r=e.append("g");let i=t.bgColor?t.bgColor:"none",a=t.borderColor?t.borderColor:"#444444",o=t.fontColor?t.fontColor:"black",s={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(s={"stroke-width":1});let l={x:t.x,y:t.y,fill:i,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:s};kue(r,l);let c=n.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=o,$ue(n)(t.label.text,r,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},c),t.type&&""!==t.type.text&&(c=n.boundaryFont(),c.fontColor=o,$ue(n)(t.type.text,r,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},c)),t.descr&&""!==t.descr.text&&(c=n.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=o,$ue(n)(t.descr.text,r,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},c))},"drawBoundary"),Sue=QH(function(e,t,n){let r=t.bgColor?t.bgColor:n[t.typeC4Shape.text+"_bg_color"],i=t.borderColor?t.borderColor:n[t.typeC4Shape.text+"_border_color"],a=t.fontColor?t.fontColor:"#FFFFFF",o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="}const s=e.append("g");s.attr("class","person-man");const l=Mce();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=t.x,l.y=t.y,l.fill=r,l.width=t.width,l.height=t.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},kue(s,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2))}let c=Pue(n,t.typeC4Shape.text);switch(s.append("text").attr("fill",a).attr("font-family",c.fontFamily).attr("font-size",c.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":Tue(s,48,48,t.x+t.width/2-24,t.y+t.image.Y,o)}let u=n[t.typeC4Shape.text+"Font"]();return u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,$ue(n)(t.label.text,s,t.x,t.y+t.label.Y,t.width,t.height,{fill:a},u),u=n[t.typeC4Shape.text+"Font"](),u.fontColor=a,t.techn&&""!==t.techn?.text?$ue(n)(t.techn.text,s,t.x,t.y+t.techn.Y,t.width,t.height,{fill:a,"font-style":"italic"},u):t.type&&""!==t.type.text&&$ue(n)(t.type.text,s,t.x,t.y+t.type.Y,t.width,t.height,{fill:a,"font-style":"italic"},u),t.descr&&""!==t.descr.text&&(u=n.personFont(),u.fontColor=a,$ue(n)(t.descr.text,s,t.x,t.y+t.descr.Y,t.width,t.height,{fill:a},u)),t.height},"drawC4Shape"),Aue=QH(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Nue=QH(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Iue=QH(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Oue=QH(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),Lue=QH(function(e){e.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Mue=QH(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Rue=QH(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),Due=QH(function(e){const t=e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);t.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),t.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Pue=QH((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),$ue=function(){function e(e,t,n,i,a,o,s){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l){const{fontSize:c,fontFamily:u,fontWeight:h}=l,d=e.split(kG.lineBreakRegex);for(let e=0;e=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>jue)&&(t=this.nextData.startx+e.margin+Uue.nextLinePaddingX,r=this.nextData.stopy+2*e.margin,this.nextData.stopx=n=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=r+e.height,this.nextData.cnt=1),e.x=t,e.y=r,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",i,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},que(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},que=QH(function(e){pU(Uue,e),e.fontFamily&&(Uue.personFontFamily=Uue.systemFontFamily=Uue.messageFontFamily=e.fontFamily),e.fontSize&&(Uue.personFontSize=Uue.systemFontSize=Uue.messageFontSize=e.fontSize),e.fontWeight&&(Uue.personFontWeight=Uue.systemFontWeight=Uue.messageFontWeight=e.fontWeight)},"setConf"),Wue=QH((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Vue=QH(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),Yue=QH(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function Xue(e,t,n,r,i){if(!t[e].width)if(n)t[e].text=T5(t[e].text,i,r),t[e].textLines=t[e].text.split(kG.lineBreakRegex).length,t[e].width=i,t[e].height=C5(t[e].text,r);else{let n=t[e].text.split(kG.lineBreakRegex);t[e].textLines=n.length;let i=0;t[e].height=0,t[e].width=0;for(const a of n)t[e].width=Math.max(S5(a,r),t[e].width),i=C5(a,r),t[e].height=t[e].height+i}}QH(Xue,"calcC4ShapeTextWH");var Kue=QH(function(e,t,n){t.x=n.data.startx,t.y=n.data.starty,t.width=n.data.stopx-n.data.startx,t.height=n.data.stopy-n.data.starty,t.label.y=Uue.c4ShapeMargin-35;let r=t.wrap&&Uue.wrap,i=Vue(Uue);i.fontSize=i.fontSize+2,i.fontWeight="bold",Xue("label",t,r,i,S5(t.label.text,i)),Bue.drawBoundary(e,t,Uue)},"drawBoundary"),Que=QH(function(e,t,n,r){let i=0;for(const a of r){i=0;const r=n[a];let o=Wue(Uue,r.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,r.typeC4Shape.width=S5("«"+r.typeC4Shape.text+"»",o),r.typeC4Shape.height=o.fontSize+2,r.typeC4Shape.Y=Uue.c4ShapePadding,i=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height);let s=r.wrap&&Uue.wrap,l=Uue.width-2*Uue.c4ShapePadding,c=Wue(Uue,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Xue("label",r,s,c,l),r.label.Y=i+8,i=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",Xue("type",r,s,Wue(Uue,r.typeC4Shape.text),l),r.type.Y=i+5,i=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",Xue("techn",r,s,Wue(Uue,r.techn.text),l),r.techn.Y=i+5,i=r.techn.Y+r.techn.height}let u=i,h=r.label.width;if(r.descr&&""!==r.descr.text){Xue("descr",r,s,Wue(Uue,r.typeC4Shape.text),l),r.descr.Y=i+20,i=r.descr.Y+r.descr.height,h=Math.max(r.label.width,r.descr.width),u=i-5*r.descr.textLines}h+=Uue.c4ShapePadding,r.width=Math.max(r.width||Uue.width,h,Uue.width),r.height=Math.max(r.height||Uue.height,u,Uue.height),r.margin=r.margin||Uue.c4ShapeMargin,e.insert(r),Bue.drawC4Shape(t,r,Uue)}e.bumpLastMargin(Uue.c4ShapeMargin)},"drawC4ShapeArray"),Zue=class{static{QH(this,"Point")}constructor(e,t){this.x=e,this.y=t}},Jue=QH(function(e,t){let n=e.x,r=e.y,i=t.x,a=t.y,o=n+e.width/2,s=r+e.height/2,l=Math.abs(n-i),c=Math.abs(r-a),u=c/l,h=e.height/e.width,d=null;return r==a&&ni?d=new Zue(n,s):n==i&&ra&&(d=new Zue(o,r)),n>i&&r=u?new Zue(n,s+u*e.width/2):new Zue(o-l/c*e.height/2,r+e.height):n=u?new Zue(n+e.width,s+u*e.width/2):new Zue(o+l/c*e.height/2,r+e.height):na?d=h>=u?new Zue(n+e.width,s-u*e.width/2):new Zue(o+e.height/2*l/c,r):n>i&&r>a&&(d=h>=u?new Zue(n,s-e.width/2*u):new Zue(o-e.height/2*l/c,r)),d},"getIntersectPoint"),ehe=QH(function(e,t){let n={x:0,y:0};n.x=t.x+t.width/2,n.y=t.y+t.height/2;let r=Jue(e,n);return n.x=e.x+e.width/2,n.y=e.y+e.height/2,{startPoint:r,endPoint:Jue(t,n)}},"getIntersectPoints"),the=QH(function(e,t,n,r){let i=0;for(let e of t){i+=1;let t=e.wrap&&Uue.wrap,a=Yue(Uue);"C4Dynamic"===r.db.getC4Type()&&(e.label.text=i+": "+e.label.text);let o=S5(e.label.text,a);Xue("label",e,t,a,o),e.techn&&""!==e.techn.text&&(o=S5(e.techn.text,a),Xue("techn",e,t,a,o)),e.descr&&""!==e.descr.text&&(o=S5(e.descr.text,a),Xue("descr",e,t,a,o));let s=n(e.from),l=n(e.to),c=ehe(s,l);e.startPoint=c.startPoint,e.endPoint=c.endPoint}Bue.drawRels(e,t,Uue)},"drawRels");function nhe(e,t,n,r,i){let a=new Gue(i);a.data.widthLimit=n.data.widthLimit/Math.min(Hue,r.length);for(let[o,s]of r.entries()){let r=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=r,r=s.image.Y+s.image.height);let l=s.wrap&&Uue.wrap,c=Vue(Uue);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Xue("label",s,l,c,a.data.widthLimit),s.label.Y=r+8,r=s.label.Y+s.label.height,s.type&&""!==s.type.text){s.type.text="["+s.type.text+"]",Xue("type",s,l,Vue(Uue),a.data.widthLimit),s.type.Y=r+5,r=s.type.Y+s.type.height}if(s.descr&&""!==s.descr.text){let e=Vue(Uue);e.fontSize=e.fontSize-2,Xue("descr",s,l,e,a.data.widthLimit),s.descr.Y=r+20,r=s.descr.Y+s.descr.height}if(0==o||o%Hue===0){let e=n.data.startx+Uue.diagramMarginX,t=n.data.stopy+Uue.diagramMarginY+r;a.setData(e,e,t,t)}else{let e=a.data.stopx!==a.data.startx?a.data.stopx+Uue.diagramMarginX:a.data.startx,t=a.data.starty;a.setData(e,e,t,t)}a.name=s.alias;let u=i.db.getC4ShapeArray(s.alias),h=i.db.getC4ShapeKeys(s.alias);h.length>0&&Que(a,e,u,h),t=s.alias;let d=i.db.getBoundarys(t);d.length>0&&nhe(e,t,a,d,i),"global"!==s.alias&&Kue(e,s,a),n.data.stopy=Math.max(a.data.stopy+Uue.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(a.data.stopx+Uue.c4ShapeMargin,n.data.stopx),Fue=Math.max(Fue,n.data.stopx),zue=Math.max(zue,n.data.stopy)}}QH(nhe,"drawInsideBoundary");var rhe=QH(function(e,t,n,r){Uue=WG().c4;const i=WG().securityLevel;let a;"sandbox"===i&&(a=EK("#i"+t));const o=EK("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let s=r.db;r.db.setWrap(Uue.wrap),jue=s.getC4ShapeInRow(),Hue=s.getC4BoundaryInRow(),eU.debug(`C:${JSON.stringify(Uue,null,2)}`);const l="sandbox"===i?o.select(`[id="${t}"]`):EK(`[id="${t}"]`);Bue.insertComputerIcon(l),Bue.insertDatabaseIcon(l),Bue.insertClockIcon(l);let c=new Gue(r);c.setData(Uue.diagramMarginX,Uue.diagramMarginX,Uue.diagramMarginY,Uue.diagramMarginY),c.data.widthLimit=screen.availWidth,Fue=Uue.diagramMarginX,zue=Uue.diagramMarginY;const u=r.db.getTitle();nhe(l,"",c,r.db.getBoundarys(""),r),Bue.insertArrowHead(l),Bue.insertArrowEnd(l),Bue.insertArrowCrossHead(l),Bue.insertArrowFilledHead(l),the(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=Fue,c.data.stopy=zue;const h=c.data;let d=h.stopy-h.starty+2*Uue.diagramMarginY;const p=h.stopx-h.startx+2*Uue.diagramMarginX;u&&l.append("text").text(u).attr("x",(h.stopx-h.startx)/2-4*Uue.diagramMarginX).attr("y",h.starty+Uue.diagramMarginY),CG(l,d,p,Uue.useMaxWidth);const f=u?60:0;l.attr("viewBox",h.startx-Uue.diagramMarginX+" -"+(Uue.diagramMarginY+f)+" "+p+" "+(d+f)),eU.debug("models:",h)},"draw"),ihe={drawPersonOrSystemArray:Que,drawBoundary:Kue,setConf:que,draw:rhe},ahe={parser:$ce,db:Eue,renderer:ihe,styles:QH(e=>`.person {\n stroke: ${e.personBorder};\n fill: ${e.personBkg};\n }\n`,"getStyles"),init:QH(({c4:e,wrap:t})=>{ihe.setConf(e),Eue.setWrap(t)},"init")},ohe=Object.freeze({__proto__:null,diagram:ahe}),she=QH((e,t)=>{let n;"sandbox"===t&&(n=EK("#i"+e));return EK("sandbox"===t?n.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`)},"getDiagramElement"),lhe=QH((e,t,n,r)=>{e.attr("class",n);const{width:i,height:a,x:o,y:s}=che(e,t);CG(e,a,i,r);const l=uhe(o,s,i,a,t);e.attr("viewBox",l),eU.debug(`viewBox configured: ${l} with padding: ${t}`)},"setupViewPortForSVG"),che=QH((e,t)=>{const n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+2*t,height:n.height+2*t,x:n.x,y:n.y}},"calculateDimensionsWithPadding"),uhe=QH((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,"createViewBox"),hhe=class{constructor(){this.vertexCounter=0,this.config=WG(),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=BG,this.setAccDescription=zG,this.setDiagramTitle=HG,this.getAccTitle=FG,this.getAccDescription=jG,this.getDiagramTitle=UG,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")}static{QH(this,"FlowDB")}sanitizeText(e){return kG.sanitizeText(e,this.config)}lookUpDomId(e){for(const t of this.vertices.values())if(t.id===e)return t.domId;return e}addVertex(e,t,n,r,i,a,o={},s){if(!e||0===e.trim().length)return;let l;if(void 0!==s){let e;e=s.includes("\n")?s+"\n":"{\n"+s+"\n}",l=tY(e,{schema:eY})}const c=this.edges.find(t=>t.id===e);if(c){const e=l;return void 0!==e?.animate&&(c.animate=e.animate),void(void 0!==e?.animation&&(c.animation=e.animation))}let u,h=this.vertices.get(e);if(void 0===h&&(h={id:e,labelType:"text",domId:"flowchart-"+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,h)),this.vertexCounter++,void 0!==t?(this.config=WG(),u=this.sanitizeText(t.text.trim()),h.labelType=t.type,u.startsWith('"')&&u.endsWith('"')&&(u=u.substring(1,u.length-1)),h.text=u):void 0===h.text&&(h.text=e),void 0!==n&&(h.type=n),null!=r&&r.forEach(e=>{h.styles.push(e)}),null!=i&&i.forEach(e=>{h.classes.push(e)}),void 0!==a&&(h.dir=a),void 0===h.props?h.props=o:void 0!==o&&Object.assign(h.props,o),void 0!==l){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_"))throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!Dee(l.shape))throw new Error(`No such shape: ${l.shape}.`);h.type=l?.shape}l?.label&&(h.text=l?.label),l?.icon&&(h.icon=l?.icon,l.label?.trim()||h.text!==e||(h.text="")),l?.form&&(h.form=l?.form),l?.pos&&(h.pos=l?.pos),l?.img&&(h.img=l?.img,l.label?.trim()||h.text!==e||(h.text="")),l?.constraint&&(h.constraint=l.constraint),l.w&&(h.assetWidth=Number(l.w)),l.h&&(h.assetHeight=Number(l.h))}}addSingleLink(e,t,n,r){const i={start:e,end:t,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};eU.info("abc78 Got edge...",i);const a=n.text;if(void 0!==a&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith('"')&&i.text.endsWith('"')&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=a.type),void 0!==n&&(i.type=n.type,i.stroke=n.stroke,i.length=n.length>10?10:n.length),r&&!this.edges.some(e=>e.id===r))i.id=r,i.isUserDefinedId=!0;else{const e=this.edges.filter(e=>e.start===i.start&&e.end===i.end);0===e.length?i.id=F5(i.start,i.end,{counter:0,prefix:"L"}):i.id=F5(i.start,i.end,{counter:e.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);eU.info("Pushing edge..."),this.edges.push(i)}isLinkData(e){return null!==e&&"object"==typeof e&&"id"in e&&"string"==typeof e.id}addLink(e,t,n){const r=this.isLinkData(n)?n.id.replace("@",""):void 0;eU.info("addLink",e,t,r);for(const i of e)for(const a of t){const o=i===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(i,a,n,r):this.addSingleLink(i,a,n,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{"default"===e?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if("number"==typeof e&&e>=this.edges.length)throw new Error(`The index ${e} 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.)`);"default"===e?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith("fill"))&&this.edges[e]?.style?.push("fill:none"))})}addClass(e,t){const n=t.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(e=>{let t=this.classes.get(e);void 0===t&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),null!=n&&n.forEach(e=>{if(/color/.exec(e)){const n=e.replace("fill","bgFill");t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e,/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(e,t){for(const n of e.split(",")){const e=this.vertices.get(n);e&&e.classes.push(t);const r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);const i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(void 0!==t){t=this.sanitizeText(t);for(const n of e.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){const r=this.lookUpDomId(e);if("loose"!==WG().securityLevel)return;if(void 0===t)return;let i=[];if("string"==typeof n){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{const e=document.querySelector(`[id="${r}"]`);null!==e&&e.addEventListener("click",()=>{P5.runFunc(t,...i)},!1)}))}setLink(e,t,n){e.split(",").forEach(e=>{const r=this.vertices.get(e);void 0!==r&&(r.link=P5.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(",").forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let t=EK(".mermaidTooltip");null===(t._groups||t)[0][0]&&(t=EK("body").append("div").attr("class","mermaidTooltip").style("opacity",0));EK(e).select("svg").selectAll("g.node").on("mouseover",e=>{const n=EK(e.currentTarget);if(null===n.attr("title"))return;const r=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.text(n.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),t.html(t.html().replace(/<br\/>/g,"
    ")),n.classed("hover",!0)}).on("mouseout",e=>{t.transition().duration(500).style("opacity",0);EK(e.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=WG(),$G()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text;e===n&&/\s/.exec(n.text)&&(r=void 0);const a=QH(e=>{const t={boolean:{},number:{},string:{}},n=[];let r;const i=e.filter(function(e){const i=typeof e;return e.stmt&&"dir"===e.stmt?(r=e.value,!1):""!==e.trim()&&(i in t?!t[i].hasOwnProperty(e)&&(t[i][e]=!0):!n.includes(e)&&n.push(e))});return{nodeList:i,dir:r}},"uniq"),{nodeList:o,dir:s}=a(t.flat());if("gen-1"===this.version)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){const n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(e){let t=e.trim(),n="arrow_open";switch(t[0]){case"<":n="arrow_point",t=t.slice(1);break;case"x":n="arrow_cross",t=t.slice(1);break;case"o":n="arrow_circle",t=t.slice(1)}let r="normal";return t.includes("=")&&(r="thick"),t.includes(".")&&(r="dotted"),{type:n,stroke:r}}countChar(e,t){const n=t.length;let r=0;for(let i=0;i":r="arrow_point",t.startsWith("<")&&(r="double_"+r,n=n.slice(1));break;case"o":r="arrow_circle",t.startsWith("o")&&(r="double_"+r,n=n.slice(1))}let i="normal",a=n.length-1;n.startsWith("=")&&(i="thick"),n.startsWith("~")&&(i="invisible");const o=this.countChar(".",n);return o&&(i="dotted",a=o),{type:r,stroke:i,length:a}}destructLink(e,t){const n=this.destructEndLink(e);let r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===r.type)r.type=n.type;else{if(r.type!==n.type)return{type:"INVALID",stroke:"INVALID"};r.type="double_"+r.type}return"double_arrow"===r.type&&(r.type="double_arrow_point"),r.length=n.length,r}return n}exists(e,t){for(const n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){const n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return"circle"===e.form?"iconCircle":"square"===e.form?"iconSquare":"rounded"===e.form?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":t=e.replace("double_",""),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){const o=n.get(e.id),s=r.get(e.id)??!1,l=this.findNode(t,e.id);if(l)l.cssStyles=e.styles,l.cssCompiledStyles=this.getCompiledStyles(e.classes),l.cssClasses=e.classes.join(" ");else{const n={id:e.id,label:e.text,labelStyle:"",parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:"rect"}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let t=[];for(const n of e){const e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){const e=WG(),t=[],n=[],r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){const t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(const e of t.nodes)i.set(e,t.id)}for(let n=r.length-1;n>=0;n--){const a=r[n];t.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,t,i,a,e,e.look||"classic")});const o=this.getEdges();return o.forEach((t,r)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),s=[...o.defaultStyle??[]];t.style&&s.push(...t.style);const l={id:F5(t.start,t.end,{counter:r,prefix:"L"},t.id),isUserDefinedId:t.isUserDefinedId,start:t.start,end:t.end,type:t.type??"normal",label:t.text,labelpos:"c",thickness:t.stroke,minlen:t.length,classes:"invisible"===t?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===t?.stroke||"arrow_open"===t?.type?"none":i,arrowTypeEnd:"invisible"===t?.stroke||"arrow_open"===t?.type?"none":a,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:s,style:s,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};n.push(l)}),{nodes:t,edges:n,other:{},config:e}}defaultConfig(){return YG.flowchart}},dhe=QH(function(e,t){return t.db.getClasses()},"getClasses"),phe=QH(async function(e,t,n,r){eU.info("REF0:"),eU.info("Drawing state diagram (v2)",t);const{securityLevel:i,flowchart:a,layout:o}=WG();let s;"sandbox"===i&&(s=EK("#i"+t));const l="sandbox"===i?s.nodes()[0].contentDocument:document;eU.debug("Before getData: ");const c=r.db.getData();eU.debug("Data: ",c);const u=she(t,i),h=r.db.getDirection();c.type=r.type,c.layoutAlgorithm=Cte(o),"dagre"===c.layoutAlgorithm&&"elk"===o&&eU.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=h,c.nodeSpacing=a?.nodeSpacing||50,c.rankSpacing=a?.rankSpacing||50,c.markers=["point","circle","cross"],c.diagramId=t,eU.debug("REF1:",c),await _te(c,u);const d=c.config.flowchart?.diagramPadding??8;P5.insertTitle(u,"flowchartTitleText",a?.titleTopMargin||0,r.db.getDiagramTitle()),lhe(u,d,"flowchart",a?.useMaxWidth||!1);for(const e of c.nodes){const n=EK(`#${t} [id="${e.id}"]`);if(!n||!e.link)continue;const r=l.createElementNS("http://www.w3.org/2000/svg","a");r.setAttributeNS("http://www.w3.org/2000/svg","class",e.cssClasses),r.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?r.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):e.linkTarget&&r.setAttributeNS("http://www.w3.org/2000/svg","target",e.linkTarget);const a=n.insert(function(){return r},":first-child"),o=n.select(".label-container");o&&a.append(function(){return o.node()});const s=n.select(".label");s&&a.append(function(){return s.node()})}},"draw"),fhe={getClasses:dhe,draw:phe},ghe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],a=[2,2],o=[1,13],s=[1,14],l=[1,15],c=[1,16],u=[1,23],h=[1,25],d=[1,26],p=[1,27],f=[1,49],g=[1,48],m=[1,29],y=[1,30],v=[1,31],b=[1,32],x=[1,33],w=[1,44],E=[1,46],k=[1,42],T=[1,47],_=[1,43],C=[1,50],S=[1,45],A=[1,51],N=[1,52],I=[1,34],O=[1,35],L=[1,36],M=[1,37],R=[1,57],D=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],P=[1,61],$=[1,60],B=[1,62],F=[8,9,11,75,77,78],z=[1,78],j=[1,91],H=[1,96],U=[1,95],G=[1,92],q=[1,88],W=[1,94],V=[1,90],Y=[1,97],X=[1,93],K=[1,98],Q=[1,89],Z=[8,9,10,11,40,75,77,78],J=[8,9,10,11,40,46,75,77,78],ee=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ne=[44,60,89,102,105,106,109,111,114,115,116],re=[1,121],ie=[1,122],ae=[1,124],oe=[1,123],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],le=[1,133],ce=[1,147],ue=[1,148],he=[1,149],de=[1,150],pe=[1,135],fe=[1,137],ge=[1,141],me=[1,142],ye=[1,143],ve=[1,144],be=[1,145],xe=[1,146],we=[1,151],Ee=[1,152],ke=[1,131],Te=[1,132],_e=[1,139],Ce=[1,134],Se=[1,138],Ae=[1,136],Ne=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],Ie=[1,154],Oe=[1,156],Le=[8,9,11],Me=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Re=[1,176],De=[1,172],Pe=[1,173],$e=[1,177],Be=[1,174],Fe=[1,175],ze=[77,116,119],je=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],He=[10,106],Ue=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ge=[1,247],qe=[1,245],We=[1,249],Ve=[1,243],Ye=[1,244],Xe=[1,246],Ke=[1,248],Qe=[1,250],Ze=[1,268],Je=[8,9,11,106],et=[8,9,10,11,60,84,105,106,109,110,111,112],tt={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:case 44:case 54:case 76:case 181:this.$=a[s];break;case 11:r.setDirection("TB"),this.$="TB";break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:case 133:this.$=a[s-1]+a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:case 128:case 130:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"square");break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"doublecircle");break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"circle");break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"ellipse");break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"stadium");break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"subroutine");break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"cylinder");break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"round");break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"diamond");break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"hexagon");break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"odd");break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"trapezoid");break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"inv_trapezoid");break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_right");break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_left");break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 77:var l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1]};break;case 78:l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1],id:a[s-3]};break;case 79:case 86:case 101:case 103:this.$={text:a[s],type:"text"};break;case 80:case 87:case 102:this.$={text:a[s-1].text+""+a[s],type:a[s-1].type};break;case 81:case 88:this.$={text:a[s],type:"string"};break;case 82:case 89:case 104:this.$={text:a[s],type:"markdown"};break;case 83:l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 182:case 184:this.$=a[s-1]+""+a[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"}}},"anonymous"),table:[{3:1,4:2,9:t,10:n,12:r},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:n,12:r},{4:8,9:t,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,54],9:[1,55],10:R,15:53,18:56},e(D,[2,3]),e(D,[2,4]),e(D,[2,5]),e(D,[2,6]),e(D,[2,7]),e(D,[2,8]),{8:P,9:$,11:B,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:P,9:$,11:B,21:67},{8:P,9:$,11:B,21:68},{8:P,9:$,11:B,21:69},{8:P,9:$,11:B,21:70},{8:P,9:$,11:B,21:71},{8:P,9:$,10:[1,72],11:B,21:73},e(D,[2,36]),{35:[1,74]},{37:[1,75]},e(D,[2,39]),e(F,[2,50],{18:76,39:77,10:R,40:z}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:j,44:H,60:U,80:[1,86],89:G,95:[1,83],97:[1,84],101:85,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},e(D,[2,185]),e(D,[2,186]),e(D,[2,187]),e(D,[2,188]),e(Z,[2,51]),e(Z,[2,54],{46:[1,99]}),e(J,[2,72],{113:112,29:[1,100],44:f,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:g,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),e(ee,[2,181]),e(ee,[2,142]),e(ee,[2,143]),e(ee,[2,144]),e(ee,[2,145]),e(ee,[2,146]),e(ee,[2,147]),e(ee,[2,148]),e(ee,[2,149]),e(ee,[2,150]),e(ee,[2,151]),e(ee,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,113]},e(te,[2,26],{18:114,10:R}),e(D,[2,27]),{42:115,43:38,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(D,[2,40]),e(D,[2,41]),e(D,[2,42]),e(ne,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:re,81:ie,116:ae,119:oe},{75:[1,125],77:[1,126]},e(se,[2,83]),e(D,[2,28]),e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),{10:le,12:ce,14:ue,27:he,28:127,32:de,44:pe,60:fe,75:ge,80:[1,129],81:[1,130],83:140,84:me,85:ye,86:ve,87:be,88:xe,89:we,90:Ee,91:128,105:ke,109:Te,111:_e,114:Ce,115:Se,116:Ae},e(Ne,a,{5:153}),e(D,[2,37]),e(D,[2,38]),e(F,[2,48],{44:Ie}),e(F,[2,49],{18:155,10:R,40:Oe}),e(Z,[2,44]),{44:f,47:157,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{102:[1,158],103:159,105:[1,160]},{44:f,47:161,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{44:f,47:162,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},e(Le,[2,115],{120:167,10:[1,166],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,117],{10:[1,168]}),e(Me,[2,183]),e(Me,[2,170]),e(Me,[2,171]),e(Me,[2,172]),e(Me,[2,173]),e(Me,[2,174]),e(Me,[2,175]),e(Me,[2,176]),e(Me,[2,177]),e(Me,[2,178]),e(Me,[2,179]),e(Me,[2,180]),{44:f,47:169,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{30:170,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:178,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:180,50:[1,179],67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:181,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:182,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:183,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{109:[1,184]},{30:185,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:186,65:[1,187],67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:188,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:189,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:190,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(ee,[2,182]),e(i,[2,20]),e(te,[2,25]),e(F,[2,46],{39:191,18:192,10:R,40:z}),e(ne,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{77:[1,196],79:197,116:ae,119:oe},e(ze,[2,79]),e(ze,[2,81]),e(ze,[2,82]),e(ze,[2,168]),e(ze,[2,169]),{76:198,79:120,80:re,81:ie,116:ae,119:oe},e(se,[2,84]),{8:P,9:$,10:le,11:B,12:ce,14:ue,21:200,27:he,29:[1,199],32:de,44:pe,60:fe,75:ge,83:140,84:me,85:ye,86:ve,87:be,88:xe,89:we,90:Ee,91:201,105:ke,109:Te,111:_e,114:Ce,115:Se,116:Ae},e(je,[2,101]),e(je,[2,103]),e(je,[2,104]),e(je,[2,157]),e(je,[2,158]),e(je,[2,159]),e(je,[2,160]),e(je,[2,161]),e(je,[2,162]),e(je,[2,163]),e(je,[2,164]),e(je,[2,165]),e(je,[2,166]),e(je,[2,167]),e(je,[2,90]),e(je,[2,91]),e(je,[2,92]),e(je,[2,93]),e(je,[2,94]),e(je,[2,95]),e(je,[2,96]),e(je,[2,97]),e(je,[2,98]),e(je,[2,99]),e(je,[2,100]),{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,202],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},{10:R,18:203},{44:[1,204]},e(Z,[2,43]),{10:[1,205],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{10:[1,206]},{10:[1,207],106:[1,208]},e(He,[2,128]),{10:[1,209],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{10:[1,210],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{80:[1,211]},e(Le,[2,109],{10:[1,212]}),e(Le,[2,111],{10:[1,213]}),{80:[1,214]},e(Me,[2,184]),{80:[1,215],98:[1,216]},e(Z,[2,55],{113:112,44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),{31:[1,217],67:Re,82:218,116:$e,117:Be,118:Fe},e(Ue,[2,86]),e(Ue,[2,88]),e(Ue,[2,89]),e(Ue,[2,153]),e(Ue,[2,154]),e(Ue,[2,155]),e(Ue,[2,156]),{49:[1,219],67:Re,82:218,116:$e,117:Be,118:Fe},{30:220,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{51:[1,221],67:Re,82:218,116:$e,117:Be,118:Fe},{53:[1,222],67:Re,82:218,116:$e,117:Be,118:Fe},{55:[1,223],67:Re,82:218,116:$e,117:Be,118:Fe},{57:[1,224],67:Re,82:218,116:$e,117:Be,118:Fe},{60:[1,225]},{64:[1,226],67:Re,82:218,116:$e,117:Be,118:Fe},{66:[1,227],67:Re,82:218,116:$e,117:Be,118:Fe},{30:228,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{31:[1,229],67:Re,82:218,116:$e,117:Be,118:Fe},{67:Re,69:[1,230],71:[1,231],82:218,116:$e,117:Be,118:Fe},{67:Re,69:[1,233],71:[1,232],82:218,116:$e,117:Be,118:Fe},e(F,[2,45],{18:155,10:R,40:Oe}),e(F,[2,47],{44:Ie}),e(ne,[2,75]),e(ne,[2,74]),{62:[1,234],67:Re,82:218,116:$e,117:Be,118:Fe},e(ne,[2,77]),e(ze,[2,80]),{77:[1,235],79:197,116:ae,119:oe},{30:236,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(Ne,a,{5:237}),e(je,[2,102]),e(D,[2,35]),{43:238,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{10:R,18:239},{10:Ge,60:qe,84:We,92:240,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:251,104:[1,252],105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:253,104:[1,254],105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{105:[1,255]},{10:Ge,60:qe,84:We,92:256,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{44:f,47:257,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},e(Le,[2,116]),e(Le,[2,118],{10:[1,261]}),e(Le,[2,119]),e(J,[2,56]),e(Ue,[2,87]),e(J,[2,57]),{51:[1,262],67:Re,82:218,116:$e,117:Be,118:Fe},e(J,[2,64]),e(J,[2,59]),e(J,[2,60]),e(J,[2,61]),{109:[1,263]},e(J,[2,63]),e(J,[2,65]),{66:[1,264],67:Re,82:218,116:$e,117:Be,118:Fe},e(J,[2,67]),e(J,[2,68]),e(J,[2,70]),e(J,[2,69]),e(J,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(ne,[2,78]),{31:[1,265],67:Re,82:218,116:$e,117:Be,118:Fe},{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,266],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},e(Z,[2,53]),{43:267,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,121],{106:Ze}),e(Je,[2,130],{108:269,10:Ge,60:qe,84:We,105:Ve,109:Ye,110:Xe,111:Ke,112:Qe}),e(et,[2,132]),e(et,[2,134]),e(et,[2,135]),e(et,[2,136]),e(et,[2,137]),e(et,[2,138]),e(et,[2,139]),e(et,[2,140]),e(et,[2,141]),e(Le,[2,122],{106:Ze}),{10:[1,270]},e(Le,[2,123],{106:Ze}),{10:[1,271]},e(He,[2,129]),e(Le,[2,105],{106:Ze}),e(Le,[2,106],{113:112,44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),e(Le,[2,110]),e(Le,[2,112],{10:[1,272]}),e(Le,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:P,9:$,11:B,21:277},e(D,[2,34]),e(Z,[2,52]),{10:Ge,60:qe,84:We,105:Ve,107:278,108:242,109:Ye,110:Xe,111:Ke,112:Qe},e(et,[2,133]),{14:j,44:H,60:U,89:G,101:279,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},{14:j,44:H,60:U,89:G,101:280,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},{98:[1,281]},e(Le,[2,120]),e(J,[2,58]),{30:282,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(J,[2,66]),e(Ne,a,{5:283}),e(Je,[2,131],{108:269,10:Ge,60:qe,84:We,105:Ve,109:Ye,110:Xe,111:Ke,112:Qe}),e(Le,[2,126],{120:167,10:[1,284],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,127],{120:167,10:[1,285],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,114]),{31:[1,286],67:Re,82:218,116:$e,117:Be,118:Fe},{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,287],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},{10:Ge,60:qe,84:We,92:288,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:289,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},e(J,[2,62]),e(D,[2,33]),e(Le,[2,124],{106:Ze}),e(Le,[2,125],{106:Ze})],defaultActions:{},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},nt=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:QH(function(e,t,n,r){switch(n){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:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),t.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const n=/\n\s*/g;return t.yytext=t.yytext.replace(n,"
    "),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";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 34:return 88;case 35:case 36:case 37:return e.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 98;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:case 102:return 111;case 62:return 46;case 63:return 60;case 64:case 103:return 44;case 65:return 8;case 66:return 106;case 67:case 101:return 115;case 68:case 71:case 74:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:case 73:case 76:return 119;case 72:return this.pushState("thickEdgeText"),75;case 75:return this.pushState("dottedEdgeText"),75;case 77:return 77;case 78:return this.popState(),53;case 79:case 115:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-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]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return e}();function rt(){this.yy={}}return tt.lexer=nt,QH(rt,"Parser"),rt.prototype=tt,tt.Parser=rt,new rt}();ghe.parser=ghe;var mhe=ghe,yhe=Object.assign({},mhe);yhe.parse=e=>{const t=e.replace(/}\s*\n/g,"}\n");return mhe.parse(t)};var vhe=yhe,bhe=QH((e,t)=>{const n=Pj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return Dj(r,i,a,t)},"fade"),xhe=QH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span {\n color: ${e.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${e.lineColor} !important;\n stroke-width: 0;\n stroke: ${e.lineColor};\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${bhe(e.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n`,"getStyles"),whe={parser:vhe,get db(){return new hhe},renderer:fhe,styles:xhe,init:QH(e=>{e.flowchart||(e.flowchart={}),e.layout&&VG({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,VG({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")},Ehe=Object.freeze({__proto__:null,diagram:whe}),khe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],n=[1,10],r=[1,11],i=[1,12],a=[1,13],o=[1,20],s=[1,21],l=[1,22],c=[1,23],u=[1,24],h=[1,19],d=[1,25],p=[1,26],f=[1,18],g=[1,33],m=[1,34],y=[1,35],v=[1,36],b=[1,37],x=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],w=[1,42],E=[1,43],k=[1,52],T=[40,50,68,69],_=[1,63],C=[1,61],S=[1,58],A=[1,62],N=[1,64],I=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],O=[63,64,65,66,67],L=[1,81],M=[1,80],R=[1,78],D=[1,79],P=[6,10,42,47],$=[6,10,13,41,42,47,48,49],B=[1,89],F=[1,88],z=[1,87],j=[19,56],H=[1,98],U=[1,97],G=[19,56,58,60],q={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes: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:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:case 55:case 78:case 62:case 63:case 66:this.$=a[s];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 56:case 64:case 43:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 44:case 65:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 76:case 77:case 67:this.$=a[s].replace(/"/g,"");break;case 57:a[s].push(a[s-1]),this.$=a[s];break;case 58:this.$={type:a[s-1],name:a[s]};break;case 59:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 60:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 61:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 68:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 69:this.$=r.Cardinality.ZERO_OR_ONE;break;case 70:this.$=r.Cardinality.ZERO_OR_MORE;break;case 71:this.$=r.Cardinality.ONE_OR_MORE;break;case 72:this.$=r.Cardinality.ONLY_ONE;break;case 73:this.$=r.Cardinality.MD_PARENT;break;case 74:this.$=r.Identification.NON_IDENTIFYING;break;case 75:this.$=r.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:n,24:r,26:i,28:a,29:14,30:15,31:16,32:17,33:o,34:s,35:l,36:c,37:u,40:h,43:d,44:p,50:f},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:27,11:9,22:n,24:r,26:i,28:a,29:14,30:15,31:16,32:17,33:o,34:s,35:l,36:c,37:u,40:h,43:d,44:p,50:f},e(t,[2,5]),e(t,[2,6]),e(t,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:g,64:m,65:y,66:v,67:b}),{23:[1,38]},{25:[1,39]},{27:[1,40]},e(t,[2,27]),e(t,[2,28]),e(t,[2,29]),e(t,[2,30]),e(t,[2,31]),e(x,[2,54]),e(x,[2,55]),e(t,[2,32]),e(t,[2,33]),e(t,[2,34]),e(t,[2,35]),{16:41,40:w,41:E},{16:44,40:w,41:E},{16:45,40:w,41:E},e(t,[2,4]),{11:46,40:h,50:f},{16:47,40:w,41:E},{18:48,19:[1,49],51:50,52:51,56:k},{11:53,40:h,50:f},{62:54,68:[1,55],69:[1,56]},e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),{13:_,38:57,41:C,42:S,45:59,46:60,48:A,49:N},e(I,[2,37]),e(I,[2,38]),{16:65,40:w,41:E,42:S},{13:_,38:66,41:C,42:S,45:59,46:60,48:A,49:N},{13:[1,67],15:[1,68]},e(t,[2,17],{61:32,12:69,17:[1,70],42:S,63:g,64:m,65:y,66:v,67:b}),{19:[1,71]},e(t,[2,14]),{18:72,19:[2,56],51:50,52:51,56:k},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:g,64:m,65:y,66:v,67:b},e(O,[2,74]),e(O,[2,75]),{6:L,10:M,39:77,42:R,47:D},{40:[1,82],41:[1,83]},e(P,[2,43],{46:84,13:_,41:C,48:A,49:N}),e($,[2,45]),e($,[2,50]),e($,[2,51]),e($,[2,52]),e($,[2,53]),e(t,[2,41],{42:S}),{6:L,10:M,39:85,42:R,47:D},{14:86,40:B,50:F,70:z},{16:90,40:w,41:E},{11:91,40:h,50:f},{18:92,19:[1,93],51:50,52:51,56:k},e(t,[2,12]),{19:[2,57]},e(j,[2,58],{54:94,55:95,57:96,59:H,60:U}),e([19,56,59,60],[2,63]),e(t,[2,22],{15:[1,100],17:[1,99]}),e([40,50],[2,68]),e(t,[2,36]),{13:_,41:C,45:101,46:60,48:A,49:N},e(t,[2,47]),e(t,[2,48]),e(t,[2,49]),e(I,[2,39]),e(I,[2,40]),e($,[2,46]),e(t,[2,42]),e(t,[2,8]),e(t,[2,76]),e(t,[2,77]),e(t,[2,78]),{13:[1,102],42:S},{13:[1,104],15:[1,103]},{19:[1,105]},e(t,[2,15]),e(j,[2,59],{55:106,58:[1,107],60:U}),e(j,[2,60]),e(G,[2,64]),e(j,[2,67]),e(G,[2,66]),{18:108,19:[1,109],51:50,52:51,56:k},{16:110,40:w,41:E},e(P,[2,44],{46:84,13:_,41:C,48:A,49:N}),{14:111,40:B,50:F,70:z},{16:112,40:w,41:E},{14:113,40:B,50:F,70:z},e(t,[2,13]),e(j,[2,61]),{57:114,59:H},{19:[1,115]},e(t,[2,20]),e(t,[2,23],{17:[1,116],42:S}),e(t,[2,11]),{13:[1,117],42:S},e(t,[2,10]),e(G,[2,65]),e(t,[2,18]),{18:118,19:[1,119],51:50,52:51,56:k},{14:120,40:B,50:F,70:z},{19:[1,121]},e(t,[2,21]),e(t,[2,9]),e(t,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},W=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;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 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 59;case 25:case 26:return 56;case 27:return 60;case 29:return this.popState(),19;case 30:case 73:return t.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 59:return 63;case 42:case 43:case 44:case 52:case 54:case 61:return 65;case 47:case 48:case 49:case 50:case 51:case 53:case 60:return 64;case 55:case 56:case 57:case 58:return 66;case 62:return 67;case 63:case 66:case 67:case 68:return 68;case 64:case 65:return 69;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 74: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,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/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,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/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,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,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,71,72,73,74],inclusive:!0}}};return e}();function V(){this.yy={}}return q.lexer=W,QH(V,"Parser"),V.prototype=q,q.Parser=V,new V}();khe.parser=khe;var The=khe,_he=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=BG,this.getAccTitle=FG,this.setAccDescription=zG,this.getAccDescription=jG,this.setDiagramTitle=HG,this.getDiagramTitle=UG,this.getConfig=QH(()=>WG().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{QH(this,"ErDB")}addEntity(e,t=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,eU.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:"erBox",look:WG().look??"default",cssClasses:"default",cssStyles:[]}),eU.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){const n=this.addEntity(e);let r;for(r=t.length-1;r>=0;r--)t[r].keys||(t[r].keys=[]),t[r].comment||(t[r].comment=""),n.attributes.push(t[r]),eU.debug("Added attribute ",t[r].name)}addRelationship(e,t,n,r){const i=this.entities.get(e),a=this.entities.get(n);if(!i||!a)return;const o={entityA:i.id,roleA:t,entityB:a.id,relSpec:r};this.relationships.push(o),eU.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(const n of e){const e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(const n of e){const e=this.entities.get(n);if(!t||!e)return;for(const n of t)e.cssStyles.push(n)}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);void 0===n&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){const t=e.replace("fill","bgFill");n.textStyles.push(t)}n.styles.push(e)})})}setClass(e,t){for(const n of e){const e=this.entities.get(n);if(e)for(const n of t)e.cssClasses+=" "+n}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],$G()}getData(){const e=[],t=[],n=WG();for(const t of this.entities.keys()){const n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(" ")),e.push(n))}let r=0;for(const e of this.relationships){const i={id:F5(e.entityA,e.entityB,{prefix:"id",counter:r++}),type:"normal",curve:"basis",start:e.entityA,end:e.entityB,label:e.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==e.relSpec.relType?"solid":"dashed",look:n.look};t.push(i)}return{nodes:e,edges:t,other:{},config:n,direction:"TB"}}},Che={};ZH(Che,{draw:()=>She});var She=QH(async function(e,t,n,r){eU.info("REF0:"),eU.info("Drawing er diagram (unified)",t);const{securityLevel:i,er:a,layout:o}=WG(),s=r.db.getData(),l=she(t,i);s.type=r.type,s.layoutAlgorithm=Cte(o),s.config.flowchart.nodeSpacing=a?.nodeSpacing||140,s.config.flowchart.rankSpacing=a?.rankSpacing||80,s.direction=r.db.getDirection(),s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],s.diagramId=t,await _te(s,l),"elk"===s.layoutAlgorithm&&l.select(".edges").lower();const c=l.selectAll('[id*="-background"]');Array.from(c).length>0&&c.each(function(){const e=EK(this),t=e.attr("id").replace("-background",""),n=l.select(`#${CSS.escape(t)}`);if(!n.empty()){const t=n.attr("transform");e.attr("transform",t)}});P5.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),lhe(l,8,"erDiagram",a?.useMaxWidth??!0)},"draw"),Ahe=QH((e,t)=>{const n=Pj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return Dj(r,i,a,t)},"fade"),Nhe=QH(e=>`\n .entityBox {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${e.tertiaryColor};\n opacity: 0.7;\n background-color: ${e.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${Ahe(e.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${e.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${e.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n }\n`,"getStyles"),Ihe={parser:The,get db(){return new _he},renderer:Che,styles:Nhe},Ohe=Object.freeze({__proto__:null,diagram:Ihe});function Lhe(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}QH(Lhe,"populateCommonDb");var Mhe=class{constructor(e){this.init=e,this.records=this.init()}static{QH(this,"ImperativeState")}reset(){this.records=this.init()}};function Rhe(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$type}function Dhe(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$refText}function Phe(e){return"object"==typeof e&&null!==e&&Rhe(e.container)&&Dhe(e.reference)&&"string"==typeof e.message}class $he{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return Rhe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const r=n[t];if(void 0!==r)return r;{const r=this.computeIsSubtype(e,t);return n[t]=r,r}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const t=this.getAllTypes(),n=[];for(const r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}}function Bhe(e){return"object"==typeof e&&null!==e&&Array.isArray(e.content)}function Fhe(e){return"object"==typeof e&&null!==e&&"object"==typeof e.tokenType}function zhe(e){return Bhe(e)&&"string"==typeof e.fullText}class jhe{constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){const e=this.iterator();return Boolean(e.next().done)}count(){const e=this.iterator();let t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){const e=[],t=this.iterator();let n;do{n=t.next(),void 0!==n.value&&e.push(n.value)}while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){const n=this.map(n=>[e?e(n):n,t?t(n):n]);return new Map(n)}toString(){return this.join()}concat(e){return new jhe(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),e=>{let t;if(!e.firstDone){do{if(t=this.nextFn(e.first),!t.done)return t}while(!t.done);e.firstDone=!0}do{if(t=e.iterator.next(),!t.done)return t}while(!t.done);return qhe})}join(e=","){const t=this.iterator();let n,r="",i=!1;do{n=t.next(),n.done||(i&&(r+=e),r+=Hhe(n.value)),i=!0}while(!n.done);return r}indexOf(e,t=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(e){return new jhe(this.startFn,t=>{const{done:n,value:r}=this.nextFn(t);return n?qhe:{done:!1,value:e(r)}})}filter(e){return new jhe(this.startFn,t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return qhe})}nonNullable(){return this.filter(e=>null!=e)}reduce(e,t){const n=this.iterator();let r=t,i=n.next();for(;!i.done;)r=void 0===r?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){const r=e.next();if(r.done)return n;const i=this.recursiveReduce(e,t,n);return void 0===i?r.value:t(i,r.value)}find(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(e){return new jhe(()=>({this:this.startFn()}),t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!Uhe(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return qhe})}flat(e){if(void 0===e&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new jhe(()=>({this:t.startFn()}),e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}const{done:n,value:r}=t.nextFn(e.this);if(!n){if(!Uhe(r))return{done:!1,value:r};e.iterator=r[Symbol.iterator]()}}while(e.iterator);return qhe})}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new jhe(()=>{const t=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),t=>(t.size++,t.size>e?qhe:this.nextFn(t.state)))}distinct(e){return new jhe(()=>({set:new Set,internalState:this.startFn()}),t=>{let n;do{if(n=this.nextFn(t.internalState),!n.done){const r=e?e(n.value):n.value;if(!t.set.has(r))return t.set.add(r),n}}while(!n.done);return qhe})}exclude(e,t){const n=new Set;for(const r of e){const e=t?t(r):r;n.add(e)}return this.filter(e=>{const r=t?t(e):e;return!n.has(r)})}}function Hhe(e){return"string"==typeof e?e:void 0===e?"undefined":"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}function Uhe(e){return!!e&&"function"==typeof e[Symbol.iterator]}const Ghe=new jhe(()=>{},()=>qhe),qhe=Object.freeze({done:!0,value:void 0});function Whe(...e){if(1===e.length){const t=e[0];if(t instanceof jhe)return t;if(Uhe(t))return new jhe(()=>t[Symbol.iterator](),e=>e.next());if("number"==typeof t.length)return new jhe(()=>({index:0}),e=>e.index1?new jhe(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:(null==n?void 0:n.includeRoot)?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),e=>{for(e.pruned&&(e.iterators.pop(),e.pruned=!1);e.iterators.length>0;){const n=e.iterators[e.iterators.length-1].next();if(!n.done)return e.iterators.push(t(n.value)[Symbol.iterator]()),n;e.iterators.pop()}return qhe})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Yhe,Xhe;function Khe(e){return new Vhe(e,e=>Bhe(e)?e.content:[],{includeRoot:!0})}function Qhe(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function Zhe(e){if(!e)return;const{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function Jhe(e,t){const n=function(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Xhe.After;const n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.lineXhe.After}!function(e){e.sum=function(e){return e.reduce((e,t)=>e+t,0)},e.product=function(e){return e.reduce((e,t)=>e*t,0)},e.min=function(e){return e.reduce((e,t)=>Math.min(e,t))},e.max=function(e){return e.reduce((e,t)=>Math.max(e,t))}}(Yhe||(Yhe={})),function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"}(Xhe||(Xhe={}));const ede=/^[\w\p{L}]$/u;function tde(e,t){if(e){const n=function(e,t=!0){for(;e.container;){const n=e.container;let r=n.content.indexOf(e);for(;r>0;){r--;const e=n.content[r];if(t||!e.hidden)return e}e=n}return}(e,!0);if(n&&nde(n,t))return n;if(zhe(e)){const n=e.content.findIndex(e=>!e.hidden);for(let r=n-1;r>=0;r--){const n=e.content[r];if(nde(n,t))return n}}}}function nde(e,t){return Fhe(e)&&t.includes(e.tokenType.name)}class rde extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function ide(e){throw new Error("Error! The input value was not handled.")}const ade="AbstractRule",ode="AbstractType",sde="Condition",lde="TypeDefinition",cde="ValueLiteral",ude="AbstractElement";function hde(e){return ppe.isInstance(e,ude)}const dde="ArrayLiteral",pde="ArrayType",fde="BooleanLiteral";const gde="Conjunction";const mde="Disjunction";const yde="Grammar",vde="GrammarImport",bde="InferredType";function xde(e){return ppe.isInstance(e,bde)}const wde="Interface";function Ede(e){return ppe.isInstance(e,wde)}const kde="NamedArgument",Tde="Negation";const _de="NumberLiteral",Cde="Parameter",Sde="ParameterReference";const Ade="ParserRule";function Nde(e){return ppe.isInstance(e,Ade)}const Ide="ReferenceType",Ode="ReturnType";const Lde="SimpleType";function Mde(e){return ppe.isInstance(e,Lde)}const Rde="StringLiteral",Dde="TerminalRule";function Pde(e){return ppe.isInstance(e,Dde)}const $de="Type";function Bde(e){return ppe.isInstance(e,$de)}const Fde="TypeAttribute",zde="UnionType",jde="Action";function Hde(e){return ppe.isInstance(e,jde)}const Ude="Alternatives";function Gde(e){return ppe.isInstance(e,Ude)}const qde="Assignment";function Wde(e){return ppe.isInstance(e,qde)}const Vde="CharacterRange";const Yde="CrossReference";function Xde(e){return ppe.isInstance(e,Yde)}const Kde="EndOfFile";const Qde="Group";function Zde(e){return ppe.isInstance(e,Qde)}const Jde="Keyword";function epe(e){return ppe.isInstance(e,Jde)}const tpe="NegatedToken";const npe="RegexToken";const rpe="RuleCall";function ipe(e){return ppe.isInstance(e,rpe)}const ape="TerminalAlternatives";const ope="TerminalGroup";const spe="TerminalRuleCall";const lpe="UnorderedGroup";function cpe(e){return ppe.isInstance(e,lpe)}const upe="UntilToken";const hpe="Wildcard";class dpe extends $he{getAllTypes(){return[ude,ade,ode,jde,Ude,dde,pde,qde,fde,Vde,sde,gde,Yde,mde,Kde,yde,vde,Qde,bde,wde,Jde,kde,tpe,Tde,_de,Cde,Sde,Ade,Ide,npe,Ode,rpe,Lde,Rde,ape,ope,Dde,spe,$de,Fde,lde,zde,lpe,upe,cde,hpe]}computeIsSubtype(e,t){switch(e){case jde:case Ude:case qde:case Vde:case Yde:case Kde:case Qde:case Jde:case tpe:case npe:case rpe:case ape:case ope:case spe:case lpe:case upe:case hpe:return this.isSubtype(ude,t);case dde:case _de:case Rde:return this.isSubtype(cde,t);case pde:case Ide:case Lde:case zde:return this.isSubtype(lde,t);case fde:return this.isSubtype(sde,t)||this.isSubtype(cde,t);case gde:case mde:case Tde:case Sde:return this.isSubtype(sde,t);case bde:case wde:case $de:return this.isSubtype(ode,t);case Ade:return this.isSubtype(ade,t)||this.isSubtype(ode,t);case Dde:return this.isSubtype(ade,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return ode;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return ade;case"Grammar:usedGrammars":return yde;case"NamedArgument:parameter":case"ParameterReference:parameter":return Cde;case"TerminalRuleCall:rule":return Dde;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case ude:return{name:ude,properties:[{name:"cardinality"},{name:"lookahead"}]};case dde:return{name:dde,properties:[{name:"elements",defaultValue:[]}]};case pde:return{name:pde,properties:[{name:"elementType"}]};case fde:return{name:fde,properties:[{name:"true",defaultValue:!1}]};case gde:return{name:gde,properties:[{name:"left"},{name:"right"}]};case mde:return{name:mde,properties:[{name:"left"},{name:"right"}]};case yde:return{name:yde,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case vde:return{name:vde,properties:[{name:"path"}]};case bde:return{name:bde,properties:[{name:"name"}]};case wde:return{name:wde,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case kde:return{name:kde,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Tde:return{name:Tde,properties:[{name:"value"}]};case _de:return{name:_de,properties:[{name:"value"}]};case Cde:return{name:Cde,properties:[{name:"name"}]};case Sde:return{name:Sde,properties:[{name:"parameter"}]};case Ade:return{name:Ade,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Ide:return{name:Ide,properties:[{name:"referenceType"}]};case Ode:return{name:Ode,properties:[{name:"name"}]};case Lde:return{name:Lde,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Rde:return{name:Rde,properties:[{name:"value"}]};case Dde:return{name:Dde,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case $de:return{name:$de,properties:[{name:"name"},{name:"type"}]};case Fde:return{name:Fde,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case zde:return{name:zde,properties:[{name:"types",defaultValue:[]}]};case jde:return{name:jde,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Ude:return{name:Ude,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case qde:return{name:qde,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Vde:return{name:Vde,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Yde:return{name:Yde,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Kde:return{name:Kde,properties:[{name:"cardinality"},{name:"lookahead"}]};case Qde:return{name:Qde,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Jde:return{name:Jde,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case tpe:return{name:tpe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case npe:return{name:npe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case rpe:return{name:rpe,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case ape:return{name:ape,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ope:return{name:ope,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case spe:return{name:spe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case lpe:return{name:lpe,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case upe:return{name:upe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case hpe:return{name:hpe,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const ppe=new dpe;function fpe(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function gpe(e){const t=mpe(e).$document;if(!t)throw new Error("AST node has no document.");return t}function mpe(e){for(;e.$container;)e=e.$container;return e}function ype(e,t){if(!e)throw new Error("Node must be an AstNode.");const n=null==t?void 0:t.range;return new jhe(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexype(e,t))}function bpe(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new Vhe(e,e=>ype(e,t),{includeRoot:!0})}function xpe(e,t){var n;if(!t)return!0;const r=null===(n=e.$cstNode)||void 0===n?void 0:n.range;return!!r&&Jhe(r,t)}function wpe(e){return new jhe(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Dpe{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},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"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)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const Ppe=/\r?\n/gm,$pe=new Rpe;const Bpe=new class extends Dpe{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 t=String.fromCharCode(e.value);if(this.multiline||"\n"!==t||(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=Hpe(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=Boolean("\n".match(n))}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){if("Group"===e.type){if(e.quantifier)return}super.visitChildren(e)}};function Fpe(e){try{return"string"==typeof e&&(e=new RegExp(e)),e=e.toString(),Bpe.reset(e),Bpe.visit($pe.pattern(e)),Bpe.multiline}catch(e){return!1}}const zpe="\f\n\r\t\v              \u2028\u2029   \ufeff".split("");function jpe(e){const t="string"==typeof e?new RegExp(e):e;return zpe.some(e=>t.test(e))}function Hpe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Upe(e,t){const n=function(e){"string"==typeof e&&(e=new RegExp(e));const t=e,n=e.source;let r=0;function i(){let e,a="";function o(e){a+=n.substr(r,e),r+=e}function s(e){a+="(?:"+n.substr(r,e)+"|$)",r+=e}for(;r",r)-r+1);break;default:s(2)}break;case"[":e=/\[(?:\\.|.)*?\]/g,e.lastIndex=r,e=e.exec(n)||[],s(e[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":e=/\{\d+,?\d*\}/g,e.lastIndex=r,e=e.exec(n),e?o(e[0].length):s(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":a+="(?:",r+=3,a+=i()+"|$)";break;case"=":a+="(?=",r+=3,a+=i()+")";break;case"!":e=r,r+=3,i(),a+=n.substr(e,r-e);break;case"<":switch(n[r+3]){case"=":case"!":e=r,r+=4,i(),a+=n.substr(e,r-e);break;default:o(n.indexOf(">",r)-r+1),a+=i()+"|$)"}}else o(1),a+=i()+"|$)";break;case")":return++r,a;default:s(1)}return a}return new RegExp(i(),e.flags)}(e),r=t.match(n);return!!r&&r[0].length>0}function Gpe(e,t){const n=new Set,r=function(e){return e.rules.find(e=>Nde(e)&&e.entry)}(e);if(!r)return new Set(e.rules);const i=[r].concat(function(e){return e.rules.filter(e=>Pde(e)&&e.hidden)}(e));for(const e of i)qpe(e,n,t);const a=new Set;for(const t of e.rules)(n.has(t.name)||Pde(t)&&t.hidden)&&a.add(t);return a}function qpe(e,t,n){t.add(e.name),vpe(e).forEach(e=>{if(ipe(e)||n){const r=e.rule.ref;r&&!t.has(r.name)&&qpe(r,t,n)}})}function Wpe(e){return e.hidden&&!jpe(nfe(e))}function Vpe(e,t,n){if(!e||!t)return;const r=Ype(e,t,e.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function Ype(e,t,n,r){if(!r){const n=fpe(e.grammarSource,Wde);if(n&&n.feature===t)return[e]}return Bhe(e)&&e.astNode===n?e.content.flatMap(e=>Ype(e,t,n,!1)):[]}function Xpe(e,t,n){if(!e)return;const r=function(e,t,n){if(e.astNode!==n)return[];if(epe(e.grammarSource)&&e.grammarSource.value===t)return[e];const r=Khe(e).iterator();let i;const a=[];do{if(i=r.next(),!i.done){const e=i.value;e.astNode===n?epe(e.grammarSource)&&e.grammarSource.value===t&&a.push(e):r.prune()}}while(!i.done);return a}(e,t,null==e?void 0:e.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function Kpe(e){let t=e;return xde(t)&&(Hde(t.$container)?t=t.$container.$container:Nde(t.$container)?t=t.$container:ide(t.$container)),Qpe(e,t,new Map)}function Qpe(e,t,n){var r;function i(t,r){let i;return fpe(t,Wde)||(i=Qpe(r,r,n)),n.set(e,i),i}if(n.has(e))return n.get(e);n.set(e,void 0);for(const a of vpe(t)){if(Wde(a)&&"name"===a.feature.toLowerCase())return n.set(e,a),a;if(ipe(a)&&Nde(a.rule.ref))return i(a,a.rule.ref);if(Mde(a)&&(null===(r=a.typeRef)||void 0===r?void 0:r.ref))return i(a,a.typeRef.ref)}}function Zpe(e){return Jpe(e,new Set)}function Jpe(e,t){if(t.has(e))return!0;t.add(e);for(const n of vpe(e))if(ipe(n)){if(!n.rule.ref)return!1;if(Nde(n.rule.ref)&&!Jpe(n.rule.ref,t))return!1}else{if(Wde(n))return!1;if(Hde(n))return!1}return Boolean(e.definition)}function efe(e){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t){if(Nde(t))return t.name;if(Ede(t)||Bde(t))return t.name}}}function tfe(e){var t,n;if(Nde(e))return Zpe(e)?e.name:null!==(t=efe(e))&&void 0!==t?t:e.name;if(Ede(e)||Bde(e)||(n=e,ppe.isInstance(n,Ode)))return e.name;if(Hde(e)){const t=function(e){var t;if(e.inferredType)return e.inferredType.name;if(null===(t=e.type)||void 0===t?void 0:t.ref)return tfe(e.type.ref);return}(e);if(t)return t}else if(xde(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function nfe(e){const t={s:!1,i:!1,u:!1},n=ife(e.definition,t),r=Object.entries(t).filter(([,e])=>e).map(([e])=>e).join("");return new RegExp(n,r)}const rfe=/[\s\S]/.source;function ife(e,t){if(a=e,ppe.isInstance(a,ape))return ofe((i=e).elements.map(e=>ife(e)).join("|"),{cardinality:i.cardinality,lookahead:i.lookahead});if(function(e){return ppe.isInstance(e,ope)}(e))return ofe((r=e).elements.map(e=>ife(e)).join(""),{cardinality:r.cardinality,lookahead:r.lookahead});if(function(e){return ppe.isInstance(e,Vde)}(e))return function(e){if(e.right)return ofe(`[${afe(e.left)}-${afe(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1});return ofe(afe(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}(e);if(function(e){return ppe.isInstance(e,spe)}(e)){const t=e.rule.ref;if(!t)throw new Error("Missing rule reference.");return ofe(ife(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead})}if(function(e){return ppe.isInstance(e,tpe)}(e))return function(e){return ofe(`(?!${ife(e.terminal)})${rfe}*?`,{cardinality:e.cardinality,lookahead:e.lookahead})}(e);if(function(e){return ppe.isInstance(e,upe)}(e))return ofe(`${rfe}*?${ife((n=e).terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead});if(function(e){return ppe.isInstance(e,npe)}(e)){const n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),ofe(r,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}if(function(e){return ppe.isInstance(e,hpe)}(e))return ofe(rfe,{cardinality:e.cardinality,lookahead:e.lookahead});throw new Error(`Invalid terminal element: ${null==e?void 0:e.$type}`);var n,r,i,a}function afe(e){return Hpe(e.value)}function ofe(e,t){var n;return(!1!==t.wrap||t.lookahead)&&(e=`(${null!==(n=t.lookahead)&&void 0!==n?n:""}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function sfe(e){console&&console.error&&console.error(`Error: ${e}`)}function lfe(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function cfe(e){const t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}function ufe(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}function hfe(e){return ese((t=e).LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}class dfe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Moe(this.definition,t=>{t.accept(e)})}}class pfe extends dfe{constructor(e){super([]),this.idx=1,oae(this,mse(e,e=>void 0!==e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class ffe extends dfe{constructor(e){super(e.definition),this.orgText="",oae(this,mse(e,e=>void 0!==e))}}class gfe extends dfe{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,oae(this,mse(e,e=>void 0!==e))}}let mfe=class extends dfe{constructor(e){super(e.definition),this.idx=1,oae(this,mse(e,e=>void 0!==e))}};class yfe extends dfe{constructor(e){super(e.definition),this.idx=1,oae(this,mse(e,e=>void 0!==e))}}class vfe extends dfe{constructor(e){super(e.definition),this.idx=1,oae(this,mse(e,e=>void 0!==e))}}class bfe extends dfe{constructor(e){super(e.definition),this.idx=1,oae(this,mse(e,e=>void 0!==e))}}class xfe extends dfe{constructor(e){super(e.definition),this.idx=1,oae(this,mse(e,e=>void 0!==e))}}class wfe extends dfe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,oae(this,mse(e,e=>void 0!==e))}}class Efe{constructor(e){this.idx=1,oae(this,mse(e,e=>void 0!==e))}accept(e){e.visit(this)}}function kfe(e){function t(e){return Goe(e,kfe)}if(e instanceof pfe){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return ese(e.label)&&(t.label=e.label),t}if(e instanceof gfe)return{type:"Alternative",definition:t(e.definition)};if(e instanceof mfe)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof yfe)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof vfe)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:kfe(new Efe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof xfe)return{type:"RepetitionWithSeparator",idx:e.idx,separator:kfe(new Efe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof bfe)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof wfe)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Efe){const t={type:"Terminal",name:e.terminalType.name,label:hfe(e.terminalType),idx:e.idx};ese(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ose(n)?n.source:n),t}if(e instanceof ffe)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class Tfe{visit(e){const t=e;switch(t.constructor){case pfe:return this.visitNonTerminal(t);case gfe:return this.visitAlternative(t);case mfe:return this.visitOption(t);case yfe:return this.visitRepetitionMandatory(t);case vfe:return this.visitRepetitionMandatoryWithSeparator(t);case xfe:return this.visitRepetitionWithSeparator(t);case bfe:return this.visitRepetition(t);case wfe:return this.visitAlternation(t);case Efe:return this.visitTerminal(t);case ffe:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function _fe(e,t=[]){return!!(e instanceof mfe||e instanceof bfe||e instanceof xfe)||(e instanceof wfe?Sse(e.definition,e=>_fe(e,t)):!(e instanceof pfe&&rse(t,e))&&(e instanceof dfe&&(e instanceof pfe&&t.push(e),Poe(e.definition,e=>_fe(e,t)))))}function Cfe(e){if(e instanceof pfe)return"SUBRULE";if(e instanceof mfe)return"OPTION";if(e instanceof wfe)return"OR";if(e instanceof yfe)return"AT_LEAST_ONE";if(e instanceof vfe)return"AT_LEAST_ONE_SEP";if(e instanceof xfe)return"MANY_SEP";if(e instanceof bfe)return"MANY";if(e instanceof Efe)return"CONSUME";throw Error("non exhaustive match")}class Sfe{walk(e,t=[]){Moe(e.definition,(n,r)=>{const i=Ioe(e.definition,r+1);if(n instanceof pfe)this.walkProdRef(n,i,t);else if(n instanceof Efe)this.walkTerminal(n,i,t);else if(n instanceof gfe)this.walkFlat(n,i,t);else if(n instanceof mfe)this.walkOption(n,i,t);else if(n instanceof yfe)this.walkAtLeastOne(n,i,t);else if(n instanceof vfe)this.walkAtLeastOneSep(n,i,t);else if(n instanceof xfe)this.walkManySep(n,i,t);else if(n instanceof bfe)this.walkMany(n,i,t);else{if(!(n instanceof wfe))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new mfe({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Afe(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new mfe({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Afe(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);Moe(e.definition,e=>{const t=new gfe({definition:[e]});this.walk(t,r)})}}function Afe(e,t,n){return[new mfe({definition:[new Efe({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Nfe(e){if(e instanceof pfe)return Nfe(e.referencedRule);if(e instanceof Efe)return[e.terminalType];if(function(e){return e instanceof gfe||e instanceof mfe||e instanceof bfe||e instanceof yfe||e instanceof vfe||e instanceof xfe||e instanceof Efe||e instanceof ffe}(e))return function(e){let t=[];const n=e.definition;let r,i=0,a=n.length>i,o=!0;for(;a&&o;)r=n[i],o=_fe(r),t=t.concat(Nfe(r)),i+=1,a=n.length>i;return Lse(t)}(e);if(function(e){return e instanceof wfe}(e))return function(e){const t=Goe(e.definition,e=>Nfe(e));return Lse(wae(t))}(e);throw Error("non exhaustive match")}const Ife="_~IN~_";class Ofe extends Sfe{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=function(e,t){return e.name+t+Ife}(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(n),a=Nfe(new gfe({definition:i}));this.follows[r]=a}}let Lfe={};const Mfe=new Rpe;function Rfe(e){const t=e.toString();if(Lfe.hasOwnProperty(t))return Lfe[t];{const e=Mfe.pattern(t);return Lfe[t]=e,e}}const Dfe="Complement Sets are not supported for first char optimization",Pfe='Unable to use "first char" lexer optimizations:\n';function $fe(e,t=!1){try{const t=Rfe(e);return Bfe(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Dfe)t&&lfe(`${Pfe}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),sfe(`${Pfe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Bfe(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)Ffe(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)Ffe(e,t,n);else{for(let e=r.from;e<=r.to&&e=sge){const e=r.from>=sge?r.from:sge,n=r.to,i=cge(e),a=cge(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case"Group":Bfe(a.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===jfe(a)||"Group"!==a.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return tse(t)}function Ffe(e,t,n){const r=cge(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=cge(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=cge(e.charCodeAt(0));t[n]=n}}}(e,t)}function zfe(e,t){return joe(e.value,e=>{if("number"==typeof e)return rse(t,e);{const n=e;return void 0!==joe(t,e=>n.from<=e&&e<=n.to)}})}function jfe(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(u3(e.value)?Poe(e.value,jfe):jfe(e.value))}class Hfe extends Dpe{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){rse(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===zfe(e,this.targetCharCodes)&&(this.found=!0):void 0!==zfe(e,this.targetCharCodes)&&(this.found=!0)}}function Ufe(e,t){if(t instanceof RegExp){const n=Rfe(t),r=new Hfe(e);return r.visit(n),r.found}return void 0!==joe(t,t=>rse(e,t.charCodeAt(0)))}const Gfe="PATTERN",qfe="defaultMode",Wfe="modes";let Vfe="boolean"==typeof new RegExp("(?:)").sticky;function Yfe(e,t){const n=(t=Soe(t,{useSticky:Vfe,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(Yte(lge)){lge=new Array(65536);for(let e=0;e<65536;e++)lge[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=_se(e,e=>e[Gfe]===Ege.NA)});let i,a,o,s,l,c,u,h,d,p,f,g=!1;n("Transform Patterns",()=>{g=!1,i=Goe(r,e=>{const n=e[Gfe];if(ose(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||rse(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?Jfe(n):Zfe(n):e[1]:e}if(h4(n))return g=!0,{exec:n};if("object"==typeof n)return g=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?Jfe(r):Zfe(r)}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{a=Goe(r,e=>e.tokenTypeIdx),o=Goe(r,e=>{const t=e.GROUP;if(t!==Ege.SKIPPED){if(ese(t))return t;if(sse(t))return!1;throw Error("non exhaustive match")}}),s=Goe(r,e=>{const t=e.LONGER_ALT;if(t){const e=u3(t)?Goe(t,e=>ise(r,e)):[ise(r,t)];return e}}),l=Goe(r,e=>e.PUSH_MODE),c=Goe(r,e=>Joe(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=age(t.lineTerminatorCharacters);u=Goe(r,e=>!1),"onlyOffset"!==t.positionTracking&&(u=Goe(r,t=>Joe(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ige(t,e)&&Ufe(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=Goe(r,tge),d=Goe(i,nge),p=Tse(r,(e,t)=>{const n=t.GROUP;return ese(n)&&n!==Ege.SKIPPED&&(e[n]=[]),e},{}),f=Goe(i,(e,t)=>({pattern:i[t],longerAlt:s[t],canLineTerminator:u[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:c[t],tokenTypeIdx:a[t],tokenType:r[t]}))});let m=!0,y=[];return t.safeMode||n("First Char Optimization",()=>{y=Tse(r,(e,n,r)=>{if("string"==typeof n.PATTERN){const t=cge(n.PATTERN.charCodeAt(0));oge(e,t,f[r])}else if(u3(n.START_CHARS_HINT)){let t;Moe(n.START_CHARS_HINT,n=>{const i=cge("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,oge(e,i,f[r]))})}else if(ose(n.PATTERN))if(n.PATTERN.unicode)m=!1,t.ensureOptimizations&&sfe(`${Pfe}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=$fe(n.PATTERN,t.ensureOptimizations);Yte(i)&&(m=!1),Moe(i,t=>{oge(e,t,f[r])})}else t.ensureOptimizations&&sfe(`${Pfe}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),m=!1;return e},[])}),{emptyGroups:p,patternIdxToConfig:f,charCodeToPatternIdxToConfig:y,hasCustom:g,canBeOptimized:m}}function Xfe(e,t){let n=[];const r=function(e){const t=Boe(e,e=>!Joe(e,Gfe)),n=Goe(t,e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:xge.MISSING_PATTERN,tokenTypes:[e]})),r=Aoe(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);const i=function(e){const t=Boe(e,e=>{const t=e[Gfe];return!(ose(t)||h4(t)||Joe(t,"exec")||ese(t))}),n=Goe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:xge.INVALID_PATTERN,tokenTypes:[e]})),r=Aoe(e,t);return{errors:n,valid:r}}(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=Boe(e,e=>ose(e[Gfe]));return t=t.concat(function(e){class t extends Dpe{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=Boe(e,e=>{const n=e.PATTERN;try{const e=Rfe(n),r=new t;return r.visit(e),r.found}catch(e){return Kfe.test(n.source)}}),r=Goe(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:xge.EOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){class t extends Dpe{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=Boe(e,e=>{const n=e.PATTERN;try{const e=Rfe(n),r=new t;return r.visit(e),r.found}catch(e){return Qfe.test(n.source)}}),r=Goe(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:xge.SOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){const t=Boe(e,e=>{const t=e[Gfe];return t instanceof RegExp&&(t.multiline||t.global)}),n=Goe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:xge.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}));return n}(n)),t=t.concat(function(e){const t=[];let n=Goe(e,n=>Tse(e,(e,r)=>(n.PATTERN.source!==r.PATTERN.source||rse(t,r)||r.PATTERN===Ege.NA||(t.push(r),e.push(r)),e),[]));n=Xae(n);const r=Goe(Boe(n,e=>e.length>1),e=>{const t=Goe(e,e=>e.name);return{message:`The same RegExp pattern ->${Hoe(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:xge.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}});return r}(n)),t=t.concat(function(e){const t=Boe(e,e=>e.PATTERN.test("")),n=Goe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:xge.EMPTY_MATCH_PATTERN,tokenTypes:[e]}));return n}(n)),t}(a)),n=n.concat(function(e){const t=Boe(e,e=>{if(!Joe(e,"GROUP"))return!1;const t=e.GROUP;return t!==Ege.SKIPPED&&t!==Ege.NA&&!ese(t)}),n=Goe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:xge.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}));return n}(a)),n=n.concat(function(e,t){const n=Boe(e,e=>void 0!==e.PUSH_MODE&&!rse(t,e.PUSH_MODE)),r=Goe(n,e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:xge.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}));return r}(a,t)),n=n.concat(function(e){const t=[],n=Tse(e,(e,t,n)=>{const r=t.PATTERN;return r===Ege.NA||(ese(r)?e.push({str:r,idx:n,tokenType:t}):ose(r)&&(i=r,void 0===joe([".","\\","[","]","|","^","$","(",")","?","*","+","{"],e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return Moe(e,(e,r)=>{Moe(n,({str:n,idx:i,tokenType:a})=>{if(r${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:xge.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}(a)),n}const Kfe=/[^\\][$]/;const Qfe=/[^\\[][\^]|^\^/;function Zfe(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function Jfe(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function ege(e,t,n){const r=[];let i=!1;const a=_se(Xae(wae(tse(e.modes))),e=>e[Gfe]===Ege.NA),o=age(n);return t&&Moe(a,e=>{const t=ige(e,o);if(!1!==t){const n=function(e,t){if(t.issue===xge.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===xge.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Joe(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):Ufe(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:xge.NO_LINE_BREAKS_FLAGS}),r}function tge(e){const t=e.PATTERN;if(ose(t))return!1;if(h4(t))return!0;if(Joe(t,"exec"))return!0;if(ese(t))return!1;throw Error("non exhaustive match")}function nge(e){return!(!ese(e)||1!==e.length)&&e.charCodeAt(0)}const rge={test:function(e){const t=e.length;for(let n=this.lastIndex;nese(e)?e.charCodeAt(0):e)}function oge(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const sge=256;let lge=[];function cge(e){return ee.CATEGORIES)));const e=Aoe(n,t);t=t.concat(e),Yte(e)?r=!1:n=e}return t}(e);!function(e){Moe(e,e=>{mge(e)||(pge[dge]=e,e.tokenTypeIdx=dge++),yge(e)&&!u3(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),yge(e)||(e.CATEGORIES=[]),Joe(e,"categoryMatches")||(e.categoryMatches=[]),function(e){return Joe(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){Moe(e,e=>{gge([],e)})}(t),function(e){Moe(e,e=>{e.categoryMatches=[],Moe(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(pge[n].tokenTypeIdx)})})}(t),Moe(t,e=>{e.isParent=e.categoryMatches.length>0})}function gge(e,t){Moe(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),Moe(t.CATEGORIES,n=>{const r=e.concat(t);rse(r,n)||gge(r,n)})}function mge(e){return Joe(e,"tokenTypeIdx")}function yge(e){return Joe(e,"CATEGORIES")}function vge(e){return Joe(e,"tokenTypeIdx")}const bge={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};var xge;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(xge||(xge={}));const wge={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:bge,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(wge);class Ege{constructor(e,t=wge){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=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=cfe(t),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=oae({},wge,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===wge.lineTerminatorsPattern)this.config.lineTerminatorsPattern=rge;else if(this.config.lineTerminatorCharacters===wge.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.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),u3(e)?n={modes:{defaultMode:Vae(e)},defaultMode:qfe}:(r=!1,n=Vae(e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Joe(e,qfe)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+qfe+"> property in its definition\n",type:xge.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Joe(e,Wfe)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:xge.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Joe(e,Wfe)&&Joe(e,qfe)&&!Joe(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${qfe}: <${e.defaultMode}>which does not exist\n`,type:xge.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Joe(e,Wfe)&&Moe(e.modes,(e,n)=>{Moe(e,(r,i)=>{sse(r)?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:xge.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Joe(r,"LONGER_ALT")&&Moe(u3(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT],i=>{sse(i)||rse(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:xge.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ege(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Moe(n.modes,(e,t)=>{n.modes[t]=_se(e,e=>sse(e))});const i=iae(n.modes);if(Moe(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Xfe(e,i))}),Yte(this.lexerDefinitionErrors)){let r;fge(e),this.TRACE_INIT("analyzeTokenTypes",()=>{r=Yfe(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=oae({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!Yte(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=Goe(this.lexerDefinitionErrors,e=>e.message),t=e.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+t)}Moe(this.lexerDefinitionWarning,e=>{lfe(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Vfe?(this.chopInput=G3,this.match=this.matchWithTest):(this.updateLastIndex=Zie,this.match=this.matchWithExec),r&&(this.handleModes=Zie),!1===this.trackStartLines&&(this.computeNewColumn=G3),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=Zie),/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))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}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 e=Tse(this.canModeBeOptimized,(e,t,n)=>(!1===t&&e.push(n),e),[]);if(t.ensureOptimizations&&!Yte(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Lfe={}}),this.TRACE_INIT("toFastProperties",()=>{ufe(this)})})}tokenize(e,t=this.defaultMode){if(!Yte(this.lexerDefinitionErrors)){const e=Goe(this.lexerDefinitionErrors,e=>e.message),t=e.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+t)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,l,c,u,h,d,p,f,g,m;const y=e,v=y.length;let b=0,x=0;const w=this.hasCustom?0:Math.floor(e.length/10),E=new Array(w),k=[];let T=this.trackStartLines?1:void 0,_=this.trackStartLines?1:void 0;const C=function(e){const t={};return Moe(iae(e),n=>{const r=e[n];if(!u3(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),S=this.trackStartLines,A=this.config.lineTerminatorsPattern;let N=0,I=[],O=[];const L=[],M=[];let R;function D(){return I}function P(e){const t=cge(e),n=O[t];return void 0===n?M:n}Object.freeze(M);const $=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);k.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=Noe(L);I=this.patternIdxToConfig[e],O=this.charCodeToPatternIdxToConfig[e],N=I.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;R=O&&t?P:D}};function B(e){L.push(e),O=this.charCodeToPatternIdxToConfig[e],I=this.patternIdxToConfig[e],N=I.length,N=I.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;R=O&&t?P:D}let F;B.call(this,t);const z=this.config.recoveryEnabled;for(;bs.length){s=a,l=c,F=t;break}}}break}}if(null!==s){if(u=s.length,h=F.group,void 0!==h&&(d=F.tokenTypeIdx,p=this.createTokenInstance(s,b,d,F.tokenType,T,_,u),this.handlePayload(p,l),!1===h?x=this.addToken(E,x,p):C[h].push(p)),e=this.chopInput(e,u),b+=u,_=this.computeNewColumn(_,u),!0===S&&!0===F.canLineTerminator){let e,t,n=0;A.lastIndex=0;do{e=A.test(s),!0===e&&(t=A.lastIndex-1,n++)}while(!0===e);0!==n&&(T+=n,_=u-t,this.updateTokenEndLineColumnLocation(p,h,t,n,T,_,u))}this.handleModes(F,$,B,p)}else{const t=b,n=T,i=_;let a=!1===z;for(;!1===a&&b`Expecting ${Tge(e)?`--\x3e ${kge(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const a="Expecting: ",o="\nbut found: '"+Hoe(t).image+"'";if(r)return a+r+o;{const t=Goe(Tse(e,(e,t)=>e.concat(t),[]),e=>`[${Goe(e,e=>kge(e)).join(", ")}]`);return a+`one of these possible Token sequences:\n${Goe(t,(e,t)=>` ${t+1}. ${e}`).join("\n")}`+o}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",a="\nbut found: '"+Hoe(t).image+"'";if(n)return i+n+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${Goe(e,e=>`[${Goe(e,e=>kge(e)).join(",")}]`).join(" ,")}>`+a}};Object.freeze(Bge);const Fge={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},zge={buildDuplicateFoundError(e,t){const n=e.name,r=Hoe(t),i=r.idx,a=Cfe(r),o=(s=r)instanceof Efe?s.terminalType.name:s instanceof pfe?s.nonTerminalName:"";var s;let l=`->${a}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=Goe(e.prefixPath,e=>kge(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=Goe(e.prefixPath,e=>kge(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=Cfe(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);return`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${Goe(e.leftRecursionPath,e=>e.name).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;t=e.topLevelRule instanceof ffe?e.topLevelRule.name:e.topLevelRule;return`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class jge extends Tfe{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Moe(tse(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:cye.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Hge extends Sfe{constructor(e,t){super(),this.topProd=e,this.path=t,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=Vae(this.path.ruleStack).reverse(),this.occurrenceStack=Vae(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){Yte(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Uge extends Hge{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new gfe({definition:e});this.possibleTokTypes=Nfe(r),this.found=!0}}}class Gge extends Sfe{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class qge extends Gge{walkMany(e,t,n){if(e.idx===this.occurrence){const e=Hoe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Efe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class Wge extends Gge{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=Hoe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Efe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Vge extends Gge{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=Hoe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Efe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Yge extends Gge{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=Hoe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Efe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Xge(e,t,n=[]){n=Vae(n);let r=[],i=0;function a(a){const o=Xge(a.concat(Ioe(e,i+1)),t,n);return r.concat(o)}for(;n.length{!1===Yte(e.definition)&&(r=a(e.definition))}),r;if(!(t instanceof Efe))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:Ioe(e,i)}),r}function Kge(e,t,n,r){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let s=!1;const l=t.length,c=l-r-1,u=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Yte(h);){const e=h.pop();if(e===o){s&&Noe(h).idx<=c&&h.pop();continue}const r=e.def,d=e.idx,p=e.ruleStack,f=e.occurrenceStack;if(Yte(r))continue;const g=r[0];if(g===i){const e={idx:d,def:Ioe(r),ruleStack:Ooe(p),occurrenceStack:Ooe(f)};h.push(e)}else if(g instanceof Efe)if(d=0;e--){const t={idx:d,def:g.definition[e].definition.concat(Ioe(r)),ruleStack:p,occurrenceStack:f};h.push(t),h.push(o)}else if(g instanceof gfe)h.push({idx:d,def:g.definition.concat(Ioe(r)),ruleStack:p,occurrenceStack:f});else{if(!(g instanceof ffe))throw Error("non exhaustive match");h.push(Qge(g,d,p,f))}}return u}function Qge(e,t,n,r){const i=Vae(n);i.push(e.name);const a=Vae(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var Zge;function Jge(e){if(e instanceof mfe||"Option"===e)return Zge.OPTION;if(e instanceof bfe||"Repetition"===e)return Zge.REPETITION;if(e instanceof yfe||"RepetitionMandatory"===e)return Zge.REPETITION_MANDATORY;if(e instanceof vfe||"RepetitionMandatoryWithSeparator"===e)return Zge.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof xfe||"RepetitionWithSeparator"===e)return Zge.REPETITION_WITH_SEPARATOR;if(e instanceof wfe||"Alternation"===e)return Zge.ALTERNATION;throw Error("non exhaustive match")}function eme(e){const{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=Jge(r);return a===Zge.ALTERNATION?cme(t,n,i):ume(t,n,a,i)}function tme(e,t,n,r){const i=e.length,a=Poe(e,e=>Poe(e,e=>1===e.length));if(t)return function(t){const r=Goe(t,e=>e.GATE);for(let t=0;twae(e)),(e,t,n)=>(Moe(t,t=>{Joe(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),Moe(t.categoryMatches,t=>{Joe(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=wae(e);if(1===t.length&&Yte(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=Tse(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,Moe(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nXge([e],1)),r=ame(n.length),i=Goe(n,e=>{const t={};return Moe(e,e=>{Moe(ome(e.partialPath),e=>{t[e]=!0})}),t});let a=n;for(let e=1;e<=t;e++){const n=a;a=ame(n.length);for(let o=0;o{Moe(ome(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}function cme(e,t,n,r){const i=new ime(e,Zge.ALTERNATION,r);return t.accept(i),lme(i.result,n)}function ume(e,t,n,r){const i=new ime(e,n);t.accept(i);const a=i.result,o=new rme(t,e,n).startWalking();return lme([new gfe({definition:a}),new gfe({definition:o})],r)}function hme(e,t){e:for(let n=0;nPoe(e,e=>Poe(e,e=>Yte(e.categoryMatches))))}function pme(e,t,n,r){const i=qoe(e,e=>function(e,t){const n=new mme;e.accept(n);const r=n.allProductions,i=Xoe(r,fme),a=Goe(tse(mse(i,e=>e.length>1)),n=>{const r=Hoe(n),i=t.buildDuplicateFoundError(e,n),a=Cfe(r),o={message:i,type:cye.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=gme(r);return s&&(o.parameter=s),o});return a}(e,n)),a=function(e,t,n){const r=[],i=Goe(t,e=>e.name);return Moe(e,e=>{const t=e.name;if(rse(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:cye.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=qoe(e,e=>function(e,t){const n=new bme;e.accept(n);const r=qoe(n.alternations,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:cye.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]);return r}(e,n)),s=qoe(e,t=>function(e,t,n,r){const i=[],a=Tse(t,(t,n)=>n.name===e.name?t+1:t,0);if(a>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:cye.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(a,o,s)}function fme(e){return`${Cfe(e)}_#_${e.idx}_#_${gme(e)}`}function gme(e){return e instanceof Efe?e.terminalType.name:e instanceof pfe?e.nonTerminalName:""}class mme extends Tfe{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function yme(e,t,n,r=[]){const i=[],a=vme(t.definition);if(Yte(a))return[];{const t=e.name;rse(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:cye.LEFT_RECURSION,ruleName:t});const o=qoe(Aoe(a,r.concat([e])),t=>{const i=Vae(r);return i.push(t),yme(e,t,n,i)});return i.concat(o)}}function vme(e){let t=[];if(Yte(e))return t;const n=Hoe(e);if(n instanceof pfe)t.push(n.referencedRule);else if(n instanceof gfe||n instanceof mfe||n instanceof yfe||n instanceof vfe||n instanceof xfe||n instanceof bfe)t=t.concat(vme(n.definition));else if(n instanceof wfe)t=wae(Goe(n.definition,e=>vme(e.definition)));else if(!(n instanceof Efe))throw Error("non exhaustive match");const r=_fe(n),i=e.length>1;if(r&&i){const n=Ioe(e);return t.concat(vme(n))}return t}class bme extends Tfe{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function xme(e,t,n){const r=new bme;e.accept(r);let i=r.alternations;i=_se(i,e=>!0===e.ignoreAmbiguities);const a=qoe(i,r=>{const i=r.idx,a=r.maxLookahead||t,o=cme(i,e,a,r),s=function(e,t,n,r){const i=[],a=Tse(e,(n,r,a)=>(!0===t.definition[a].ignoreAmbiguities||Moe(r,r=>{const o=[a];Moe(e,(e,n)=>{a!==n&&hme(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!hme(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),o=Goe(a,e=>{const i=Goe(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:cye.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}});return o}(o,r,e,n),l=function(e,t,n,r){const i=Tse(e,(e,t,n)=>{const r=Goe(t,e=>({idx:n,path:e}));return e.concat(r)},[]),a=Xae(qoe(i,e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const a=e.idx,o=e.path,s=Boe(i,e=>!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}(e.path,o));return Goe(s,e=>{const i=[e.idx+1,a+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:cye.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}));return a}(o,r,e,n);return s.concat(l)});return a}class wme extends Tfe{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Eme(e){const t=Soe(e,{errMsgProvider:Fge}),n={};return Moe(e.rules,e=>{n[e.name]=e}),function(e,t){const n=new jge(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}const kme="MismatchedTokenException",Tme="NoViableAltException",_me="EarlyExitException",Cme="NotAllInputParsedException",Sme=[kme,Tme,_me,Cme];function Ame(e){return rse(Sme,e.name)}Object.freeze(Sme);class Nme extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Ime extends Nme{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=kme}}class Ome extends Nme{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Tme}}class Lme extends Nme{constructor(e,t){super(e,t),this.name=Cme}}class Mme extends Nme{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=_me}}const Rme={},Dme="InRuleRecoveryException";class Pme extends Error{constructor(e){super(e),this.name=Dme}}function $me(e,t,n,r,i,a,o){const s=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[s];if(void 0===l){const e=this.getCurrRuleFullName();l=new a(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[s]=l}let c=l.token,u=l.occurrence;const h=l.isEndOfRule;1===this.RULE_STACK.length&&h&&void 0===c&&(c=Dge,u=1),void 0!==c&&void 0!==u&&this.shouldInRepetitionRecoveryBeTried(c,u,o)&&this.tryInRepetitionRecovery(e,t,n,c)}const Bme=1024,Fme=1280,zme=1536;function jme(e,t,n){return n|t|e}class Hme{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:sye.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(Yte(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return qoe(e,e=>yme(e,e,zge))}validateEmptyOrAlternatives(e){return qoe(e,e=>function(e,t){const n=new bme;return e.accept(n),qoe(n.alternations,n=>qoe(Ooe(n.definition),(r,i)=>Yte(Kge([r],[],uge,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:cye.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,zge))}validateAmbiguousAlternationAlternatives(e,t){return qoe(e,e=>xme(e,t,zge))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return Moe(e,e=>{const i=new wme;e.accept(i),Moe(i.allProductions,i=>{const a=Jge(i),o=i.maxLookahead||t;if(Yte(wae(ume(i.idx,e,a,o)[0]))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:cye.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,zge)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,a){const o=cme(e,t,n);return a(o,r,dme(o)?hge:uge,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,tme)}buildLookaheadForOptional(e){return function(e,t,n,r,i,a){const o=ume(e,t,i,n),s=dme(o)?hge:uge;return a(o[0],s,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Jge(e.prodType),nme)}}const Ume=new class extends Tfe{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Gme(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset!1===h4(e[t])),r=Goe(n,t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Xme.MISSING_METHOD,methodName:t}));return Xae(r)}(e,t);return n}(this,t);if(!Yte(e)){const t=Goe(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}var Xme;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Xme||(Xme={}));const Kme={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Kme);const Qme=!0,Zme=Math.pow(2,8)-1,Jme=Rge({name:"RECORDING_PHASE_TOKEN",pattern:Ege.NA});fge([Jme]);const eye=Pge(Jme,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(eye);const tye={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function nye(e,t,n,r=!1){aye(n);const i=Noe(this.recordingProdStack),a=h4(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),Joe(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),Kme}function rye(e,t){aye(t);const n=Noe(this.recordingProdStack),r=!1===u3(e),i=!1===r?e:e.DEF,a=new wfe({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});Joe(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD);const o=Sse(i,e=>h4(e.GATE));return a.hasPredicates=o,n.definition.push(a),Moe(i,e=>{const t=new gfe({definition:[]});a.definition.push(t),Joe(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Joe(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Kme}function iye(e){return 0===e?"":`${e}`}function aye(e){if(e<0||e>Zme){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${Zme+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const oye=Pge(Dge,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(oye);const sye=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bge,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),lye=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var cye,uye,hye;function dye(e=void 0){return function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(cye||(cye={}));class pye{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{ufe(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Moe(this.definedRulesNames,e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Eme({rules:tse(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Yte(n)&&!1===this.skipValidations){const n=(e={rules:tse(this.gastProductionsCache),tokenTypes:tse(this.tokensMap),errMsgProvider:zge,grammarName:t},pme((e=Soe(e,{errMsgProvider:zge})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){return Goe(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:cye.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:tse(this.gastProductionsCache),tokenTypes:tse(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e}),Yte(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return Moe(e,e=>{const n=new Ofe(e).startWalking();oae(t,n)}),t}(tse(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:tse(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(tse(this.gastProductionsCache))})),!pye.DEFER_DEFINITION_ERRORS_HANDLING&&!Yte(this.definitionErrors))throw e=Goe(this.definitionErrors,e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),Joe(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Joe(t,"skipValidations")?t.skipValidations:sye.skipValidations}}pye.DEFER_DEFINITION_ERRORS_HANDLING=!1,uye=pye,hye=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Joe(e,"recoveryEnabled")?e.recoveryEnabled:sye.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=$me)}getTokenToInsert(e){const t=Pge(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let s=!1;const l=this.LA(1);let c=this.LA(1);const u=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new Ime(t,l,this.LA(0));n.resyncedTokens=Ooe(o),this.SAVE_ERROR(n)};for(;!s;){if(this.tokenMatcher(c,r))return void u();if(n.call(this))return u(),void e.apply(this,t);this.tokenMatcher(c,i)?s=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Pme("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Yte(t))return!1;const n=this.LA(1);return void 0!==joe(t,e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return rse(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=joe(e,e=>$ge(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return Rme;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return Goe(e,(n,r)=>0===r?Rme:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return wae(Goe(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===Rme)return[Dge];const t=e.ruleName+e.idxInCallingRule+Ife+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Dge)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Ooe(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:Vae(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return Goe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},class{initLooksAhead(e){this.dynamicTokensEnabled=Joe(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:sye.dynamicTokensEnabled,this.maxLookahead=Joe(e,"maxLookahead")?e.maxLookahead:sye.maxLookahead,this.lookaheadStrategy=Joe(e,"lookaheadStrategy")?e.lookaheadStrategy:new Hme({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Moe(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=function(e){Ume.reset(),e.accept(Ume);const t=Ume.dslMethods;return Ume.reset(),t}(e);Moe(t,t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${Cfe(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=jme(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),Moe(n,t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,Cfe(t))}),Moe(r,t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,Cfe(t))}),Moe(i,t=>{this.computeLookaheadFunc(e,t.idx,Bme,"RepetitionMandatory",t.maxLookahead,Cfe(t))}),Moe(a,t=>{this.computeLookaheadFunc(e,t.idx,zme,"RepetitionMandatoryWithSeparator",t.maxLookahead,Cfe(t))}),Moe(o,t=>{this.computeLookaheadFunc(e,t.idx,Fme,"RepetitionWithSeparator",t.maxLookahead,Cfe(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${0===t?"":t}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=jme(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return jme(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Joe(e,"nodeLocationTracking")?e.nodeLocationTracking:sye.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=qme,this.setNodeLocationFromNode=qme,this.cstPostRule=Zie,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Zie,this.setNodeLocationFromNode=Zie,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Gme,this.setNodeLocationFromNode=Gme,this.cstPostRule=Zie,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Zie,this.setNodeLocationFromNode=Zie,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=Zie,this.setNodeLocationFromNode=Zie,this.cstPostRule=Zie,this.setInitialNodeLocation=Zie}else this.cstInvocationStateUpdate=Zie,this.cstFinallyStateUpdate=Zie,this.cstPostTerminal=Zie,this.cstPostNonTerminal=Zie,this.cstPostRule=Zie}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 t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[n]?e.children[n]=[t]:e.children[n].push(t)}(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(sse(this.baseCstVisitorConstructor)){const e=Yme(this.className,iae(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(sse(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};Wme(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return Moe(t,e=>{i[e]=Vme}),(r.prototype=i).constructor=r,r}(this.className,iae(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]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing 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)):oye}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?oye:this.tokVector[t]}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()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=hge,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Joe(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(u3(e)){if(Yte(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(u3(e))this.tokensMap=Tse(e,(e,t)=>(e[t.name]=t,e),{});else if(Joe(e,"modes")&&Poe(wae(tse(e.modes)),vge)){const t=Lse(wae(tse(e.modes)));this.tokensMap=Tse(t,(e,t)=>(e[t.name]=t,e),{})}else{if(!u4(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Vae(e)}this.tokensMap.EOF=Dge;const n=Poe(Joe(e,"modes")?wae(tse(e.modes)):tse(e),e=>Yte(e.categoryMatches));this.tokenMatcher=n?hge:uge,fge(tse(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Joe(n,"resyncEnabled")?n.resyncEnabled:lye.resyncEnabled,i=Joe(n,"recoveryValueFunc")?n.recoveryValueFunc:lye.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Ame(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Bme,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Zge.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Bme,e,Vge)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(zme,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Zge.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Yge],t,zme,e,Yge)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,qge,a)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Fme,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Wge],t,Fme,e,Wge)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,zme,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=u3(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Lme(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw Ame(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Ime(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Dme?n:e}}}saveRecogState(){const e=this.errors,t=Vae(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Dge)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=lye){if(rse(this.definedRulesNames,e)){const t={message:zge.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:cye.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=lye){const r=function(e,t,n){const r=[];let i;return rse(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:cye.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(Ame(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Goe(tse(this.gastProductionsCache),kfe)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Joe(e,"errorMessageProvider")?e.errorMessageProvider:sye.errorMessageProvider}SAVE_ERROR(e){if(Ame(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Vae(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Vae(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=ume(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Mme(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=cme(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const a=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Ome(o,this.LA(1),a))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(sse(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Kge([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Hoe(e.ruleStack),n=this.getGAstProductions()[t];return new Uge(n,e).startWalking()}},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 t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},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 t=0;t<10;t++){const n=t>0?t:"";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,t){return()=>!0}LA_RECORD(e){return oye}topLevelRuleRecord(e,t){try{const n=new ffe({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return nye.call(this,mfe,e,t)}atLeastOneInternalRecord(e,t){nye.call(this,yfe,t,e)}atLeastOneSepFirstInternalRecord(e,t){nye.call(this,vfe,t,e,Qme)}manyInternalRecord(e,t){nye.call(this,bfe,t,e)}manySepFirstInternalRecord(e,t){nye.call(this,xfe,t,e,Qme)}orInternalRecord(e,t){return rye.call(this,e,t)}subruleInternalRecord(e,t,n){if(aye(t),!e||!1===Joe(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Noe(this.recordingProdStack),i=e.ruleName,a=new pfe({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?tye:Kme}consumeInternalRecord(e,t,n){if(aye(t),!mge(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Noe(this.recordingProdStack),i=new Efe({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),eye}},class{initPerformanceTracer(e){if(Joe(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=sye.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=cfe(t),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],hye.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(uye.prototype,n,r):uye.prototype[n]=e.prototype[n]})});class fye extends pye{constructor(e,t=sye){const n=Vae(t);n.outputCst=!1,super(e,n)}}function gye(e,t,n){return`${e.name}_${t}_${n}`}class mye{constructor(e){this.target=e}isEpsilon(){return!1}}class yye extends mye{constructor(e,t){super(e),this.tokenType=t}}class vye extends mye{constructor(e){super(e)}isEpsilon(){return!0}}class bye extends mye{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}}function xye(e){const t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};!function(e,t){const n=t.length;for(let r=0;rwye(e,t,n)),a=Cye(e,t,r,n,...i);return a}(e,t,n):n instanceof mfe?function(e,t,n){const r=Iye(e,t,n,{type:1});_ye(e,r);const i=Cye(e,t,r,n,Eye(e,t,n));return function(e,t,n,r){const i=r.left,a=r.right;return Nye(i,a),e.decisionMap[gye(t,"Option",n.idx)]=i,r}(e,t,n,i)}(e,t,n):n instanceof bfe?function(e,t,n){const r=Iye(e,t,n,{type:5});_ye(e,r);const i=Cye(e,t,r,n,Eye(e,t,n));return Tye(e,t,n,i)}(e,t,n):n instanceof xfe?function(e,t,n){const r=Iye(e,t,n,{type:5});_ye(e,r);const i=Cye(e,t,r,n,Eye(e,t,n)),a=Sye(e,t,n.separator,n);return Tye(e,t,n,i,a)}(e,t,n):n instanceof yfe?function(e,t,n){const r=Iye(e,t,n,{type:4});_ye(e,r);const i=Cye(e,t,r,n,Eye(e,t,n));return kye(e,t,n,i)}(e,t,n):n instanceof vfe?function(e,t,n){const r=Iye(e,t,n,{type:4});_ye(e,r);const i=Cye(e,t,r,n,Eye(e,t,n)),a=Sye(e,t,n.separator,n);return kye(e,t,n,i,a)}(e,t,n):Eye(e,t,n)}function Eye(e,t,n){const r=Boe(Goe(n.definition,n=>wye(e,t,n)),e=>void 0!==e);return 1===r.length?r[0]:0===r.length?void 0:function(e,t){const n=t.length;for(let r=0;re.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}}function Dye(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join("_")}`}function Pye(e,t){const n={};return r=>{const i=r.toString();let a=n[i];return void 0!==a||(a={atnStartState:e,decision:t,states:{}},n[i]=a),a}}class $ye{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let n=0;nconsole.log(e)}initialize(e){this.atn=xye(e.rules),this.dfas=function(e){const t=e.decisionStates.length,n=Array(t);for(let r=0;rGoe(e,e=>e[0]));if(zye(c,!1)&&!i){const e=Tse(c,(e,t,n)=>(Moe(t,t=>{t&&(e[t.tokenTypeIdx]=n,Moe(t.categoryMatches,t=>{e[t]=n}))}),e),{});return r?function(t){var n;const r=this.LA(1),i=e[r.tokenTypeIdx];if(void 0!==t&&void 0!==i){const e=null===(n=t[i])||void 0===n?void 0:n.GATE;if(void 0!==e&&!1===e.call(this))return}return i}:function(){const t=this.LA(1);return e[t.tokenTypeIdx]}}return r?function(e){const t=new $ye,n=void 0===e?0:e.length;for(let r=0;rGoe(e,e=>e[0]));if(zye(c)&&c[0][0]&&!i){const e=wae(c[0]);if(1===e.length&&Yte(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=Tse(e,(e,t)=>(void 0!==t&&(e[t.tokenTypeIdx]=!0,Moe(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const e=jye.call(this,a,l,Bye,o);return"object"!=typeof e&&0===e}}}function zye(e,t=!0){const n=new Set;for(const r of e){const e=new Set;for(const i of r){if(void 0===i){if(t)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function jye(e,t,n,r){const i=e[t](n);let a=i.start;if(void 0===a){a=Kye(i,Yye(Qye(i.atnStartState))),i.start=a}return Hye.apply(this,[i,a,n,r])}function Hye(e,t,n,r){let i=t,a=1;const o=[];let s=this.LA(a++);for(;;){let t=Wye(i,s);if(void 0===t&&(t=Uye.apply(this,[e,i,s,a,n,r])),t===Mye)return qye(o,i,s);if(!0===t.isAcceptState)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function Uye(e,t,n,r,i,a){const o=function(e,t,n){const r=new Rye,i=[];for(const a of e.elements){if(!1===n.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const e=a.state.transitions.length;for(let n=0;n0&&!function(e){for(const t of e.elements)if(7===t.state.type)return!0;return!1}(a))for(const e of i)a.add(e);return a}(t.configs,n,i);if(0===o.size)return Xye(e,t,n,Mye),Mye;let s=Yye(o);const l=function(e,t){let n;for(const r of e.elements)if(!0===t.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}(o,i);if(void 0!==l)s.isAcceptState=!0,s.prediction=l,s.configs.uniqueAlt=l;else if(function(e){if(function(e){for(const t of e.elements)if(7!==t.state.type)return!1;return!0}(e))return!0;const t=function(e){const t=new Map;for(const n of e){const e=Dye(n,!1);let r=t.get(e);void 0===r&&(r={},t.set(e,r)),r[n.alt]=!0}return t}(e.elements);return function(e){for(const t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}(t)&&!function(e){for(const t of Array.from(e.values()))if(1===Object.keys(t).length)return!0;return!1}(t)}(o)){const t=dse(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,Gye.apply(this,[e,r,o.alts,a])}return s=Xye(e,t,n,s),s}function Gye(e,t,n,r){const i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);const a=e.atnStartState;r(function(e){const t=Goe(e.prefixPath,e=>kge(e)).join(", "),n=0===e.production.idx?"":e.production.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${function(e){if(e instanceof pfe)return"SUBRULE";if(e instanceof mfe)return"OPTION";if(e instanceof wfe)return"OR";if(e instanceof yfe)return"AT_LEAST_ONE";if(e instanceof vfe)return"AT_LEAST_ONE_SEP";if(e instanceof xfe)return"MANY_SEP";if(e instanceof bfe)return"MANY";if(e instanceof Efe)return"CONSUME";throw Error("non exhaustive match")}(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}({topLevelRule:a.rule,ambiguityIndices:n,production:a.production,prefixPath:i}))}function qye(e,t,n){const r=qoe(t.configs.elements,e=>e.state.transitions),i=function(e,t){return e&&e.length?Ise(e,boe(t)):[]}(r.filter(e=>e instanceof yye).map(e=>e.tokenType),e=>e.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:e}}function Wye(e,t){return e.edges[t.tokenTypeIdx]}function Vye(e,t){if(e instanceof yye&&$ge(t,e.tokenType))return e.target}function Yye(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Xye(e,t,n,r){return r=Kye(e,r),t.edges[n.tokenTypeIdx]=r,r}function Kye(e,t){if(t===Mye)return t;const n=t.configs.key,r=e.states[n];return void 0!==r?r:(t.configs.finalize(),e.states[n]=t,t)}function Qye(e){const t=new Rye,n=e.transitions.length;for(let r=0;r0){const n=[...e.stack];Zye({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);const r=n.transitions.length;for(let i=0;i0&&(r.arguments=n),r},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.string(t.title)&&Cbe.string(t.command)}}(vve||(vve={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&Cbe.string(t.newText)&&ave.is(t.range)}}(bve||(bve={})),function(e){e.create=function(e,t,n){const r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&Cbe.string(t.label)&&(Cbe.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Cbe.string(t.description)||void 0===t.description)}}(xve||(xve={})),function(e){e.is=function(e){const t=e;return Cbe.string(t)}}(wve||(wve={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){const t=e;return bve.is(t)&&(xve.is(t.annotationId)||wve.is(t.annotationId))}}(Eve||(Eve={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return Cbe.defined(t)&&Ive.is(t.textDocument)&&Array.isArray(t.edits)}}(kve||(kve={})),function(e){e.create=function(e,t,n){let r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"create"===t.kind&&Cbe.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Cbe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Cbe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||wve.is(t.annotationId))}}(Tve||(Tve={})),function(e){e.create=function(e,t,n,r){let i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&"rename"===t.kind&&Cbe.string(t.oldUri)&&Cbe.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Cbe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Cbe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||wve.is(t.annotationId))}}(_ve||(_ve={})),function(e){e.create=function(e,t,n){let r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"delete"===t.kind&&Cbe.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Cbe.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Cbe.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||wve.is(t.annotationId))}}(Cve||(Cve={})),function(e){e.is=function(e){let t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every(e=>Cbe.string(e.kind)?Tve.is(e)||_ve.is(e)||Cve.is(e):kve.is(e)))}}(Sve||(Sve={})),function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.string(t.uri)}}(Ave||(Ave={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.string(t.uri)&&Cbe.integer(t.version)}}(Nve||(Nve={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.string(t.uri)&&(null===t.version||Cbe.integer(t.version))}}(Ive||(Ive={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.string(t.uri)&&Cbe.string(t.languageId)&&Cbe.integer(t.version)&&Cbe.string(t.text)}}(Ove||(Ove={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){const n=t;return n===e.PlainText||n===e.Markdown}}(Lve||(Lve={})),function(e){e.is=function(e){const t=e;return Cbe.objectLiteral(e)&&Lve.is(t.kind)&&Cbe.string(t.value)}}(Mve||(Mve={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Rve||(Rve={})),function(e){e.PlainText=1,e.Snippet=2}(Dve||(Dve={})),function(e){e.Deprecated=1}(Pve||(Pve={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){const t=e;return t&&Cbe.string(t.newText)&&ave.is(t.insert)&&ave.is(t.replace)}}($ve||($ve={})),function(e){e.asIs=1,e.adjustIndentation=2}(Bve||(Bve={})),function(e){e.is=function(e){const t=e;return t&&(Cbe.string(t.detail)||void 0===t.detail)&&(Cbe.string(t.description)||void 0===t.description)}}(Fve||(Fve={})),function(e){e.create=function(e){return{label:e}}}(zve||(zve={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(jve||(jve={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){const t=e;return Cbe.string(t)||Cbe.objectLiteral(t)&&Cbe.string(t.language)&&Cbe.string(t.value)}}(Hve||(Hve={})),function(e){e.is=function(e){let t=e;return!!t&&Cbe.objectLiteral(t)&&(Mve.is(t.contents)||Hve.is(t.contents)||Cbe.typedArray(t.contents,Hve.is))&&(void 0===e.range||ave.is(e.range))}}(Uve||(Uve={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Gve||(Gve={})),function(e){e.create=function(e,t,...n){let r={label:e};return Cbe.defined(t)&&(r.documentation=t),Cbe.defined(n)?r.parameters=n:r.parameters=[],r}}(qve||(qve={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Wve||(Wve={})),function(e){e.create=function(e,t){let n={range:e};return Cbe.number(t)&&(n.kind=t),n}}(Vve||(Vve={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Yve||(Yve={})),function(e){e.Deprecated=1}(Xve||(Xve={})),function(e){e.create=function(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}}(Kve||(Kve={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(Qve||(Qve={})),function(e){e.create=function(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==a&&(o.children=a),o},e.is=function(e){let t=e;return t&&Cbe.string(t.name)&&Cbe.number(t.kind)&&ave.is(t.range)&&ave.is(t.selectionRange)&&(void 0===t.detail||Cbe.string(t.detail))&&(void 0===t.deprecated||Cbe.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Zve||(Zve={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(Jve||(Jve={})),function(e){e.Invoked=1,e.Automatic=2}(ebe||(ebe={})),function(e){e.create=function(e,t,n){let r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.typedArray(t.diagnostics,yve.is)&&(void 0===t.only||Cbe.typedArray(t.only,Cbe.string))&&(void 0===t.triggerKind||t.triggerKind===ebe.Invoked||t.triggerKind===ebe.Automatic)}}(tbe||(tbe={})),function(e){e.create=function(e,t,n){let r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):vve.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){let t=e;return t&&Cbe.string(t.title)&&(void 0===t.diagnostics||Cbe.typedArray(t.diagnostics,yve.is))&&(void 0===t.kind||Cbe.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||vve.is(t.command))&&(void 0===t.isPreferred||Cbe.boolean(t.isPreferred))&&(void 0===t.edit||Sve.is(t.edit))}}(nbe||(nbe={})),function(e){e.create=function(e,t){let n={range:e};return Cbe.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return Cbe.defined(t)&&ave.is(t.range)&&(Cbe.undefined(t.command)||vve.is(t.command))}}(rbe||(rbe={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return Cbe.defined(t)&&Cbe.uinteger(t.tabSize)&&Cbe.boolean(t.insertSpaces)}}(ibe||(ibe={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return Cbe.defined(t)&&ave.is(t.range)&&(Cbe.undefined(t.target)||Cbe.string(t.target))}}(abe||(abe={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return Cbe.objectLiteral(n)&&ave.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(obe||(obe={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(sbe||(sbe={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(lbe||(lbe={})),function(e){e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(cbe||(cbe={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){const t=e;return null!=t&&ave.is(t.range)&&Cbe.string(t.text)}}(ube||(ube={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){const t=e;return null!=t&&ave.is(t.range)&&Cbe.boolean(t.caseSensitiveLookup)&&(Cbe.string(t.variableName)||void 0===t.variableName)}}(hbe||(hbe={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){const t=e;return null!=t&&ave.is(t.range)&&(Cbe.string(t.expression)||void 0===t.expression)}}(dbe||(dbe={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){const t=e;return Cbe.defined(t)&&ave.is(e.stoppedLocation)}}(pbe||(pbe={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(fbe||(fbe={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&(void 0===t.tooltip||Cbe.string(t.tooltip)||Mve.is(t.tooltip))&&(void 0===t.location||ove.is(t.location))&&(void 0===t.command||vve.is(t.command))}}(gbe||(gbe={})),function(e){e.create=function(e,t,n){const r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&ive.is(t.position)&&(Cbe.string(t.label)||Cbe.typedArray(t.label,gbe.is))&&(void 0===t.kind||fbe.is(t.kind))&&void 0===t.textEdits||Cbe.typedArray(t.textEdits,bve.is)&&(void 0===t.tooltip||Cbe.string(t.tooltip)||Mve.is(t.tooltip))&&(void 0===t.paddingLeft||Cbe.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Cbe.boolean(t.paddingRight))}}(mbe||(mbe={})),function(e){e.createSnippet=function(e){return{kind:"snippet",value:e}}}(ybe||(ybe={})),function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}}(vbe||(vbe={})),function(e){e.create=function(e){return{items:e}}}(bbe||(bbe={})),function(e){e.Invoked=0,e.Automatic=1}(xbe||(xbe={})),function(e){e.create=function(e,t){return{range:e,text:t}}}(wbe||(wbe={})),function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}}(Ebe||(Ebe={})),function(e){e.is=function(e){const t=e;return Cbe.objectLiteral(t)&&tve.is(t.uri)&&Cbe.string(t.name)}}(kbe||(kbe={})),function(e){function t(e,n){if(e.length<=1)return e;const r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);let o=0,s=0,l=0;for(;o{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),a=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),s=e.offsetAt(n.range.end);if(!(s<=a))throw new Error("Overlapping edit");r=r.substring(0,o)+n.newText+r.substring(s,r.length),a=o}return r}}(Tbe||(Tbe={}));let _be=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],t=this._content,n=!0;for(let r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return ive.create(0,e);for(;ne?r=i:n=i+1}let i=n-1;return ive.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1=0&&t.content.splice(n,1)}}addHiddenNodes(e){const t=[];for(const n of e){const e=new Nbe(n.startOffset,n.image.length,Qhe(n),n.tokenType,!0);e.root=this.rootNode,t.push(e)}let n=this.current,r=!1;if(n.content.length>0)n.content.push(...t);else{for(;n.container;){const e=n.container.content.indexOf(n);if(e>0){n.container.content.splice(e,0,...t),r=!0;break}n=n.container}r||this.rootNode.content.unshift(...t)}}construct(e){const t=this.current;"string"==typeof e.$type&&(this.current.astNode=e),e.$cstNode=t;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}}class Abe{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,t;const n="string"==typeof(null===(e=this._astNode)||void 0===e?void 0:e.$type)?this._astNode:null===(t=this.container)||void 0===t?void 0:t.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Nbe extends Abe{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,n,r,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=r,this._length=t,this._range=n}}class Ibe extends Abe{constructor(){super(...arguments),this.content=new Obe(this)}get children(){return this.content}get offset(){var e,t;return null!==(t=null===(e=this.firstNonHiddenNode)||void 0===e?void 0:e.offset)&&void 0!==t?t:0}get length(){return this.end-this.offset}get end(){var e,t;return null!==(t=null===(e=this.lastNonHiddenNode)||void 0===e?void 0:e.end)&&void 0!==t?t:0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(void 0===this._rangeCache){const{range:n}=e,{range:r}=t;this._rangeCache={start:n.start,end:r.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class Obe extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Obe.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(const t of e)t.container=this.parent}}class Lbe extends Ibe{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=null!=e?e:""}}const Mbe=Symbol("Datatype");function Rbe(e){return e.$type===Mbe}const Dbe=e=>e.endsWith("​")?e:e+"​";class Pbe{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,n="production"===e.LanguageMetaData.mode;this.wrapper=new Hbe(t,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class $be extends Pbe{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Sbe,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const n=this.computeRuleType(e),r=this.wrapper.DEFINE_RULE(Dbe(e.name),this.startImplementation(n,t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}computeRuleType(e){if(!e.fragment){if(Zpe(e))return Mbe;{const t=efe(e);return null!=t?t:e.name}}}parse(e,t={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const r=t.rule?this.allRules.get(t.rule):this.mainRule;if(!r)throw new Error(t.rule?`No rule found with name '${t.rule}'`:"No main rule available.");const i=r.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:i,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,t){return n=>{const r=!this.isRecording()&&void 0!==e;if(r){const t={$type:e};this.stack.push(t),e===Mbe&&(t.value="")}let i;try{i=t(n)}catch(e){i=void 0}return void 0===i&&r&&(i=this.construct()),i}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const n=e.startOffset;for(let e=0;en)return t.splice(0,e)}return t.splice(0,t.length)}consume(e,t,n){const r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){const e=this.extractHiddenTokens(r);this.nodeBuilder.addHiddenNodes(e);const t=this.nodeBuilder.buildLeafNode(r,n),{assignment:i,isCrossRef:a}=this.getAssignment(n),o=this.current;if(i){const e=epe(n)?r.image:this.converter.convert(r.image,t);this.assign(i.operator,i.feature,e,t,a)}else if(Rbe(o)){let e=r.image;epe(n)||(e=this.converter.convert(e,t).toString()),o.value+=e}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&"number"==typeof e.endOffset&&!isNaN(e.endOffset)}subrule(e,t,n,r,i){let a;this.isRecording()||n||(a=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,t,i);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,r,a)}performSubruleAssignment(e,t,n){const{assignment:r,isCrossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){const t=this.current;if(Rbe(t))t.value+=e.toString();else if("object"==typeof e&&e){const n=this.assignWithoutOverride(e,t);this.stack.pop(),this.stack.push(n)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(t.feature&&t.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode);this.nodeBuilder.buildCompositeNode(t).content.push(n.$cstNode);const r={$type:e};this.stack.push(r),this.assign(t.operator,t.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return function(e){for(const[t,n]of Object.entries(e))t.startsWith("$")||(Array.isArray(n)?n.forEach((n,r)=>{Rhe(n)&&(n.$container=e,n.$containerProperty=t,n.$containerIndex=r)}):Rhe(n)&&(n.$container=e,n.$containerProperty=t))}(e),this.nodeBuilder.construct(e),this.stack.pop(),Rbe(e)?this.converter.convert(e.value,e.$cstNode):(function(e,t){const n=e.getTypeMetaData(t.$type),r=t;for(const e of n.properties)void 0!==e.defaultValue&&void 0===r[e.name]&&(r[e.name]=Epe(e.defaultValue))}(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=fpe(e,Wde);this.assignmentMap.set(e,{assignment:t,isCrossRef:!!t&&Xde(t.terminal)})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){const a=this.current;let o;switch(o=i&&"string"==typeof n?this.linker.buildReference(a,t,r,n):n,e){case"=":a[t]=o;break;case"?=":a[t]=!0;break;case"+=":Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(const[n,r]of Object.entries(t)){const t=e[n];void 0===t?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Bbe{buildMismatchTokenMessage(e){return Bge.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Bge.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Bge.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Bge.buildEarlyExitMessage(e)}}class Fbe extends Bbe{buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class zbe extends Pbe{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const n=this.wrapper.DEFINE_RULE(Dbe(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,t,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const jbe={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Fbe};class Hbe extends fye{constructor(e,t){const n=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},jbe),{lookaheadStrategy:n?new Hme({maxLookahead:t.maxLookahead}):new Fye({logging:t.skipValidations?()=>{}:void 0})}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function Ube(e,t,n){return function(e,t){const n=Gpe(t,!1),r=Whe(t.rules).filter(Nde).filter(e=>n.has(e));for(const t of r){const n=Object.assign(Object.assign({},e),{consume:1,optional:1,subrule:1,many:1,or:1});e.parser.rule(t,Gbe(n,t.definition))}}({parser:t,tokens:n,ruleNames:new Map},e),t}function Gbe(e,t,n=!1){let r;if(epe(t))r=function(e,t){const n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}(e,t);else if(Hde(t))r=function(e,t){const n=tfe(t);return()=>e.parser.action(n,t)}(e,t);else if(Wde(t))r=Gbe(e,t.terminal);else if(Xde(t))r=Vbe(e,t);else if(ipe(t))r=function(e,t){const n=t.rule.ref;if(Nde(n)){const r=e.subrule++,i=n.fragment,a=t.arguments.length>0?function(e,t){const n=t.map(e=>qbe(e.value));return t=>{const r={};for(let i=0;i({});return o=>e.parser.subrule(r,Xbe(e,n),i,t,a(o))}if(Pde(n)){const r=e.consume++,i=Kbe(e,n.name);return()=>e.parser.consume(r,i,t)}if(!n)throw new rde(t.$cstNode,`Undefined rule: ${t.rule.$refText}`);ide()}(e,t);else if(Gde(t))r=function(e,t){if(1===t.elements.length)return Gbe(e,t.elements[0]);{const n=[];for(const r of t.elements){const t={ALT:Gbe(e,r,!0)},i=Wbe(r);i&&(t.GATE=qbe(i)),n.push(t)}const r=e.or++;return t=>e.parser.alternatives(r,n.map(e=>{const n={ALT:()=>e.ALT(t)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n}))}}(e,t);else if(cpe(t))r=function(e,t){if(1===t.elements.length)return Gbe(e,t.elements[0]);const n=[];for(const r of t.elements){const t={ALT:Gbe(e,r,!0)},i=Wbe(r);i&&(t.GATE=qbe(i)),n.push(t)}const r=e.or++,i=(e,t)=>`uGroup_${e}_${t.getRuleStack().join("-")}`,a=t=>e.parser.alternatives(r,n.map((n,a)=>{const o={ALT:()=>!0},s=e.parser;o.ALT=()=>{if(n.ALT(t),!s.isRecording()){const e=i(r,s);s.unorderedGroups.get(e)||s.unorderedGroups.set(e,[]);const t=s.unorderedGroups.get(e);void 0===(null==t?void 0:t[a])&&(t[a]=!0)}};const l=n.GATE;return o.GATE=l?()=>l(t):()=>{const e=s.unorderedGroups.get(i(r,s));return!(null==e?void 0:e[a])},o})),o=Ybe(e,Wbe(t),a,"*");return t=>{o(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}(e,t);else if(Zde(t))r=function(e,t){const n=t.elements.map(t=>Gbe(e,t));return e=>n.forEach(t=>t(e))}(e,t);else{if(i=t,!ppe.isInstance(i,Kde))throw new rde(t.$cstNode,`Unexpected element type: ${t.$type}`);{const n=e.consume++;r=()=>e.parser.consume(n,Dge,t)}}var i;return Ybe(e,n?void 0:Wbe(t),r,t.cardinality)}function qbe(e){if(t=e,ppe.isInstance(t,mde)){const t=qbe(e.left),n=qbe(e.right);return e=>t(e)||n(e)}if(function(e){return ppe.isInstance(e,gde)}(e)){const t=qbe(e.left),n=qbe(e.right);return e=>t(e)&&n(e)}if(function(e){return ppe.isInstance(e,Tde)}(e)){const t=qbe(e.value);return e=>!t(e)}if(function(e){return ppe.isInstance(e,Sde)}(e)){const t=e.parameter.ref.name;return e=>void 0!==e&&!0===e[t]}if(function(e){return ppe.isInstance(e,fde)}(e)){const t=Boolean(e.true);return()=>t}var t;ide()}function Wbe(e){if(Zde(e))return e.guardCondition}function Vbe(e,t,n=t.terminal){if(n){if(ipe(n)&&Nde(n.rule.ref)){const r=n.rule.ref,i=e.subrule++;return n=>e.parser.subrule(i,Xbe(e,r),!1,t,n)}if(ipe(n)&&Pde(n.rule.ref)){const r=e.consume++,i=Kbe(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}if(epe(n)){const r=e.consume++,i=Kbe(e,n.value);return()=>e.parser.consume(r,i,t)}throw new Error("Could not build cross reference parser")}{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const n=Kpe(t.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+tfe(t.type.ref));return Vbe(e,t,r)}}function Ybe(e,t,n,r){const i=t&&qbe(t);if(!r){if(i){const t=e.or++;return r=>e.parser.alternatives(t,[{ALT:()=>n(r),GATE:()=>i(r)},{ALT:dye(),GATE:()=>!i(r)}])}return n}if("*"===r){const t=e.many++;return r=>e.parser.many(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}if("+"===r){const t=e.many++;if(i){const r=e.or++;return a=>e.parser.alternatives(r,[{ALT:()=>e.parser.atLeastOne(t,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:dye(),GATE:()=>!i(a)}])}return r=>e.parser.atLeastOne(t,{DEF:()=>n(r)})}if("?"===r){const t=e.optional++;return r=>e.parser.optional(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}ide()}function Xbe(e,t){const n=function(e,t){if(Nde(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!Nde(r);){if(Zde(r)||Gde(r)||cpe(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,e.ruleNames.set(t,i),i}}(e,t),r=e.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Kbe(e,t){const n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function Qbe(e){const t=function(e){const t=e.Grammar,n=e.parser.Lexer,r=new $be(e);return Ube(t,r,n.definition)}(e);return t.finalize(),t}class Zbe{constructor(){this.diagnostics=[]}buildTokens(e,t){const n=Whe(Gpe(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return r.forEach(e=>{const t=e.PATTERN;"object"==typeof t&&t&&"test"in t&&jpe(t)?i.unshift(e):i.push(e)}),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Pde).filter(e=>!e.fragment).map(e=>this.buildTerminalToken(e)).toArray()}buildTerminalToken(e){const t=nfe(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n};return"function"==typeof n&&(r.LINE_BREAKS=!0),e.hidden&&(r.GROUP=jpe(t)?Ege.SKIPPED:"hidden"),r}requiresCustomPattern(e){return!(!e.flags.includes("u")&&!e.flags.includes("s"))||!(!e.source.includes("?<=")&&!e.source.includes("?{t.lastIndex=n;return t.exec(e)}}buildKeywordTokens(e,t,n){return e.filter(Nde).flatMap(e=>vpe(e).filter(epe)).distinct(e=>e.value).toArray().sort((e,t)=>t.value.length-e.value.length).map(e=>this.buildKeywordToken(e,t,Boolean(null==n?void 0:n.caseInsensitive)))}buildKeywordToken(e,t,n){const r=this.buildKeywordPattern(e,n),i={name:e.value,PATTERN:r,LONGER_ALT:this.findLongerAlt(e,t)};return"function"==typeof r&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,t){return t?new RegExp(function(e){return Array.prototype.map.call(e,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Hpe(e)).join("")}(e.value)):e.value}findLongerAlt(e,t){return t.reduce((t,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&Upe("^"+r.source+"$",e.value)&&t.push(n),t},[])}}class Jbe{convert(e,t){let n=t.grammarSource;if(Xde(n)&&(n=function(e){if(e.terminal)return e.terminal;if(e.type.ref){const t=Kpe(e.type.ref);return null==t?void 0:t.terminal}}(n)),ipe(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,e,t)}return e}runConverter(e,t,n){var r;switch(e.name.toUpperCase()){case"INT":return exe.convertInt(t);case"STRING":return exe.convertString(t);case"ID":return exe.convertID(t)}switch(null===(r=function(e){var t,n,r;return Pde(e)?null!==(n=null===(t=e.type)||void 0===t?void 0:t.name)&&void 0!==n?n:"string":null!==(r=efe(e))&&void 0!==r?r:e.name}(e))||void 0===r?void 0:r.toLowerCase()){case"number":return exe.convertNumber(t);case"boolean":return exe.convertBoolean(t);case"bigint":return exe.convertBigint(t);case"date":return exe.convertDate(t);default:return t}}}var exe;!function(e){function t(e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return e}}e.convertString=function(e){let n="";for(let r=1;roxe(e))};var lxe={};Object.defineProperty(lxe,"__esModule",{value:!0});var cxe=lxe.Emitter=lxe.Event=void 0;const uxe=nxe;var hxe;!function(e){const t={dispose(){}};e.None=function(){return t}}(hxe||(lxe.Event=hxe={}));class dxe{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new dxe),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};var fxe;cxe=lxe.Emitter=pxe,pxe._noop=function(){},Object.defineProperty(txe,"__esModule",{value:!0});var gxe=txe.CancellationTokenSource=fxe=txe.CancellationToken=void 0;const mxe=nxe,yxe=axe,vxe=lxe;var bxe;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:vxe.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vxe.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||yxe.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(bxe||(fxe=txe.CancellationToken=bxe={}));const xxe=Object.freeze(function(e,t){const n=(0,mxe.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}});class wxe{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?xxe:(this._emitter||(this._emitter=new vxe.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}gxe=txe.CancellationTokenSource=class{get token(){return this._token||(this._token=new wxe),this._token}cancel(){this._token?this._token.cancel():this._token=bxe.Cancelled}dispose(){this._token?this._token instanceof wxe&&this._token.dispose():this._token=bxe.None}};let Exe=0;const kxe=Symbol("OperationCancelled");function Txe(e){return e===kxe}async function _xe(e){if(e===fxe.None)return;const t=performance.now();if(t-Exe>=10&&(Exe=t,await new Promise(e=>{"undefined"==typeof setImmediate?setTimeout(e,0):setImmediate(e)}),Exe=performance.now()),e.isCancellationRequested)throw kxe}class Cxe{constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)})}}class Sxe{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(const t of e)if(Sxe.isIncremental(t)){const e=Mxe(t.range),n=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,n)+t.text+this._content.substring(r,this._content.length);const i=Math.max(e.start.line,0),a=Math.max(e.end.line,0);let o=this._lineOffsets;const s=Oxe(t.text,!1,n);if(a-i===s.length)for(let e=0,t=s.length;ee?r=i:n=i+1}const i=n-1;return{line:i,character:(e=this.ensureBeforeEOL(e,t[i]))-t[i]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const n=t[e.line];if(e.character<=0)return n;const r=e.line+1t&&Lxe(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}var Axe,Nxe;function Ixe(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Ixe(r,t),Ixe(i,t);let a=0,o=0,s=0;for(;an.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function Rxe(e){const t=Mxe(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new Sxe(e,t,n,r)},e.update=function(e,t,n){if(e instanceof Sxe)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){const n=e.getText(),r=Ixe(t.map(Rxe),(e,t)=>{const n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n});let i=0;const a=[];for(const t of r){const r=e.offsetAt(t.range.start);if(ri&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join("")}}(Axe||(Axe={})),(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;ic){if(47===n.charCodeAt(s+h))return n.slice(s+h+1);if(0===h)return n.slice(s+h)}else o>c&&(47===e.charCodeAt(i+h)?u=h:0===h&&(u=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(s+h))break;47===d&&(u=h)}var p="";for(h=i+u+1;h<=a;++h)h!==a&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(s+u):(s+=u,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1),s>=0&&(c===n.charCodeAt(s)?-1==--s&&(a=r):(s=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(a=!1,i=s+1),46===l?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!a){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,s=0,l=-1,c=!0,u=e.length-1,h=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===o?o=u:1!==h&&(h=1):-1!==o&&(h=-1);else if(!c){s=u+1;break}return-1===o||-1===l||0===h||1===h&&o===l-1&&o===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;if(n.r(r),n.d(r,{URI:()=>u,Utils:()=>T}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){let t=navigator.userAgent;e=t.indexOf("Windows")>=0}const t=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(e,n){if(!e.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!i.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const s="",l="/",c=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static isUri(e){return e instanceof u||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){"object"==typeof e?(this.scheme=e.scheme||s,this.authority=e.authority||s,this.path=e.path||s,this.query=e.query||s,this.fragment=e.fragment||s):(this.scheme=function(e,t){return e||t?e:"file"}(e,a),this.authority=t||s,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==l&&(t=l+t):t=l}return t}(this.scheme,n||s),this.query=r||s,this.fragment=i||s,o(this,a))}get fsPath(){return m(this)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return void 0===t?t=this.scheme:null===t&&(t=s),void 0===n?n=this.authority:null===n&&(n=s),void 0===r?r=this.path:null===r&&(r=s),void 0===i?i=this.query:null===i&&(i=s),void 0===a?a=this.fragment:null===a&&(a=s),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new d(t,n,r,i,a)}static parse(e,t=!1){const n=c.exec(e);return n?new d(n[2]||s,x(n[4]||s),x(n[5]||s),x(n[7]||s),x(n[9]||s),t):new d(s,s,s,s,s)}static file(t){let n=s;if(e&&(t=t.replace(/\\/g,l)),t[0]===l&&t[1]===l){const e=t.indexOf(l,2);-1===e?(n=t.substring(2),t=l):(n=t.substring(2,e),t=t.substring(e)||l)}return new d("file",n,t,s,s)}static from(e){const t=new d(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return y(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof u)return e;{const t=new d(e);return t._formatted=e.external,t._fsPath=e._sep===h?e.fsPath:null,t}}return e}}const h=e?1:void 0;class d extends u{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=m(this)),this._fsPath}toString(e=!1){return e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const p={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function f(e,t,n){let r,i=-1;for(let a=0;a=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o||n&&91===o||n&&93===o||n&&58===o)-1!==i&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),void 0!==r&&(r+=e.charAt(a));else{void 0===r&&(r=e.substr(0,a));const t=p[o];void 0!==t?(-1!==i&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t):-1===i&&(i=a)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function g(e){let t;for(let n=0;n1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function y(e,t){const n=t?g:f;let r="",{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=":"),(a||"file"===i)&&(r+=l,r+=l),a){let e=a.indexOf("@");if(-1!==e){const t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(":"),-1===e?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=":",r+=n(t.substr(e+1),!1,!0)),r+="@"}a=a.toLowerCase(),e=a.lastIndexOf(":"),-1===e?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+="?",r+=n(s,!1,!1)),c&&(r+="#",r+=t?c:f(c,!1,!1)),r}function v(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(e){return e.match(b)?e.replace(b,e=>v(e)):e}var w=n(470);const E=w.posix||w,k="/";var T;!function(e){e.joinPath=function(e,...t){return e.with({path:E.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==k&&(n=k+n,r=!0);let i=E.resolve(n,...t);return r&&i[0]===k&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===k)return e;let t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(T||(T={}))})(),Nxe=r})();const{URI:Dxe,Utils:Pxe}=Nxe;var $xe,Bxe;!function(e){e.basename=Pxe.basename,e.dirname=Pxe.dirname,e.extname=Pxe.extname,e.joinPath=Pxe.joinPath,e.resolvePath=Pxe.resolvePath,e.equals=function(e,t){return(null==e?void 0:e.toString())===(null==t?void 0:t.toString())},e.relative=function(e,t){const n="string"==typeof e?e:e.path,r="string"==typeof t?t:t.path,i=n.split("/").filter(e=>e.length>0),a=r.split("/").filter(e=>e.length>0);let o=0;for(;onull!=r?r:r=Axe.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,null!=t?t:"")}}class zxe{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return Whe(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then(e=>(this.addDocument(e),e));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),n=this.documentMap.get(t);if(n){this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=Bxe.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0}return n}deleteDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=Bxe.Changed,this.documentMap.delete(t)),n}}const jxe=Symbol("ref_resolving");class Hxe{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=fxe.None){for(const n of bpe(e.parseResult.value))await _xe(t),wpe(n).forEach(t=>this.doLink(t,e))}doLink(e,t){var n;const r=e.reference;if(void 0===r._ref){r._ref=jxe;try{const t=this.getCandidate(e);if(Phe(t))r._ref=t;else if(r._nodeDescription=t,this.langiumDocuments().hasDocument(t.documentUri)){const n=this.loadAstNode(t);r._ref=null!=n?n:this.createLinkingError(e,t)}else r._ref=void 0}catch(t){console.error(`An error occurred while resolving reference to '${r.$refText}':`,t);const i=null!==(n=t.message)&&void 0!==n?n:String(t);r._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${r.$refText}': ${i}`})}t.references.push(r)}}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const t=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return null!=t?t:this.createLinkingError(e)}buildReference(e,t,n,r){const i=this,a={$refNode:n,$refText:r,get ref(){var n,o;if(Rhe(this._ref))return this._ref;if("object"==typeof(o=this._nodeDescription)&&null!==o&&"string"==typeof o.name&&"string"==typeof o.type&&"string"==typeof o.path){const n=i.loadAstNode(this._nodeDescription);this._ref=null!=n?n:i.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(void 0===this._ref){this._ref=jxe;const r=mpe(e).$document,o=i.getLinkedNode({reference:a,container:e,property:t});if(o.error&&r&&r.state=e.end)return t.ref}if(n){const t=this.nameProvider.getNameNode(n);if(t&&(t===e||function(e,t){for(;e.container;)if((e=e.container)===t)return!0;return!1}(e,t)))return n}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(null==t?void 0:t.$cstNode){const e=this.nameProvider.getNameNode(t);return null!=e?e:t.$cstNode}}findReferences(e,t){const n=[];if(t.includeDeclaration){const t=this.getReferenceToSelf(e);t&&n.push(t)}let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter(e=>$xe.equals(e.sourceUri,t.documentUri))),n.push(...r),Whe(n)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const n=gpe(e),r=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:Zhe(t),local:!0}}}}class qxe{constructor(e){if(this.map=new Map,e)for(const[t,n]of e)this.add(t,n)}get size(){return Yhe.sum(Whe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(void 0===t)return this.map.delete(e);{const n=this.map.get(e);if(n){const r=n.indexOf(t);if(r>=0)return 1===n.length?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){var t;return null!==(t=this.map.get(e))&&void 0!==t?t:[]}has(e,t){if(void 0===t)return this.map.has(e);{const n=this.map.get(e);return!!n&&n.indexOf(t)>=0}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,n)=>t.forEach(t=>e(t,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Whe(this.map.entries()).flatMap(([e,t])=>t.map(t=>[e,t]))}keys(){return Whe(this.map.keys())}values(){return Whe(this.map.values()).flat()}entriesGroupedByKey(){return Whe(this.map.entries())}}class Wxe{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return void 0!==t&&(this.map.delete(e),this.inverse.delete(t),!0)}}class Vxe{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=fxe.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,n=ype,r=fxe.None){const i=[];this.exportNode(e,i,t);for(const a of n(e))await _xe(r),this.exportNode(a,i,t);return i}exportNode(e,t,n){const r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async computeLocalScopes(e,t=fxe.None){const n=e.parseResult.value,r=new qxe;for(const i of vpe(n))await _xe(t),this.processNode(i,e,r);return r}processNode(e,t,n){const r=e.$container;if(r){const i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}}class Yxe{constructor(e,t,n){var r;this.elements=e,this.outerScope=t,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find(t=>t.name.toLowerCase()===e.toLowerCase()):this.elements.find(t=>t.name===e);return t||(this.outerScope?this.outerScope.getElement(e):void 0)}}class Xxe{constructor(e,t,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const t of e){const e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.set(e,t)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return n||(this.outerScope?this.outerScope.getElement(e):void 0)}getAllElements(){let e=Whe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Kxe{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Qxe extends Kxe{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const n=t();return this.cache.set(e,n),n}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Zxe extends Kxe{constructor(e){super(),this.cache=new Map,this.converter=null!=e?e:e=>e}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();const r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){const e=n();return r.set(t,e),e}}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}}class Jxe extends Qxe{constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{t.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class ewe{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Jxe(e.shared)}getScope(e){const t=[],n=this.reflection.getReferenceType(e),r=gpe(e.container).precomputedScopes;if(r){let i=e.container;do{const e=r.get(i);e.length>0&&t.push(Whe(e).filter(e=>this.reflection.isSubtype(e.type,n))),i=i.$container}while(i)}let i=this.getGlobalScope(n,e);for(let e=t.length-1;e>=0;e--)i=this.createScope(t[e],i);return i}createScope(e,t,n){return new Yxe(Whe(e),t,n)}createScopeForNodes(e,t,n){const r=Whe(e).map(e=>{const t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)}).nonNullable();return new Yxe(r,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new Xxe(this.indexManager.allElements(e)))}}function twe(e){return"object"==typeof e&&!!e&&("$ref"in e||"$error"in e)}class nwe{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const n=null!=t?t:{},r=null==t?void 0:t.replacer,i=(e,t)=>this.replacer(e,t,n),a=r?(e,t)=>r(e,t,i):i;try{return this.currentDocument=gpe(e),JSON.stringify(e,a,null==t?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const n=null!=t?t:{},r=JSON.parse(e);return this.linkNode(r,r,n),r}replacer(e,t,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:o}){var s,l,c,u;if(!this.ignoreProperties.has(e)){if(Dhe(t)){const e=t.ref,r=n?t.$refText:void 0;if(e){const n=gpe(e);let i="";this.currentDocument&&this.currentDocument!==n&&(i=o?o(n.uri,t):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(e)}`,$refText:r}}return{$error:null!==(l=null===(s=t.error)||void 0===s?void 0:s.message)&&void 0!==l?l:"Could not resolve reference",$refText:r}}if(Rhe(t)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),e&&!t.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),r&&!e&&(null!=n||(n=Object.assign({},t)),n.$sourceText=null===(u=t.$cstNode)||void 0===u?void 0:u.text),a){null!=n||(n=Object.assign({},t));const e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,""))}return null!=n?n:t}return t}}addAstNodeRegionWithAssignmentsTo(e){const t=e=>({offset:e.offset,end:e.end,length:e.length,range:e.range});if(e.$cstNode){const n=(e.$textRegion=t(e.$cstNode)).assignments={};return Object.keys(e).filter(e=>!e.startsWith("$")).forEach(r=>{const i=function(e,t){return e&&t?Ype(e,t,e.astNode,!0):[]}(e.$cstNode,r).map(t);0!==i.length&&(n[r]=i)}),e}}linkNode(e,t,n,r,i,a){for(const[r,i]of Object.entries(e))if(Array.isArray(i))for(let a=0;a{await this.handleException(()=>e.call(t,n,r,i),"An error occurred during validation",r,n)}}async handleException(e,t,n,r){try{await e()}catch(e){if(Txe(e))throw e;console.error(`${t}:`,e),e instanceof Error&&e.stack&&console.error(e.stack);n("error",`${t}: ${e instanceof Error?e.message:String(e)}`,{node:r})}}addEntry(e,t){if("AstNode"!==e)for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,t);else this.entries.add("AstNode",t)}getChecks(e,t){let n=Whe(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(n=n.filter(e=>t.includes(e.category))),n.map(e=>e.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,n){return async(r,i,a,o)=>{await this.handleException(()=>e.call(n,r,i,a,o),t,i,r)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class cwe{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},n=fxe.None){const r=e.parseResult,i=[];if(await _xe(n),!t.categories||t.categories.includes("built-in")){if(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===owe.LexingError}))return i;if(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===owe.ParsingError}))return i;if(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===owe.LinkingError}))return i}try{i.push(...await this.validateAst(r.value,t,n))}catch(e){if(Txe(e))throw e;console.error("An error occurred during validation:",e)}return await _xe(n),i}processLexingErrors(e,t,n){var r,i,a;const o=[...e.lexerErrors,...null!==(i=null===(r=e.lexerReport)||void 0===r?void 0:r.diagnostics)&&void 0!==i?i:[]];for(const e of o){const n=null!==(a=e.severity)&&void 0!==a?a:"error",r={severity:hwe(n),range:{start:{line:e.line-1,character:e.column-1},end:{line:e.line-1,character:e.column+e.length-1}},message:e.message,data:dwe(n),source:this.getSource()};t.push(r)}}processParsingErrors(e,t,n){for(const n of e.parserErrors){let e;if(isNaN(n.token.startOffset)){if("previousToken"in n){const t=n.previousToken;if(isNaN(t.startOffset)){const t={line:0,character:0};e={start:t,end:t}}else{const n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=Qhe(n.token);if(e){const r={severity:hwe("error"),range:e,message:n.message,data:iwe(owe.ParsingError),source:this.getSource()};t.push(r)}}}processLinkingErrors(e,t,n){for(const n of e.references){const e=n.error;if(e){const n={node:e.container,property:e.property,index:e.index,data:{code:owe.LinkingError,containerType:e.container.$type,property:e.property,refText:e.reference.$refText}};t.push(this.toDiagnostic("error",e.message,n))}}}async validateAst(e,t,n=fxe.None){const r=[],i=(e,t,n)=>{r.push(this.toDiagnostic(e,t,n))};return await this.validateAstBefore(e,t,i,n),await this.validateAstNodes(e,t,i,n),await this.validateAstAfter(e,t,i,n),r}async validateAstBefore(e,t,n,r=fxe.None){var i;const a=this.validationRegistry.checksBefore;for(const o of a)await _xe(r),await o(e,n,null!==(i=t.categories)&&void 0!==i?i:[],r)}async validateAstNodes(e,t,n,r=fxe.None){await Promise.all(bpe(e).map(async e=>{await _xe(r);const i=this.validationRegistry.getChecks(e.$type,t.categories);for(const t of i)await t(e,n,r)}))}async validateAstAfter(e,t,n,r=fxe.None){var i;const a=this.validationRegistry.checksAfter;for(const o of a)await _xe(r),await o(e,n,null!==(i=t.categories)&&void 0!==i?i:[],r)}toDiagnostic(e,t,n){return{message:t,range:uwe(n),severity:hwe(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function uwe(e){if(e.range)return e.range;let t;return"string"==typeof e.property?t=Vpe(e.node.$cstNode,e.property,e.index):"string"==typeof e.keyword&&(t=Xpe(e.node.$cstNode,e.keyword,e.index)),null!=t||(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function hwe(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}function dwe(e){switch(e){case"error":return iwe(owe.LexingError);case"warning":return iwe(owe.LexingWarning);case"info":return iwe(owe.LexingInfo);case"hint":return iwe(owe.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}!function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"}(owe||(owe={}));class pwe{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n){const r=null!=n?n:gpe(e);null!=t||(t=this.nameProvider.getName(e));const i=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${i} has no name.`);let a;const o=()=>{var t;return null!=a?a:a=Zhe(null!==(t=this.nameProvider.getNameNode(e))&&void 0!==t?t:e.$cstNode)};return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Zhe(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}}class fwe{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=fxe.None){const n=[],r=e.parseResult.value;for(const e of bpe(r))await _xe(t),wpe(e).filter(e=>!Phe(e)).forEach(e=>{const t=this.createDescription(e);t&&n.push(t)});return n}createDescription(e){const t=e.reference.$nodeDescription,n=e.reference.$refNode;if(!t||!n)return;const r=gpe(e.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:Zhe(n),local:$xe.equals(t.documentUri,r)}}}class gwe{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==t?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((e,t)=>{if(!e||0===t.length)return e;const n=t.indexOf(this.indexSeparator);if(n>0){const r=t.substring(0,n),i=parseInt(t.substring(n+1)),a=e[r];return null==a?void 0:a[i]}return e[t]},e)}}class mwe{constructor(e){this._ready=new Cxe,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new cxe,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,n;this.workspaceConfig=null!==(n=null===(t=e.capabilities.workspace)||void 0===t?void 0:t.configuration)&&void 0!==n&&n}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(e=>this.toSectionName(e.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(e=>({section:this.toSectionName(e.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(t);t.forEach((e,t)=>{this.updateSectionConfiguration(e.section,n[t])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(t=>{const n=e.settings[t];this.updateSectionConfiguration(t,n),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:n})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}!function(e){e.create=function(e){return{dispose:async()=>await e()}}}(swe||(swe={}));class ywe{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new qxe,this.documentPhaseListeners=new qxe,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Bxe.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=fxe.None){var r,i;for(const n of e){const e=n.uri.toString();if(n.state===Bxe.Validated){if("boolean"==typeof t.validation&&t.validation)n.state=Bxe.IndexedReferences,n.diagnostics=void 0,this.buildState.delete(e);else if("object"==typeof t.validation){const a=this.buildState.get(e),o=null===(r=null==a?void 0:a.result)||void 0===r?void 0:r.validationChecks;if(o){const r=(null!==(i=t.validation.categories)&&void 0!==i?i:awe.all).filter(e=>!o.includes(e));r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:r})},result:a.result}),n.state=Bxe.IndexedReferences)}}}else this.buildState.delete(e)}this.currentState=Bxe.Changed,await this.emitUpdate(e.map(e=>e.uri),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=fxe.None){this.currentState=Bxe.Changed;for(const e of t)this.langiumDocuments.deleteDocument(e),this.buildState.delete(e.toString()),this.indexManager.remove(e);for(const t of e){if(!this.langiumDocuments.invalidateDocument(t)){const e=this.langiumDocumentFactory.fromModel({$type:"INVALID"},t);e.state=Bxe.Changed,this.langiumDocuments.addDocument(e)}this.buildState.delete(t.toString())}const r=Whe(e).concat(t).map(e=>e.toString()).toSet();this.langiumDocuments.all.filter(e=>!r.has(e.uri.toString())&&this.shouldRelink(e,r)).forEach(e=>{this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e),e.state=Math.min(e.state,Bxe.ComputedScopes),e.diagnostics=void 0}),await this.emitUpdate(e,t),await _xe(n);const i=this.sortDocuments(this.langiumDocuments.all.filter(e=>{var t;return e.staten(e,t)))}sortDocuments(e){let t=0,n=e.length-1;for(;t=0&&!this.hasTextDocument(e[n]);)n--;tvoid 0!==e.error)||this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),swe.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,Bxe.Parsed,n,e=>this.langiumDocumentFactory.update(e,n)),await this.runCancelable(e,Bxe.IndexedContent,n,e=>this.indexManager.updateContent(e,n)),await this.runCancelable(e,Bxe.ComputedScopes,n,async e=>{const t=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await t.computeLocalScopes(e,n)}),await this.runCancelable(e,Bxe.Linked,n,e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n)),await this.runCancelable(e,Bxe.IndexedReferences,n,e=>this.indexManager.updateReferences(e,n));const r=e.filter(e=>this.shouldValidate(e));await this.runCancelable(r,Bxe.Validated,n,e=>this.validate(e,n));for(const t of e){const e=this.buildState.get(t.uri.toString());e&&(e.completed=!0)}}prepareBuild(e,t){for(const n of e){const e=n.uri.toString(),r=this.buildState.get(e);r&&!r.completed||this.buildState.set(e,{completed:!1,options:t,result:null==r?void 0:r.result})}}async runCancelable(e,t,n,r){const i=e.filter(e=>e.statee.state===t);await this.notifyBuildPhase(a,t,n),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),swe.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),swe.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let r;if(t&&"path"in t?r=t:n=t,null!=n||(n=fxe.None),r){const t=this.langiumDocuments.getDocument(r);if(t&&t.state>e)return Promise.resolve(r)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(kxe):new Promise((t,i)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),o.dispose(),r){const e=this.langiumDocuments.getDocument(r);t(null==e?void 0:e.uri)}else t(void 0)}),o=n.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(kxe)})})}async notifyDocumentPhase(e,t,n){const r=this.documentPhaseListeners.get(t).slice();for(const t of r)try{await t(e,n)}catch(e){if(!Txe(e))throw e}}async notifyBuildPhase(e,t,n){if(0===e.length)return;const r=this.buildPhaseListeners.get(t).slice();for(const t of r)await _xe(n),await t(e,n)}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}async validate(e,t){var n,r;const i=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o="object"==typeof a?a:void 0,s=await i.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const l=this.buildState.get(e.uri.toString());if(l){null!==(n=l.result)&&void 0!==n||(l.result={});const e=null!==(r=null==o?void 0:o.categories)&&void 0!==r?r:awe.all;l.result.validationChecks?l.result.validationChecks.push(...e):l.result.validationChecks=[...e]}}getBuildOptions(e){var t,n;return null!==(n=null===(t=this.buildState.get(e.uri.toString()))||void 0===t?void 0:t.options)&&void 0!==n?n:{}}}class vwe{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Zxe,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const n=gpe(e).uri,r=[];return this.referenceIndex.forEach(e=>{e.forEach(e=>{$xe.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)})}),Whe(r)}allElements(e,t){let n=Whe(this.symbolIndex.keys());return t&&(n=n.filter(e=>!t||t.has(e))),n.map(t=>this.getFileDescriptions(t,e)).flat()}getFileDescriptions(e,t){var n;if(!t)return null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(e,t,()=>{var n;return(null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[]).filter(e=>this.astReflection.isSubtype(e.type,t))});return r}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=fxe.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.references.ScopeComputation.computeExports(e,t),i=e.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=fxe.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),r)}isAffected(e,t){const n=this.referenceIndex.get(e.uri.toString());return!!n&&n.some(e=>!e.local&&t.has(e.targetUri.toString()))}}class bwe{constructor(e){this.initialBuildOptions={},this._ready=new Cxe,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var t;this.folders=null!==(t=e.workspaceFolders)&&void 0!==t?t:void 0}initialized(e){return this.mutex.write(e=>{var t;return this.initializeWorkspace(null!==(t=this.folders)&&void 0!==t?t:[],e)})}async initializeWorkspace(e,t=fxe.None){const n=await this.performStartup(e);await _xe(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap(e=>e.LanguageMetaData.fileExtensions),n=[],r=e=>{n.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)};return await this.loadAdditionalDocuments(e,r),await Promise.all(e.map(e=>[e,this.getRootFolder(e)]).map(async e=>this.traverseFolder(...e,t,r))),this._ready.resolve(),n}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return Dxe.parse(e.uri)}async traverseFolder(e,t,n,r){const i=await this.fileSystemProvider.readDirectory(t);await Promise.all(i.map(async t=>{if(this.includeEntry(e,t,n))if(t.isDirectory)await this.traverseFolder(e,t.uri,n,r);else if(t.isFile){const e=await this.langiumDocuments.getOrCreateDocument(t.uri);r(e)}}))}includeEntry(e,t,n){const r=$xe.basename(t.uri);if(r.startsWith("."))return!1;if(t.isDirectory)return"node_modules"!==r&&"out"!==r;if(t.isFile){const e=$xe.extname(t.uri);return n.includes(e)}return!1}}class xwe{buildUnexpectedCharactersMessage(e,t,n,r,i){return bge.buildUnexpectedCharactersMessage(e,t,n,r,i)}buildUnableToPopLexerModeMessage(e){return bge.buildUnableToPopLexerModeMessage(e)}}const wwe={mode:"full"};class Ewe{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const n=Twe(t)?Object.values(t):t,r="production"===e.LanguageMetaData.mode;this.chevrotainLexer=new Ege(n,{positionTracking:"full",skipValidations:r,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=wwe){var n,r,i;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:null!==(n=a.groups.hidden)&&void 0!==n?n:[],report:null===(i=(r=this.tokenBuilder).flushLexingReport)||void 0===i?void 0:i.call(r,e)}}toTokenTypeDictionary(e){if(Twe(e))return e;const t=kwe(e)?Object.values(e.modes).flat():e,n={};return t.forEach(e=>n[e.name]=e),n}}function kwe(e){return e&&"modes"in e&&"defaultMode"in e}function Twe(e){return!function(e){return Array.isArray(e)&&(0===e.length||"name"in e[0])}(e)&&!kwe(e)}function _we(e,t,n){let r,i;"string"==typeof e?(i=t,r=n):(i=e.range.start,r=t),i||(i=ive.create(0,0));const a=function(e){var t,n,r;const i=[];let a=e.position.line,o=e.position.character;for(let s=0;s=u.length){if(i.length>0){const e=ive.create(a,o);i.push({type:"break",content:"",range:ave.create(e,e)})}}else{Swe.lastIndex=h;const e=Swe.exec(u);if(e){const t=e[0],n=e[1],r=ive.create(a,o+h),s=ive.create(a,o+h+t.length);i.push({type:"tag",content:n,range:ave.create(r,s)}),h+=t.length,h=Lwe(u,h)}if(h0&&"break"===i[i.length-1].type)return i.slice(0,-1);return i}({lines:Cwe(e),position:i,options:Fwe(r)});return function(e){var t,n,r,i;const a=ive.create(e.position.line,e.position.character);if(0===e.tokens.length)return new jwe([],ave.create(a,a));const o=[];for(;e.index0&&i.push({type:"text",content:t.substring(a,e),range:ave.create(ive.create(n,a+r),ive.create(n,e+r))});let l=s.length+1;const c=o[1];if(i.push({type:"inline-tag",content:c,range:ave.create(ive.create(n,a+l+r),ive.create(n,a+l+c.length+r))}),l+=c.length,4===o.length){l+=o[2].length;const e=o[3];i.push({type:"text",content:e,range:ave.create(ive.create(n,a+l+r),ive.create(n,a+l+e.length+r))})}else i.push({type:"text",content:"",range:ave.create(ive.create(n,a+l+r),ive.create(n,a+l+r))});a=e+o[0].length}const o=t.substring(a);o.length>0&&i.push({type:"text",content:o,range:ave.create(ive.create(n,a+r),ive.create(n,a+r+o.length))})}return i}const Iwe=/\S/,Owe=/\s*$/;function Lwe(e,t){const n=e.substring(t).match(Iwe);return n?t+n.index:e.length}function Mwe(e){const t=e.match(Owe);if(t&&"number"==typeof t.index)return t.index}function Rwe(e,t){const n=e.tokens[e.index];return"tag"===n.type?$we(e,!1):"text"===n.type||"inline-tag"===n.type?Dwe(e):(function(e,t){if(t){const n=new Gwe("",e.range);"inlines"in t?t.inlines.push(n):t.content.inlines.push(n)}}(n,t),void e.index++)}function Dwe(e){let t=e.tokens[e.index];const n=t;let r=t;const i=[];for(;t&&"break"!==t.type&&"tag"!==t.type;)i.push(Pwe(e)),r=t,t=e.tokens[e.index];return new Uwe(i,ave.create(n.range.start,r.range.end))}function Pwe(e){return"inline-tag"===e.tokens[e.index].type?$we(e,!0):Bwe(e)}function $we(e,t){const n=e.tokens[e.index++],r=n.content.substring(1),i=e.tokens[e.index];if("text"===(null==i?void 0:i.type)){if(t){const i=Bwe(e);return new Hwe(r,new Uwe([i],i.range),t,ave.create(n.range.start,i.range.end))}{const i=Dwe(e);return new Hwe(r,i,t,ave.create(n.range.start,i.range.end))}}{const e=n.range;return new Hwe(r,new Uwe([],e),t,e)}}function Bwe(e){const t=e.tokens[e.index++];return new Gwe(t.content,t.range)}function Fwe(e){if(!e)return Fwe({start:"/**",end:"*/",line:"*"});const{start:t,end:n,line:r}=e;return{start:zwe(t,!0),end:zwe(n,!1),line:zwe(r,!0)}}function zwe(e,t){if("string"==typeof e||"object"==typeof e){const n="string"==typeof e?Hpe(e):e.source;return t?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return e}class jwe{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(0===e.length)e=t.toString();else{const n=t.toString();e+=qwe(e)+n}return e.trim()}toMarkdown(e){let t="";for(const n of this.elements)if(0===t.length)t=n.toMarkdown(e);else{const r=n.toMarkdown(e);t+=qwe(t)+r}return t.trim()}}class Hwe{constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`;const t=this.content.toString();return 1===this.content.inlines.length?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}\n${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.renderTag)||void 0===t?void 0:t.call(e,this))&&void 0!==n?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const n=function(e,t,n){var r,i;if("linkplain"===e||"linkcode"===e||"link"===e){const a=t.indexOf(" ");let o=t;if(a>0){const e=Lwe(t,a);o=t.substring(e),t=t.substring(0,a)}("linkcode"===e||"link"===e&&"code"===n.link)&&(o=`\`${o}\``);const s=null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,t,o))&&void 0!==i?i:function(e,t){try{return Dxe.parse(e,!0),`[${t}](${e})`}catch(t){return e}}(t,o);return s}return}(this.name,t,null!=e?e:{});if("string"==typeof n)return n}let n="";"italic"===(null==e?void 0:e.tag)||void 0===(null==e?void 0:e.tag)?n="*":"bold"===(null==e?void 0:e.tag)?n="**":"bold-italic"===(null==e?void 0:e.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} — ${t}`:this.content.inlines.length>1&&(r=`${r}\n${t}`),this.inline?`{${r}}`:r}}class Uwe{constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tn.range.start.line&&(e+="\n")}return e}toMarkdown(e){let t="";for(let n=0;nr.range.start.line&&(t+="\n")}return t}}class Gwe{constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}}function qwe(e){return e.endsWith("\n")?"\n":"\n\n"}class Wwe{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&function(e,t){const n=Fwe(t),r=Cwe(e);if(0===r.length)return!1;const i=r[0],a=r[r.length-1],o=n.start,s=n.end;return Boolean(null==o?void 0:o.exec(i))&&Boolean(null==s?void 0:s.exec(a))}(t)){return _we(t).toMarkdown({renderLink:(t,n)=>this.documentationLinkRenderer(e,t,n),renderTag:t=>this.documentationTagRenderer(e,t)})}}documentationLinkRenderer(e,t,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(e,t))&&void 0!==r?r:this.findNameInGlobalScope(e,t);if(i&&i.nameSegment){const e=i.nameSegment.range.start.line+1,t=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${e},${t}`}).toString()})`}}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const n=gpe(e).precomputedScopes;if(!n)return;let r=e;do{const e=n.get(r).find(e=>e.name===t);if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){const n=this.indexManager.allElements().find(e=>e.name===t);return n}}class Vwe{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return function(e){return"string"==typeof e.$comment}(e)?e.$comment:null===(t=tde(e.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===t?void 0:t.text}}class Ywe{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}}class Xwe{constructor(){this.previousTokenSource=new gxe,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=(Exe=performance.now(),new gxe);return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n=fxe.None){const r=new Cxe,i={action:t,deferred:r,cancellationToken:n};return e.push(i),this.performNextOperation(),r.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))return;e.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(e.map(async({action:e,deferred:t,cancellationToken:n})=>{try{const r=await Promise.resolve().then(()=>e(n));t.resolve(r)}catch(e){Txe(e)?t.resolve(void 0):t.reject(e)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Kwe{constructor(e){this.grammarElementIdMap=new Wxe,this.tokenTypeIdMap=new Wxe,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(e=>Object.assign(Object.assign({},e),{message:e.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,n=new Map;for(const n of bpe(e))t.set(n,{});if(e.$cstNode)for(const t of Khe(e.$cstNode))n.set(t,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,void 0!==e.$cstNode&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[r,i]of Object.entries(e))if(!r.startsWith("$"))if(Array.isArray(i)){const e=[];n[r]=e;for(const n of i)Rhe(n)?e.push(this.dehydrateAstNode(n,t)):Dhe(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else Rhe(i)?n[r]=this.dehydrateAstNode(i,t):Dhe(i)?n[r]=this.dehydrateReference(i,t):void 0!==i&&(n[r]=i);return n}dehydrateReference(e,t){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){const n=t.cstNodes.get(e);return zhe(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),Bhe(e)?n.content=e.content.map(e=>this.dehydrateCstNode(e,t)):Fhe(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const t=e.value,n=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){const t=new Map,n=new Map;for(const n of bpe(e))t.set(n,{});let r;if(e.$cstNode)for(const t of Khe(e.$cstNode)){let e;"fullText"in t?(e=new Lbe(t.fullText),r=e):"content"in t?e=new Ibe:"tokenType"in t&&(e=this.hydrateCstLeafNode(t)),e&&(n.set(t,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(const[r,i]of Object.entries(e))if(!r.startsWith("$"))if(Array.isArray(i)){const e=[];n[r]=e;for(const a of i)Rhe(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):Dhe(a)?e.push(this.hydrateReference(a,n,r,t)):e.push(a)}else Rhe(i)?n[r]=this.setParent(this.hydrateAstNode(i,t),n):Dhe(i)?n[r]=this.hydrateReference(i,n,r,t):void 0!==i&&(n[r]=i);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){const r=t.cstNodes.get(e);if("number"==typeof e.grammarSource&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),Bhe(r))for(const i of e.content){const e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,a=e.startColumn,o=e.endLine,s=e.endColumn,l=e.hidden;return new Nbe(n,r,{start:{line:i,character:a},end:{line:o,character:s}},t,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();return this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of bpe(this.grammar))hde(t)&&this.grammarElementIdMap.set(t,e++)}}function Qwe(e){return{documentation:{CommentProvider:e=>new Vwe(e),DocumentationProvider:e=>new Wwe(e)},parser:{AsyncParser:e=>new Ywe(e),GrammarConfig:e=>function(e){const t=[],n=e.Grammar;for(const e of n.rules)Pde(e)&&Wpe(e)&&Fpe(nfe(e))&&t.push(e.name);return{multilineCommentRules:t,nameRegexp:ede}}(e),LangiumParser:e=>Qbe(e),CompletionParser:e=>function(e){const t=e.Grammar,n=e.parser.Lexer,r=new zbe(e);return Ube(t,r,n.definition),r.finalize(),r}(e),ValueConverter:()=>new Jbe,TokenBuilder:()=>new Zbe,Lexer:e=>new Ewe(e),ParserErrorMessageProvider:()=>new Fbe,LexerErrorMessageProvider:()=>new xwe},workspace:{AstNodeLocator:()=>new gwe,AstNodeDescriptionProvider:e=>new pwe(e),ReferenceDescriptionProvider:e=>new fwe(e)},references:{Linker:e=>new Hxe(e),NameProvider:()=>new Uxe,ScopeProvider:e=>new ewe(e),ScopeComputation:e=>new Vxe(e),References:e=>new Gxe(e)},serializer:{Hydrator:e=>new Kwe(e),JsonSerializer:e=>new nwe(e)},validation:{DocumentValidator:e=>new cwe(e),ValidationRegistry:e=>new lwe(e)},shared:()=>e.shared}}function Zwe(e){return{ServiceRegistry:e=>new rwe(e),workspace:{LangiumDocuments:e=>new zxe(e),LangiumDocumentFactory:e=>new Fxe(e),DocumentBuilder:e=>new ywe(e),IndexManager:e=>new vwe(e),WorkspaceManager:e=>new bwe(e),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new Xwe,ConfigurationProvider:e=>new mwe(e)}}}var Jwe;function eEe(e,t,n,r,i,a,o,s,l){return nEe([e,t,n,r,i,a,o,s,l].reduce(aEe,{}))}!function(e){e.merge=(e,t)=>aEe(aEe({},e),t)}(Jwe||(Jwe={}));const tEe=Symbol("isProxy");function nEe(e,t){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===tEe||iEe(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(iEe(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(t,n)=>n in e,ownKeys:()=>[...Object.getOwnPropertyNames(e)]});return n}const rEe=Symbol();function iEe(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:e[t]});if(e[t]===rEe)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}if(t in n){const i=n[t];e[t]=rEe;try{e[t]="function"==typeof i?i(r):nEe(i,r)}catch(n){throw e[t]=n instanceof Error?n:void 0,n}return e[t]}}function aEe(e,t){if(t)for(const[n,r]of Object.entries(t))if(void 0!==r){const t=e[n];e[n]=null!==t&&null!==r&&"object"==typeof t&&"object"==typeof r?aEe(t,r):r}return e}class oEe{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const sEe={fileSystemProvider:()=>new oEe},lEe={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},cEe={AstReflection:()=>new dpe};function uEe(e){var t;const n=function(){const e=eEe(Zwe(sEe),cEe),t=eEe(Qwe({shared:e}),lEe);return e.ServiceRegistry.register(t),t}(),r=n.serializer.JsonSerializer.deserialize(e);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Dxe.parse(`memory://${null!==(t=r.name)&&void 0!==t?t:"grammar"}.langium`)),r}var hEe=Object.defineProperty,dEe=(e,t)=>hEe(e,"name",{value:t,configurable:!0}),pEe="Statement",fEe="Architecture";dEe(function(e){return GEe.isInstance(e,fEe)},"isArchitecture");var gEe="Axis",mEe="Branch";dEe(function(e){return GEe.isInstance(e,mEe)},"isBranch");var yEe="Checkout",vEe="CherryPicking",bEe="Commit";dEe(function(e){return GEe.isInstance(e,bEe)},"isCommit");var xEe="Common";dEe(function(e){return GEe.isInstance(e,xEe)},"isCommon");var wEe="Curve",EEe="Edge",kEe="Entry",TEe="GitGraph";dEe(function(e){return GEe.isInstance(e,TEe)},"isGitGraph");var _Ee="Group",CEe="Info";dEe(function(e){return GEe.isInstance(e,CEe)},"isInfo");var SEe="Junction",AEe="Merge";dEe(function(e){return GEe.isInstance(e,AEe)},"isMerge");var NEe="Option",IEe="Packet";dEe(function(e){return GEe.isInstance(e,IEe)},"isPacket");var OEe="PacketBlock";dEe(function(e){return GEe.isInstance(e,OEe)},"isPacketBlock");var LEe="Pie";dEe(function(e){return GEe.isInstance(e,LEe)},"isPie");var MEe="PieSection";dEe(function(e){return GEe.isInstance(e,MEe)},"isPieSection");var REe,DEe,PEe,$Ee,BEe,FEe,zEe="Radar",jEe="Service",HEe="Direction",UEe=class extends $he{static{dEe(this,"MermaidAstReflection")}getAllTypes(){return[fEe,gEe,mEe,yEe,vEe,bEe,xEe,wEe,HEe,EEe,kEe,TEe,_Ee,CEe,SEe,AEe,NEe,IEe,OEe,LEe,MEe,zEe,jEe,pEe]}computeIsSubtype(e,t){switch(e){case mEe:case yEe:case vEe:case bEe:case AEe:return this.isSubtype(pEe,t);case HEe:return this.isSubtype(TEe,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;if("Entry:axis"===t)return gEe;throw new Error(`${t} is not a valid reference id.`)}getTypeMetaData(e){switch(e){case fEe:return{name:fEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case gEe:return{name:gEe,properties:[{name:"label"},{name:"name"}]};case mEe:return{name:mEe,properties:[{name:"name"},{name:"order"}]};case yEe:return{name:yEe,properties:[{name:"branch"}]};case vEe:return{name:vEe,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case bEe:return{name:bEe,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case xEe:return{name:xEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case wEe:return{name:wEe,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case EEe:return{name:EEe,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case kEe:return{name:kEe,properties:[{name:"axis"},{name:"value"}]};case TEe:return{name:TEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case _Ee:return{name:_Ee,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case CEe:return{name:CEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case SEe:return{name:SEe,properties:[{name:"id"},{name:"in"}]};case AEe:return{name:AEe,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case NEe:return{name:NEe,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case IEe:return{name:IEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case OEe:return{name:OEe,properties:[{name:"end"},{name:"label"},{name:"start"}]};case LEe:return{name:LEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case MEe:return{name:MEe,properties:[{name:"label"},{name:"value"}]};case zEe:return{name:zEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case jEe:return{name:jEe,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case HEe:return{name:HEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},GEe=new UEe,qEe=dEe(()=>REe??(REe=uEe('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"InfoGrammar"),WEe=dEe(()=>DEe??(DEe=uEe('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PacketGrammar"),VEe=dEe(()=>PEe??(PEe=uEe('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PieGrammar"),YEe=dEe(()=>$Ee??($Ee=uEe('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"ArchitectureGrammar"),XEe=dEe(()=>BEe??(BEe=uEe('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}')),"GitGraphGrammar"),KEe=dEe(()=>FEe??(FEe=uEe('{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}')),"RadarGrammar"),QEe={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ZEe={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},JEe={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},eke={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tke={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nke={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rke={AstReflection:dEe(()=>new UEe,"AstReflection")},ike={Grammar:dEe(()=>qEe(),"Grammar"),LanguageMetaData:dEe(()=>QEe,"LanguageMetaData"),parser:{}},ake={Grammar:dEe(()=>WEe(),"Grammar"),LanguageMetaData:dEe(()=>ZEe,"LanguageMetaData"),parser:{}},oke={Grammar:dEe(()=>VEe(),"Grammar"),LanguageMetaData:dEe(()=>JEe,"LanguageMetaData"),parser:{}},ske={Grammar:dEe(()=>YEe(),"Grammar"),LanguageMetaData:dEe(()=>eke,"LanguageMetaData"),parser:{}},lke={Grammar:dEe(()=>XEe(),"Grammar"),LanguageMetaData:dEe(()=>tke,"LanguageMetaData"),parser:{}},cke={Grammar:dEe(()=>KEe(),"Grammar"),LanguageMetaData:dEe(()=>nke,"LanguageMetaData"),parser:{}},uke={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},hke=class extends Jbe{static{dEe(this,"AbstractMermaidValueConverter")}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return void 0===r&&(r=this.runCustomConverter(e,t,n)),void 0===r?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){const r=uke[e.name];if(void 0===r)return;const i=r.exec(t);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},dke=class extends hke{static{dEe(this,"CommonValueConverter")}runCustomConverter(e,t,n){}},pke=class extends Zbe{static{dEe(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){const r=super.buildKeywordTokens(e,t,n);return r.forEach(e=>{this.keywords.has(e.name)&&void 0!==e.PATTERN&&(e.PATTERN=new RegExp(e.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),r}};(class extends pke{static{dEe(this,"CommonTokenBuilder")}});var fke=class extends pke{static{dEe(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},gke={parser:{TokenBuilder:dEe(()=>new fke,"TokenBuilder"),ValueConverter:dEe(()=>new dke,"ValueConverter")}};function mke(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),lke,gke);return t.ServiceRegistry.register(n),{shared:t,GitGraph:n}}dEe(mke,"createGitGraphServices");var yke=class extends pke{static{dEe(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},vke={parser:{TokenBuilder:dEe(()=>new yke,"TokenBuilder"),ValueConverter:dEe(()=>new dke,"ValueConverter")}};function bke(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),ike,vke);return t.ServiceRegistry.register(n),{shared:t,Info:n}}dEe(bke,"createInfoServices");var xke=class extends pke{static{dEe(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},wke={parser:{TokenBuilder:dEe(()=>new xke,"TokenBuilder"),ValueConverter:dEe(()=>new dke,"ValueConverter")}};function Eke(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),ake,wke);return t.ServiceRegistry.register(n),{shared:t,Packet:n}}dEe(Eke,"createPacketServices");var kke=class extends pke{static{dEe(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Tke=class extends hke{static{dEe(this,"PieValueConverter")}runCustomConverter(e,t,n){if("PIE_SECTION_LABEL"===e.name)return t.replace(/"/g,"").trim()}},_ke={parser:{TokenBuilder:dEe(()=>new kke,"TokenBuilder"),ValueConverter:dEe(()=>new Tke,"ValueConverter")}};function Cke(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),oke,_ke);return t.ServiceRegistry.register(n),{shared:t,Pie:n}}dEe(Cke,"createPieServices");var Ske=class extends pke{static{dEe(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Ake=class extends hke{static{dEe(this,"ArchitectureValueConverter")}runCustomConverter(e,t,n){return"ARCH_ICON"===e.name?t.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===e.name?t.replace(/["()]/g,""):"ARCH_TITLE"===e.name?t.replace(/[[\]]/g,"").trim():void 0}},Nke={parser:{TokenBuilder:dEe(()=>new Ske,"TokenBuilder"),ValueConverter:dEe(()=>new Ake,"ValueConverter")}};function Ike(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),ske,Nke);return t.ServiceRegistry.register(n),{shared:t,Architecture:n}}dEe(Ike,"createArchitectureServices");var Oke=class extends pke{static{dEe(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Lke={parser:{TokenBuilder:dEe(()=>new Oke,"TokenBuilder"),ValueConverter:dEe(()=>new dke,"ValueConverter")}};function Mke(e=sEe){const t=eEe(Zwe(e),rke),n=eEe(Qwe({shared:t}),cke,Lke);return t.ServiceRegistry.register(n),{shared:t,Radar:n}}dEe(Mke,"createRadarServices");var Rke={},Dke={info:dEe(async()=>{const{createInfoServices:e}=await Promise.resolve().then(function(){return MJe}),t=e().Info.parser.LangiumParser;Rke.info=t},"info"),packet:dEe(async()=>{const{createPacketServices:e}=await Promise.resolve().then(function(){return RJe}),t=e().Packet.parser.LangiumParser;Rke.packet=t},"packet"),pie:dEe(async()=>{const{createPieServices:e}=await Promise.resolve().then(function(){return DJe}),t=e().Pie.parser.LangiumParser;Rke.pie=t},"pie"),architecture:dEe(async()=>{const{createArchitectureServices:e}=await Promise.resolve().then(function(){return PJe}),t=e().Architecture.parser.LangiumParser;Rke.architecture=t},"architecture"),gitGraph:dEe(async()=>{const{createGitGraphServices:e}=await Promise.resolve().then(function(){return $Je}),t=e().GitGraph.parser.LangiumParser;Rke.gitGraph=t},"gitGraph"),radar:dEe(async()=>{const{createRadarServices:e}=await Promise.resolve().then(function(){return BJe}),t=e().Radar.parser.LangiumParser;Rke.radar=t},"radar")};async function Pke(e,t){const n=Dke[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);Rke[e]||await n();const r=Rke[e].parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new $ke(r);return r.value}dEe(Pke,"parse");var $ke=class extends Error{constructor(e){super(`Parsing failed: ${e.lexerErrors.map(e=>e.message).join("\n")} ${e.parserErrors.map(e=>e.message).join("\n")}`),this.result=e}static{dEe(this,"MermaidParseError")}},Bke={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Fke=OU.gitGraph,zke=QH(()=>D5({...Fke,...GU().gitGraph}),"getConfig"),jke=new Mhe(()=>{const e=zke(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});function Hke(){return w5({length:7})}function Uke(e,t){const n=Object.create(null);return e.reduce((e,r)=>{const i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}QH(Hke,"getID"),QH(Uke,"uniqBy");var Gke=QH(function(e){jke.records.direction=e},"setDirection"),qke=QH(function(e){eU.debug("options str",e),e=e?.trim(),e=e||"{}";try{jke.records.options=JSON.parse(e)}catch(e){eU.error("error while parsing gitGraph options",e.message)}},"setOptions"),Wke=QH(function(){return jke.records.options},"getOptions"),Vke=QH(function(e){let t=e.msg,n=e.id;const r=e.type;let i=e.tags;eU.info("commit",t,n,r,i),eU.debug("Entering commit:",t,n,r,i);const a=zke();n=kG.sanitizeText(n,a),t=kG.sanitizeText(t,a),i=i?.map(e=>kG.sanitizeText(e,a));const o={id:n||jke.records.seq+"-"+Hke(),message:t,seq:jke.records.seq++,type:r??Bke.NORMAL,tags:i??[],parents:null==jke.records.head?[]:[jke.records.head.id],branch:jke.records.currBranch};jke.records.head=o,eU.info("main branch",a.mainBranchName),jke.records.commits.set(o.id,o),jke.records.branches.set(jke.records.currBranch,o.id),eU.debug("in pushCommit "+o.id)},"commit"),Yke=QH(function(e){let t=e.name;const n=e.order;if(t=kG.sanitizeText(t,zke()),jke.records.branches.has(t))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 ${t}")`);jke.records.branches.set(t,null!=jke.records.head?jke.records.head.id:null),jke.records.branchConfig.set(t,{name:t,order:n}),Qke(t),eU.debug("in createBranch")},"branch"),Xke=QH(e=>{let t=e.branch,n=e.id;const r=e.type,i=e.tags,a=zke();t=kG.sanitizeText(t,a),n&&(n=kG.sanitizeText(n,a));const o=jke.records.branches.get(jke.records.currBranch),s=jke.records.branches.get(t),l=o?jke.records.commits.get(o):void 0,c=s?jke.records.commits.get(s):void 0;if(l&&c&&l.branch===t)throw new Error(`Cannot merge branch '${t}' into itself.`);if(jke.records.currBranch===t){const e=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},e}if(void 0===l||!l){const e=new Error(`Incorrect usage of "merge". Current branch (${jke.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]},e}if(!jke.records.branches.has(t)){const e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(void 0===c||!c){const e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']},e}if(l===c){const e=new Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},e}if(n&&jke.records.commits.has(n)){const e=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom Id");throw e.hash={text:`merge ${t} ${n} ${r} ${i?.join(" ")}`,token:`merge ${t} ${n} ${r} ${i?.join(" ")}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(" ")}`]},e}const u=s||"",h={id:n||`${jke.records.seq}-${Hke()}`,message:`merged branch ${t} into ${jke.records.currBranch}`,seq:jke.records.seq++,parents:null==jke.records.head?[]:[jke.records.head.id,u],branch:jke.records.currBranch,type:Bke.MERGE,customType:r,customId:!!n,tags:i??[]};jke.records.head=h,jke.records.commits.set(h.id,h),jke.records.branches.set(jke.records.currBranch,h.id),eU.debug(jke.records.branches),eU.debug("in mergeBranch")},"merge"),Kke=QH(function(e){let t=e.id,n=e.targetId,r=e.tags,i=e.parent;eU.debug("Entering cherryPick:",t,n,r);const a=zke();if(t=kG.sanitizeText(t,a),n=kG.sanitizeText(n,a),r=r?.map(e=>kG.sanitizeText(e,a)),i=kG.sanitizeText(i,a),!t||!jke.records.commits.has(t)){const e=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const o=jke.records.commits.get(t);if(void 0===o||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&(!Array.isArray(o.parents)||!o.parents.includes(i))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const s=o.branch;if(o.type===Bke.MERGE&&!i){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!n||!jke.records.commits.has(n)){if(s===jke.records.currBranch){const e=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const e=jke.records.branches.get(jke.records.currBranch);if(void 0===e||!e){const e=new Error(`Incorrect usage of "cherry-pick". Current branch (${jke.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const a=jke.records.commits.get(e);if(void 0===a||!a){const e=new Error(`Incorrect usage of "cherry-pick". Current branch (${jke.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const l={id:jke.records.seq+"-"+Hke(),message:`cherry-picked ${o?.message} into ${jke.records.currBranch}`,seq:jke.records.seq++,parents:null==jke.records.head?[]:[jke.records.head.id,o.id],branch:jke.records.currBranch,type:Bke.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${o.id}${o.type===Bke.MERGE?`|parent:${i}`:""}`]};jke.records.head=l,jke.records.commits.set(l.id,l),jke.records.branches.set(jke.records.currBranch,l.id),eU.debug(jke.records.branches),eU.debug("in cherryPick")}},"cherryPick"),Qke=QH(function(e){if(e=kG.sanitizeText(e,zke()),!jke.records.branches.has(e)){const t=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}{jke.records.currBranch=e;const t=jke.records.branches.get(jke.records.currBranch);jke.records.head=void 0!==t&&t?jke.records.commits.get(t)??null:null}},"checkout");function Zke(e,t,n){const r=e.indexOf(t);-1===r?e.push(n):e.splice(r,1,n)}function Jke(e){const t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]);let n="";e.forEach(function(e){n+=e===t?"\t*":"\t|"});const r=[n,t.id,t.seq];for(const e in jke.records.branches)jke.records.branches.get(e)===t.id&&r.push(e);if(eU.debug(r.join(" ")),t.parents&&2==t.parents.length&&t.parents[0]&&t.parents[1]){const n=jke.records.commits.get(t.parents[0]);Zke(e,t,n),t.parents[1]&&e.push(jke.records.commits.get(t.parents[1]))}else{if(0==t.parents.length)return;if(t.parents[0]){const n=jke.records.commits.get(t.parents[0]);Zke(e,t,n)}}Jke(e=Uke(e,e=>e.id))}QH(Zke,"upsert"),QH(Jke,"prettyPrintCommitHistory");var eTe=QH(function(){eU.debug(jke.records.commits);Jke([aTe()[0]])},"prettyPrint"),tTe=QH(function(){jke.reset(),$G()},"clear"),nTe=QH(function(){const e=[...jke.records.branchConfig.values()].map((e,t)=>null!==e.order&&void 0!==e.order?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}));return e},"getBranchesAsObjArray"),rTe=QH(function(){return jke.records.branches},"getBranches"),iTe=QH(function(){return jke.records.commits},"getCommits"),aTe=QH(function(){const e=[...jke.records.commits.values()];return e.forEach(function(e){eU.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},"getCommitsArray"),oTe={commitType:Bke,getConfig:zke,setDirection:Gke,setOptions:qke,getOptions:Wke,commit:Vke,branch:Yke,merge:Xke,cherryPick:Kke,checkout:Qke,prettyPrint:eTe,clear:tTe,getBranchesAsObjArray:nTe,getBranches:rTe,getCommits:iTe,getCommitsArray:aTe,getCurrentBranch:QH(function(){return jke.records.currBranch},"getCurrentBranch"),getDirection:QH(function(){return jke.records.direction},"getDirection"),getHead:QH(function(){return jke.records.head},"getHead"),setAccTitle:BG,getAccTitle:FG,getAccDescription:jG,setAccDescription:zG,setDiagramTitle:HG,getDiagramTitle:UG},sTe=QH((e,t)=>{Lhe(e,t),e.dir&&t.setDirection(e.dir);for(const n of e.statements)lTe(n,t)},"populate"),lTe=QH((e,t)=>{const n={Commit:QH(e=>t.commit(cTe(e)),"Commit"),Branch:QH(e=>t.branch(uTe(e)),"Branch"),Merge:QH(e=>t.merge(hTe(e)),"Merge"),Checkout:QH(e=>t.checkout(dTe(e)),"Checkout"),CherryPicking:QH(e=>t.cherryPick(pTe(e)),"CherryPicking")}[e.$type];n?n(e):eU.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),cTe=QH(e=>({id:e.id,msg:e.message??"",type:void 0!==e.type?Bke[e.type]:Bke.NORMAL,tags:e.tags??void 0}),"parseCommit"),uTe=QH(e=>({name:e.name,order:e.order??0}),"parseBranch"),hTe=QH(e=>({branch:e.branch,id:e.id??"",type:void 0!==e.type?Bke[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),dTe=QH(e=>e.branch,"parseCheckout"),pTe=QH(e=>({id:e.id,targetId:"",tags:0===e.tags?.length?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),fTe={parse:QH(async e=>{const t=await Pke("gitGraph",e);eU.debug(t),sTe(t,oTe)},"parse")},gTe=WG(),mTe=gTe?.gitGraph,yTe=10,vTe=40,bTe=new Map,xTe=new Map,wTe=new Map,ETe=[],kTe=0,TTe="LR",_Te=QH(()=>{bTe.clear(),xTe.clear(),wTe.clear(),kTe=0,ETe=[],TTe="LR"},"clear"),CTe=QH(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof e?e.split(/\\n|\n|/gi):e).forEach(e=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}),t},"drawText"),STe=QH(e=>{let t,n,r;return"BT"===TTe?(n=QH((e,t)=>e<=t,"comparisonFunc"),r=1/0):(n=QH((e,t)=>e>=t,"comparisonFunc"),r=0),e.forEach(e=>{const i="TB"===TTe||"BT"==TTe?xTe.get(e)?.y:xTe.get(e)?.x;void 0!==i&&n(i,r)&&(t=e,r=i)}),t},"findClosestParent"),ATe=QH(e=>{let t="",n=1/0;return e.forEach(e=>{const r=xTe.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},"findClosestParentBT"),NTe=QH((e,t,n)=>{let r=n,i=n;const a=[];e.forEach(e=>{const n=t.get(e);if(!n)throw new Error(`Commit not found for key ${e}`);n.parents.length?(r=OTe(n),i=Math.max(r,i)):a.push(n),LTe(n,r)}),r=i,a.forEach(e=>{MTe(e,r,n)}),e.forEach(e=>{const n=t.get(e);if(n?.parents.length){const e=ATe(n.parents);r=xTe.get(e).y-vTe,r<=i&&(i=r);const t=bTe.get(n.branch).pos,a=r-yTe;xTe.set(n.id,{x:t,y:a})}})},"setParallelBTPos"),ITe=QH(e=>{const t=STe(e.parents.filter(e=>null!==e));if(!t)throw new Error(`Closest parent not found for commit ${e.id}`);const n=xTe.get(t)?.y;if(void 0===n)throw new Error(`Closest parent position not found for commit ${e.id}`);return n},"findClosestParentPos"),OTe=QH(e=>ITe(e)+vTe,"calculateCommitPosition"),LTe=QH((e,t)=>{const n=bTe.get(e.branch);if(!n)throw new Error(`Branch not found for commit ${e.id}`);const r=n.pos,i=t+yTe;return xTe.set(e.id,{x:r,y:i}),{x:r,y:i}},"setCommitPosition"),MTe=QH((e,t,n)=>{const r=bTe.get(e.branch);if(!r)throw new Error(`Branch not found for commit ${e.id}`);const i=t+n,a=r.pos;xTe.set(e.id,{x:a,y:i})},"setRootPosition"),RTe=QH((e,t,n,r,i,a)=>{if(a===Bke.HIGHLIGHT)e.append("rect").attr("x",n.x-10).attr("y",n.y-10).attr("width",20).attr("height",20).attr("class",`commit ${t.id} commit-highlight${i%8} ${r}-outer`),e.append("rect").attr("x",n.x-6).attr("y",n.y-6).attr("width",12).attr("height",12).attr("class",`commit ${t.id} commit${i%8} ${r}-inner`);else if(a===Bke.CHERRY_PICK)e.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",10).attr("class",`commit ${t.id} ${r}`),e.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${r}`),e.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${r}`),e.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${r}`),e.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${r}`);else{const o=e.append("circle");if(o.attr("cx",n.x),o.attr("cy",n.y),o.attr("r",t.type===Bke.MERGE?9:10),o.attr("class",`commit ${t.id} commit${i%8}`),a===Bke.MERGE){const a=e.append("circle");a.attr("cx",n.x),a.attr("cy",n.y),a.attr("r",6),a.attr("class",`commit ${r} ${t.id} commit${i%8}`)}if(a===Bke.REVERSE){e.append("path").attr("d",`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr("class",`commit ${r} ${t.id} commit${i%8}`)}}},"drawCommitBullet"),DTe=QH((e,t,n,r)=>{if(t.type!==Bke.CHERRY_PICK&&(t.customId&&t.type===Bke.MERGE||t.type!==Bke.MERGE)&&mTe?.showCommitLabel){const i=e.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),o=i.append("text").attr("x",r).attr("y",n.y+25).attr("class","commit-label").text(t.id),s=o.node()?.getBBox();if(s&&(a.attr("x",n.posWithOffset-s.width/2-2).attr("y",n.y+13.5).attr("width",s.width+4).attr("height",s.height+4),"TB"===TTe||"BT"===TTe?(a.attr("x",n.x-(s.width+16+5)).attr("y",n.y-12),o.attr("x",n.x-(s.width+16)).attr("y",n.y+s.height-12)):o.attr("x",n.posWithOffset-s.width/2),mTe.rotateCommitLabel))if("TB"===TTe||"BT"===TTe)o.attr("transform","rotate(-45, "+n.x+", "+n.y+")"),a.attr("transform","rotate(-45, "+n.x+", "+n.y+")");else{const e=-7.5-(s.width+10)/25*9.5,t=10+s.width/25*8.5;i.attr("transform","translate("+e+", "+t+") rotate(-45, "+r+", "+n.y+")")}}},"drawCommitLabel"),PTe=QH((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0;const s=[];for(const r of t.tags.reverse()){const t=e.insert("polygon"),l=e.append("circle"),c=e.append("text").attr("y",n.y-16-i).attr("class","tag-label").text(r),u=c.node()?.getBBox();if(!u)throw new Error("Tag bbox not found");a=Math.max(a,u.width),o=Math.max(o,u.height),c.attr("x",n.posWithOffset-u.width/2),s.push({tag:c,hole:l,rect:t,yOffset:i}),i+=20}for(const{tag:e,hole:t,rect:i,yOffset:l}of s){const s=o/2,c=n.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${r-a/2-2},${c+2} \n ${r-a/2-2},${c-2}\n ${n.posWithOffset-a/2-4},${c-s-2}\n ${n.posWithOffset+a/2+4},${c-s-2}\n ${n.posWithOffset+a/2+4},${c+s+2}\n ${n.posWithOffset-a/2-4},${c+s+2}`),t.attr("cy",c).attr("cx",r-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===TTe||"BT"===TTe){const o=r+l;i.attr("class","tag-label-bkg").attr("points",`\n ${n.x},${o+2}\n ${n.x},${o-2}\n ${n.x+yTe},${o-s-2}\n ${n.x+yTe+a+4},${o-s-2}\n ${n.x+yTe+a+4},${o+s+2}\n ${n.x+yTe},${o+s+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),t.attr("cx",n.x+2).attr("cy",o).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),e.attr("x",n.x+5).attr("y",o+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+r+")")}}}},"drawCommitTags"),$Te=QH(e=>{switch(e.customType??e.type){case Bke.NORMAL:return"commit-normal";case Bke.REVERSE:return"commit-reverse";case Bke.HIGHLIGHT:return"commit-highlight";case Bke.MERGE:return"commit-merge";case Bke.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),BTe=QH((e,t,n,r)=>{const i={x:0,y:0};if(!(e.parents.length>0)){if("TB"===t)return 30;if("BT"===t){return(r.get(e.id)??i).y-vTe}return 0}{const n=STe(e.parents);if(n){const a=r.get(n)??i;if("TB"===t)return a.y+vTe;if("BT"===t){return(r.get(e.id)??i).y-vTe}return a.x+vTe}}return 0},"calculatePosition"),FTe=QH((e,t,n)=>{const r="BT"===TTe&&n?t:t+yTe,i="TB"===TTe||"BT"===TTe?r:bTe.get(e.branch)?.pos,a="TB"===TTe||"BT"===TTe?bTe.get(e.branch)?.pos:r;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${e.id}`);return{x:a,y:i,posWithOffset:r}},"getCommitPosition"),zTe=QH((e,t,n)=>{if(!mTe)throw new Error("GitGraph config not found");const r=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let a="TB"===TTe||"BT"===TTe?30:0;const o=[...t.keys()],s=mTe?.parallelCommits??!1,l=QH((e,n)=>{const r=t.get(e)?.seq,i=t.get(n)?.seq;return void 0!==r&&void 0!==i?r-i:0},"sortKeys");let c=o.sort(l);"BT"===TTe&&(s&&NTe(c,t,a),c=c.reverse()),c.forEach(e=>{const o=t.get(e);if(!o)throw new Error(`Commit not found for key ${e}`);s&&(a=BTe(o,TTe,a,xTe));const l=FTe(o,a,s);if(n){const e=$Te(o),t=o.customType??o.type,n=bTe.get(o.branch)?.index??0;RTe(r,o,l,e,n,t),DTe(i,o,l,a),PTe(i,o,l,a)}"TB"===TTe||"BT"===TTe?xTe.set(o.id,{x:l.x,y:l.posWithOffset}):xTe.set(o.id,{x:l.posWithOffset,y:l.y}),a="BT"===TTe&&s?a+vTe:a+vTe+yTe,a>kTe&&(kTe=a)})},"drawCommits"),jTe=QH((e,t,n,r,i)=>{const a=("TB"===TTe||"BT"===TTe?n.xe.branch===a,"isOnBranchToGetCurve"),s=QH(n=>n.seq>e.seq&&n.seqs(e)&&o(e))},"shouldRerouteArrow"),HTe=QH((e,t,n=0)=>{const r=e+Math.abs(e-t)/2;if(n>5)return r;if(ETe.every(e=>Math.abs(e-r)>=10))return ETe.push(r),r;const i=Math.abs(e-t);return HTe(e,t-i/5,n+1)},"findLane"),UTe=QH((e,t,n,r)=>{const i=xTe.get(t.id),a=xTe.get(n.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${t.id} and ${n.id}`);const o=jTe(t,n,i,a,r);let s,l="",c="",u=0,h=0,d=bTe.get(n.branch)?.index;if(n.type===Bke.MERGE&&t.id!==n.parents[0]&&(d=bTe.get(t.branch)?.index),o){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",u=10,h=10;const e=i.ya.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",u=20,h=20,s=n.type===Bke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-u} ${c} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+u} ${i.y} ${l} ${a.x} ${i.y+h} L ${a.x} ${a.y}`),i.x===a.x&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):"BT"===TTe?(i.xa.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",u=20,h=20,s=n.type===Bke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${l} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y-h} L ${a.x} ${a.y}`),i.x===a.x&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.ya.y&&(s=n.type===Bke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y-h} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${c} ${i.x+h} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(void 0===s)throw new Error("Line definition not found");e.append("path").attr("d",s).attr("class","arrow arrow"+d%8)},"drawArrow"),GTe=QH((e,t)=>{const n=e.append("g").attr("class","commit-arrows");[...t.keys()].forEach(e=>{const r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{UTe(n,t.get(e),r,t)})})},"drawArrows"),qTe=QH((e,t)=>{const n=e.append("g");t.forEach((e,t)=>{const r=t%8,i=bTe.get(e.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${e.name}`);const a=n.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",kTe),a.attr("y2",i),a.attr("class","branch branch"+r),"TB"===TTe?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",kTe),a.attr("x2",i)):"BT"===TTe&&(a.attr("y1",kTe),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),ETe.push(i);const o=e.name,s=CTe(o),l=n.insert("rect"),c=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);c.node().appendChild(s);const u=s.getBBox();l.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-u.width-4-(!0===mTe?.rotateCommitLabel?30:0)).attr("y",-u.height/2+8).attr("width",u.width+18).attr("height",u.height+4),c.attr("transform","translate("+(-u.width-14-(!0===mTe?.rotateCommitLabel?30:0))+", "+(i-u.height/2-1)+")"),"TB"===TTe?(l.attr("x",i-u.width/2-10).attr("y",0),c.attr("transform","translate("+(i-u.width/2-5)+", 0)")):"BT"===TTe?(l.attr("x",i-u.width/2-10).attr("y",kTe),c.attr("transform","translate("+(i-u.width/2-5)+", "+kTe+")")):l.attr("transform","translate(-19, "+(i-u.height/2)+")")})},"drawBranches"),WTe=QH(function(e,t,n,r,i){return bTe.set(e,{pos:t,index:n}),t+=50+(i?40:0)+("TB"===TTe||"BT"===TTe?r.width/2:0)},"setBranchPosition"),VTe=QH(function(e,t,n,r){if(_Te(),eU.debug("in gitgraph renderer",e+"\n","id:",t,n),!mTe)throw new Error("GitGraph config not found");const i=mTe.rotateCommitLabel??!1,a=r.db;wTe=a.getCommits();const o=a.getBranchesAsObjArray();TTe=a.getDirection();const s=EK(`[id="${t}"]`);let l=0;o.forEach((e,t)=>{const n=CTe(e.name),r=s.append("g"),a=r.insert("g").attr("class","branchLabel"),o=a.insert("g").attr("class","label branch-label");o.node()?.appendChild(n);const c=n.getBBox();l=WTe(e.name,l,t,c,i),o.remove(),a.remove(),r.remove()}),zTe(s,wTe,!1),mTe.showBranches&&qTe(s,o),GTe(s,wTe),zTe(s,wTe,!0),P5.insertTitle(s,"gitTitleText",mTe.titleTopMargin??0,a.getDiagramTitle()),KG(void 0,s,mTe.diagramPadding,mTe.useMaxWidth)},"draw"),YTe={draw:VTe},XTe=QH(e=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map(t=>`\n .branch-label${t} { fill: ${e["gitBranchLabel"+t]}; }\n .commit${t} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; }\n .commit-highlight${t} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; }\n .label${t} { fill: ${e["git"+t]}; }\n .arrow${t} { stroke: ${e["git"+t]}; }\n `).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${e.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelColor};}\n .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}\n .tag-label-bkg { fill: ${e.tagLabelBackground}; stroke: ${e.tagLabelBorder}; }\n .tag-hole { fill: ${e.textColor}; }\n\n .commit-merge {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n }\n .commit-reverse {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`,"getStyles"),KTe={parser:fTe,db:oTe,renderer:YTe,styles:XTe},QTe=Object.freeze({__proto__:null,diagram:KTe}),ZTe={exports:{}};ZTe.exports=function(){var e="day";return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s=i(this),l=(n=this.isoWeekYear(),o=4-(a=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,e));return s.diff(l,"week")+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(e,t)}}}();var JTe=Zt(ZTe.exports),e_e=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],l=[1,32],c=[1,33],u=[1,34],h=[1,9],d=[1,10],p=[1,11],f=[1,12],g=[1,13],m=[1,14],y=[1,15],v=[1,16],b=[1,19],x=[1,20],w=[1,21],E=[1,22],k=[1,23],T=[1,25],_=[1,35],C={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$="task";break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+" "+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+" "+a[s-1]+" "+a[s];break;case 44:case 46:this.$=a[s-3]+" "+a[s-2]+" "+a[s-1]+" "+a[s]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:c,21:u,22:h,23:d,24:p,25:f,26:g,27:m,28:y,29:v,30:b,31:x,33:w,35:E,36:k,37:24,38:T,40:_},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:c,21:u,22:h,23:d,24:p,25:f,26:g,27:m,28:y,29:v,30:b,31:x,33:w,35:E,36:k,37:24,38:T,40:_},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},S=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){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:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");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 e}();function A(){this.yy={}}return C.lexer=S,QH(A,"Parser"),A.prototype=C,C.Parser=A,new A}();e_e.parser=e_e;var t_e=e_e;Rm.extend(JTe),Rm.extend(Bm),Rm.extend(Pm);var n_e,r_e,i_e={friday:5,saturday:6},a_e="",o_e="",s_e=void 0,l_e="",c_e=[],u_e=[],h_e=new Map,d_e=[],p_e=[],f_e="",g_e="",m_e=["active","done","crit","milestone"],y_e=[],v_e=!1,b_e=!1,x_e="sunday",w_e="saturday",E_e=0,k_e=QH(function(){d_e=[],p_e=[],f_e="",y_e=[],tCe=0,n_e=void 0,r_e=void 0,aCe=[],a_e="",o_e="",g_e="",s_e=void 0,l_e="",c_e=[],u_e=[],v_e=!1,b_e=!1,E_e=0,h_e=new Map,$G(),x_e="sunday",w_e="saturday"},"clear"),T_e=QH(function(e){o_e=e},"setAxisFormat"),__e=QH(function(){return o_e},"getAxisFormat"),C_e=QH(function(e){s_e=e},"setTickInterval"),S_e=QH(function(){return s_e},"getTickInterval"),A_e=QH(function(e){l_e=e},"setTodayMarker"),N_e=QH(function(){return l_e},"getTodayMarker"),I_e=QH(function(e){a_e=e},"setDateFormat"),O_e=QH(function(){v_e=!0},"enableInclusiveEndDates"),L_e=QH(function(){return v_e},"endDatesAreInclusive"),M_e=QH(function(){b_e=!0},"enableTopAxis"),R_e=QH(function(){return b_e},"topAxisEnabled"),D_e=QH(function(e){g_e=e},"setDisplayMode"),P_e=QH(function(){return g_e},"getDisplayMode"),$_e=QH(function(){return a_e},"getDateFormat"),B_e=QH(function(e){c_e=e.toLowerCase().split(/[\s,]+/)},"setIncludes"),F_e=QH(function(){return c_e},"getIncludes"),z_e=QH(function(e){u_e=e.toLowerCase().split(/[\s,]+/)},"setExcludes"),j_e=QH(function(){return u_e},"getExcludes"),H_e=QH(function(){return h_e},"getLinks"),U_e=QH(function(e){f_e=e,d_e.push(e)},"addSection"),G_e=QH(function(){return d_e},"getSections"),q_e=QH(function(){let e=uCe();let t=0;for(;!e&&t<10;)e=uCe(),t++;return p_e=aCe},"getTasks"),W_e=QH(function(e,t,n,r){return!r.includes(e.format(t.trim()))&&(!(!n.includes("weekends")||e.isoWeekday()!==i_e[w_e]&&e.isoWeekday()!==i_e[w_e]+1)||(!!n.includes(e.format("dddd").toLowerCase())||n.includes(e.format(t.trim()))))},"isInvalidDate"),V_e=QH(function(e){x_e=e},"setWeekday"),Y_e=QH(function(){return x_e},"getWeekday"),X_e=QH(function(e){w_e=e},"setWeekend"),K_e=QH(function(e,t,n,r){if(!n.length||e.manualEndTime)return;let i,a;i=e.startTime instanceof Date?Rm(e.startTime):Rm(e.startTime,t,!0),i=i.add(1,"d"),a=e.endTime instanceof Date?Rm(e.endTime):Rm(e.endTime,t,!0);const[o,s]=Q_e(i,a,t,n,r);e.endTime=o.toDate(),e.renderEndTime=s},"checkTaskDates"),Q_e=QH(function(e,t,n,r,i){let a=!1,o=null;for(;e<=t;)a||(o=t.toDate()),a=W_e(e,n,r,i),a&&(t=t.add(1,"d")),e=e.add(1,"d");return[t,o]},"fixTaskDates"),Z_e=QH(function(e,t,n){n=n.trim();const r=/^after\s+(?[\d\w- ]+)/.exec(n);if(null!==r){let e=null;for(const t of r.groups.ids.split(" ")){let n=lCe(t);void 0!==n&&(!e||n.endTime>e.endTime)&&(e=n)}if(e)return e.endTime;const t=new Date;return t.setHours(0,0,0,0),t}let i=Rm(n,t.trim(),!0);if(i.isValid())return i.toDate();{eU.debug("Invalid date:"+n),eU.debug("With date format:"+t.trim());const e=new Date(n);if(void 0===e||isNaN(e.getTime())||e.getFullYear()<-1e4||e.getFullYear()>1e4)throw new Error("Invalid date:"+n);return e}},"getStartDate"),J_e=QH(function(e){const t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return null!==t?[Number.parseFloat(t[1]),t[2]]:[NaN,"ms"]},"parseDuration"),eCe=QH(function(e,t,n,r=!1){n=n.trim();const i=/^until\s+(?[\d\w- ]+)/.exec(n);if(null!==i){let e=null;for(const t of i.groups.ids.split(" ")){let n=lCe(t);void 0!==n&&(!e||n.startTime{window.open(n,"_self")}),h_e.set(e,n))}),dCe(e,"clickable")},"setLink"),dCe=QH(function(e,t){e.split(",").forEach(function(e){let n=lCe(e);void 0!==n&&n.classes.push(t)})},"setClass"),pCe=QH(function(e,t,n){if("loose"!==WG().securityLevel)return;if(void 0===t)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{P5.runFunc(t,...r)})},"setClickFun"),fCe=QH(function(e,t){y_e.push(function(){const n=document.querySelector(`[id="${e}"]`);null!==n&&n.addEventListener("click",function(){t()})},function(){const n=document.querySelector(`[id="${e}-text"]`);null!==n&&n.addEventListener("click",function(){t()})})},"pushFun"),gCe=QH(function(e,t,n){e.split(",").forEach(function(e){pCe(e,t,n)}),dCe(e,"clickable")},"setClickEvent"),mCe=QH(function(e){y_e.forEach(function(t){t(e)})},"bindFunctions"),yCe={getConfig:QH(()=>WG().gantt,"getConfig"),clear:k_e,setDateFormat:I_e,getDateFormat:$_e,enableInclusiveEndDates:O_e,endDatesAreInclusive:L_e,enableTopAxis:M_e,topAxisEnabled:R_e,setAxisFormat:T_e,getAxisFormat:__e,setTickInterval:C_e,getTickInterval:S_e,setTodayMarker:A_e,getTodayMarker:N_e,setAccTitle:BG,getAccTitle:FG,setDiagramTitle:HG,getDiagramTitle:UG,setDisplayMode:D_e,getDisplayMode:P_e,setAccDescription:zG,getAccDescription:jG,addSection:U_e,getSections:G_e,getTasks:q_e,addTask:sCe,findTaskById:lCe,addTaskOrg:cCe,setIncludes:B_e,getIncludes:F_e,setExcludes:z_e,getExcludes:j_e,setClickEvent:gCe,setLink:hCe,getLinks:H_e,bindFunctions:mCe,parseDuration:J_e,isInvalidDate:W_e,setWeekday:V_e,getWeekday:Y_e,setWeekend:X_e};function vCe(e,t,n){let r=!0;for(;r;)r=!1,n.forEach(function(n){const i=new RegExp("^\\s*"+n+"\\s*$");e[0].match(i)&&(t[n]=!0,e.shift(1),r=!0)})}QH(vCe,"getTaskTags");var bCe,xCe=QH(function(){eU.debug("Something is calling, setConf, remove the call")},"setConf"),wCe={monday:HJ,tuesday:UJ,wednesday:GJ,thursday:qJ,friday:WJ,saturday:VJ,sunday:jJ},ECe=QH((e,t)=>{let n=[...e].map(()=>-1/0),r=[...e].sort((e,t)=>e.startTime-t.startTime||e.order-t.order),i=0;for(const e of r)for(let r=0;r=n[r]){n[r]=e.endTime,e.order=r+t,r>i&&(i=r);break}return i},"getMaxIntersections"),kCe=QH(function(e,t,n,r){const i=WG().gantt,a=WG().securityLevel;let o;"sandbox"===a&&(o=EK("#i"+t));const s=EK("sandbox"===a?o.nodes()[0].contentDocument.body:"body"),l="sandbox"===a?o.nodes()[0].contentDocument:document,c=l.getElementById(t);void 0===(bCe=c.parentElement.offsetWidth)&&(bCe=1200),void 0!==i.useWidth&&(bCe=i.useWidth);const u=r.db.getTasks();let h=[];for(const e of u)h.push(e.type);h=k(h);const d={};let p=2*i.topPadding;if("compact"===r.db.getDisplayMode()||"compact"===i.displayMode){const e={};for(const t of u)void 0===e[t.section]?e[t.section]=[t]:e[t.section].push(t);let t=0;for(const n of Object.keys(e)){const r=ECe(e[n],t)+1;t+=r,p+=r*(i.barHeight+i.barGap),d[n]=r}}else{p+=u.length*(i.barHeight+i.barGap);for(const e of h)d[e]=u.filter(t=>t.type===e).length}c.setAttribute("viewBox","0 0 "+bCe+" "+p);const f=s.select(`[id="${t}"]`),g=M1().domain([KY(u,function(e){return e.startTime}),XY(u,function(e){return e.endTime})]).rangeRound([0,bCe-i.leftPadding-i.rightPadding]);function m(e,t){const n=e.startTime,r=t.startTime;let i=0;return n>r?i=1:ne.order))].map(t=>e.find(e=>e.order===t));f.append("g").selectAll("rect").data(u).enter().append("rect").attr("x",0).attr("y",function(e,t){return e.order*n+a-2}).attr("width",function(){return c-i.rightPadding/2}).attr("height",n).attr("class",function(e){for(const[t,n]of h.entries())if(e.type===n)return"section section"+t%i.numberSectionStyles;return"section section0"});const d=f.append("g").selectAll("rect").data(e).enter(),p=r.db.getLinks();d.append("rect").attr("id",function(e){return e.id}).attr("rx",3).attr("ry",3).attr("x",function(e){return e.milestone?g(e.startTime)+o+.5*(g(e.endTime)-g(e.startTime))-.5*s:g(e.startTime)+o}).attr("y",function(e,t){return e.order*n+a}).attr("width",function(e){return e.milestone?s:g(e.renderEndTime||e.endTime)-g(e.startTime)}).attr("height",s).attr("transform-origin",function(e,t){return t=e.order,(g(e.startTime)+o+.5*(g(e.endTime)-g(e.startTime))).toString()+"px "+(t*n+a+.5*s).toString()+"px"}).attr("class",function(e){let t="";e.classes.length>0&&(t=e.classes.join(" "));let n=0;for(const[t,r]of h.entries())e.type===r&&(n=t%i.numberSectionStyles);let r="";return e.active?e.crit?r+=" activeCrit":r=" active":e.done?r=e.crit?" doneCrit":" done":e.crit&&(r+=" crit"),0===r.length&&(r=" task"),e.milestone&&(r=" milestone "+r),r+=n,r+=" "+t,"task"+r}),d.append("text").attr("id",function(e){return e.id+"-text"}).text(function(e){return e.task}).attr("font-size",i.fontSize).attr("x",function(e){let t=g(e.startTime),n=g(e.renderEndTime||e.endTime);e.milestone&&(t+=.5*(g(e.endTime)-g(e.startTime))-.5*s),e.milestone&&(n=t+s);const r=this.getBBox().width;return r>n-t?n+r+1.5*i.leftPadding>c?t+o-5:n+o+5:(n-t)/2+t+o}).attr("y",function(e,t){return e.order*n+i.barHeight/2+(i.fontSize/2-2)+a}).attr("text-height",s).attr("class",function(e){const t=g(e.startTime);let n=g(e.endTime);e.milestone&&(n=t+s);const r=this.getBBox().width;let a="";e.classes.length>0&&(a=e.classes.join(" "));let o=0;for(const[t,n]of h.entries())e.type===n&&(o=t%i.numberSectionStyles);let l="";return e.active&&(l=e.crit?"activeCritText"+o:"activeText"+o),e.done?l=e.crit?l+" doneCritText"+o:l+" doneText"+o:e.crit&&(l=l+" critText"+o),e.milestone&&(l+=" milestoneText"),r>n-t?n+r+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+o+" "+l:a+" taskTextOutsideRight taskTextOutside"+o+" "+l+" width-"+r:a+" taskText taskText"+o+" "+l+" width-"+r});if("sandbox"===WG().securityLevel){let e;e=EK("#i"+t);const n=e.nodes()[0].contentDocument;d.filter(function(e){return p.has(e.id)}).each(function(e){var t=n.querySelector("#"+e.id),r=n.querySelector("#"+e.id+"-text");const i=t.parentNode;var a=n.createElement("a");a.setAttribute("xlink:href",p.get(e.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(t),a.appendChild(r)})}}function b(e,t,n,a,o,s,l,c){if(0===l.length&&0===c.length)return;let u,h;for(const{startTime:e,endTime:t}of s)(void 0===u||eh)&&(h=t);if(!u||!h)return;if(Rm(h).diff(Rm(u),"year")>5)return void eU.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const d=r.db.getDateFormat(),p=[];let m=null,y=Rm(u);for(;y.valueOf()<=h;)r.db.isInvalidDate(y,d,l,c)?m?m.end=y:m={start:y,end:y}:m&&(p.push(m),m=null),y=y.add(1,"d");f.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",function(e){return"exclude-"+e.start.format("YYYY-MM-DD")}).attr("x",function(e){return g(e.start)+n}).attr("y",i.gridLineStartPadding).attr("width",function(e){const t=e.end.add(1,"day");return g(t)-g(e.start)}).attr("height",o-t-i.gridLineStartPadding).attr("transform-origin",function(t,r){return(g(t.start)+n+.5*(g(t.end)-g(t.start))).toString()+"px "+(r*e+.5*o).toString()+"px"}).attr("class","exclude-range")}function x(e,t,n,a){let o=function(e){return iX(3,e)}(g).tickSize(-a+t+i.gridLineStartPadding).tickFormat(d0(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const s=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(null!==s){const e=s[1],t=s[2],n=r.db.getWeekday()||i.weekday;switch(t){case"millisecond":o.ticks(TJ.every(e));break;case"second":o.ticks(LJ.every(e));break;case"minute":o.ticks(MJ.every(e));break;case"hour":o.ticks(DJ.every(e));break;case"day":o.ticks($J.every(e));break;case"week":o.ticks(wCe[n].every(e));break;case"month":o.ticks(n0.every(e))}}if(f.append("g").attr("class","grid").attr("transform","translate("+e+", "+(a-50)+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let n=function(e){return iX(1,e)}(g).tickSize(-a+t+i.gridLineStartPadding).tickFormat(d0(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==s){const e=s[1],t=s[2],a=r.db.getWeekday()||i.weekday;switch(t){case"millisecond":n.ticks(TJ.every(e));break;case"second":n.ticks(LJ.every(e));break;case"minute":n.ticks(MJ.every(e));break;case"hour":n.ticks(DJ.every(e));break;case"day":n.ticks($J.every(e));break;case"week":n.ticks(wCe[a].every(e));break;case"month":n.ticks(n0.every(e))}}f.append("g").attr("class","grid").attr("transform","translate("+e+", "+t+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function w(e,t){let n=0;const r=Object.keys(d).map(e=>[e,d[e]]);f.append("g").selectAll("text").data(r).enter().append(function(e){const t=e[0].split(kG.lineBreakRegex),n=-(t.length-1)/2,r=l.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",n+"em");for(const[e,n]of t.entries()){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttribute("alignment-baseline","central"),t.setAttribute("x","10"),e>0&&t.setAttribute("dy","1em"),t.textContent=n,r.appendChild(t)}return r}).attr("x",10).attr("y",function(i,a){if(!(a>0))return i[1]*e/2+t;for(let o=0;o`\n .mermaid-main-font {\n font-family: ${e.fontFamily};\n }\n\n .exclude-range {\n fill: ${e.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${e.sectionBkgColor};\n }\n\n .section2 {\n fill: ${e.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${e.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: ${e.fontFamily};\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${e.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${e.fontFamily};\n fill: ${e.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${e.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: ${e.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${e.taskTextDarkColor};\n text-anchor: start;\n font-family: ${e.fontFamily};\n }\n\n .taskTextOutsideLeft {\n fill: ${e.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${e.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${e.taskBkgColor};\n stroke: ${e.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${e.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${e.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${e.activeTaskBkgColor};\n stroke: ${e.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${e.doneTaskBorderColor};\n fill: ${e.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.titleColor||e.textColor};\n font-family: ${e.fontFamily};\n }\n`,"getStyles")},_Ce=Object.freeze({__proto__:null,diagram:TCe}),CCe={parse:QH(async e=>{const t=await Pke("info",e);eU.debug(t)},"parse")},SCe={version:Ste},ACe={getVersion:QH(()=>SCe.version,"getVersion")},NCe=QH((e,t,n)=>{eU.debug("rendering info diagram\n"+e);const r=Ate(t);CG(r,100,400,!0);r.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"),ICe={parser:CCe,db:ACe,renderer:{draw:NCe}},OCe=Object.freeze({__proto__:null,diagram:ICe}),LCe=OU.pie,MCe={sections:new Map,showData:!1},RCe=MCe.sections,DCe=MCe.showData,PCe=structuredClone(LCe),$Ce=QH(()=>structuredClone(PCe),"getConfig"),BCe=QH(()=>{RCe=new Map,DCe=MCe.showData,$G()},"clear"),FCe=QH(({label:e,value:t})=>{RCe.has(e)||(RCe.set(e,t),eU.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),zCe={getConfig:$Ce,clear:BCe,setDiagramTitle:HG,getDiagramTitle:UG,setAccTitle:BG,getAccTitle:FG,setAccDescription:zG,getAccDescription:jG,addSection:FCe,getSections:QH(()=>RCe,"getSections"),setShowData:QH(e=>{DCe=e},"setShowData"),getShowData:QH(()=>DCe,"getShowData")},jCe=QH((e,t)=>{Lhe(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),HCe={parse:QH(async e=>{const t=await Pke("pie",e);eU.debug(t),jCe(t,zCe)},"parse")},UCe=QH(e=>`\n .pieCircle{\n stroke: ${e.pieStrokeColor};\n stroke-width : ${e.pieStrokeWidth};\n opacity : ${e.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${e.pieOuterStrokeColor};\n stroke-width: ${e.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${e.pieTitleTextSize};\n fill: ${e.pieTitleTextColor};\n font-family: ${e.fontFamily};\n }\n .slice {\n font-family: ${e.fontFamily};\n fill: ${e.pieSectionTextColor};\n font-size:${e.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${e.pieLegendTextColor};\n font-family: ${e.fontFamily};\n font-size: ${e.pieLegendTextSize};\n }\n`,"getStyles"),GCe=QH(e=>{const t=[...e.entries()].map(e=>({label:e[0],value:e[1]})).sort((e,t)=>t.value-e.value),n=function(){var e=c2,t=l2,n=null,r=D1(0),i=D1(W1),a=D1(0);function o(o){var s,l,c,u,h,d=(o=n2(o)).length,p=0,f=new Array(d),g=new Array(d),m=+r.apply(this,arguments),y=Math.min(W1,Math.max(-W1,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s0&&(p+=h);for(null!=t?f.sort(function(e,n){return t(g[e],g[n])}):null!=n&&f.sort(function(e,t){return n(o[e],o[t])}),s=0,c=p?(y-d*b)/p:0;s0?h*c:0)+b,g[l]={data:o[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:v};return g}return o.value=function(t){return arguments.length?(e="function"==typeof t?t:D1(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:D1(+e),o):r},o.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:D1(+e),o):i},o.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:D1(+e),o):a},o}().value(e=>e.value);return n(t)},"createPieArcs"),qCe=QH((e,t,n,r)=>{eU.debug("rendering pie chart\n"+e);const i=r.db,a=WG(),o=D5(i.getConfig(),a.pie),s=18,l=450,c=l,u=Ate(t),h=u.append("g");h.attr("transform","translate(225,225)");const{themeVariables:d}=a;let[p]=R5(d.pieOuterStrokeWidth);p??=2;const f=o.textPosition,g=Math.min(c,l)/2-40,m=t2().innerRadius(0).outerRadius(g),y=t2().innerRadius(g*f).outerRadius(g*f);h.append("circle").attr("cx",0).attr("cy",0).attr("r",g+p/2).attr("class","pieOuterCircle");const v=i.getSections(),b=GCe(v),x=sJ([d.pie1,d.pie2,d.pie3,d.pie4,d.pie5,d.pie6,d.pie7,d.pie8,d.pie9,d.pie10,d.pie11,d.pie12]);h.selectAll("mySlices").data(b).enter().append("path").attr("d",m).attr("fill",e=>x(e.data.label)).attr("class","pieCircle");let w=0;v.forEach(e=>{w+=e}),h.selectAll("mySlices").data(b).enter().append("text").text(e=>(e.data.value/w*100).toFixed(0)+"%").attr("transform",e=>"translate("+y.centroid(e)+")").style("text-anchor","middle").attr("class","slice"),h.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const E=h.selectAll(".legend").data(x.domain()).enter().append("g").attr("class","legend").attr("transform",(e,t)=>"translate(216,"+(22*t-22*x.domain().length/2)+")");E.append("rect").attr("width",s).attr("height",s).style("fill",x).style("stroke",x),E.data(b).append("text").attr("x",22).attr("y",14).text(e=>{const{label:t,value:n}=e.data;return i.getShowData()?`${t} [${n}]`:t});const k=Math.max(...E.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0)),T=512+k;u.attr("viewBox",`0 0 ${T} 450`),CG(u,l,T,o.useMaxWidth)},"draw"),WCe={parser:HCe,db:zCe,renderer:{draw:qCe},styles:UCe},VCe=Object.freeze({__proto__:null,diagram:WCe}),YCe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[1,7],o=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],s=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],c=[2,36],u=[1,37],h=[1,36],d=[1,38],p=[1,35],f=[1,43],g=[1,41],m=[1,14],y=[1,23],v=[1,18],b=[1,19],x=[1,20],w=[1,21],E=[1,22],k=[1,24],T=[1,25],_=[1,26],C=[1,27],S=[1,28],A=[1,29],N=[1,32],I=[1,33],O=[1,34],L=[1,39],M=[1,40],R=[1,42],D=[1,44],P=[1,62],$=[1,61],B=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],F=[1,65],z=[1,66],j=[1,67],H=[1,68],U=[1,69],G=[1,70],q=[1,71],W=[1,72],V=[1,73],Y=[1,74],X=[1,75],K=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],Z=[1,90],J=[1,91],ee=[1,92],te=[1,99],ne=[1,93],re=[1,96],ie=[1,94],ae=[1,95],oe=[1,97],se=[1,98],le=[1,102],ce=[10,55,56,57],ue=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:QH(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],[59,1],[59,1],[59,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:case 68:this.$=a[s];break;case 24:case 69:this.$=a[s-1]+""+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],"",a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],"",a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=" ⟶ ",r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=" ⟶ ",r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:case 66:this.$={text:a[s],type:"text"};break;case 65:this.$={text:a[s-1].text+""+a[s],type:a[s-1].type};break;case 67:this.$={text:a[s],type:"markdown"}}},"anonymous"),table:[{18:t,26:1,27:2,28:n,55:r,56:i,57:a},{1:[3]},{18:t,26:8,27:2,28:n,55:r,56:i,57:a},{18:t,26:9,27:2,28:n,55:r,56:i,57:a},e(o,[2,33],{29:10}),e(s,[2,61]),e(s,[2,62]),e(s,[2,63]),{1:[2,30]},{1:[2,31]},e(l,c,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:h,10:d,12:p,13:f,14:g,18:m,25:y,35:v,37:b,39:x,41:w,42:E,48:k,50:T,51:_,52:C,53:S,54:A,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(o,[2,34]),{27:45,55:r,56:i,57:a},e(l,[2,37]),e(l,c,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:h,10:d,12:p,13:f,14:g,18:m,25:y,35:v,37:b,39:x,41:w,42:E,48:k,50:T,51:_,52:C,53:S,54:A,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},e(l,[2,45]),e(l,[2,46]),{18:[1,50]},{4:u,5:h,10:d,12:p,13:f,14:g,43:51,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:52,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:53,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:54,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:55,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:56,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,44:[1,57],47:[1,58],58:60,59:59,63:O,64:L,65:M,66:R,67:D},e(B,[2,64]),e(B,[2,66]),e(B,[2,67]),e(B,[2,70]),e(B,[2,71]),e(B,[2,72]),e(B,[2,73]),e(B,[2,74]),e(B,[2,75]),e(B,[2,76]),e(B,[2,77]),e(B,[2,78]),e(B,[2,79]),e(B,[2,80]),e(o,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:64,4:F,5:z,6:j,7:H,8:U,9:G,10:q,11:W,12:V,13:Y,14:X,15:K,21:63},e(l,[2,53],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,49:[1,77],63:O,64:L,65:M,66:R,67:D}),e(l,[2,56],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,49:[1,78],63:O,64:L,65:M,66:R,67:D}),e(l,[2,57],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,58],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,59],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,60],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),{45:[1,79]},{44:[1,80]},e(B,[2,65]),e(B,[2,81]),e(B,[2,82]),e(B,[2,83]),{3:82,4:F,5:z,6:j,7:H,8:U,9:G,10:q,11:W,12:V,13:Y,14:X,15:K,18:[1,81]},e(Q,[2,23]),e(Q,[2,1]),e(Q,[2,2]),e(Q,[2,3]),e(Q,[2,4]),e(Q,[2,5]),e(Q,[2,6]),e(Q,[2,7]),e(Q,[2,8]),e(Q,[2,9]),e(Q,[2,10]),e(Q,[2,11]),e(Q,[2,12]),e(l,[2,52],{58:31,43:83,4:u,5:h,10:d,12:p,13:f,14:g,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(l,[2,55],{58:31,43:84,4:u,5:h,10:d,12:p,13:f,14:g,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),{46:[1,85]},{45:[1,86]},{4:Z,5:J,6:ee,8:te,11:ne,13:re,16:89,17:ie,18:ae,19:oe,20:se,22:88,23:87},e(Q,[2,24]),e(l,[2,51],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,54],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,47],{22:88,16:89,23:100,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),{46:[1,101]},e(l,[2,29],{10:le}),e(ce,[2,27],{16:103,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),e(ue,[2,25]),e(ue,[2,13]),e(ue,[2,14]),e(ue,[2,15]),e(ue,[2,16]),e(ue,[2,17]),e(ue,[2,18]),e(ue,[2,19]),e(ue,[2,20]),e(ue,[2,21]),e(ue,[2,22]),e(l,[2,49],{10:le}),e(l,[2,48],{22:88,16:89,23:104,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),{4:Z,5:J,6:ee,8:te,11:ne,13:re,16:89,17:ie,18:ae,19:oe,20:se,22:105},e(ue,[2,26]),e(l,[2,50],{10:le}),e(ce,[2,28],{16:103,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},de=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:case 1:case 3:break;case 2:return 55;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:case 23:case 25:case 31: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 24:this.begin("string");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 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 11;case 37:return 64;case 38:return 10;case 39:case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51: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,/^(?::)/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],inclusive:!0}}};return e}();function pe(){this.yy={}}return he.lexer=de,QH(pe,"Parser"),pe.prototype=he,he.Parser=pe,new pe}();YCe.parser=YCe;var XCe=YCe,KCe=EU(),QCe=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{QH(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:OU.quadrantChart?.chartWidth||500,chartWidth:OU.quadrantChart?.chartHeight||500,titlePadding:OU.quadrantChart?.titlePadding||10,titleFontSize:OU.quadrantChart?.titleFontSize||20,quadrantPadding:OU.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:OU.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:OU.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:OU.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:OU.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:OU.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:OU.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:OU.quadrantChart?.pointTextPadding||5,pointLabelFontSize:OU.quadrantChart?.pointLabelFontSize||12,pointRadius:OU.quadrantChart?.pointRadius||5,xAxisPosition:OU.quadrantChart?.xAxisPosition||"top",yAxisPosition:OU.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:OU.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:OU.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:KCe.quadrant1Fill,quadrant2Fill:KCe.quadrant2Fill,quadrant3Fill:KCe.quadrant3Fill,quadrant4Fill:KCe.quadrant4Fill,quadrant1TextFill:KCe.quadrant1TextFill,quadrant2TextFill:KCe.quadrant2TextFill,quadrant3TextFill:KCe.quadrant3TextFill,quadrant4TextFill:KCe.quadrant4TextFill,quadrantPointFill:KCe.quadrantPointFill,quadrantPointTextFill:KCe.quadrantPointTextFill,quadrantXAxisTextFill:KCe.quadrantXAxisTextFill,quadrantYAxisTextFill:KCe.quadrantYAxisTextFill,quadrantTitleFill:KCe.quadrantTitleFill,quadrantInternalBorderStrokeFill:KCe.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:KCe.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,eU.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,t){this.classes.set(e,t)}setConfig(e){eU.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){eU.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,t,n,r){const i=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,a={top:"top"===e&&t?i:0,bottom:"bottom"===e&&t?i:0},o=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,s={left:"left"===this.config.yAxisPosition&&n?o:0,right:"right"===this.config.yAxisPosition&&n?o:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:r?l:0},u=this.config.quadrantPadding+s.left,h=this.config.quadrantPadding+a.top+c.top,d=this.config.chartWidth-2*this.config.quadrantPadding-s.left-s.right,p=this.config.chartHeight-2*this.config.quadrantPadding-a.top-a.bottom-c.top;return{xAxisSpace:a,yAxisSpace:s,titleSpace:c,quadrantSpace:{quadrantLeft:u,quadrantTop:h,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(e,t,n,r){const{quadrantSpace:i,titleSpace:a}=r,{quadrantHalfHeight:o,quadrantHeight:s,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:u,quadrantWidth:h}=i,d=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),f=[];return this.data.xAxisLeftText&&t&&f.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(d?c/2:0),y:"top"===e?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+u+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&t&&f.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(d?c/2:0),y:"top"===e?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+u+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&f.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:u+s-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&f.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:u+o-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),f}getQuadrants(e){const{quadrantSpace:t}=e,{quadrantHalfHeight:n,quadrantLeft:r,quadrantHalfWidth:i,quadrantTop:a}=t,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:a,width:i,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:a,width:i,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(const e of o)e.text.x=e.x+e.width/2,0===this.data.points.length?(e.text.y=e.y+e.height/2,e.text.horizontalPos="middle"):(e.text.y=e.y+this.config.quadrantTextTopPadding,e.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:t}=e,{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:a}=t,o=xJ().domain([0,1]).range([r,a+r]),s=xJ().domain([0,1]).range([n+i,i]),l=this.data.points.map(e=>{const t=this.classes.get(e.className);t&&(e={...t,...e});return{x:o(e.x),y:s(e.y),fill:e.color??this.themeConfig.quadrantPointFill,radius:e.radius??this.config.pointRadius,text:{text:e.text,fill:this.themeConfig.quadrantPointTextFill,x:o(e.x),y:s(e.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:e.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:e.strokeWidth??"0px"}});return l}getBorders(e){const t=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:s,quadrantWidth:l}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s,x2:a+l+t,y2:s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:s+t,x2:a+l,y2:s+i-t},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s+i,x2:a+l+t,y2:s+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:s+t,x2:a,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:s+t,x2:a+o,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+t,y1:s+r,x2:a+l-t,y2:s+r}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),t=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(r,e,t,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,e,t,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}},ZCe=class extends Error{static{QH(this,"InvalidStyleError")}constructor(e,t,n){super(`value for ${e} ${t} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}};function JCe(e){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(e)}function eSe(e){return!/^\d+$/.test(e)}function tSe(e){return!/^\d+px$/.test(e)}QH(JCe,"validateHexCode"),QH(eSe,"validateNumber"),QH(tSe,"validateSizeInPixels");var nSe=WG();function rSe(e){return iG(e.trim(),nSe)}QH(rSe,"textSanitizer");var iSe=new QCe;function aSe(e){iSe.setData({quadrant1Text:rSe(e.text)})}function oSe(e){iSe.setData({quadrant2Text:rSe(e.text)})}function sSe(e){iSe.setData({quadrant3Text:rSe(e.text)})}function lSe(e){iSe.setData({quadrant4Text:rSe(e.text)})}function cSe(e){iSe.setData({xAxisLeftText:rSe(e.text)})}function uSe(e){iSe.setData({xAxisRightText:rSe(e.text)})}function hSe(e){iSe.setData({yAxisTopText:rSe(e.text)})}function dSe(e){iSe.setData({yAxisBottomText:rSe(e.text)})}function pSe(e){const t={};for(const n of e){const[e,r]=n.trim().split(/\s*:\s*/);if("radius"===e){if(eSe(r))throw new ZCe(e,r,"number");t.radius=parseInt(r)}else if("color"===e){if(JCe(r))throw new ZCe(e,r,"hex code");t.color=r}else if("stroke-color"===e){if(JCe(r))throw new ZCe(e,r,"hex code");t.strokeColor=r}else{if("stroke-width"!==e)throw new Error(`style named ${e} is not supported.`);if(tSe(r))throw new ZCe(e,r,"number of pixels (eg. 10px)");t.strokeWidth=r}}return t}function fSe(e,t,n,r,i){const a=pSe(i);iSe.addPoints([{x:n,y:r,text:rSe(e.text),className:t,...a}])}function gSe(e,t){iSe.addClass(e,pSe(t))}function mSe(e){iSe.setConfig({chartWidth:e})}function ySe(e){iSe.setConfig({chartHeight:e})}function vSe(){const e=WG(),{themeVariables:t,quadrantChart:n}=e;return n&&iSe.setConfig(n),iSe.setThemeConfig({quadrant1Fill:t.quadrant1Fill,quadrant2Fill:t.quadrant2Fill,quadrant3Fill:t.quadrant3Fill,quadrant4Fill:t.quadrant4Fill,quadrant1TextFill:t.quadrant1TextFill,quadrant2TextFill:t.quadrant2TextFill,quadrant3TextFill:t.quadrant3TextFill,quadrant4TextFill:t.quadrant4TextFill,quadrantPointFill:t.quadrantPointFill,quadrantPointTextFill:t.quadrantPointTextFill,quadrantXAxisTextFill:t.quadrantXAxisTextFill,quadrantYAxisTextFill:t.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:t.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:t.quadrantInternalBorderStrokeFill,quadrantTitleFill:t.quadrantTitleFill}),iSe.setData({titleText:UG()}),iSe.build()}QH(aSe,"setQuadrant1Text"),QH(oSe,"setQuadrant2Text"),QH(sSe,"setQuadrant3Text"),QH(lSe,"setQuadrant4Text"),QH(cSe,"setXAxisLeftText"),QH(uSe,"setXAxisRightText"),QH(hSe,"setYAxisTopText"),QH(dSe,"setYAxisBottomText"),QH(pSe,"parseStyles"),QH(fSe,"addPoint"),QH(gSe,"addClass"),QH(mSe,"setWidth"),QH(ySe,"setHeight"),QH(vSe,"getQuadrantData");var bSe={setWidth:mSe,setHeight:ySe,setQuadrant1Text:aSe,setQuadrant2Text:oSe,setQuadrant3Text:sSe,setQuadrant4Text:lSe,setXAxisLeftText:cSe,setXAxisRightText:uSe,setYAxisTopText:hSe,setYAxisBottomText:dSe,parseStyles:pSe,addPoint:fSe,addClass:gSe,getQuadrantData:vSe,clear:QH(function(){iSe.clear(),$G()},"clear"),setAccTitle:BG,getAccTitle:FG,setDiagramTitle:HG,getDiagramTitle:UG,getAccDescription:jG,setAccDescription:zG},xSe=QH((e,t,n,r)=>{function i(e){return"top"===e?"hanging":"middle"}function a(e){return"left"===e?"start":"middle"}function o(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}QH(i,"getDominantBaseLine"),QH(a,"getTextAnchor"),QH(o,"getTransformation");const s=WG();eU.debug("Rendering quadrant chart\n"+e);const l=s.securityLevel;let c;"sandbox"===l&&(c=EK("#i"+t));const u=EK("sandbox"===l?c.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`),h=u.append("g").attr("class","main"),d=s.quadrantChart?.chartWidth??500,p=s.quadrantChart?.chartHeight??500;CG(u,p,d,s.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+d+" "+p),r.db.setHeight(p),r.db.setWidth(d);const f=r.db.getQuadrantData(),g=h.append("g").attr("class","quadrants"),m=h.append("g").attr("class","border"),y=h.append("g").attr("class","data-points"),v=h.append("g").attr("class","labels"),b=h.append("g").attr("class","title");f.title&&b.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",i(f.title.horizontalPos)).attr("text-anchor",a(f.title.verticalPos)).attr("transform",o(f.title)).text(f.title.text),f.borderLines&&m.selectAll("line").data(f.borderLines).enter().append("line").attr("x1",e=>e.x1).attr("y1",e=>e.y1).attr("x2",e=>e.x2).attr("y2",e=>e.y2).style("stroke",e=>e.strokeFill).style("stroke-width",e=>e.strokeWidth);const x=g.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");x.append("rect").attr("x",e=>e.x).attr("y",e=>e.y).attr("width",e=>e.width).attr("height",e=>e.height).attr("fill",e=>e.fill),x.append("text").attr("x",0).attr("y",0).attr("fill",e=>e.text.fill).attr("font-size",e=>e.text.fontSize).attr("dominant-baseline",e=>i(e.text.horizontalPos)).attr("text-anchor",e=>a(e.text.verticalPos)).attr("transform",e=>o(e.text)).text(e=>e.text.text);v.selectAll("g.label").data(f.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(e=>e.text).attr("fill",e=>e.fill).attr("font-size",e=>e.fontSize).attr("dominant-baseline",e=>i(e.horizontalPos)).attr("text-anchor",e=>a(e.verticalPos)).attr("transform",e=>o(e));const w=y.selectAll("g.data-point").data(f.points).enter().append("g").attr("class","data-point");w.append("circle").attr("cx",e=>e.x).attr("cy",e=>e.y).attr("r",e=>e.radius).attr("fill",e=>e.fill).attr("stroke",e=>e.strokeColor).attr("stroke-width",e=>e.strokeWidth),w.append("text").attr("x",0).attr("y",0).text(e=>e.text.text).attr("fill",e=>e.text.fill).attr("font-size",e=>e.text.fontSize).attr("dominant-baseline",e=>i(e.text.horizontalPos)).attr("text-anchor",e=>a(e.text.verticalPos)).attr("transform",e=>o(e.text))},"draw"),wSe={parser:XCe,db:bSe,renderer:{draw:xSe},styles:QH(()=>"","styles")},ESe=Object.freeze({__proto__:null,diagram:wSe}),kSe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],s=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],c=[1,26],u=[1,28],h=[1,29],d=[1,30],p=[1,31],f=[1,32],g=[1,33],m=[1,34],y=[1,35],v=[1,36],b=[1,37],x=[1,43],w=[1,42],E=[1,47],k=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],S=[1,64],A={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:"",type:"text"},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:"",type:"text"},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:case 27:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:"text",text:""});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:"text",text:""});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:case 38:this.$={text:a[s],type:"text"};break;case 39:this.$={text:a[s],type:"markdown"};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+""+a[s]}},"anonymous"),table:[e(t,n,{3:1,4:2,7:4,5:r,34:i,35:a,36:o}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,34:i,35:a,36:o}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:i,35:a,36:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(s,[2,34]),e(s,[2,35]),e(s,[2,36]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,34:i,35:a,36:o}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,34:i,35:a,36:o}),{11:23,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:39,13:38,24:x,27:w,29:40,30:41,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:45,15:44,27:E,33:46,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:49,17:48,24:k,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:52,17:51,24:k,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(_,[2,37],{40:55,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b}),e(_,[2,38]),e(_,[2,39]),e(C,[2,40]),e(C,[2,42]),e(C,[2,43]),e(C,[2,44]),e(C,[2,45]),e(C,[2,46]),e(C,[2,47]),e(C,[2,48]),e(C,[2,49]),e(C,[2,50]),e(C,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:w}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:E}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:k},{25:63,27:S},e(T,[2,14]),{17:65,24:k},e(T,[2,16]),e(T,[2,17]),e(C,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:S},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},N=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return e}();function I(){this.yy={}}return A.lexer=N,QH(I,"Parser"),I.prototype=A,A.Parser=I,new I}();kSe.parser=kSe;var TSe=kSe;function _Se(e){return"bar"===e.type}function CSe(e){return"band"===e.type}function SSe(e){return"linear"===e.type}QH(_Se,"isBarPlot"),QH(CSe,"isBandAxisData"),QH(SSe,"isLinearAxisData");var ASe=class{constructor(e){this.parentGroup=e}static{QH(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};const n={width:0,height:0},r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",t);for(const i of e){const e=h7(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},NSe=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{QH(this,"BaseAxis")}setRange(e){this.range=e,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*e.width;this.outerPadding=Math.min(n.width/2,r);const i=n.height+2*this.axisConfig.labelPadding;this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+2*this.axisConfig.titlePadding;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*e.height;this.outerPadding=Math.min(n.height/2,r);const i=n.width+2*this.axisConfig.labelPadding;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+2*this.axisConfig.titlePadding;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const t=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},ISe=class extends NSe{static{QH(this,"BandAxis")}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=lJ().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=lJ().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),eU.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},OSe=class extends NSe{static{QH(this,"LinearAxis")}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=xJ().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];"left"===this.axisPosition&&e.reverse(),this.scale=xJ().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function LSe(e,t,n,r){const i=new ASe(r);return CSe(e)?new ISe(t,n,e.categories,e.title,i):new OSe(t,n,[e.min,e.max],e.title,i)}QH(LSe,"getAxis");var MSe=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{QH(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function RSe(e,t,n,r){const i=new ASe(r);return new MSe(i,e,t,n)}QH(RSe,"getChartTitleComponent");var DSe=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{QH(this,"LinePlot")}getDrawableElement(){const e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let t;return t="horizontal"===this.orientation?s2().y(e=>e[0]).x(e=>e[1])(e):s2().x(e=>e[0]).y(e=>e[1])(e),t?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},PSe=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{QH(this,"BarPlot")}getDrawableElement(){const e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),n=t/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},$Se=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{QH(this,"BasePlot")}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const e=[];for(const[t,n]of this.chartData.plots.entries())switch(n.type){case"line":{const r=new DSe(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case"bar":{const r=new PSe(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}};function BSe(e,t,n){return new $Se(e,t,n)}QH(BSe,"getPlotComponent");var FSe,zSe=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:RSe(e,t,n,r),plot:BSe(e,t,n),xAxis:LSe(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:LSe(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{QH(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>_Se(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition("left"),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition("top"),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>_Se(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},jSe=class{static{QH(this,"XYChartBuilder")}static build(e,t,n,r){return new zSe(e,t,n,r).getDrawableElement()}},HSe=0,USe=KSe(),GSe=XSe(),qSe=QSe(),WSe=GSe.plotColorPalette.split(",").map(e=>e.trim()),VSe=!1,YSe=!1;function XSe(){const e=EU(),t=GU();return D5(e.xyChart,t.themeVariables.xyChart)}function KSe(){const e=GU();return D5(OU.xyChart,e.xyChart)}function QSe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function ZSe(e){const t=GU();return iG(e.trim(),t)}function JSe(e){FSe=e}function eAe(e){USe.chartOrientation="horizontal"===e?"horizontal":"vertical"}function tAe(e){qSe.xAxis.title=ZSe(e.text)}function nAe(e,t){qSe.xAxis={type:"linear",title:qSe.xAxis.title,min:e,max:t},VSe=!0}function rAe(e){qSe.xAxis={type:"band",title:qSe.xAxis.title,categories:e.map(e=>ZSe(e.text))},VSe=!0}function iAe(e){qSe.yAxis.title=ZSe(e.text)}function aAe(e,t){qSe.yAxis={type:"linear",title:qSe.yAxis.title,min:e,max:t},YSe=!0}function oAe(e){const t=Math.min(...e),n=Math.max(...e),r=SSe(qSe.yAxis)?qSe.yAxis.min:1/0,i=SSe(qSe.yAxis)?qSe.yAxis.max:-1/0;qSe.yAxis={type:"linear",title:qSe.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}function sAe(e){let t=[];if(0===e.length)return t;if(!VSe){const t=SSe(qSe.xAxis)?qSe.xAxis.min:1/0,n=SSe(qSe.xAxis)?qSe.xAxis.max:-1/0;nAe(Math.min(t,1),Math.max(n,e.length))}if(YSe||oAe(e),CSe(qSe.xAxis)&&(t=qSe.xAxis.categories.map((t,n)=>[t,e[n]])),SSe(qSe.xAxis)){const n=qSe.xAxis.min,r=qSe.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}function lAe(e){return WSe[0===e?0:e%WSe.length]}function cAe(e,t){const n=sAe(t);qSe.plots.push({type:"line",strokeFill:lAe(HSe),strokeWidth:2,data:n}),HSe++}function uAe(e,t){const n=sAe(t);qSe.plots.push({type:"bar",fill:lAe(HSe),data:n}),HSe++}function hAe(){if(0===qSe.plots.length)throw Error("No Plot to render, please provide a plot with some data");return qSe.title=UG(),jSe.build(USe,qSe,GSe,FSe)}function dAe(){return GSe}function pAe(){return USe}QH(XSe,"getChartDefaultThemeConfig"),QH(KSe,"getChartDefaultConfig"),QH(QSe,"getChartDefaultData"),QH(ZSe,"textSanitizer"),QH(JSe,"setTmpSVGG"),QH(eAe,"setOrientation"),QH(tAe,"setXAxisTitle"),QH(nAe,"setXAxisRangeData"),QH(rAe,"setXAxisBand"),QH(iAe,"setYAxisTitle"),QH(aAe,"setYAxisRangeData"),QH(oAe,"setYAxisRangeFromPlotData"),QH(sAe,"transformDataWithoutCategory"),QH(lAe,"getPlotColorFromPalette"),QH(cAe,"setLineData"),QH(uAe,"setBarData"),QH(hAe,"getDrawableElem"),QH(dAe,"getChartThemeConfig"),QH(pAe,"getChartConfig");var fAe=QH(function(){$G(),HSe=0,USe=KSe(),qSe={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},GSe=XSe(),WSe=GSe.plotColorPalette.split(",").map(e=>e.trim()),VSe=!1,YSe=!1},"clear"),gAe={getDrawableElem:hAe,clear:fAe,setAccTitle:BG,getAccTitle:FG,setDiagramTitle:HG,getDiagramTitle:UG,getAccDescription:jG,setAccDescription:zG,setOrientation:eAe,setXAxisTitle:tAe,setXAxisRangeData:nAe,setXAxisBand:rAe,setYAxisTitle:iAe,setYAxisRangeData:aAe,setLineData:cAe,setBarData:uAe,setTmpSVGG:JSe,getChartThemeConfig:dAe,getChartConfig:pAe},mAe=QH((e,t,n,r)=>{const i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig();function s(e){return"top"===e?"text-before-edge":"middle"}function l(e){return"left"===e?"start":"right"===e?"end":"middle"}function c(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}QH(s,"getDominantBaseLine"),QH(l,"getTextAnchor"),QH(c,"getTextTransformation"),eU.debug("Rendering xychart chart\n"+e);const u=Ate(t),h=u.append("g").attr("class","main"),d=h.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");CG(u,o.height,o.width,!0),u.attr("viewBox",`0 0 ${o.width} ${o.height}`),d.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=i.getDrawableElem(),f={};function g(e){let t=h,n="";for(const[r]of e.entries()){let i=h;r>0&&f[n]&&(i=f[n]),n+=e[r],t=f[n],t||(t=f[n]=i.append("g").attr("class",e[r]))}return t}QH(g,"getGroup");for(const e of p){if(0===e.data.length)continue;const t=g(e.groupTexts);switch(e.type){case"rect":t.selectAll("rect").data(e.data).enter().append("rect").attr("x",e=>e.x).attr("y",e=>e.y).attr("width",e=>e.width).attr("height",e=>e.height).attr("fill",e=>e.fill).attr("stroke",e=>e.strokeFill).attr("stroke-width",e=>e.strokeWidth);break;case"text":t.selectAll("text").data(e.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",e=>e.fill).attr("font-size",e=>e.fontSize).attr("dominant-baseline",e=>s(e.verticalPos)).attr("text-anchor",e=>l(e.horizontalPos)).attr("transform",e=>c(e)).text(e=>e.text);break;case"path":t.selectAll("path").data(e.data).enter().append("path").attr("d",e=>e.path).attr("fill",e=>e.fill?e.fill:"none").attr("stroke",e=>e.strokeFill).attr("stroke-width",e=>e.strokeWidth)}}},"draw"),yAe={parser:TSe,db:gAe,renderer:{draw:mAe}},vAe=Object.freeze({__proto__:null,diagram:yAe}),bAe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],o=[1,22],s=[2,7],l=[1,26],c=[1,27],u=[1,28],h=[1,29],d=[1,33],p=[1,34],f=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,24],b=[1,31],x=[1,32],w=[1,30],E=[1,39],k=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],C=[89,90],S=[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],A=[27,29],N=[1,70],I=[1,71],O=[1,72],L=[1,73],M=[1,74],R=[1,75],D=[1,76],P=[1,83],$=[1,80],B=[1,84],F=[1,85],z=[1,86],j=[1,87],H=[1,88],U=[1,89],G=[1,90],q=[1,91],W=[1,92],V=[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],X=[1,101],K=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Q=[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],Z=[1,110],J=[1,106],ee=[1,107],te=[1,108],ne=[1,109],re=[1,111],ie=[1,116],ae=[1,117],oe=[1,114],se=[1,115],le={trace:QH(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:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection("TB");break;case 18:r.setDirection("BT");break;case 19:r.setDirection("RL");break;case 20:r.setDirection("LR");break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:case 65:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},"anonymous"),table:[{3:1,4:2,6:t,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:t,9:n,11:r,13:i},{1:[2,2]},{4:17,5:o,7:13,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:o,7:42,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:43,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:44,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:45,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:46,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:47,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:48,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:49,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:50,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:_,89:E,90:k},{30:63,33:62,75:_,89:E,90:k},{30:64,33:62,75:_,89:E,90:k},e(C,[2,29]),e(C,[2,30]),e(C,[2,31]),e(C,[2,32]),e(C,[2,33]),e(C,[2,34]),e(S,[2,81]),e(S,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(A,[2,79]),e(A,[2,80]),{27:[1,67],29:[1,68]},e(A,[2,85]),e(A,[2,86]),{62:69,65:N,66:I,67:O,68:L,69:M,70:R,71:D},{62:77,65:N,66:I,67:O,68:L,69:M,70:R,71:D},{30:78,33:62,75:_,89:E,90:k},{73:79,75:P,76:$,78:81,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},e(V,[2,60]),e(V,[2,62]),{73:93,75:P,76:$,78:81,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},{30:94,33:62,75:_,76:$,89:E,90:k},{5:[1,95]},{30:96,33:62,75:_,89:E,90:k},{5:[1,97]},{30:98,33:62,75:_,89:E,90:k},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(T,[2,59],{76:$}),e(T,[2,64],{76:X}),{33:103,75:[1,102],89:E,90:k},e(K,[2,65],{79:104,75:P,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W}),e(Q,[2,67]),e(Q,[2,69]),e(Q,[2,70]),e(Q,[2,71]),e(Q,[2,72]),e(Q,[2,73]),e(Q,[2,74]),e(Q,[2,75]),e(Q,[2,76]),e(Q,[2,77]),e(Q,[2,78]),e(T,[2,57],{76:X}),e(T,[2,58],{76:$}),{5:Z,28:105,31:J,34:ee,36:te,38:ne,40:re},{27:[1,112],76:$},{5:ie,40:ae,56:113,57:oe,59:se},{27:[1,118],76:$},{33:119,89:E,90:k},{33:120,89:E,90:k},{75:P,78:121,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},e(V,[2,61]),e(V,[2,63]),e(Q,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:J,34:ee,36:te,38:ne,40:re},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:ie,40:ae,56:130,57:oe,59:se},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(K,[2,66],{79:104,75:P,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W}),{33:132,89:E,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:Z,28:145,31:J,34:ee,36:te,38:ne,40:re},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:ie,40:ae,56:152,57:oe,59:se},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:Z,28:159,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:160,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:161,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:162,31:J,34:ee,36:te,38:ne,40:re},{5:ie,40:ae,56:163,57:oe,59:se},{5:ie,40:ae,56:164,57:oe,59:se},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ce=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){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:case 58:case 65: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:case 14:case 15:case 56: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:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");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 66:return"qString";case 67:return t.yytext=t.yytext.trim(),89;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 e}();function ue(){this.yy={}}return le.lexer=ce,QH(ue,"Parser"),ue.prototype=le,le.Parser=ue,new ue}();bAe.parser=bAe;var xAe=bAe,wAe=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:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=BG,this.getAccTitle=FG,this.setAccDescription=zG,this.getAccDescription=jG,this.setDiagramTitle=HG,this.getDiagramTitle=UG,this.getConfig=QH(()=>WG().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{QH(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,t){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=e)}setNewReqText(e){void 0!==this.latestRequirement&&(this.latestRequirement.text=e)}setNewReqRisk(e){void 0!==this.latestRequirement&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),eU.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){void 0!==this.latestElement&&(this.latestElement.type=e)}setNewElementDocRef(e){void 0!==this.latestElement&&(this.latestElement.docRef=e)}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,$G()}setCssStyle(e,t){for(const n of e){const e=this.requirements.get(n)??this.elements.get(n);if(!t||!e)return;for(const n of t)n.includes(",")?e.cssStyles.push(...n.split(",")):e.cssStyles.push(n)}}setClass(e,t){for(const n of e){const e=this.requirements.get(n)??this.elements.get(n);if(e)for(const n of t){e.classes.push(n);const t=this.classes.get(n)?.styles;t&&e.cssStyles.push(...t)}}}defineClass(e,t){for(const n of e){let e=this.classes.get(n);void 0===e&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t&&t.forEach(function(t){if(/color/.exec(t)){const n=t.replace("fill","bgFill");e.textStyles.push(n)}e.styles.push(t)}),this.requirements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))}),this.elements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))})}}getClasses(){return this.classes}getData(){const e=WG(),t=[],n=[];for(const n of this.requirements.values()){const r=n;r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(" "),r.shape="requirementBox",r.look=e.look,t.push(r)}for(const n of this.elements.values()){const r=n;r.shape="requirementBox",r.look=e.look,r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(" "),t.push(r)}for(const t of this.relations){let r=0;const i=t.type===this.Relationships.CONTAINS,a={id:`${t.src}-${t.dst}-${r}`,start:this.requirements.get(t.src)?.name??this.elements.get(t.src)?.name,end:this.requirements.get(t.dst)?.name??this.elements.get(t.dst)?.name,label:`<<${t.type}>>`,classes:"relationshipLine",style:["fill:none",i?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:i?"normal":"dashed",arrowTypeStart:i?"requirement_contains":"",arrowTypeEnd:i?"":"requirement_arrow",look:e.look};n.push(a),r++}return{nodes:t,edges:n,other:{},config:e,direction:this.getDirection()}}},EAe=QH(e=>`\n\n marker {\n fill: ${e.relationColor};\n stroke: ${e.relationColor};\n }\n\n marker.cross {\n stroke: ${e.lineColor};\n }\n\n svg {\n font-family: ${e.fontFamily};\n font-size: ${e.fontSize};\n }\n\n .reqBox {\n fill: ${e.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${e.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${e.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${e.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${e.relationLabelColor};\n }\n .divider {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n`,"getStyles"),kAe={};ZH(kAe,{draw:()=>TAe});var TAe=QH(async function(e,t,n,r){eU.info("REF0:"),eU.info("Drawing requirement diagram (unified)",t);const{securityLevel:i,state:a,layout:o}=WG(),s=r.db.getData(),l=she(t,i);s.type=r.type,s.layoutAlgorithm=Cte(o),s.nodeSpacing=a?.nodeSpacing??50,s.rankSpacing=a?.rankSpacing??50,s.markers=["requirement_contains","requirement_arrow"],s.diagramId=t,await _te(s,l);P5.insertTitle(l,"requirementDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),lhe(l,8,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),_Ae={parser:xAe,get db(){return new wAe},renderer:kAe,styles:EAe},CAe=Object.freeze({__proto__:null,diagram:_Ae}),SAe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,13],l=[1,14],c=[1,16],u=[1,17],h=[1,18],d=[1,24],p=[1,25],f=[1,26],g=[1,27],m=[1,28],y=[1,29],v=[1,30],b=[1,31],x=[1,32],w=[1,33],E=[1,34],k=[1,35],T=[1,36],_=[1,37],C=[1,38],S=[1,39],A=[1,41],N=[1,42],I=[1,43],O=[1,44],L=[1,45],M=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],D=[4,5,16,50,52,53],P=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],z=[68,69,70],j=[1,122],H={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",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",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,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],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 11:case 12:case 62:this.$=a[s];break;case 15:a[s].type="createParticipant",this.$=a[s];break;case 16:a[s-1].unshift({type:"boxStart",boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:"boxEnd",boxText:a[s-2]}),this.$=a[s-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 29:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 30:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:a[s-1].unshift({type:"loopStart",loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 35:a[s-1].unshift({type:"rectStart",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:"rectEnd",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:"optStart",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:"altStart",altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:"parStart",parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:"parStart",parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:"criticalStart",criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:"breakStart",breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:"breakEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 43:this.$=a[s-3].concat([{type:"option",optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 45:this.$=a[s-3].concat([{type:"and",parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 47:this.$=a[s-3].concat([{type:"else",altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 48:a[s-3].draw="participant",a[s-3].type="addParticipant",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 49:a[s-1].draw="participant",a[s-1].type="addParticipant",this.$=a[s-1];break;case 50:a[s-3].draw="actor",a[s-3].type="addParticipant",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 51:a[s-1].draw="actor",a[s-1].type="addParticipant",this.$=a[s-1];break;case 52:a[s-1].type="destroyParticipant",this.$=a[s-1];break;case 53:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 54:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 55:this.$=[a[s-1],{type:"addLinks",actor:a[s-1].actor,text:a[s]}];break;case 56:this.$=[a[s-1],{type:"addALink",actor:a[s-1].actor,text:a[s]}];break;case 57:this.$=[a[s-1],{type:"addProperties",actor:a[s-1].actor,text:a[s]}];break;case 58:this.$=[a[s-1],{type:"addDetails",actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-2],a[s]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 66:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 67:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 68:this.$={type:"addParticipant",actor:a[s]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(a[s].trim().substring(1))}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,12:12,13:s,14:l,17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},e(R,[2,5]),{9:47,12:12,13:s,14:l,17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},e(R,[2,7]),e(R,[2,8]),e(R,[2,14]),{12:48,50:_,52:C,53:S},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:M},{22:55,70:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(R,[2,29]),e(R,[2,30]),{32:[1,61]},{34:[1,62]},e(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:M},{22:72,70:M},{22:73,70:M},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:M},{22:90,70:M},{22:91,70:M},{22:92,70:M},e([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),e(R,[2,6]),e(R,[2,15]),e(D,[2,9],{10:93}),e(R,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},e(R,[2,21]),{5:[1,97]},{5:[1,98]},e(R,[2,24]),e(R,[2,25]),e(R,[2,26]),e(R,[2,27]),e(R,[2,28]),e(R,[2,31]),e(R,[2,32]),e(P,i,{7:99}),e(P,i,{7:100}),e(P,i,{7:101}),e($,i,{40:102,7:103}),e(B,i,{42:104,7:105}),e(B,i,{7:105,42:106}),e(F,i,{45:107,7:108}),e(P,i,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:M},e(z,[2,69]),e(z,[2,70]),e(z,[2,71]),e(z,[2,72]),e(z,[2,73]),e(z,[2,74]),e(z,[2,75]),e(z,[2,76]),e(z,[2,77]),e(z,[2,78]),{22:118,70:M},{22:120,58:119,70:M},{70:[2,63]},{70:[2,64]},{56:121,81:j},{56:123,81:j},{56:124,81:j},{56:125,81:j},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:_,52:C,53:S},{5:[1,131]},e(R,[2,19]),e(R,[2,20]),e(R,[2,22]),e(R,[2,23]),{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,132],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,133],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,134],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,135]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,46],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,49:[1,136],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,137]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,44],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,48:[1,138],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,139]},{16:[1,140]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,42],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,47:[1,141],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,142],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{15:[1,143]},e(R,[2,49]),{15:[1,144]},e(R,[2,51]),e(R,[2,52]),{22:145,70:M},{22:146,70:M},{56:147,81:j},{56:148,81:j},{56:149,81:j},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},e(R,[2,16]),e(D,[2,10]),{12:151,50:_,52:C,53:S},e(D,[2,12]),e(D,[2,13]),e(R,[2,18]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{15:[1,152]},e(R,[2,38]),{15:[1,153]},e(R,[2,39]),e(R,[2,40]),{15:[1,154]},e(R,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:j},{56:158,81:j},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:M},e(D,[2,11]),e($,i,{7:103,40:160}),e(B,i,{7:105,42:161}),e(F,i,{7:108,45:162}),e(R,[2,48]),e(R,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},U=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return t.yytext=t.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return t.yytext=t.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/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,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return e}();function G(){this.yy={}}return H.lexer=U,QH(G,"Parser"),G.prototype=H,H.Parser=G,new G}();SAe.parser=SAe;var AAe=SAe,NAe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},IAe={FILLED:0,OPEN:1},OAe={LEFTOF:0,RIGHTOF:1,OVER:2},LAe=class{constructor(){this.state=new Mhe(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=BG,this.setAccDescription=zG,this.setDiagramTitle=HG,this.getAccTitle=FG,this.getAccDescription=jG,this.getDiagramTitle=UG,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(WG().wrap),this.LINETYPE=NAe,this.ARROWTYPE=IAe,this.PLACEMENT=OAe}static{QH(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r){let i=this.state.records.currentBox;const a=this.state.records.actors.get(e);if(a){if(this.state.records.currentBox&&a.box&&this.state.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:this.state.records.currentBox,a.box=i,a&&t===a.name&&null==n)return}if(null==n?.text&&(n={text:t,type:r}),null!=r&&null!=n.text||(n={text:t,type:r}),this.state.records.actors.set(e,{box:i,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},t}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??"",wrap:n?.wrap??this.autoWrap(),type:r,activate:i}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.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(e){return this.state.records.actors.get(e)}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(e){this.state.records.wrapEnabled=e}extractWrap(e){if(void 0===e)return{};e=e.trim();const t=null!==/^:?wrap:/.exec(e)||null===/^:?nowrap:/.exec(e)&&void 0;return{cleanedText:(void 0===t?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:WG().sequence?.wrap??!1}clear(){this.state.reset(),$G()}parseMessage(e){const t=e.trim(),{wrap:n,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:n};return eU.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",n)||(n="transparent",r=e.trim());else{const t=(new Option).style;t.color=n,t.color!==n&&(n="transparent",r=e.trim())}const{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?iG(a,WG()):void 0,color:n,wrap:i}}addNote(e,t,n){const r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const n=this.getActor(e);try{let e=iG(t.text,WG());e=e.replace(/=/g,"="),e=e.replace(/&/g,"&");const r=JSON.parse(e);this.insertLinks(n,r)}catch(e){eU.error("error while parsing actor link text",e)}}addALink(e,t){const n=this.getActor(e);try{const e={};let r=iG(t.text,WG());const i=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const a=r.slice(0,i-1).trim(),o=r.slice(i+1).trim();e[a]=o,this.insertLinks(n,e)}catch(e){eU.error("error while parsing actor link text",e)}}insertLinks(e,t){if(null==e.links)e.links=t;else for(const n in t)e.links[n]=t[n]}addProperties(e,t){const n=this.getActor(e);try{const e=iG(t.text,WG()),r=JSON.parse(e);this.insertProperties(n,r)}catch(e){eU.error("error while parsing actor properties text",e)}}insertProperties(e,t){if(null==e.properties)e.properties=t;else for(const n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const n=this.getActor(e),r=document.getElementById(t.text);try{const e=r.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(n,t.properties),t.links&&this.insertLinks(n,t.links)}catch(e){eU.error("error while parsing actor details text",e)}}getActorProperty(e,t){if(void 0!==e?.properties)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"setAccTitle":BG(e.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType)}}getConfig(){return WG().sequence}},MAe=QH(e=>`.actor {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${e.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${e.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${e.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${e.signalColor};\n }\n\n #arrowhead path {\n fill: ${e.signalColor};\n stroke: ${e.signalColor};\n }\n\n .sequenceNumber {\n fill: ${e.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${e.signalColor};\n }\n\n #crosshead path {\n fill: ${e.signalColor};\n stroke: ${e.signalColor};\n }\n\n .messageText {\n fill: ${e.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${e.labelBoxBorderColor};\n fill: ${e.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${e.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${e.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${e.labelBoxBorderColor};\n fill: ${e.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${e.noteBorderColor};\n fill: ${e.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${e.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .activation1 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .activation2 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${e.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n stroke-width: 2px;\n }\n`,"getStyles"),RAe="actor-top",DAe="actor-bottom",PAe="actor-man",$Ae=QH(function(e,t){return Ace(e,t)},"drawRect"),BAe=QH(function(e,t,n,r,i){if(void 0===t.links||null===t.links||0===Object.keys(t.links).length)return{height:0,width:0};const a=t.links,o=t.actorCnt,s=t.rectData;var l="none";i&&(l="block !important");const c=e.append("g");c.attr("id","actor"+o+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var u="";void 0!==s.class&&(u=" "+s.class);let h=s.width>n?s.width:n;const d=c.append("rect");if(d.attr("class","actorPopupMenuPanel"+u),d.attr("x",s.x),d.attr("y",s.height),d.attr("fill",s.fill),d.attr("stroke",s.stroke),d.attr("width",h),d.attr("height",s.height),d.attr("rx",s.rx),d.attr("ry",s.ry),null!=a){var p=20;for(let e in a){var f=c.append("a"),g=OY(a[e]);f.attr("xlink:href",g),f.attr("target","_blank"),cNe(r)(e,f,s.x+10,s.height+p,h,20,{class:"actor"},r),p+=30}}return d.attr("height",p),{height:s.height+p,width:h}},"drawPopup"),FAe=QH(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),zAe=QH(async function(e,t,n=null){let r=e.append("foreignObject");const i=await EG(t.text,GU()),a=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(a.height)).attr("width",Math.round(a.width)),"noteText"===t.class){const n=e.node().firstChild;n.setAttribute("height",a.height+2*t.textMargin);const i=n.getBBox();r.attr("x",Math.round(i.x+i.width/2-a.width/2)).attr("y",Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:e,stopx:i,starty:o}=n;if(e>i){const t=e;e=i,i=t}r.attr("x",Math.round(e+Math.abs(e-i)/2-a.width/2)),"loopText"===t.class?r.attr("y",Math.round(o)):r.attr("y",Math.round(o-a.height))}return[r]},"drawKatex"),jAe=QH(function(e,t){let n=0,r=0;const i=t.text.split(kG.lineBreakRegex),[a,o]=R5(t.fontSize);let s=[],l=0,c=QH(()=>t.y,"yfunc");if(void 0!==t.valign&&void 0!==t.textMargin&&t.textMargin>0)switch(t.valign){case"top":case"start":c=QH(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":c=QH(()=>Math.round(t.y+(n+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":c=QH(()=>Math.round(t.y+(n+r+2*t.textMargin)-t.textMargin),"yfunc")}if(void 0!==t.anchor&&void 0!==t.textMargin&&void 0!==t.width)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"}for(let[u,h]of i.entries()){void 0!==t.textMargin&&0===t.textMargin&&void 0!==a&&(l=u*a);const i=e.append("text");i.attr("x",t.x),i.attr("y",c()),void 0!==t.anchor&&i.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),void 0!==t.fontFamily&&i.style("font-family",t.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==t.fontWeight&&i.style("font-weight",t.fontWeight),void 0!==t.fill&&i.attr("fill",t.fill),void 0!==t.class&&i.attr("class",t.class),void 0!==t.dy?i.attr("dy",t.dy):0!==l&&i.attr("dy",l);const d=h||"​";if(t.tspan){const e=i.append("tspan");e.attr("x",t.x),void 0!==t.fill&&e.attr("fill",t.fill),e.text(d)}else i.text(d);void 0!==t.valign&&void 0!==t.textMargin&&t.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),s.push(i)}return s},"drawText"),HAe=QH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}QH(n,"genPoints");const r=e.append("polygon");return r.attr("points",n(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,jAe(e,t),r},"drawLabel"),UAe=-1,GAe=QH((e,t,n,r)=>{e.select&&n.forEach(n=>{const i=t.get(n),a=e.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):r.mirrorActors&&a.attr("y2",i.stopy)})},"fixLifeLineHeights"),qAe=QH(function(e,t,n,r){const i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height,s=e.append("g").lower();var l=s;r||(UAe++,Object.keys(t.links||{}).length&&!n.forceMenus&&l.attr("onclick",FAe(`actor${UAe}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+UAe).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=s.append("g"),t.actorCnt=UAe,null!=t.links&&l.attr("id","root-"+UAe));const c=Mce();var u="actor";t.properties?.class?u=t.properties.class:c.fill="#eaeaea",u+=r?` ${DAe}`:` ${RAe}`,c.x=t.x,c.y=i,c.width=t.width,c.height=t.height,c.class=u,c.rx=3,c.ry=3,c.name=t.name;const h=$Ae(l,c);if(t.rectData=c,t.properties?.icon){const e=t.properties.icon.trim();"@"===e.charAt(0)?Lce(l,c.x+c.width-20,c.y+10,e.substr(1)):Oce(l,c.x+c.width-20,c.y+10,e)}lNe(n,xG(t.description))(t.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},n);let d=t.height;if(h.node){const e=h.node().getBBox();t.height=e.height,d=e.height}return d},"drawActorTypeParticipant"),WAe=QH(function(e,t,n,r){const i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+80,s=e.append("g").lower();r||(UAe++,s.append("line").attr("id","actor"+UAe).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=UAe);const l=e.append("g");let c=PAe;c+=r?` ${DAe}`:` ${RAe}`,l.attr("class",c),l.attr("name",t.name);const u=Mce();u.x=t.x,u.y=i,u.fill="#eaeaea",u.width=t.width,u.height=t.height,u.class="actor",u.rx=3,u.ry=3,l.append("line").attr("id","actor-man-torso"+UAe).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+UAe).attr("x1",a-18).attr("y1",i+33).attr("x2",a+18).attr("y2",i+33),l.append("line").attr("x1",a-18).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+18-2).attr("y2",i+60);const h=l.append("circle");h.attr("cx",t.x+t.width/2),h.attr("cy",i+10),h.attr("r",15),h.attr("width",t.width),h.attr("height",t.height);const d=l.node().getBBox();return t.height=d.height,lNe(n,xG(t.description))(t.description,l,u.x,u.y+35,u.width,u.height,{class:`actor ${PAe}`},n),t.height},"drawActorTypeActor"),VAe=QH(async function(e,t,n,r){switch(t.type){case"actor":return await WAe(e,t,n,r);case"participant":return await qAe(e,t,n,r)}},"drawActor"),YAe=QH(function(e,t,n){const r=e.append("g");ZAe(r,t),t.name&&lNe(n)(t.name,r,t.x,t.y+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},n),r.lower()},"drawBox"),XAe=QH(function(e){return e.append("g")},"anchorElement"),KAe=QH(function(e,t,n,r,i){const a=Mce(),o=t.anchored;a.x=t.startx,a.y=t.starty,a.class="activation"+i%3,a.width=t.stopx-t.startx,a.height=n-t.starty,$Ae(o,a)},"drawActivation"),QAe=QH(async function(e,t,n,r){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:s,messageFontFamily:l,messageFontSize:c,messageFontWeight:u}=r,h=e.append("g"),d=QH(function(e,t,n,r){return h.append("line").attr("x1",e).attr("y1",t).attr("x2",n).attr("y2",r).attr("class","loopLine")},"drawLoopLine");d(t.startx,t.starty,t.stopx,t.starty),d(t.stopx,t.starty,t.stopx,t.stopy),d(t.startx,t.stopy,t.stopx,t.stopy),d(t.startx,t.starty,t.startx,t.stopy),void 0!==t.sections&&t.sections.forEach(function(e){d(t.startx,e.y,t.stopx,e.y).style("stroke-dasharray","3, 3")});let p=Rce();p.text=n,p.x=t.startx,p.y=t.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=s||50,p.height=o||20,p.textMargin=a,p.class="labelText",HAe(h,p),p=oNe(),p.text=t.title,p.x=t.startx+s/2+(t.stopx-t.startx)/2,p.y=t.starty+i+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.wrap=!0;let f=xG(p.text)?await zAe(h,p,t):jAe(h,p);if(void 0!==t.sectionTitles)for(const[e,n]of Object.entries(t.sectionTitles))if(n.message){p.text=n.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[e].y+i+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.wrap=t.wrap,xG(p.text)?(t.starty=t.sections[e].y,await zAe(h,p,t)):jAe(h,p);let r=Math.round(f.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));t.sections[e].height+=r-(i+a)}return t.height=Math.round(t.stopy-t.starty),h},"drawLoop"),ZAe=QH(function(e,t){Nce(e,t)},"drawBackgroundRect"),JAe=QH(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),eNe=QH(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),tNe=QH(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),nNe=QH(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),rNe=QH(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),iNe=QH(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),aNe=QH(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),oNe=QH(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),sNe=QH(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),lNe=function(){function e(e,t,n,r,a,o,s){i(t.append("text").attr("x",n+a/2).attr("y",r+o/2+5).style("text-anchor","middle").text(e),s)}function t(e,t,n,r,a,o,s,l){const{actorFontSize:c,actorFontFamily:u,actorFontWeight:h}=l,[d,p]=R5(c),f=e.split(kG.lineBreakRegex);for(let e=0;ee.height||0))+(0===this.loops.length?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(0===this.messages.length?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(0===this.notes.length?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:QH(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:QH(function(e){this.boxes.push(e)},"addBox"),addActor:QH(function(e){this.actors.push(e)},"addActor"),addLoop:QH(function(e){this.loops.push(e)},"addLoop"),addMessage:QH(function(e){this.messages.push(e)},"addMessage"),addNote:QH(function(e){this.notes.push(e)},"addNote"),lastActor:QH(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:QH(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:QH(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:QH(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:QH(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,ENe(WG())},"init"),updateVal:QH(function(e,t,n,r){void 0===e[t]?e[t]=n:e[t]=r(n,e[t])},"updateVal"),updateBounds:QH(function(e,t,n,r){const i=this;let a=0;function o(o){return QH(function(s){a++;const l=i.sequenceItems.length-a+1;i.updateVal(s,"starty",t-l*hNe.boxMargin,Math.min),i.updateVal(s,"stopy",r+l*hNe.boxMargin,Math.max),i.updateVal(dNe.data,"startx",e-l*hNe.boxMargin,Math.min),i.updateVal(dNe.data,"stopx",n+l*hNe.boxMargin,Math.max),"activation"!==o&&(i.updateVal(s,"startx",e-l*hNe.boxMargin,Math.min),i.updateVal(s,"stopx",n+l*hNe.boxMargin,Math.max),i.updateVal(dNe.data,"starty",t-l*hNe.boxMargin,Math.min),i.updateVal(dNe.data,"stopy",r+l*hNe.boxMargin,Math.max))},"updateItemBounds")}QH(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:QH(function(e,t,n,r){const i=kG.getMin(e,n),a=kG.getMax(e,n),o=kG.getMin(t,r),s=kG.getMax(t,r);this.updateVal(dNe.data,"startx",i,Math.min),this.updateVal(dNe.data,"starty",o,Math.min),this.updateVal(dNe.data,"stopx",a,Math.max),this.updateVal(dNe.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),newActivation:QH(function(e,t,n){const r=n.get(e.from),i=kNe(e.from).length||0,a=r.x+r.width/2+(i-1)*hNe.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+hNe.activationWidth,stopy:void 0,actor:e.from,anchored:uNe.anchorElement(t)})},"newActivation"),endActivation:QH(function(e){const t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:QH(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:QH(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:QH(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:QH(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:QH(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:dNe.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:QH(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:QH(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:QH(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=kG.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:QH(function(){return this.verticalPos},"getVerticalPos"),getBounds:QH(function(){return{bounds:this.data,models:this.models}},"getBounds")},pNe=QH(async function(e,t){dNe.bumpVerticalPos(hNe.boxMargin),t.height=hNe.boxMargin,t.starty=dNe.getVerticalPos();const n=Mce();n.x=t.startx,n.y=t.starty,n.width=t.width||hNe.width,n.class="note";const r=e.append("g"),i=uNe.drawRect(r,n),a=Rce();a.x=t.startx,a.y=t.starty,a.width=n.width,a.dy="1em",a.text=t.message,a.class="noteText",a.fontFamily=hNe.noteFontFamily,a.fontSize=hNe.noteFontSize,a.fontWeight=hNe.noteFontWeight,a.anchor=hNe.noteAlign,a.textMargin=hNe.noteMargin,a.valign="center";const o=xG(a.text)?await zAe(r,a):jAe(r,a),s=Math.round(o.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));i.attr("height",s+2*hNe.noteMargin),t.height+=s+2*hNe.noteMargin,dNe.bumpVerticalPos(s+2*hNe.noteMargin),t.stopy=t.starty+s+2*hNe.noteMargin,t.stopx=t.startx+n.width,dNe.insert(t.startx,t.starty,t.stopx,t.stopy),dNe.models.addNote(t)},"drawNote"),fNe=QH(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),gNe=QH(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),mNe=QH(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function yNe(e,t){dNe.bumpVerticalPos(10);const{startx:n,stopx:r,message:i}=t,a=kG.splitBreaks(i).length,o=xG(i),s=o?await wG(i,WG()):P5.calculateTextDimensions(i,fNe(hNe));if(!o){const e=s.height/a;t.height+=e,dNe.bumpVerticalPos(e)}let l,c=s.height-10;const u=s.width;if(n===r){l=dNe.getVerticalPos()+c,hNe.rightAngles||(c+=hNe.boxMargin,l=dNe.getVerticalPos()+c),c+=30;const e=kG.getMax(u/2,hNe.width/2);dNe.insert(n-e,dNe.getVerticalPos()-10+c,r+e,dNe.getVerticalPos()+30+c)}else c+=hNe.boxMargin,l=dNe.getVerticalPos()+c,dNe.insert(n,l-10,r,l);return dNe.bumpVerticalPos(c),t.height+=c,t.stopy=t.starty+t.height,dNe.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}QH(yNe,"boundMessage");var vNe=QH(async function(e,t,n,r){const{startx:i,stopx:a,starty:o,message:s,type:l,sequenceIndex:c,sequenceVisible:u}=t,h=P5.calculateTextDimensions(s,fNe(hNe)),d=Rce();d.x=i,d.y=o+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=s,d.fontFamily=hNe.messageFontFamily,d.fontSize=hNe.messageFontSize,d.fontWeight=hNe.messageFontWeight,d.anchor=hNe.messageAlign,d.valign="center",d.textMargin=hNe.wrapPadding,d.tspan=!1,xG(d.text)?await zAe(e,d,{startx:i,stopx:a,starty:n}):jAe(e,d);const p=h.width;let f;i===a?f=hNe.rightAngles?e.append("path").attr("d",`M ${i},${n} H ${i+kG.getMax(hNe.width/2,p/2)} V ${n+25} H ${i}`):e.append("path").attr("d","M "+i+","+n+" C "+(i+60)+","+(n-10)+" "+(i+60)+","+(n+30)+" "+i+","+(n+20)):(f=e.append("line"),f.attr("x1",i),f.attr("y1",n),f.attr("x2",a),f.attr("y2",n)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");let g="";hNe.arrowMarkerAbsolute&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","none"),f.style("fill","none"),l!==r.db.LINETYPE.SOLID&&l!==r.db.LINETYPE.DOTTED||f.attr("marker-end","url("+g+"#arrowhead)"),l!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(f.attr("marker-start","url("+g+"#arrowhead)"),f.attr("marker-end","url("+g+"#arrowhead)")),l!==r.db.LINETYPE.SOLID_POINT&&l!==r.db.LINETYPE.DOTTED_POINT||f.attr("marker-end","url("+g+"#filled-head)"),l!==r.db.LINETYPE.SOLID_CROSS&&l!==r.db.LINETYPE.DOTTED_CROSS||f.attr("marker-end","url("+g+"#crosshead)"),(u||hNe.showSequenceNumbers)&&(f.attr("marker-start","url("+g+"#sequencenumber)"),e.append("text").attr("x",i).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))},"drawMessage"),bNe=QH(function(e,t,n,r,i,a,o){let s,l=0,c=0,u=0;for(const e of r){const r=t.get(e),a=r.box;s&&s!=a&&(o||dNe.models.addBox(s),c+=hNe.boxMargin+s.margin),a&&a!=s&&(o||(a.x=l+c,a.y=i),c+=a.margin),r.width=r.width||hNe.width,r.height=kG.getMax(r.height||hNe.height,hNe.height),r.margin=r.margin||hNe.actorMargin,u=kG.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=l+c,r.starty=dNe.getVerticalPos(),dNe.insert(r.x,i,r.x+r.width,r.height),l+=r.width+c,r.box&&(r.box.width=l+a.margin-r.box.x),c=r.margin,s=r.box,dNe.models.addActor(r)}s&&!o&&dNe.models.addBox(s),dNe.bumpVerticalPos(u)},"addActorRenderingData"),xNe=QH(async function(e,t,n,r){if(r){let r=0;dNe.bumpVerticalPos(2*hNe.boxMargin);for(const i of n){const n=t.get(i);n.stopy||(n.stopy=dNe.getVerticalPos());const a=await uNe.drawActor(e,n,hNe,!0);r=kG.getMax(r,a)}dNe.bumpVerticalPos(r+hNe.boxMargin)}else for(const r of n){const n=t.get(r);await uNe.drawActor(e,n,hNe,!1)}},"drawActors"),wNe=QH(function(e,t,n,r){let i=0,a=0;for(const o of n){const n=t.get(o),s=NNe(n),l=uNe.drawPopup(e,n,s,hNe,hNe.forceMenus,r);l.height>i&&(i=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),ENe=QH(function(e){pU(hNe,e),e.fontFamily&&(hNe.actorFontFamily=hNe.noteFontFamily=hNe.messageFontFamily=e.fontFamily),e.fontSize&&(hNe.actorFontSize=hNe.noteFontSize=hNe.messageFontSize=e.fontSize),e.fontWeight&&(hNe.actorFontWeight=hNe.noteFontWeight=hNe.messageFontWeight=e.fontWeight)},"setConf"),kNe=QH(function(e){return dNe.activations.filter(function(t){return t.actor===e})},"actorActivations"),TNe=QH(function(e,t){const n=t.get(e),r=kNe(e);return[r.reduce(function(e,t){return kG.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return kG.getMax(e,t.stopx)},n.x+n.width/2+1)]},"activationBounds");function _Ne(e,t,n,r,i){dNe.bumpVerticalPos(n);let a=r;if(t.id&&t.message&&e[t.id]){const n=e[t.id].width,i=fNe(hNe);t.message=P5.wrapLabel(`[${t.message}]`,n-2*hNe.wrapPadding,i),t.width=n,t.wrap=!0;const o=P5.calculateTextDimensions(t.message,i),s=kG.getMax(o.height,hNe.labelBoxHeight);a=r+s,eU.debug(`${s} - ${t.message}`)}i(t),dNe.bumpVerticalPos(a)}function CNe(e,t,n,r,i,a,o){function s(n,r){n.x{e.add(t.from),e.add(t.to)}),f=f.filter(t=>e.has(t))}bNe(c,u,h,f,0,g,!1);const x=await MNe(g,u,b,r);function w(e,t){const n=dNe.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),uNe.drawActivation(c,n,t,hNe,kNe(e.from).length),dNe.insert(n.startx,t-10,n.stopx,t)}uNe.insertArrowHead(c),uNe.insertArrowCrossHead(c),uNe.insertArrowFilledHead(c),uNe.insertSequenceNumber(c),QH(w,"activeEnd");let E=1,k=1;const T=[],_=[];let C=0;for(const e of g){let t,n,i;switch(e.type){case r.db.LINETYPE.NOTE:dNe.resetVerticalPos(),n=e.noteModel,await pNe(c,n);break;case r.db.LINETYPE.ACTIVE_START:dNe.newActivation(e,c,u);break;case r.db.LINETYPE.ACTIVE_END:w(e,dNe.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e));break;case r.db.LINETYPE.LOOP_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"loop",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin,e=>dNe.newLoop(void 0,e.message));break;case r.db.LINETYPE.RECT_END:t=dNe.endLoop(),_.push(t),dNe.models.addLoop(t),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos());break;case r.db.LINETYPE.OPT_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e));break;case r.db.LINETYPE.OPT_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"opt",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e));break;case r.db.LINETYPE.ALT_ELSE:_Ne(x,e,hNe.boxMargin+hNe.boxTextMargin,hNe.boxMargin,e=>dNe.addSectionToLoop(e));break;case r.db.LINETYPE.ALT_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"alt",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e)),dNe.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:_Ne(x,e,hNe.boxMargin+hNe.boxTextMargin,hNe.boxMargin,e=>dNe.addSectionToLoop(e));break;case r.db.LINETYPE.PAR_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"par",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:E=e.message.start||E,k=e.message.step||k,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e));break;case r.db.LINETYPE.CRITICAL_OPTION:_Ne(x,e,hNe.boxMargin+hNe.boxTextMargin,hNe.boxMargin,e=>dNe.addSectionToLoop(e));break;case r.db.LINETYPE.CRITICAL_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"critical",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:_Ne(x,e,hNe.boxMargin,hNe.boxMargin+hNe.boxTextMargin,e=>dNe.newLoop(e));break;case r.db.LINETYPE.BREAK_END:t=dNe.endLoop(),await uNe.drawLoop(c,t,"break",hNe),dNe.bumpVerticalPos(t.stopy-dNe.getVerticalPos()),dNe.models.addLoop(t);break;default:try{i=e.msgModel,i.starty=dNe.getVerticalPos(),i.sequenceIndex=E,i.sequenceVisible=r.db.showSequenceNumbers();const t=await yNe(0,i);CNe(e,i,t,C,u,h,d),T.push({messageModel:i,lineStartY:t}),dNe.models.addMessage(i)}catch(e){eU.error("error while drawing message",e)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(E+=k),C++}eU.debug("createdActors",h),eU.debug("destroyedActors",d),await xNe(c,u,f,!1);for(const e of T)await vNe(c,e.messageModel,e.lineStartY,r);hNe.mirrorActors&&await xNe(c,u,f,!0),_.forEach(e=>uNe.drawBackgroundRect(c,e)),GAe(c,u,f,hNe);for(const e of dNe.models.boxes)e.height=dNe.getVerticalPos()-e.y,dNe.insert(e.x,e.y,e.x+e.width,e.height),e.startx=e.x,e.starty=e.y,e.stopx=e.startx+e.width,e.stopy=e.starty+e.height,e.stroke="rgb(0,0,0, 0.5)",uNe.drawBox(c,e,hNe);y&&dNe.bumpVerticalPos(hNe.boxMargin);const S=wNe(c,u,f,l),{bounds:A}=dNe.getBounds();void 0===A.startx&&(A.startx=0),void 0===A.starty&&(A.starty=0),void 0===A.stopx&&(A.stopx=0),void 0===A.stopy&&(A.stopy=0);let N=A.stopy-A.starty;N{const n=fNe(hNe);let r=t.actorKeys.reduce((t,n)=>t+(e.get(n).width+(e.get(n).margin||0)),0);r-=2*hNe.boxTextMargin,t.wrap&&(t.name=P5.wrapLabel(t.name,r-2*hNe.wrapPadding,n));const a=P5.calculateTextDimensions(t.name,n);i=kG.getMax(a.height,i);const o=kG.getMax(r,a.width+2*hNe.wrapPadding);if(t.margin=hNe.boxTextMargin,re.textMaxHeight=i),kG.getMax(r,hNe.height)}QH(INe,"calculateActorMargins");var ONe=QH(async function(e,t,n){const r=t.get(e.from),i=t.get(e.to),a=r.x,o=i.x,s=e.wrap&&e.message;let l=xG(e.message)?await wG(e.message,WG()):P5.calculateTextDimensions(s?P5.wrapLabel(e.message,hNe.width,gNe(hNe)):e.message,gNe(hNe));const c={width:s?hNe.width:kG.getMax(hNe.width,l.width+2*hNe.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===n.db.PLACEMENT.RIGHTOF?(c.width=s?kG.getMax(hNe.width,l.width):kG.getMax(r.width/2+i.width/2,l.width+2*hNe.noteMargin),c.startx=a+(r.width+hNe.actorMargin)/2):e.placement===n.db.PLACEMENT.LEFTOF?(c.width=s?kG.getMax(hNe.width,l.width+2*hNe.noteMargin):kG.getMax(r.width/2+i.width/2,l.width+2*hNe.noteMargin),c.startx=a-c.width+(r.width-hNe.actorMargin)/2):e.to===e.from?(l=P5.calculateTextDimensions(s?P5.wrapLabel(e.message,kG.getMax(hNe.width,r.width),gNe(hNe)):e.message,gNe(hNe)),c.width=s?kG.getMax(hNe.width,r.width):kG.getMax(r.width,hNe.width,l.width+2*hNe.noteMargin),c.startx=a+(r.width-c.width)/2):(c.width=Math.abs(a+r.width/2-(o+i.width/2))+hNe.actorMargin,c.startx=a2,h=QH(e=>s?-e:e,"adjustValue");e.from===e.to?c=l:(e.activate&&!u&&(c+=h(hNe.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(c+=h(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(l-=h(3)));const d=[r,i,a,o],p=Math.abs(l-c);e.wrap&&e.message&&(e.message=P5.wrapLabel(e.message,kG.getMax(p+2*hNe.wrapPadding,hNe.width),fNe(hNe)));const f=P5.calculateTextDimensions(e.message,fNe(hNe));return{width:kG.getMax(e.wrap?0:f.width+2*hNe.wrapPadding,p+2*hNe.wrapPadding,hNe.width),height:0,startx:l,stopx:c,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,d),toBounds:Math.max.apply(null,d)}},"buildMessageModel"),MNe=QH(async function(e,t,n,r){const i={},a=[];let o,s,l;for(const n of e){switch(n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(o=a.pop(),i[o.id]=o,i[n.id]=o,a.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=a.pop(),i[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{const e=t.get(n.from?n.from:n.to.actor),r=kNe(n.from?n.from:n.to.actor).length,i=e.x+e.width/2+(r-1)*hNe.activationWidth/2,a={startx:i,stopx:i+hNe.activationWidth,actor:n.from,enabled:!0};dNe.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{const e=dNe.activations.map(e=>e.actor).lastIndexOf(n.from);dNe.activations.splice(e,1).splice(0,1)}}void 0!==n.placement?(s=await ONe(n,t,r),n.noteModel=s,a.forEach(e=>{o=e,o.from=kG.getMin(o.from,s.startx),o.to=kG.getMax(o.to,s.startx+s.width),o.width=kG.getMax(o.width,Math.abs(o.from-o.to))-hNe.labelBoxWidth})):(l=LNe(n,t,r),n.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(e=>{if(o=e,l.startx===l.stopx){const e=t.get(n.from),r=t.get(n.to);o.from=kG.getMin(e.x-l.width/2,e.x-e.width/2,o.from),o.to=kG.getMax(r.x+l.width/2,r.x+e.width/2,o.to),o.width=kG.getMax(o.width,Math.abs(o.to-o.from))-hNe.labelBoxWidth}else o.from=kG.getMin(l.startx,o.from),o.to=kG.getMax(l.stopx,o.to),o.width=kG.getMax(o.width,l.width)-hNe.labelBoxWidth}))}return dNe.activations=[],eU.debug("Loop type widths:",i),i},"calculateLoopBounds"),RNe={bounds:dNe,drawActors:xNe,drawActorsPopup:wNe,setConf:ENe,draw:SNe},DNe={parser:AAe,get db(){return new LAe},renderer:RNe,styles:MAe,init:QH(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,VG({sequence:{wrap:e.wrap}}))},"init")},PNe=Object.freeze({__proto__:null,diagram:DNe}),$Ne=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,18],n=[1,19],r=[1,20],i=[1,41],a=[1,42],o=[1,26],s=[1,24],l=[1,25],c=[1,32],u=[1,33],h=[1,34],d=[1,45],p=[1,35],f=[1,36],g=[1,37],m=[1,38],y=[1,27],v=[1,28],b=[1,29],x=[1,30],w=[1,31],E=[1,44],k=[1,46],T=[1,43],_=[1,47],C=[1,9],S=[1,8,9],A=[1,58],N=[1,59],I=[1,60],O=[1,61],L=[1,62],M=[1,63],R=[1,64],D=[1,8,9,41],P=[1,76],$=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],B=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],F=[13,58,84,99,101,102],z=[13,58,71,72,84,99,101,102],j=[13,58,66,67,68,69,70,84,99,101,102],H=[1,98],U=[1,115],G=[1,107],q=[1,113],W=[1,108],V=[1,109],Y=[1,110],X=[1,111],K=[1,112],Q=[1,114],Z=[22,58,59,80,84,85,86,87,88,89],J=[1,8,9,39,41,44],ee=[1,8,9,22],te=[1,143],ne=[1,8,9,59],re=[1,8,9,22,58,59,80,84,85,86,87,88,89],ie={trace:QH(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,DOT:17,className:18,classLiteralName: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,CLASS:46,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"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:"CLASS",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,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],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,6],[43,2],[43,3],[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],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,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],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 12:case 14:this.$=a[s];break;case 10:case 13:this.$=a[s-2]+"."+a[s];break;case 11:case 15:case 95:this.$=a[s-1]+a[s];break;case 16:case 17:this.$=a[s-1]+"~"+a[s]+"~";break;case 18:r.addRelation(a[s]);break;case 19:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 30:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 33:r.addClassesToNamespace(a[s-3],a[s-1]);break;case 34:r.addClassesToNamespace(a[s-4],a[s-1]);break;case 35:this.$=a[s],r.addNamespace(a[s]);break;case 36:case 46:case 59:case 92:this.$=[a[s]];break;case 37:this.$=[a[s-1]];break;case 38:a[s].unshift(a[s-2]),this.$=a[s];break;case 40:r.setCssClass(a[s-2],a[s]);break;case 41:r.addMembers(a[s-3],a[s-1]);break;case 42:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 43:this.$=a[s],r.addClass(a[s]);break;case 44:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 45:r.addAnnotation(a[s],a[s-2]);break;case 47:a[s].push(a[s-1]),this.$=a[s];break;case 48:case 50:case 51:break;case 49:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 52:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 54:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 55:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 56:r.addNote(a[s],a[s-1]);break;case 57:r.addNote(a[s]);break;case 58:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 60:this.$=a[s-2].concat([a[s]]);break;case 61:r.setDirection("TB");break;case 62:r.setDirection("BT");break;case 63:r.setDirection("RL");break;case 64:r.setDirection("LR");break;case 65:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 66:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 67:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 68:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 69:this.$=r.relationType.AGGREGATION;break;case 70:this.$=r.relationType.EXTENSION;break;case 71:this.$=r.relationType.COMPOSITION;break;case 72:this.$=r.relationType.DEPENDENCY;break;case 73:this.$=r.relationType.LOLLIPOP;break;case 74:this.$=r.lineType.LINE;break;case 75:this.$=r.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 77:case 83:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 78:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 79:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 80:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 81:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 84:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 85:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 86:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 87:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 88:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 89:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 90:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 91:r.setCssClass(a[s-1],a[s]);break;case 93:a[s-2].push(a[s]),this.$=a[s-2]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(C,[2,5],{8:[1,48]}),{8:[1,49]},e(S,[2,18],{22:[1,50]}),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(S,[2,23]),e(S,[2,24]),e(S,[2,25]),e(S,[2,26]),e(S,[2,27]),e(S,[2,28]),e(S,[2,29]),{34:[1,51]},{36:[1,52]},e(S,[2,32]),e(S,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:A,67:N,68:I,69:O,70:L,71:M,72:R}),{39:[1,65]},e(D,[2,39],{39:[1,67],44:[1,66]}),e(S,[2,50]),e(S,[2,51]),{16:68,58:d,84:E,99:k,101:T},{16:39,18:69,19:40,58:d,84:E,99:k,101:T,102:_},{16:39,18:70,19:40,58:d,84:E,99:k,101:T,102:_},{16:39,18:71,19:40,58:d,84:E,99:k,101:T,102:_},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:d,84:E,99:k,101:T,102:_},{13:P,53:75},{56:77,58:[1,78]},e(S,[2,61]),e(S,[2,62]),e(S,[2,63]),e(S,[2,64]),e($,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:d,84:E,99:k,101:T,102:_}),e($,[2,14],{20:[1,82]}),{15:83,16:84,58:d,84:E,99:k,101:T},{16:39,18:85,19:40,58:d,84:E,99:k,101:T,102:_},e(B,[2,118]),e(B,[2,119]),e(B,[2,120]),e(B,[2,121]),e([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),e(C,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,18:21,38:22,43:23,16:39,19:40,5:86,33:t,35:n,37:r,42:i,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_}),{5:87,10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_},e(S,[2,19]),e(S,[2,30]),e(S,[2,31]),{13:[1,89],16:39,18:88,19:40,58:d,84:E,99:k,101:T,102:_},{51:90,64:56,65:57,66:A,67:N,68:I,69:O,70:L,71:M,72:R},e(S,[2,49]),{65:91,71:M,72:R},e(F,[2,68],{64:92,66:A,67:N,68:I,69:O,70:L}),e(z,[2,69]),e(z,[2,70]),e(z,[2,71]),e(z,[2,72]),e(z,[2,73]),e(j,[2,74]),e(j,[2,75]),{8:[1,94],24:95,40:93,43:23,46:a},{16:96,58:d,84:E,99:k,101:T},{45:97,49:H},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:U,57:104,58:G,80:q,82:105,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},{58:[1,116]},{13:P,53:117},e(S,[2,57]),e(S,[2,123]),{22:U,57:118,58:G,59:[1,119],80:q,82:105,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},e(Z,[2,59]),{16:39,18:120,19:40,58:d,84:E,99:k,101:T,102:_},e($,[2,15]),e($,[2,16]),e($,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:d,84:E,99:k,101:T},e(J,[2,43],{11:123,12:[1,124]}),e(C,[2,7]),{9:[1,125]},e(ee,[2,52]),{16:39,18:126,19:40,58:d,84:E,99:k,101:T,102:_},{13:[1,128],16:39,18:127,19:40,58:d,84:E,99:k,101:T,102:_},e(F,[2,67],{64:129,66:A,67:N,68:I,69:O,70:L}),e(F,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:a},{8:[1,132],41:[2,36]},e(D,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:H},{16:39,18:136,19:40,58:d,84:E,99:k,101:T,102:_},e(S,[2,76],{13:[1,137]}),e(S,[2,78],{13:[1,139],75:[1,138]}),e(S,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},e(S,[2,90],{59:te}),e(ne,[2,92],{83:144,22:U,58:G,80:q,84:W,85:V,86:Y,87:X,88:K,89:Q}),e(re,[2,94]),e(re,[2,96]),e(re,[2,97]),e(re,[2,98]),e(re,[2,99]),e(re,[2,100]),e(re,[2,101]),e(re,[2,102]),e(re,[2,103]),e(re,[2,104]),e(S,[2,91]),e(S,[2,56]),e(S,[2,58],{59:te}),{58:[1,145]},e($,[2,13]),{15:146,16:84,58:d,84:E,99:k,101:T},{39:[2,11]},e(J,[2,44]),{13:[1,147]},{1:[2,4]},e(ee,[2,54]),e(ee,[2,53]),{16:39,18:148,19:40,58:d,84:E,99:k,101:T,102:_},e(F,[2,65]),e(S,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:a},{45:151,49:H},e(D,[2,41]),{41:[2,47]},e(S,[2,45]),e(S,[2,77]),e(S,[2,79]),e(S,[2,80],{75:[1,152]}),e(S,[2,83]),e(S,[2,84],{13:[1,153]}),e(S,[2,86],{13:[1,155],75:[1,154]}),{22:U,58:G,80:q,82:156,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},e(re,[2,95]),e(Z,[2,60]),{39:[2,10]},{14:[1,157]},e(ee,[2,55]),e(S,[2,34]),{41:[2,38]},{41:[1,158]},e(S,[2,81]),e(S,[2,85]),e(S,[2,87]),e(S,[2,88],{75:[1,159]}),e(ne,[2,93],{83:144,22:U,58:G,80:q,84:W,85:V,86:Y,87:X,88:K,89:Q}),e(J,[2,8]),e(D,[2,42]),e(S,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ae=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:QH(function(e,t,n,r){switch(n){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47: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:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;case 97: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]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return e}();function oe(){this.yy={}}return ie.lexer=ae,QH(oe,"Parser"),oe.prototype=ie,ie.Parser=oe,new oe}();$Ne.parser=$Ne;var BNe=$Ne,FNe=["#","+","~","-",""],zNe=class{static{QH(this,"ClassMember")}constructor(e,t){this.memberType=t,this.visibility="",this.classifier="",this.text="";const n=iG(e,WG());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+fG(this.id);"method"===this.memberType&&(e+=`(${fG(this.parameters.trim())})`,this.returnType&&(e+=" : "+fG(this.returnType))),e=e.trim();return{displayText:e,cssStyle:this.parseClassifier()}}parseMember(e){let t="";if("method"===this.memberType){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){const e=n[1]?n[1].trim():"";if(FNe.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():"",t=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",""===t){const e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=e.length,r=e.substring(0,1),i=e.substring(n-1);FNe.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(""===this.visibility?0:1,""===t?n:n-1)}this.classifier=t,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${fG(this.id)}${"method"===this.memberType?`(${fG(this.parameters)})${this.returnType?" : "+fG(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},jNe="classId-",HNe=0,UNe=QH(e=>kG.sanitizeText(e,WG()),"sanitizeText"),GNe=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=QH(e=>{let t=EK(".mermaidTooltip");null===(t._groups||t)[0][0]&&(t=EK("body").append("div").attr("class","mermaidTooltip").style("opacity",0));EK(e).select("svg").selectAll("g.node").on("mouseover",e=>{const n=EK(e.currentTarget);if(null===n.attr("title"))return;const r=this.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.text(n.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.top-14+document.body.scrollTop+"px"),t.html(t.html().replace(/<br\/>/g,"
    ")),n.classed("hover",!0)}).on("mouseout",e=>{t.transition().duration(500).style("opacity",0);EK(e.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=BG,this.getAccTitle=FG,this.setAccDescription=zG,this.getAccDescription=jG,this.setDiagramTitle=HG,this.getDiagramTitle=UG,this.getConfig=QH(()=>WG().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{QH(this,"ClassDB")}splitClassNameAndType(e){const t=kG.sanitizeText(e,WG());let n="",r=t;if(t.indexOf("~")>0){const e=t.split("~");r=UNe(e[0]),n=UNe(e[1])}return{className:r,type:n}}setClassLabel(e,t){const n=kG.sanitizeText(e,WG());t&&(t=UNe(t));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(e){const t=kG.sanitizeText(e,WG()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;const i=kG.sanitizeText(n,WG());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:jNe+i+"-"+HNe}),HNe++}addInterface(e,t){const n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}lookUpDomId(e){const t=kG.sanitizeText(e,WG());if(this.classes.has(t))return this.classes.get(t).domId;throw new Error("Class not found: "+t)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",$G()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(e){eU.debug("Adding relation: "+JSON.stringify(e));const t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1!==this.relationType.LOLLIPOP||t.includes(e.relation.type2)?e.relation.type2!==this.relationType.LOLLIPOP||t.includes(e.relation.type1)?(this.addClass(e.id1),this.addClass(e.id2)):(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2="interface"+(this.interfaces.length-1)):(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1="interface"+(this.interfaces.length-1)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=kG.sanitizeText(e.relationTitle1.trim(),WG()),e.relationTitle2=kG.sanitizeText(e.relationTitle2.trim(),WG()),this.relations.push(e)}addAnnotation(e,t){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);const n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if("string"==typeof t){const e=t.trim();e.startsWith("<<")&&e.endsWith(">>")?r.annotations.push(UNe(e.substring(2,e.length-2))):e.indexOf(")")>0?r.methods.push(new zNe(e,"method")):e&&r.members.push(new zNe(e,"attribute"))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){const n={id:`note${this.notes.length}`,class:t,text:e};this.notes.push(n)}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),UNe(e.trim())}setCssClass(e,t){e.split(",").forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=jNe+n);const r=this.classes.get(n);r&&(r.cssClasses+=" "+t)})}defineClass(e,t){for(const n of e){let e=this.styleClasses.get(n);void 0===e&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){const n=t.replace("fill","bgFill");e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(",")))})}}setTooltip(e,t){e.split(",").forEach(e=>{void 0!==t&&(this.classes.get(e).tooltip=UNe(t))})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){const r=WG();e.split(",").forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=jNe+i);const a=this.classes.get(i);a&&(a.link=P5.formatUrl(t,r),"sandbox"===r.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof n?UNe(n):"_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,t,n){e.split(",").forEach(e=>{this.setClickFunc(e,t,n),this.classes.get(e).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,t,n){const r=kG.sanitizeText(e,WG());if("loose"!==WG().securityLevel)return;if(void 0===t)return;const i=r;if(this.classes.has(i)){const e=this.lookUpDomId(i);let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{const n=document.querySelector(`[id="${e}"]`);null!==n&&n.addEventListener("click",()=>{P5.runFunc(t,...r)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}getDirection(){return this.direction}setDirection(e){this.direction=e}addNamespace(e){this.namespaces.has(e)||(this.namespaces.set(e,{id:e,classes:new Map,children:{},domId:jNe+e+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t){if(this.namespaces.has(e))for(const n of t){const{className:t}=this.splitClassNameAndType(n);this.classes.get(t).parent=e,this.namespaces.get(e).classes.set(t,this.classes.get(t))}}setCssStyle(e,t){const n=this.classes.get(e);if(t&&n)for(const e of t)e.includes(",")?n.styles.push(...e.split(",")):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}getData(){const e=[],t=[],n=WG();for(const t of this.namespaces.keys()){const r=this.namespaces.get(t);if(r){const t={id:r.id,label:r.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:n.look};e.push(t)}}for(const t of this.classes.keys()){const r=this.classes.get(t);if(r){const t=r;t.parentId=r.parent,t.look=n.look,e.push(t)}}let r=0;for(const i of this.notes){r++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look};e.push(a);const o=this.classes.get(i.class)?.id??"";if(o){const e={id:`edgeNote${r}`,start:i.id,end:o,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};t.push(e)}}for(const t of this.interfaces){const r={id:t.id,label:t.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(r)}r=0;for(const e of this.relations){r++;const i={id:F5(e.id1,e.id2,{prefix:"id",counter:r}),start:e.id1,end:e.id2,type:"normal",label:e.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:"none"===e.relationTitle1?"":e.relationTitle1,endLabelLeft:"none"===e.relationTitle2?"":e.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:e.style||"",pattern:1==e.relation.lineType?"dashed":"solid",look:n.look};t.push(i)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},qNe=QH(e=>`g.classGroup text {\n fill: ${e.nodeBorder||e.classText};\n stroke: none;\n font-family: ${e.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${e.classText};\n}\n.edgeLabel .label rect {\n fill: ${e.mainBkg};\n}\n.label text {\n fill: ${e.classText};\n}\n\n.labelBkg {\n background: ${e.mainBkg};\n}\n.edgeLabel .label span {\n background: ${e.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${e.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${e.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${e.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n}\n`,"getStyles"),WNe=QH((e,t="TB")=>{if(!e.doc)return t;let n=t;for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir"),VNe=QH(function(e,t){return t.db.getClasses()},"getClasses"),YNe=QH(async function(e,t,n,r){eU.info("REF0:"),eU.info("Drawing class diagram (v3)",t);const{securityLevel:i,state:a,layout:o}=WG(),s=r.db.getData(),l=she(t,i);s.type=r.type,s.layoutAlgorithm=Cte(o),s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["aggregation","extension","composition","dependency","lollipop"],s.diagramId=t,await _te(s,l);P5.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),lhe(l,8,"classDiagram",a?.useMaxWidth??!0)},"draw"),XNe={getClasses:VNe,draw:YNe,getDir:WNe},KNe={parser:BNe,get db(){return new GNe},renderer:XNe,styles:qNe,init:QH(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},QNe=Object.freeze({__proto__:null,diagram:KNe}),ZNe={parser:BNe,get db(){return new GNe},renderer:XNe,styles:qNe,init:QH(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},JNe=Object.freeze({__proto__:null,diagram:ZNe}),eIe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,16],l=[1,17],c=[1,18],u=[1,19],h=[1,32],d=[1,20],p=[1,21],f=[1,22],g=[1,23],m=[1,24],y=[1,26],v=[1,27],b=[1,28],x=[1,29],w=[1,30],E=[1,31],k=[1,34],T=[1,35],_=[1,36],C=[1,37],S=[1,33],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],N=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],O={trace:QH(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,"--\x3e":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,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",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:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"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],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:"nl"!=a[s]&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:case 12:this.$=a[s];break;case 8:this.$="nl";break;case 13:const e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:"relation",state1:a[s-2],state2:a[s]};break;case 15:const t=r.trimColon(a[s]);this.$={stmt:"relation",state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:"state",id:a[s-3],type:"default",description:"",doc:a[s-1]};break;case 20:var l=a[s],c=a[s-2].trim();if(a[s].match(":")){var u=a[s].split(":");l=u[0],c=[c,u[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[s-3],type:"default",description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:"state",id:a[s],type:"fork"};break;case 23:this.$={stmt:"state",id:a[s],type:"join"};break;case 24:this.$={stmt:"state",id:a[s],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[s-1].trim(),classes:a[s].trim()};break;case 34:this.$={stmt:"style",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 35:this.$={stmt:"applyClass",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 36:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[s].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:a[s-2].trim(),classes:[a[s].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:s,17:l,19:c,22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,39],15:[1,40]}),e(A,[2,16]),{18:[1,41]},e(A,[2,18],{20:[1,42]}),{23:[1,43]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},e(A,[2,28]),{34:[1,48]},{36:[1,49]},e(A,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},e(N,[2,42],{55:[1,54]}),e(N,[2,43],{55:[1,55]}),e(A,[2,36]),e(A,[2,37]),e(A,[2,38]),e(A,[2,39]),e(A,[2,6]),e(A,[2,13]),{13:56,24:h,54:S},e(A,[2,17]),e(I,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},e(A,[2,29]),e(A,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},e(A,[2,14],{14:[1,67]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,21:[1,68],22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},e(A,[2,32]),e(A,[2,33]),e(A,[2,34]),e(A,[2,35]),e(N,[2,44]),e(N,[2,45]),e(A,[2,15]),e(A,[2,19]),e(I,i,{7:72}),e(A,[2,26]),e(A,[2,27]),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,21:[1,73],22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},L=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),t.yytext=t.yytext.substr(2).trim(),31;case 67:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return t.yytext=t.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}},"anonymous"),rules:[/^(?: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,/^(?:[^\}]%%[^\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,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return e}();function M(){this.yy={}}return O.lexer=L,QH(M,"Parser"),M.prototype=O,O.Parser=M,new M}();eIe.parser=eIe;var tIe=eIe,nIe="state",rIe="relation",iIe="default",aIe="divider",oIe="fill:none",sIe="fill: #333",lIe="text",cIe="normal",uIe="rect",hIe="rectWithTitle",dIe="divider",pIe="roundedWithTitle",fIe="statediagram",gIe=`${fIe}-state`,mIe="transition",yIe=`${mIe} note-edge`,vIe=`${fIe}-note`,bIe=`${fIe}-cluster`,xIe=`${fIe}-cluster-alt`,wIe="parent",EIe="note",kIe="----",TIe=`${kIe}${EIe}`,_Ie=`${kIe}${wIe}`,CIe=QH((e,t="TB")=>{if(!e.doc)return t;let n=t;for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir"),SIe=QH(function(e,t){return t.db.getClasses()},"getClasses"),AIe=QH(async function(e,t,n,r){eU.info("REF0:"),eU.info("Drawing state diagram (v2)",t);const{securityLevel:i,state:a,layout:o}=WG();r.db.extract(r.db.getRootDocV2());const s=r.db.getData(),l=she(t,i);s.type=r.type,s.layoutAlgorithm=o,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["barb"],s.diagramId=t,await _te(s,l);P5.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),lhe(l,8,fIe,a?.useMaxWidth??!0)},"draw"),NIe={getClasses:SIe,draw:AIe,getDir:CIe},IIe=new Map,OIe=0;function LIe(e="",t=0,n="",r=kIe){return`state-${e}${null!==n&&n.length>0?`${r}${n}`:""}-${t}`}QH(LIe,"stateDomId");var MIe=QH((e,t,n,r,i,a,o,s)=>{eU.trace("items",t),t.forEach(t=>{switch(t.stmt){case nIe:case iIe:BIe(e,t,n,r,i,a,o,s);break;case rIe:{BIe(e,t.state1,n,r,i,a,o,s),BIe(e,t.state2,n,r,i,a,o,s);const l={id:"edge"+OIe,start:t.state1.id,end:t.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:oIe,labelStyle:"",label:kG.sanitizeText(t.description,WG()),arrowheadStyle:sIe,labelpos:"c",labelType:lIe,thickness:cIe,classes:mIe,look:o};i.push(l),OIe++}}})},"setupDoc"),RIe=QH((e,t="TB")=>{let n=t;if(e.doc)for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir");function DIe(e,t,n){if(!t.id||""===t.id||""===t.id)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(" ").forEach(e=>{if(n.get(e)){const r=n.get(e);t.cssCompiledStyles=[...t.cssCompiledStyles,...r.styles]}}));const r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}function PIe(e){return e?.classes?.join(" ")??""}function $Ie(e){return e?.styles??[]}QH(DIe,"insertOrUpdateNode"),QH(PIe,"getClassesFromDbInfo"),QH($Ie,"getStylesFromDbInfo");var BIe=QH((e,t,n,r,i,a,o,s)=>{const l=t.id,c=n.get(l),u=PIe(c),h=$Ie(c);if(eU.info("dataFetcher parsedItem",t,c,h),"root"!==l){let n=uIe;!0===t.start?n="stateStart":!1===t.start&&(n="stateEnd"),t.type!==iIe&&(n=t.type),IIe.get(l)||IIe.set(l,{id:l,shape:n,description:kG.sanitizeText(l,WG()),cssClasses:`${u} ${gIe}`,cssStyles:h});const c=IIe.get(l);t.description&&(Array.isArray(c.description)?(c.shape=hIe,c.description.push(t.description)):c.description?.length>0?(c.shape=hIe,c.description===l?c.description=[t.description]:c.description=[c.description,t.description]):(c.shape=uIe,c.description=t.description),c.description=kG.sanitizeTextOrArray(c.description,WG())),1===c.description?.length&&c.shape===hIe&&("group"===c.type?c.shape=pIe:c.shape=uIe),!c.type&&t.doc&&(eU.info("Setting cluster for XCX",l,RIe(t)),c.type="group",c.isGroup=!0,c.dir=RIe(t),c.shape=t.type===aIe?dIe:pIe,c.cssClasses=`${c.cssClasses} ${bIe} ${a?xIe:""}`);const d={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:LIe(l,OIe),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:o};if(d.shape===dIe&&(d.label=""),e&&"root"!==e.id&&(eU.trace("Setting node ",l," to be child of its parent ",e.id),d.parentId=e.id),d.centerLabel=!0,t.note){const e={labelStyle:"",shape:"note",label:t.note.text,cssClasses:vIe,cssStyles:[],cssCompilesStyles:[],id:l+TIe+"-"+OIe,domId:LIe(l,OIe,EIe),type:c.type,isGroup:"group"===c.type,padding:WG().flowchart.padding,look:o,position:t.note.position},n=l+_Ie,a={labelStyle:"",shape:"noteGroup",label:t.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+_Ie,domId:LIe(l,OIe,wIe),type:"group",isGroup:!0,padding:16,look:o,position:t.note.position};OIe++,a.id=n,e.parentId=n,DIe(r,a,s),DIe(r,e,s),DIe(r,d,s);let u=l,h=e.id;"left of"===t.note.position&&(u=e.id,h=l),i.push({id:u+"-"+h,start:u,end:h,arrowhead:"none",arrowTypeEnd:"",style:oIe,labelStyle:"",classes:yIe,arrowheadStyle:sIe,labelpos:"c",labelType:lIe,thickness:cIe,look:o})}else DIe(r,d,s)}t.doc&&(eU.trace("Adding nodes children "),MIe(t,t.doc,n,r,i,!a,o,s))},"dataFetcher"),FIe=QH(()=>{IIe.clear(),OIe=0},"reset"),zIe="[*]",jIe="start",HIe=zIe,UIe="color",GIe="fill";function qIe(){return new Map}QH(qIe,"newClassesList");var WIe,VIe=QH(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),YIe=QH(e=>JSON.parse(JSON.stringify(e)),"clone"),XIe=class{static{QH(this,"StateDB")}constructor(e){this.clear(),this.version=e,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=qIe();documents={root:VIe()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(e){eU.info("Setting root doc",e),this.rootDoc=e,1===this.version?this.extract(e):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(e,t,n){if(t.stmt===rIe)this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);else if(t.stmt===nIe&&("[*]"===t.id?(t.id=n?e.id+"_start":e.id+"_end",t.start=n):t.id=t.id.trim()),t.doc){const e=[];let n,r=[];for(n=0;n0&&r.length>0){const n={stmt:nIe,id:b5(),type:"divider",doc:YIe(r)};e.push(YIe(n)),t.doc=e}t.doc.forEach(e=>this.docTranslator(t,e,!0))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(e){let t;t=e.doc?e.doc:e,eU.info(t),this.clear(!0),eU.info("Extract initial document:",t),t.forEach(e=>{switch(eU.warn("Statement",e.stmt),e.stmt){case nIe:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles);break;case rIe:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":{const t=e.id.trim().split(","),n=e.styleClass.split(",");t.forEach(e=>{let t=this.getState(e);if(void 0===t){const n=e.trim();this.addState(n),t=this.getState(n)}t.styles=n.map(e=>e.replace(/;/g,"")?.trim())})}break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass)}});const n=this.getStates(),r=WG().look;FIe(),BIe(void 0,this.getRootDocV2(),n,this.nodes,this.edges,!0,r,this.classes),this.nodes.forEach(e=>{if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+e.id+"]");e.label=e.label[0]}})}addState(e,t=iIe,n=null,r=null,i=null,a=null,o=null,s=null){const l=e?.trim();if(this.currentDocument.states.has(l)?(this.currentDocument.states.get(l).doc||(this.currentDocument.states.get(l).doc=n),this.currentDocument.states.get(l).type||(this.currentDocument.states.get(l).type=t)):(eU.info("Adding state ",l,r),this.currentDocument.states.set(l,{id:l,descriptions:[],type:t,doc:n,note:i,classes:[],styles:[],textStyles:[]})),r&&(eU.info("Setting state description",l,r),"string"==typeof r&&this.addDescription(l,r.trim()),"object"==typeof r&&r.forEach(e=>this.addDescription(l,e.trim()))),i){const e=this.currentDocument.states.get(l);e.note=i,e.note.text=kG.sanitizeText(e.note.text,WG())}if(a){eU.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach(e=>this.setCssClass(l,e.trim()))}if(o){eU.info("Setting state styles",l,o);("string"==typeof o?[o]:o).forEach(e=>this.setStyle(l,e.trim()))}if(s){eU.info("Setting state styles",l,o);("string"==typeof s?[s]:s).forEach(e=>this.setTextStyle(l,e.trim()))}}clear(e){this.nodes=[],this.edges=[],this.documents={root:VIe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=qIe(),e||$G()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){eU.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(e=""){let t=e;return e===zIe&&(this.startEndCount++,t=`${jIe}${this.startEndCount}`),t}startTypeIfNeeded(e="",t=iIe){return e===zIe?jIe:t}endIdIfNeeded(e=""){let t=e;return e===HIe&&(this.startEndCount++,t=`end${this.startEndCount}`),t}endTypeIfNeeded(e="",t=iIe){return e===HIe?"end":t}addRelationObjs(e,t,n){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:kG.sanitizeText(n,WG())})}addRelation(e,t,n){if("object"==typeof e)this.addRelationObjs(e,t,n);else{const r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,title:kG.sanitizeText(n,WG())})}}addDescription(e,t){const n=this.currentDocument.states.get(e),r=t.startsWith(":")?t.replace(":","").trim():t;n.descriptions.push(kG.sanitizeText(r,WG()))}cleanupLabel(e){return":"===e.substring(0,1)?e.substr(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(e,t=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(UIe).exec(e)){const e=t.replace(GIe,"bgFill").replace(UIe,GIe);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setCssClass(e,t){e.split(",").forEach(e=>{let n=this.getState(e);if(void 0===n){const t=e.trim();this.addState(t),n=this.getState(t)}n.classes.push(t)})}setStyle(e,t){const n=this.getState(e);void 0!==n&&n.styles.push(t)}setTextStyle(e,t){const n=this.getState(e);void 0!==n&&n.textStyles.push(t)}getDirectionStatement(){return this.rootDoc.find(e=>"dir"===e.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(e){const t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:"dir",value:e})}trimColon(e){return e&&":"===e[0]?e.substr(1).trim():e.trim()}getData(){const e=WG();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:CIe(this.getRootDocV2())}}getConfig(){return WG().state}getAccTitle=FG;setAccTitle=BG;getAccDescription=jG;setAccDescription=zG;setDiagramTitle=HG;getDiagramTitle=UG},KIe=QH(e=>`\ndefs #statediagram-barbEnd {\n fill: ${e.transitionColor};\n stroke: ${e.transitionColor};\n }\ng.stateGroup text {\n fill: ${e.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${e.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${e.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${e.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${e.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${e.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${e.noteBorderColor};\n fill: ${e.noteBkgColor};\n\n text {\n fill: ${e.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${e.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${e.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${e.transitionLabelColor||e.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${e.transitionLabelColor||e.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${e.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${e.specialStateColor};\n stroke: ${e.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${e.specialStateColor};\n stroke: ${e.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${e.innerEndBackground};\n stroke: ${e.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${e.compositeBackground||e.background};\n // stroke: ${e.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${e.stateBkg||e.mainBkg};\n stroke: ${e.stateBorder||e.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${e.mainBkg};\n stroke: ${e.stateBorder||e.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${e.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${e.compositeTitleBackground};\n stroke: ${e.stateBorder||e.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${e.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${e.stateBorder||e.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${e.compositeBackground||e.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${e.altBackground?e.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${e.altBackground?e.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${e.noteBkgColor};\n stroke: ${e.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${e.noteBkgColor};\n stroke: ${e.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${e.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${e.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${e.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${e.lineColor};\n stroke: ${e.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n}\n`,"getStyles"),QIe={},ZIe=QH((e,t)=>{QIe[e]=t},"set"),JIe=QH(e=>QIe[e],"get"),eOe=QH(()=>Object.keys(QIe),"keys"),tOe=QH(()=>eOe().length,"size"),nOe={get:JIe,set:ZIe,keys:eOe,size:tOe},rOe=QH(e=>e.append("circle").attr("class","start-state").attr("r",WG().state.sizeUnit).attr("cx",WG().state.padding+WG().state.sizeUnit).attr("cy",WG().state.padding+WG().state.sizeUnit),"drawStartState"),iOe=QH(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",WG().state.textHeight).attr("class","divider").attr("x2",2*WG().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),aOe=QH((e,t)=>{const n=e.append("text").attr("x",2*WG().state.padding).attr("y",WG().state.textHeight+2*WG().state.padding).attr("font-size",WG().state.fontSize).attr("class","state-title").text(t.id),r=n.node().getBBox();return e.insert("rect",":first-child").attr("x",WG().state.padding).attr("y",WG().state.padding).attr("width",r.width+2*WG().state.padding).attr("height",r.height+2*WG().state.padding).attr("rx",WG().state.radius),n},"drawSimpleState"),oOe=QH((e,t)=>{const n=QH(function(e,t,n){const r=e.append("tspan").attr("x",2*WG().state.padding).text(t);n||r.attr("dy",WG().state.textHeight)},"addTspan"),r=e.append("text").attr("x",2*WG().state.padding).attr("y",WG().state.textHeight+1.3*WG().state.padding).attr("font-size",WG().state.fontSize).attr("class","state-title").text(t.descriptions[0]).node().getBBox(),i=r.height,a=e.append("text").attr("x",WG().state.padding).attr("y",i+.4*WG().state.padding+WG().state.dividerMargin+WG().state.textHeight).attr("class","state-description");let o=!0,s=!0;t.descriptions.forEach(function(e){o||(n(a,e,s),s=!1),o=!1});const l=e.append("line").attr("x1",WG().state.padding).attr("y1",WG().state.padding+i+WG().state.dividerMargin/2).attr("y2",WG().state.padding+i+WG().state.dividerMargin/2).attr("class","descr-divider"),c=a.node().getBBox(),u=Math.max(c.width,r.width);return l.attr("x2",u+3*WG().state.padding),e.insert("rect",":first-child").attr("x",WG().state.padding).attr("y",WG().state.padding).attr("width",u+2*WG().state.padding).attr("height",c.height+i+2*WG().state.padding).attr("rx",WG().state.radius),e},"drawDescrState"),sOe=QH((e,t,n)=>{const r=WG().state.padding,i=2*WG().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append("text").attr("x",0).attr("y",WG().state.titleShift).attr("font-size",WG().state.fontSize).attr("class","state-title").text(t.id),c=l.node().getBBox().width+i;let u,h=Math.max(c,o);h===o&&(h+=i);const d=e.node().getBBox();t.doc,u=s-r,c>o&&(u=(o-h)/2+r),Math.abs(s-d.x)o&&(u=s-(c-o)/2);const p=1-WG().state.textHeight;return e.insert("rect",":first-child").attr("x",u).attr("y",p).attr("class",n?"alt-composit":"composit").attr("width",h).attr("height",d.height+WG().state.textHeight+WG().state.titleShift+1).attr("rx","0"),l.attr("x",u+r),c<=o&&l.attr("x",s+(h-i)/2-c/2+r),e.insert("rect",":first-child").attr("x",u).attr("y",WG().state.titleShift-WG().state.textHeight-WG().state.padding).attr("width",h).attr("height",3*WG().state.textHeight).attr("rx",WG().state.radius),e.insert("rect",":first-child").attr("x",u).attr("y",WG().state.titleShift-WG().state.textHeight-WG().state.padding).attr("width",h).attr("height",d.height+3+2*WG().state.textHeight).attr("rx",WG().state.radius),e},"addTitleAndBox"),lOe=QH(e=>(e.append("circle").attr("class","end-state-outer").attr("r",WG().state.sizeUnit+WG().state.miniPadding).attr("cx",WG().state.padding+WG().state.sizeUnit+WG().state.miniPadding).attr("cy",WG().state.padding+WG().state.sizeUnit+WG().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",WG().state.sizeUnit).attr("cx",WG().state.padding+WG().state.sizeUnit+2).attr("cy",WG().state.padding+WG().state.sizeUnit+2)),"drawEndState"),cOe=QH((e,t)=>{let n=WG().state.forkWidth,r=WG().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",WG().state.padding).attr("y",WG().state.padding)},"drawForkJoinState"),uOe=QH((e,t,n,r)=>{let i=0;const a=r.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let o=e.replace(/\r\n/g,"
    ");o=o.replace(/\n/g,"
    ");const s=o.split(kG.lineBreakRegex);let l=1.25*WG().state.noteMargin;for(const e of s){const r=e.trim();if(r.length>0){const e=a.append("tspan");if(e.text(r),0===l){l+=e.node().getBBox().height}i+=l,e.attr("x",t+WG().state.noteMargin),e.attr("y",n+i+1.25*WG().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),hOe=QH((e,t)=>{t.attr("class","state-note");const n=t.append("rect").attr("x",0).attr("y",WG().state.padding),r=t.append("g"),{textWidth:i,textHeight:a}=uOe(e,0,0,r);return n.attr("height",a+2*WG().state.noteMargin),n.attr("width",i+2*WG().state.noteMargin),n},"drawNote"),dOe=QH(function(e,t){const n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append("g").attr("id",n).attr("class","stateGroup");"start"===t.type&&rOe(i),"end"===t.type&&lOe(i),"fork"!==t.type&&"join"!==t.type||cOe(i,t),"note"===t.type&&hOe(t.note.text,i),"divider"===t.type&&iOe(i),"default"===t.type&&0===t.descriptions.length&&aOe(i,t),"default"===t.type&&t.descriptions.length>0&&oOe(i,t);const a=i.node().getBBox();return r.width=a.width+2*WG().state.padding,r.height=a.height+2*WG().state.padding,nOe.set(n,r),r},"drawState"),pOe=0,fOe=QH(function(e,t,n){const r=QH(function(e){switch(e){case XIe.relationType.AGGREGATION:return"aggregation";case XIe.relationType.EXTENSION:return"extension";case XIe.relationType.COMPOSITION:return"composition";case XIe.relationType.DEPENDENCY:return"dependency"}},"getRelationType");t.points=t.points.filter(e=>!Number.isNaN(e.y));const i=t.points,a=s2().x(function(e){return e.x}).y(function(e){return e.y}).curve(m2),o=e.append("path").attr("d",a(i)).attr("id","edge"+pOe).attr("class","transition");let s="";if(WG().state.arrowMarkerAbsolute&&(s=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,s=s.replace(/\(/g,"\\("),s=s.replace(/\)/g,"\\)")),o.attr("marker-end","url("+s+"#"+r(XIe.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const r=e.append("g").attr("class","stateLabel"),{x:i,y:a}=P5.calcLabelPosition(t.points),o=kG.getRows(n.title);let s=0;const l=[];let c=0,u=0;for(let e=0;e<=o.length;e++){const t=r.append("text").attr("text-anchor","middle").text(o[e]).attr("x",i).attr("y",a+s),n=t.node().getBBox();if(c=Math.max(c,n.width),u=Math.min(u,n.x),eU.info(n.x,i,a+s),0===s){const e=t.node().getBBox();s=e.height,eU.info("Title height",s,a)}l.push(t)}let h=s*o.length;if(o.length>1){const e=(o.length-1)*s*.5;l.forEach((t,n)=>t.attr("y",a+n*s-e)),h=s*o.length}const d=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-WG().state.padding/2).attr("y",a-h/2-WG().state.padding/2-3.5).attr("width",c+WG().state.padding).attr("height",h+WG().state.padding),eU.info(d)}pOe++},"drawEdge"),gOe={},mOe=QH(function(){},"setConf"),yOe=QH(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),vOe=QH(function(e,t,n,r){WIe=WG().state;const i=WG().securityLevel;let a;"sandbox"===i&&(a=EK("#i"+t));const o=EK("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),s="sandbox"===i?a.nodes()[0].contentDocument:document;eU.debug("Rendering diagram "+e);const l=o.select(`[id='${t}']`);yOe(l);const c=r.db.getRootDoc();xOe(c,l,void 0,!1,o,s,r);const u=WIe.padding,h=l.node().getBBox(),d=h.width+2*u,p=h.height+2*u;CG(l,p,1.75*d,WIe.useMaxWidth),l.attr("viewBox",`${h.x-WIe.padding} ${h.y-WIe.padding} `+d+" "+p)},"draw"),bOe=QH(e=>e?e.length*WIe.fontSizeFactor:1,"getLabelWidth"),xOe=QH((e,t,n,r,i,a,o)=>{const s=new Pse({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{const t=e.parentElement;let n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute("data-x-shift"),10),Number.isNaN(r)&&(r=0)),e.setAttribute("x1",0-r+8),e.setAttribute("x2",n-r-8)})}else eU.debug("No Node "+e+": "+JSON.stringify(s.node(e)))});let g=f.getBBox();s.edges().forEach(function(e){void 0!==e&&void 0!==s.edge(e)&&(eU.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(s.edge(e))),fOe(t,s.edge(e),s.edge(e).relation))}),g=f.getBBox();const m={id:n||"root",label:n||"root",width:0,height:0};return m.width=g.width+2*WIe.padding,m.height=g.height+2*WIe.padding,eU.debug("Doc rendered",m,s),m},"renderDoc"),wOe={setConf:mOe,draw:vOe},EOe={parser:tIe,get db(){return new XIe(1)},renderer:wOe,styles:KIe,init:QH(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},kOe=Object.freeze({__proto__:null,diagram:EOe}),TOe={parser:tIe,get db(){return new XIe(2)},renderer:NIe,styles:KIe,init:QH(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},_Oe=Object.freeze({__proto__:null,diagram:TOe}),COe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,14],l={trace:QH(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:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,16]},{15:[1,17]},e(t,[2,11]),e(t,[2,12]),{19:[1,18]},e(t,[2,4]),e(t,[2,9]),e(t,[2,10]),e(t,[2,13])],defaultActions:{},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},c=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 e}();function u(){this.yy={}}return l.lexer=c,QH(u,"Parser"),u.prototype=l,l.Parser=u,new u}();COe.parser=COe;var SOe=COe,AOe="",NOe=[],IOe=[],OOe=[],LOe=QH(function(){NOe.length=0,IOe.length=0,AOe="",OOe.length=0,$G()},"clear"),MOe=QH(function(e){AOe=e,NOe.push(e)},"addSection"),ROe=QH(function(){return NOe},"getSections"),DOe=QH(function(){let e=FOe();let t=0;for(;!e&&t<100;)e=FOe(),t++;return IOe.push(...OOe),IOe},"getTasks"),POe=QH(function(){const e=[];IOe.forEach(t=>{t.people&&e.push(...t.people)});return[...new Set(e)].sort()},"updateActors"),$Oe=QH(function(e,t){const n=t.substr(1).split(":");let r=0,i=[];1===n.length?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(","));const a=i.map(e=>e.trim()),o={section:AOe,type:AOe,people:a,task:e,score:r};OOe.push(o)},"addTask"),BOe=QH(function(e){const t={section:AOe,type:AOe,description:e,task:e,classes:[]};IOe.push(t)},"addTaskOrg"),FOe=QH(function(){const e=QH(function(e){return OOe[e].processed},"compileTask");let t=!0;for(const[n,r]of OOe.entries())e(n),t=t&&r.processed;return t},"compileTasks"),zOe=QH(function(){return POe()},"getActors"),jOe={getConfig:QH(()=>WG().journey,"getConfig"),clear:LOe,setDiagramTitle:HG,getDiagramTitle:UG,setAccTitle:BG,getAccTitle:FG,setAccDescription:zG,getAccDescription:jG,addSection:MOe,getSections:ROe,getTasks:DOe,addTask:$Oe,addTaskOrg:BOe,getActors:zOe},HOe=QH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n`,"getStyles"),UOe=QH(function(e,t){return Ace(e,t)},"drawRect"),GOe=QH(function(e,t){const n=15,r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");function a(e){const r=t2().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function o(e){const r=t2().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function s(e){e.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",t.cx-5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),QH(a,"smile"),QH(o,"sad"),QH(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),r},"drawFace"),qOe=QH(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),void 0!==n.class&&n.attr("class",n.class),void 0!==t.title&&n.append("title").text(t.title),n},"drawCircle"),WOe=QH(function(e,t){return Ice(e,t)},"drawText"),VOe=QH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}QH(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7)),r.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,WOe(e,t)},"drawLabel"),YOe=QH(function(e,t,n){const r=e.append("g"),i=Mce();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,UOe(r,i),ZOe(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),XOe=-1,KOe=QH(function(e,t,n){const r=t.x+n.width/2,i=e.append("g");XOe++;i.append("line").attr("id","task"+XOe).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),GOe(i,{cx:r,cy:300+30*(5-t.score),score:t.score});const a=Mce();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,UOe(i,a);let o=t.x+14;t.people.forEach(e=>{const n=t.actors[e].color,r={cx:o,cy:t.y,r:7,fill:n,stroke:"#000",title:e,pos:t.actors[e].position};qOe(i,r),o+=10}),ZOe(n)(t.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),QOe=QH(function(e,t){Nce(e,t)},"drawBackgroundRect"),ZOe=function(){function e(e,t,n,i,a,o,s,l){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("font-color",l).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l,c){const{taskFontSize:u,taskFontFamily:h}=l,d=e.split(//gi);for(let e=0;e{const i=tLe[r].color,a={cx:20,cy:n,r:7,fill:i,stroke:"#000",pos:tLe[r].position};JOe.drawCircle(e,a);const o={x:40,y:n+7,fill:"#666",text:r,textMargin:5|t.boxTextMargin};JOe.drawText(e,o),n+=20})}QH(nLe,"drawActorLegend");var rLe=WG().journey,iLe=rLe.leftMargin,aLe=QH(function(e,t,n,r){const i=WG().journey,a=WG().securityLevel;let o;"sandbox"===a&&(o=EK("#i"+t));const s=EK("sandbox"===a?o.nodes()[0].contentDocument.body:"body");oLe.init();const l=s.select("#"+t);JOe.initGraphics(l);const c=r.db.getTasks(),u=r.db.getDiagramTitle(),h=r.db.getActors();for(const e in tLe)delete tLe[e];let d=0;h.forEach(e=>{tLe[e]={color:i.actorColours[d%i.actorColours.length],position:d},d++}),nLe(l),oLe.insert(0,0,iLe,50*Object.keys(tLe).length),cLe(l,c,0);const p=oLe.getBounds();u&&l.append("text").text(u).attr("x",iLe).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const f=p.stopy-p.starty+2*i.diagramMarginY,g=iLe+p.stopx+2*i.diagramMarginX;CG(l,f,g,i.useMaxWidth),l.append("line").attr("x1",iLe).attr("y1",4*i.height).attr("x2",g-iLe-4).attr("y2",4*i.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=u?70:0;l.attr("viewBox",`${p.startx} -25 ${g} ${f+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",f+m+25)},"draw"),oLe={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:QH(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:QH(function(e,t,n,r){void 0===e[t]?e[t]=n:e[t]=r(n,e[t])},"updateVal"),updateBounds:QH(function(e,t,n,r){const i=WG().journey,a=this;let o=0;function s(s){return QH(function(l){o++;const c=a.sequenceItems.length-o+1;a.updateVal(l,"starty",t-c*i.boxMargin,Math.min),a.updateVal(l,"stopy",r+c*i.boxMargin,Math.max),a.updateVal(oLe.data,"startx",e-c*i.boxMargin,Math.min),a.updateVal(oLe.data,"stopx",n+c*i.boxMargin,Math.max),"activation"!==s&&(a.updateVal(l,"startx",e-c*i.boxMargin,Math.min),a.updateVal(l,"stopx",n+c*i.boxMargin,Math.max),a.updateVal(oLe.data,"starty",t-c*i.boxMargin,Math.min),a.updateVal(oLe.data,"stopy",r+c*i.boxMargin,Math.max))},"updateItemBounds")}QH(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:QH(function(e,t,n,r){const i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(oLe.data,"startx",i,Math.min),this.updateVal(oLe.data,"starty",o,Math.min),this.updateVal(oLe.data,"stopx",a,Math.max),this.updateVal(oLe.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:QH(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:QH(function(){return this.verticalPos},"getVerticalPos"),getBounds:QH(function(){return this.data},"getBounds")},sLe=rLe.sectionFills,lLe=rLe.sectionColours,cLe=QH(function(e,t,n){const r=WG().journey;let i="";const a=n+(2*r.height+r.diagramMarginY);let o=0,s="#CCC",l="black",c=0;for(const[n,u]of t.entries()){if(i!==u.section){s=sLe[o%sLe.length],c=o%sLe.length,l=lLe[o%lLe.length];let a=0;const h=u.section;for(let e=n;e(tLe[t]&&(e[t]=tLe[t]),e),{});u.x=n*r.taskMargin+n*r.width+iLe,u.y=a,u.width=r.diagramMarginX,u.height=r.diagramMarginY,u.colour=l,u.fill=s,u.num=c,u.actors=h,JOe.drawTask(e,u,r),oLe.insert(u.x,u.y,u.x+u.width+r.taskMargin,450)}},"drawTasks"),uLe={setConf:eLe,draw:aLe},hLe={parser:SOe,db:jOe,renderer:uLe,styles:HOe,init:QH(e=>{uLe.setConf(e.journey),jOe.clear()},"init")},dLe=Object.freeze({__proto__:null,diagram:hLe}),pLe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,11,12,14,16,17,20,21],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,16],l=[1,17],c={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline: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,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",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",20:"period",21:"event"},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,1],[9,1],[18,1],[19,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 15:r.addTask(a[s],0,""),this.$=a[s];break;case 16:r.addEvent(a[s].substr(2)),this.$=a[s]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:s,21:l},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:18,11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:s,21:l},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,19]},{15:[1,20]},e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,4]),e(t,[2,9]),e(t,[2,10])],defaultActions:{},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},u=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\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,/^(?::\s[^:\n]+)/i,/^(?:[^#:\n]+)/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],inclusive:!0}}};return e}();function h(){this.yy={}}return c.lexer=u,QH(h,"Parser"),h.prototype=c,c.Parser=h,new h}();pLe.parser=pLe;var fLe=pLe,gLe={};ZH(gLe,{addEvent:()=>SLe,addSection:()=>kLe,addTask:()=>CLe,addTaskOrg:()=>ALe,clear:()=>ELe,default:()=>ILe,getCommonDb:()=>wLe,getSections:()=>TLe,getTasks:()=>_Le});var mLe="",yLe=0,vLe=[],bLe=[],xLe=[],wLe=QH(()=>LG,"getCommonDb"),ELe=QH(function(){vLe.length=0,bLe.length=0,mLe="",xLe.length=0,$G()},"clear"),kLe=QH(function(e){mLe=e,vLe.push(e)},"addSection"),TLe=QH(function(){return vLe},"getSections"),_Le=QH(function(){let e=NLe();let t=0;for(;!e&&t<100;)e=NLe(),t++;return bLe.push(...xLe),bLe},"getTasks"),CLe=QH(function(e,t,n){const r={id:yLe++,section:mLe,type:mLe,task:e,score:t||0,events:n?[n]:[]};xLe.push(r)},"addTask"),SLe=QH(function(e){xLe.find(e=>e.id===yLe-1).events.push(e)},"addEvent"),ALe=QH(function(e){const t={section:mLe,type:mLe,description:e,task:e,classes:[]};bLe.push(t)},"addTaskOrg"),NLe=QH(function(){const e=QH(function(e){return xLe[e].processed},"compileTask");let t=!0;for(const[n,r]of xLe.entries())e(n),t=t&&r.processed;return t},"compileTasks"),ILe={clear:ELe,getCommonDb:wLe,addSection:kLe,getSections:TLe,getTasks:_Le,addTask:CLe,addTaskOrg:ALe,addEvent:SLe},OLe=QH(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),void 0!==t.class&&n.attr("class",t.class),n},"drawRect"),LLe=QH(function(e,t){const n=15,r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");function a(e){const r=t2().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function o(e){const r=t2().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function s(e){e.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",t.cx-5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),QH(a,"smile"),QH(o,"sad"),QH(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),r},"drawFace"),MLe=QH(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),void 0!==n.class&&n.attr("class",n.class),void 0!==t.title&&n.append("title").text(t.title),n},"drawCircle"),RLe=QH(function(e,t){const n=t.text.replace(//gi," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),void 0!==t.class&&r.attr("class",t.class);const i=r.append("tspan");return i.attr("x",t.x+2*t.textMargin),i.text(n),r},"drawText"),DLe=QH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}QH(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7)),r.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,RLe(e,t)},"drawLabel"),PLe=QH(function(e,t,n){const r=e.append("g"),i=jLe();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,OLe(r,i),HLe(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),$Le=-1,BLe=QH(function(e,t,n){const r=t.x+n.width/2,i=e.append("g");$Le++;i.append("line").attr("id","task"+$Le).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),LLe(i,{cx:r,cy:300+30*(5-t.score),score:t.score});const a=jLe();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,OLe(i,a),HLe(n)(t.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),FLe=QH(function(e,t){OLe(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),zLe=QH(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),jLe=QH(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),HLe=function(){function e(e,t,n,i,a,o,s,l){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("font-color",l).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l,c){const{taskFontSize:u,taskFontFamily:h}=l,d=e.split(//gi);for(let e=0;e)/).reverse(),i=[],a=n.attr("y"),o=parseFloat(n.attr("dy")),s=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",o+"em");for(let o=0;ot||"
    "===e)&&(i.pop(),s.text(i.join(" ").trim()),i="
    "===e?[""]:[e],s=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(e))})}QH(GLe,"wrap");var qLe=QH(function(e,t,n,r){const i=n%12-1,a=e.append("g");t.section=i,a.attr("class",(t.class?t.class+" ":"")+"timeline-node section-"+i);const o=a.append("g"),s=a.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(GLe,t.width).node().getBBox(),c=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return t.height=l.height+1.1*c*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),VLe(o,t,i,r),t},"drawNode"),WLe=QH(function(e,t,n){const r=e.append("g"),i=r.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(GLe,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return r.remove(),i.height+1.1*a*.5+t.padding},"getVirtualNodeHeight"),VLe=QH(function(e,t,n){e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${10-t.height} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),YLe={drawRect:OLe,drawCircle:MLe,drawSection:PLe,drawText:RLe,drawLabel:DLe,drawTask:BLe,drawBackgroundRect:FLe,getTextObj:zLe,getNoteRect:jLe,initGraphics:ULe,drawNode:qLe,getVirtualNodeHeight:WLe},XLe=QH(function(e,t,n,r){const i=WG(),a=i.leftMargin??50;eU.debug("timeline",r.db);const o=i.securityLevel;let s;"sandbox"===o&&(s=EK("#i"+t));const l=EK("sandbox"===o?s.nodes()[0].contentDocument.body:"body").select("#"+t);l.append("g");const c=r.db.getTasks(),u=r.db.getCommonDb().getDiagramTitle();eU.debug("task",c),YLe.initGraphics(l);const h=r.db.getSections();eU.debug("sections",h);let d=0,p=0,f=0,g=0,m=50+a,y=50;g=50;let v=0,b=!0;h.forEach(function(e){const t={number:v,descr:e,section:v,width:150,padding:20,maxHeight:d},n=YLe.getVirtualNodeHeight(l,t,i);eU.debug("sectionHeight before draw",n),d=Math.max(d,n+20)});let x=0,w=0;eU.debug("tasks.length",c.length);for(const[e,t]of c.entries()){const n={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:p},r=YLe.getVirtualNodeHeight(l,n,i);eU.debug("taskHeight before draw",r),p=Math.max(p,r+20),x=Math.max(x,t.events.length);let a=0;for(const e of t.events){const n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=YLe.getVirtualNodeHeight(l,n,i)}w=Math.max(w,a)}eU.debug("maxSectionHeight before draw",d),eU.debug("maxTaskHeight before draw",p),h&&h.length>0?h.forEach(e=>{const t=c.filter(t=>t.section===e),n={number:v,descr:e,section:v,width:200*Math.max(t.length,1)-50,padding:20,maxHeight:d};eU.debug("sectionNode",n);const r=l.append("g"),a=YLe.drawNode(r,n,v,i);eU.debug("sectionNode output",a),r.attr("transform",`translate(${m}, 50)`),y+=d+50,t.length>0&&KLe(l,t,v,m,y,p,i,x,w,d,!1),m+=200*Math.max(t.length,1),y=50,v++}):(b=!1,KLe(l,c,v,m,y,p,i,x,w,d,!0));const E=l.node().getBBox();eU.debug("bounds",E),u&&l.append("text").text(u).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),f=b?d+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",f).attr("x2",E.width+3*a).attr("y2",f).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),SG(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),KLe=QH(function(e,t,n,r,i,a,o,s,l,c,u){for(const s of t){const t={descr:s.task,section:n,number:n,width:150,padding:20,maxHeight:a};eU.debug("taskNode",t);const h=e.append("g").attr("class","taskWrapper"),d=YLe.drawNode(h,t,n,o).height;if(eU.debug("taskHeight after draw",d),h.attr("transform",`translate(${r}, ${i})`),a=Math.max(a,d),s.events){const t=e.append("g").attr("class","lineWrapper");let h=a;i+=100,h+=QLe(e,s.events,n,r,i,o),i-=100,t.append("line").attr("x1",r+95).attr("y1",i+a).attr("x2",r+95).attr("y2",i+a+(u?a:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,u&&!o.timeline?.disableMulticolor&&n++}i-=10},"drawTasks"),QLe=QH(function(e,t,n,r,i,a){let o=0;const s=i;i+=100;for(const s of t){const t={descr:s,section:n,number:n,width:150,padding:20,maxHeight:50};eU.debug("eventNode",t);const l=e.append("g").attr("class","eventWrapper"),c=YLe.drawNode(l,t,n,a).height;o+=c,l.attr("transform",`translate(${r}, ${i})`),i=i+10+c}return i=s,o},"drawEvents"),ZLe={setConf:QH(()=>{},"setConf"),draw:XLe},JLe=QH(e=>{let t="";for(let t=0;t`\n .edge {\n stroke-width: 3;\n }\n ${JLe(e)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`,"getStyles")},tMe=Object.freeze({__proto__:null,diagram:eMe});function nMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function oMe(e,t,n){return(t=cMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sMe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||hMe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lMe(e){return function(e){if(Array.isArray(e))return nMe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hMe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cMe(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function uMe(e){return uMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uMe(e)}function hMe(e,t){if(e){if("string"==typeof e)return nMe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nMe(e,t):void 0}}var dMe="undefined"==typeof window?null:window,pMe=dMe?dMe.navigator:null;dMe&&dMe.document;var fMe,gMe,mMe,yMe,vMe,bMe,xMe,wMe,EMe,kMe,TMe,_Me,CMe,SMe,AMe,NMe,IMe,OMe,LMe,MMe,RMe,DMe,PMe,$Me,BMe,FMe,zMe,jMe,HMe=uMe(""),UMe=uMe({}),GMe=uMe(function(){}),qMe="undefined"==typeof HTMLElement?"undefined":uMe(HTMLElement),WMe=function(e){return e&&e.instanceString&&YMe(e.instanceString)?e.instanceString():null},VMe=function(e){return null!=e&&uMe(e)==HMe},YMe=function(e){return null!=e&&uMe(e)===GMe},XMe=function(e){return!JMe(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},KMe=function(e){return null!=e&&uMe(e)===UMe&&!XMe(e)&&e.constructor===Object},QMe=function(e){return null!=e&&uMe(e)===uMe(1)&&!isNaN(e)},ZMe=function(e){return"undefined"===qMe?void 0:null!=e&&e instanceof HTMLElement},JMe=function(e){return eRe(e)||tRe(e)},eRe=function(e){return"collection"===WMe(e)&&e._private.single},tRe=function(e){return"collection"===WMe(e)&&!e._private.single},nRe=function(e){return"core"===WMe(e)},rRe=function(e){return"stylesheet"===WMe(e)},iRe=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},aRe=function(e){return function(e){return null!=e&&uMe(e)===UMe}(e)&&YMe(e.then)},oRe=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},vRe=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,a,o,s,l;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=new RegExp("^"+gRe+"$").exec(e);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(a=u[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*c(d,h,n+1/3)),s=Math.round(255*c(d,h,n)),l=Math.round(255*c(d,h,n-1/3))}t=[o,s,l,a]}return t}(e)},xRe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},wRe=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i=o||t<0||m&&e-f>=u}function x(){var e=t();if(b(e))return w(e);d=setTimeout(x,function(e){var t=o-(e-p);return m?i(t,u-(e-f)):t}(e))}function w(e){return d=void 0,y&&l?v(e):(l=c=void 0,h)}function E(){var e=t(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===d)return function(e){return f=e,d=setTimeout(x,o),g?v(e):h}(p);if(m)return clearTimeout(d),d=setTimeout(x,o),v(p)}return void 0===d&&(d=setTimeout(x,o)),h}return o=n(o)||0,e(s)&&(g=!!s.leading,u=(m="maxWait"in s)?r(n(s.maxWait)||0,o):u,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=p=c=d=void 0},E.flush=function(){return void 0===d?h:w(t())},E},zMe}(),LRe=TRe(ORe),MRe=dMe?dMe.performance:null,RRe=MRe&&MRe.now?function(){return MRe.now()}:function(){return Date.now()},DRe=function(){if(dMe){if(dMe.requestAnimationFrame)return function(e){dMe.requestAnimationFrame(e)};if(dMe.mozRequestAnimationFrame)return function(e){dMe.mozRequestAnimationFrame(e)};if(dMe.webkitRequestAnimationFrame)return function(e){dMe.webkitRequestAnimationFrame(e)};if(dMe.msRequestAnimationFrame)return function(e){dMe.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(RRe())},1e3/60)}}(),PRe=function(e){return DRe(e)},$Re=RRe,BRe=9261,FRe=5381,zRe=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:BRe;!(t=e.next()).done;)n=65599*n+t.value|0;return n},jRe=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:BRe)+e|0},HRe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:FRe;return(t<<5)+t+e|0},URe=function(e){return 2097152*e[0]+e[1]},GRe=function(e,t){return[jRe(e[0],t[0]),HRe(e[1],t[1])]},qRe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return zRe({next:function(){return r=0;r--)e[r]===t&&e.splice(r,1)},pDe=function(e){e.splice(0,e.length)},fDe=function(e,t,n){return n&&(t=cRe(n,t)),e[t]},gDe=function(e,t,n,r){n&&(t=cRe(n,t)),e[t]=r},mDe="undefined"!=typeof Map?Map:function(){return iMe(function e(){rMe(this,e),this._obj={}},[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}])}(),yDe=function(){return iMe(function e(t){if(rMe(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&nRe(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new vDe,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];XMe(t.classes)?l=t.classes:VMe(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,u=l.length;ct?1:0},c=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=e.length);in;0<=n?t++:t--)c.push(t);return c}.apply(this).reverse()).length;ag;0<=g?++d:--d)m.push(a(e,r));return m},f=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t&&i(a,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=a},g=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;i0;){var w=y.pop(),E=g(w),k=w.id();if(h[k]=E,E!==1/0)for(var T=w.neighborhood().intersect(p),_=0;_0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},LDe={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t0;){if(x(),E++,c===h){for(var k=[],T=i,_=h,C=v[_];k.unshift(T),null!=C&&k.unshift(C),null!=(T=y[_]);)C=v[_=T.id()];return{found:!0,distance:d[c],path:this.spawn(k),steps:E}}f[c]=!0;for(var S=l._private.edges,A=0;AC&&(p[_]=C,y[_]=T,v[_]=x),!i){var S=T*c+k;!i&&p[S]>C&&(p[S]=C,y[S]=k,v[S]=x)}}}for(var A=0;A1&&void 0!==arguments[1]?arguments[1]:a,r=[],i=v(e);;){if(null==i)return t.spawn();var o=y(i),l=o.edge,c=o.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=c}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},FDe=Math.sqrt(2),zDe=function(e,t,n){0===n.length&&iDe("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,c=l.length-1;c>=0;c--){var u=l[c],h=u[1],d=u[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&l.splice(c,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=zDe(i,e,t),n--}return t},HDe={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/FDe);if(!(i<2)){for(var l=[],c=0;c0?1:e<0?-1:0},XDe=function(e,t){return Math.sqrt(KDe(e,t))},KDe=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},QDe=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},nPe=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},rPe=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},iPe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},aPe=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=sMe(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},oPe=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},sPe=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},lPe=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},cPe=function(e,t){return lPe(e,t.x,t.y)},uPe=function(e,t){return lPe(e,t.x1,t.y1)&&lPe(e,t.x2,t.y2)},hPe=null!==(ADe=Math.hypot)&&void 0!==ADe?ADe:function(e,t){return Math.sqrt(e*e+t*t)};function dPe(e,t,n,r,i,a){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=hPe(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),c=r(s,o),u=a(l,c);if(Math.abs(u)<1e-9)return n(e,i(l,.5));var h=a(r(o,e),c)/u;return n(e,i(l,h))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===c?LPe(i,a):c,h=i/2,d=a/2,p=(u=Math.min(u,h,d))!==h,f=u!==d;if(p){var g=r-d-o;if((s=_Pe(e,t,n,r,n-h+u-o,g,n+h-u+o,g,!1)).length>0)return s}if(f){var m=n+h+o;if((s=_Pe(e,t,n,r,m,r-d+u-o,m,r+d-u+o,!1)).length>0)return s}if(p){var y=r+d+o;if((s=_Pe(e,t,n,r,n-h+u-o,y,n+h-u+o,y,!1)).length>0)return s}if(f){var v=n-h-o;if((s=_Pe(e,t,n,r,v,r-d+u-o,v,r+d-u+o,!1)).length>0)return s}var b=n-h+u,x=r-d+u;if((l=kPe(e,t,n,r,b,x,u+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+h-u,E=r-d+u;if((l=kPe(e,t,n,r,w,E,u+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var k=n+h-u,T=r+d-u;if((l=kPe(e,t,n,r,k,T,u+o)).length>0&&l[0]>=k&&l[1]>=T)return[l[0],l[1]];var _=n-h+u,C=r+d-u;return(l=kPe(e,t,n,r,_,C,u+o)).length>0&&l[0]<=_&&l[1]>=C?[l[0],l[1]]:[]},fPe=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,a),h=Math.max(r,a);return l-s<=e&&e<=c+s&&u-s<=t&&t<=h+s},gPe=function(e,t,n,r,i,a,o,s,l){var c=Math.min(n,o,i)-l,u=Math.max(n,o,i)+l,h=Math.min(r,s,a)-l,d=Math.max(r,s,a)+l;return!(eu||td)},mPe=function(e,t,n,r,i,a,o,s){var l=[];!function(e,t,n,r,i){var a,o,s,l,c,u,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(c=(c=s+Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u=(u=s-Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+c+u,h+=(c+u)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-u+c)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(o),i[0]=-h+d*Math.cos(l/3),i[2]=-h+d*Math.cos((l+2*Math.PI)/3),i[4]=-h+d*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,l);for(var c=[],u=0;u<6;u+=2)Math.abs(l[u+1])<1e-7&&l[u]>=0&&l[u]<=1&&c.push(l[u]);c.push(1),c.push(0);for(var h,d,p,f=-1,g=0;g=0?pl?(e-i)*(e-i)+(t-a)*(t-a):c-h},vPe=function(e,t,n){for(var r,i,a,o,s=0,l=0;l=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},bPe=function(e,t,n,r,i,a,o,s,l){var c,u=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var h,d=Math.cos(-c),p=Math.sin(-c),f=0;f0){var g=wPe(u,-l);h=xPe(g)}else h=u;return vPe(e,t,h)},xPe=function(e){for(var t,n,r,i,a,o,s,l,c=new Array(e.length/2),u=0;u=0&&f<=1&&m.push(f),g>=0&&g<=1&&m.push(g),0===m.length)return[];var y=m[0]*s[0]+e,v=m[0]*s[1]+t;return m.length>1?m[0]==m[1]?[y,v]:[y,v,m[1]*s[0]+e,m[1]*s[1]+t]:[y,v]},TPe=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},_Pe=function(e,t,n,r,i,a,o,s,l){var c=e-i,u=n-e,h=o-i,d=t-a,p=r-t,f=s-a,g=h*d-f*c,m=u*d-p*c,y=f*u-h*p;if(0!==y){var v=g/y,b=m/y,x=-.001;return x<=v&&v<=1.001&&x<=b&&b<=1.001||l?[e+v*u,t+v*p]:[]}return 0===g||0===m?TPe(e,n,o)===o?[o,s]:TPe(e,n,i)===i?[i,a]:TPe(i,o,n)===n?[n,r]:[]:[]},CPe=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,l=t,c=n;a.push({x:l+o*e[0],y:c+s*e[1]});for(var u=1;u0){var v=wPe(g,-s);c=xPe(v)}else c=g}else c=n;for(var b=0;bc&&(c=t)},h=function(e){return l[e]},d=0;d0?b.edgesTo(v)[0]:v.edgesTo(b)[0];var w=r(x);v=v.id(),c[v]>c[g]+w&&(c[v]=c[g]+w,d.nodes.indexOf(v)<0?d.push(v):d.updateItem(v),l[v]=0,n[v]=[]),c[v]==c[g]+w&&(l[v]=l[v]+l[g],n[v].push(g))}else for(var E=0;E0;){for(var C=t.pop(),S=0;S0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(u,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:e$e,o=r,s=0;s=2?o$e(e,t,n,0,r$e,i$e):o$e(e,t,n,0,n$e)},squaredEuclidean:function(e,t,n){return o$e(e,t,n,0,r$e)},manhattan:function(e,t,n){return o$e(e,t,n,0,n$e)},max:function(e,t,n){return o$e(e,t,n,-1/0,a$e)}};function l$e(e,t,n,r,i,a){var o;return o=YMe(e)?e:s$e[e]||s$e.euclidean,0===t&&YMe(e)?o(i,a):o(t,n,r,i,a)}s$e["squared-euclidean"]=s$e.squaredEuclidean,s$e.squaredeuclidean=s$e.squaredEuclidean;var c$e=hDe({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),u$e=function(e){return c$e(e)},h$e=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return l$e(e,r.length,a,function(e){return r[e](t)},o,s)},d$e=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,l=0;ln)return!1}return!0},y$e=function(e,t,n){for(var r=0;ri&&(i=t[l][c],a=c);o[a].push(e[l])}for(var u=0;u=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[o],g=t[r[o]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var m=0;mn[g.key][y.key]&&(a=n[g.key][y.key])):"max"===i.linkage?(a=n[f.key][y.key],n[f.key][y.key]1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var a=0,o=e.length-1;o>=0;o--){var s=e[o];i?isFinite(s)||(e[o]=-1/0,a++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+a]:(e[c-1+a]+e[c+a])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;io&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var c=0;c=C?(S=C,C=N,A=I):N>S&&(S=N);for(var O=0;O0?1:0;k[E%c.minIterations*t+$]=B,P+=B}if(P>0&&(E>=c.minIterations-1||E==c.maxIterations-1)){for(var F=0,z=0;z0&&r.push(i);return r}(t,a,o),U=function(e,t,n){for(var r=D$e(e,t,n),i=0;il&&(s=c,l=u)}n[i]=a[s]}return D$e(e,t,n)}(t,r,H),G={},q=0;q1||o>1)&&(c=!0),u[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[t].push(e.id())})}else h[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?c=!0:r=t:n=t),u[t]=[],e.connectedEdges().forEach(function(e){return u[t].push(e.id())})):h[t]=[e.source().id(),e.target().id()]});var d={found:!1,trail:void 0};if(c)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,a=[e];u[i].length;)t=u[i].shift(),n=h[t][0],i!=(r=h[t][1])?(u[r]=u[r].filter(function(e){return e!=t}),i=r):s||i==n||(u[n]=u[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},f=[],g=[];for(g=p(i);1!=g.length;)0==u[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var m in f.unshift(l.getElementById(g.shift())),u)if(u[m].length)return d;return d.found=!0,d.trail=this.spawn(f,!0),d}},z$e=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(l,c,u){l===u&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var h,d,p,f,g=e.getElementById(c).connectedEdges().intersection(e);0===g.size()?i.push(e.spawn(e.getElementById(c))):g.forEach(function(n){h=n.source().id(),d=n.target().id(),(p=h===c?d:h)!==u&&(f=n.id(),o[f]||(o[f]=!0,a.push({x:c,y:p,edge:n})),p in t?t[c].low=Math.min(t[c].low,t[p].id):(s(l,p,c),t[c].low=Math.min(t[c].low,t[p].low),t[c].id<=t[p].low&&(t[c].cutVertex=!0,function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)}(c,p))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},j$e=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var c=i.pop();if(l.merge(e.getElementById(c)),t[c].low=t[s].index,t[c].explored=!0,c===s)break}var u=l.edgesWith(l),h=l.merge(u);r.push(h),a=a.difference(h)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},H$e={};[wDe,ODe,LDe,RDe,PDe,BDe,HDe,$Pe,FPe,jPe,UPe,JPe,k$e,O$e,$$e,F$e,{hopcroftTarjanBiconnected:z$e,htbc:z$e,htb:z$e,hopcroftTarjanBiconnectedComponents:z$e},{tarjanStronglyConnected:j$e,tsc:j$e,tscc:j$e,tarjanStronglyConnectedComponents:j$e}].forEach(function(e){vRe(H$e,e)}); +function(e,t,n){var r=this,i=o(null),a=o(0),s=o(null),c=o([]),u=o(),d=o(),p=o(e),f=o(!0);p.current=e;var g="undefined"!=typeof window,m=!t&&0!==t&&g;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,b="maxWait"in n,x="debounceOnServer"in n&&!!n.debounceOnServer,w=b?Math.max(+n.maxWait||0,t):null;l(function(){return f.current=!0,function(){f.current=!1}},[]);var E=h(function(){var e=function(e){var t=c.current,n=u.current;return c.current=u.current=null,a.current=e,d.current=p.current.apply(n,t)},n=function(e,t){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(e):setTimeout(e,t)},o=function(e){if(!f.current)return!1;var n=e-i.current;return!i.current||n>=t||n<0||b&&e-a.current>=w},l=function(t){return s.current=null,v&&c.current?e(t):(c.current=u.current=null,d.current)},h=function e(){var r=Date.now();if(o(r))return l(r);if(f.current){var s=t-(r-i.current),c=b?Math.min(s,w-(r-a.current)):s;n(e,c)}},E=function(){if(g||x){var l=Date.now(),p=o(l);if(c.current=[].slice.call(arguments),u.current=r,i.current=l,p){if(!s.current&&f.current)return a.current=i.current,n(h,t),y?e(i.current):d.current;if(b)return n(h,t),e(i.current)}return s.current||n(h,t),d.current}};return E.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,c.current=i.current=u.current=s.current=null},E.isPending=function(){return!!s.current},E.flush=function(){return s.current?l(Date.now()):d.current},E},[y,b,t,w,v,m,g,x]);return E}(()=>{if(!t?.current)return;const e=t.current.querySelector("code.language-mermaid");e&&r(e.innerText)},600);return l(()=>{if(t?.current){const e=t.current.querySelectorAll("code"),n=["","md","markdown","text","txt","plaintext","tex","latex"];e.forEach(e=>{let t=e.className.match(/language-(\w+)/),r=t?t[1]:"";n.includes(r)&&(e.style.whiteSpace="pre-wrap")}),setTimeout(i,1)}},[t?.current]),Ow.jsxs(Ow.Fragment,{children:[Ow.jsxs("pre",{ref:t,children:[Ow.jsx("span",{className:"copy-code-button",onClick:()=>{}}),e.children]}),n.length>0&&Ow.jsx(Kre,{code:n},n)]})}),Zre=u((e,t)=>{const[n,r]=d(!0),[i,a]=d(!1);l(()=>{if(t?.current){const e=t.current.scrollHeight;a(e>400),t.current.scrollTop=t.current.scrollHeight}},[t?.current]);return Ow.jsxs(Ow.Fragment,{children:[Ow.jsx("code",{className:fE(e?.className),ref:t,style:{maxHeight:"none",overflowY:"hidden"},children:e.children}),null]})});function Jre(e){const t=h(()=>function(e){return e?e?.replace(/([`]*?)(\w*?)([\n\r]*?)()/g,(e,t,n)=>t?e:"\n```html\n"+n)?.replace(/(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*)([`]*)([\n\r]*?)/g,(e,t,n,r,i)=>i?e:t+n+r+"\n```\n"):e}(function(e){return e?e?.replace(/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g,(e,t,n,r)=>t||(n?`$$${n}$$`:r?`$${r}$`:e)):e}(e.content)),[e.content]);return Ow.jsx(bS,{remarkPlugins:[DL,uD,zL],rehypePlugins:[bj,vM,[P$,{detect:!1,ignoreMissing:!0}]],components:{pre:Qre,code:Zre,p:e=>Ow.jsx("p",{...e,dir:"auto"}),a:e=>{const t=e.href||"";if(/\.(aac|mp3|opus|wav)$/.test(t))return Ow.jsx("figure",{children:Ow.jsx("audio",{controls:!0,src:t})});if(/\.(3gp|3g2|webm|ogv|mpeg|mp4|avi)$/.test(t))return Ow.jsx("video",{controls:!0,width:"99.9%",children:Ow.jsx("source",{src:t})});const n=/^\/#/i.test(t)?"_self":e.target??"_blank";return Ow.jsx("a",{...e,target:n})}},children:t})}const eie=t.memo(Jre);function tie(e){const t=o(null);return Ow.jsx("div",{className:"coco-chat",children:Ow.jsx("div",{className:"markdown-body",style:{fontSize:`${e.fontSize??14}px`,fontFamily:e.fontFamily||"inherit"},ref:t,onContextMenu:e.onContextMenu,onDoubleClickCapture:e.onDoubleClickCapture,dir:"auto",children:e.content?Ow.jsx(eie,{content:e.content}):null})})}function nie(e){const{getContainer:t,data:n={},isMobile:r,children:i}=e,[a,o]=d(!1),s=()=>{o(!1)};return Ow.jsxs(Ow.Fragment,{children:[m(i,{onClick:()=>{o(!0)}}),Ow.jsxs(Cv,{title:n.source?.name||" ",onClose:s,open:a,width:r?"100%":724,closeIcon:null,extra:Ow.jsx(tE,{className:"color-[#bbb] cursor-pointer",onClick:s}),rootClassName:lE,getContainer:t,children:[Ow.jsxs("div",{className:"h-full overflow-auto px-24px",children:[Ow.jsx("div",{className:"color-[#027ffe] text-16px mb-8px",children:n.title}),Ow.jsx("div",{className:"color-[#999] mb-16px",children:n.url}),n.tags?.length>0&&Ow.jsxs("div",{className:"color-[#999] mb-16px flex items-center gap-8px mb-24px flex-wrap",children:[Ow.jsx(Jw,{className:"text-24px"}),n.tags.map((e,t)=>Ow.jsx(_x,{className:"bg-#E8E8E8 color-#101010 border-0",children:e},t))]}),n.thumbnail&&Ow.jsx("div",{className:"flex justify-center items-center w-full bg-#F6F8FA rounded-lg mb-16px",children:Ow.jsx("img",{src:n.thumbnail,className:"max-w-full max-h-full object-contain"})}),Ow.jsx("div",{className:"leading-[24px] text-12px",children:Ow.jsx(tie,{content:n.content})})]}),Ow.jsxs("div",{className:"absolute bottom-0 w-full pb-24px px-24px",children:[Ow.jsx("div",{className:"bg-#f5f5f5 rounded-20px mb-24px py-24px px-16px",children:Ow.jsx(ov,{column:2,colon:!1,items:[{key:"type",label:"Type",children:n.type||"-"},{key:"size",label:"Size",children:n.size||"-"},{key:"created_at",label:"Created At",children:n.created?hE(n.created)?dE(n.created):n.created:"-"},{key:"created_by",label:"Created by",children:n.owner?.username||"-"},{key:"updated_at",label:"Updated at",children:n.last_updated_by?.timestamp?hE(n.last_updated_by?.timestamp)?dE(n.last_updated_by?.timestamp):n.last_updated_by?.timestamp:"-"},{key:"updated_by",label:"Updated by",children:n.last_updated_by?.user?.username||"-"}]})}),Ow.jsxs("div",{className:"flex gap-8px",children:[Ow.jsxs(Kc,{size:"large",className:"w-50% rounded-36px",onClick:()=>n.url&&window.open(n.url,"_blank"),children:[Ow.jsx(Zw,{className:"w-14px"})," Open"]}),Ow.jsxs(Kc,{size:"large",type:"primary",className:"w-50% rounded-36px",children:[Ow.jsx(Uw,{className:"w-14px"})," AI 解读"]})]})]})]})]})}function rie(e,t,n="highlight-text"){if(!e||"string"!=typeof e)return e;if(!t||"string"!=typeof t||""===t.trim())return e;const r=t.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(${r})`,"gi");if(!i.test(e))return e;i.lastIndex=0;return e.split(i).map((e,t)=>e&&i.test(e)?(i.lastIndex=0,Ow.jsx("span",{className:n,style:{backgroundColor:"#fff3cd",color:"#856404",padding:"2px 6px",borderRadius:"4px",boxShadow:"0 1px 3px rgba(255, 227, 205, 0.4)",display:"inline-block",lineHeight:"1.3",margin:"0 1px",transition:"all 0.2s ease-in-out"},children:e},t)):e)}var iie="NormalList-module__list___Dxu8i";function aie(e){const{getDetailContainer:t,from:n,size:r,hits:i,onSearch:a,isMobile:o,query:s}=e,l=s||"";return Ow.jsx("div",{className:iie,children:Ow.jsx(ux,{itemLayout:"vertical",size:"large",pagination:{onChange:(e,t)=>{a((e-1)*t,t)},pageSize:r,current:Math.round(n/r+1),total:i?.total||0},dataSource:i?.hits||[],renderItem:(e,n)=>Ow.jsx(nie,{getContainer:t,data:e,isMobile:o,children:Ow.jsxs(ux.Item,{actions:[],className:"mb-24px",extra:e.thumbnail?Ow.jsx("img",{width:"100%",src:e.thumbnail}):null,children:[Ow.jsx(ux.Item.Meta,{title:Ow.jsxs("a",{title:e.title,className:"flex items-center text-base text-[#333]",children:[e.icon?.startsWith("http")&&Ow.jsx("img",{src:e.icon,className:"mr-1 w-4 h-4"}),rie(e.title,l)]}),description:e.summary?Ow.jsx(ww.Text,{ellipsis:{suffix:"...",ellipsis:!0,rows:3,expanded:!0},className:"text-[#999]",children:rie(e.summary,l)}):null}),Ow.jsxs("div",{className:"flex items-center mb-6px",children:[e.source?.name&&Ow.jsx(_x,{color:"#58a65c",className:"text-xs",children:rie(e.source.name,l)}),Ow.jsx(_x,{bordered:!1,color:"blue",className:"text-[##101010]",children:rie(e.type,l)}),e.last_updated_by?.user?.username&&e.last_updated_by?.timestamp?Ow.jsxs("span",{className:"text-[##101010]",children:["Last updated by ",rie(e.last_updated_by.user.username,l)," ",hE(e.last_updated_by?.timestamp)?dE(e.last_updated_by?.timestamp):`at ${e.last_updated_by?.timestamp}`]}):e.created&&Ow.jsxs("span",{className:"text-[##101010]",children:["Created"," ",hE(e.created)?dE(e.created):`at ${e.created}`]})]}),e.url&&Ow.jsx("div",{className:"mb-6px",children:e.url&&Ow.jsxs("a",{className:"truncate w-full inline-block align-middle",href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),children:[Ow.jsx(Zw,{className:"relative top-2px w-14px h-14px mr-1"}),rie(e.url,l)]})})]})},e.id)})})}const oie=[{type:"normal",component:v(aie)}],sie=e=>{const t={took:e?.took||0,total:e?.hits?.total?.value||0,hits:e?.hits?.hits?e?.hits?.hits.map(e=>({...e._source})):[]},n=[];if(e?.aggregations){Object.keys(e?.aggregations).forEach(t=>{const r=e?.aggregations[t]?.buckets||[];n.push({key:t,list:r.map(e=>({count:e.doc_count,key:e.key,name:e.top?.hits?.hits?.[0]?._source?.source?.name||""}))})})}return{hits:t,aggregations:n}};function lie(e){const{text:t}=e;return t?Ow.jsx("div",{className:"w-full text-center color-#999 leading-[24px]",children:t}):null}var cie={};function uie(e){return uie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uie(e)}Object.defineProperty(cie,"__esModule",{value:!0}),cie.CopyToClipboard=void 0;var hie=fie(t),die=fie(jx),pie=["text","onCopy","options","children"];function fie(e){return e&&e.__esModule?e:{default:e}}function gie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mie(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vie(e,t,n){return t&&function(e,t){for(var n=0;n{const[a,o]=d(!1),[s,l]=d(!1),c=Sie.includes(e),u="p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg transition-colors border-0 bg-transparent cursor-pointer";return Ow.jsxs("div",{className:fE("flex items-center gap-1 mt-2",n),children:[!c&&Ow.jsx(Cie.CopyToClipboard,{text:t,onCopy:()=>(async()=>{o(!0);const e=setTimeout(()=>{o(!1),clearTimeout(e)},1e3)})(),children:Ow.jsx("button",{id:i,className:u,children:a?Ow.jsx(qw,{className:"w-4 h-4 text-[#38C200] dark:text-[#38C200]",style:{width:r,height:r}}):Ow.jsx(Ww,{className:"w-4 h-4 text-[#666666] dark:text-[#A3A3A3]",style:{width:r,height:r}})})}),!c&&Ow.jsx("button",{onClick:()=>{if("speechSynthesis"in window){if(s)return window.speechSynthesis.cancel(),void l(!1);const e=new SpeechSynthesisUtterance(t);e.lang="zh-CN",e.onend=()=>{l(!1)},l(!0),window.speechSynthesis.speak(e)}},className:u,children:Ow.jsx(eE,{className:"w-4 h-4 "+(s?"text-[#1990FF] dark:text-[#1990FF]":"text-[#666666] dark:text-[#A3A3A3]"),style:{width:r,height:r}})})]})},Nie=v(function({message:e,isTyping:t,response:n,onResend:r,actionClassName:i,actionIconSize:a,copyButtonId:o,showActions:s=!0,output:l="markdown"}){const c=e?._source?.message||"",u=e?._source?.question||"",h=c||n?.message_chunk||"",d=s&&!1===t&&!!h;return Ow.jsx("div",{className:"flex justify-start",children:Ow.jsx("div",{className:"flex gap-4 w-full",children:Ow.jsx("div",{className:"w-full space-y-2 text-left",children:Ow.jsx("div",{className:"w-full max-w-none",children:Ow.jsx("div",{className:"w-full text-[#333] leading-relaxed",children:(()=>{let n;return"markdown"===l?n=Ow.jsx(tie,{content:h,loading:t,onDoubleClickCapture:()=>{}}):"html"===l?n=Ow.jsx("div",{dangerouslySetInnerHTML:{__html:h}}):"text"===l&&(n=h),Ow.jsxs(Ow.Fragment,{children:[n,t&&Ow.jsx("div",{className:"inline-block w-1.5 h-5 ml-0.5 -mb-0.5 bg-[#666666] dark:bg-[#A3A3A3] rounded-sm animate-typing"}),d&&Ow.jsx(Aie,{id:e._id,content:h,question:u,actionClassName:i,actionIconSize:a,copyButtonId:o,onResend:()=>{r&&r(u)}})]})})()})})})})})}),Iie=e=>{const{config:t={},data:n,loading:r,visible:i,setVisible:a}=e,s=o(null),[c,u]=d(!0);l(()=>{c&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[n,c]);return n&&n.response&&i?Ow.jsxs("div",{className:"flex flex-col gap-2 relative p-4 rounded-3 text-[#333] bg-white shadow-[0_4px_8px_rgba(0,0,0,0.1)] dark:shadow-[0_4px_20px_rgba(255,255,255,0.2)]",style:{maxHeight:t.height?t.height:"auto"},children:[Ow.jsx("div",{className:"absolute top-2 right-2 flex items-center justify-center size-[20px] border rounded-md cursor-pointer dark:border-[#282828]",onClick:()=>{a(!1)},children:Ow.jsx(tE,{className:"size-4"})}),t.title&&Ow.jsxs("div",{className:"flex item-center gap-1",children:[t.logo?.light?Ow.jsx("img",{src:t.logo.light,className:"size-4"}):Ow.jsx(Qw,{className:"size-4 text-[#881c94]"}),t.title&&Ow.jsx("span",{className:"text-xs font-semibold",children:t.title})]}),Ow.jsx("div",{ref:s,onScroll:()=>{const e=s.current;if(e){const t=e.scrollHeight-e.scrollTop<=e.clientHeight+100;u(t)}},className:"flex-1 overflow-auto text-sm",children:Ow.jsx(Nie,{message:{_id:"current",_source:{type:"assistant",message:"",question:""}},...n,isTyping:r,rootClassName:"!py-0",actionClassName:"absolute bottom-3 left-3 !m-0",actionIconSize:12,showActions:t.showActions,output:t.output},"current")}),Ow.jsx("div",{className:fE("min-h-[20px]",{hidden:r||!1===t.showActions})})]}):null},Oie=e=>{const{askBody:t,config:n,onAsk:r}=e,[i,a]=d(),[o,s]=d(!1),[c,u]=d(!0),h=(e,t)=>{const n=e.chunk_type,r=t?.[n];let i=r?r.message_chunk:"";return i+="deep_read"===n?"&"+e.message_chunk:e.message_chunk,{...t||{},[n]:{...r||{},message_chunk:i}}};return l(()=>{((e,t)=>{e&&t.assistant&&(a(),r(t.assistant,e,e=>{a(t=>h(e,t))},s))})(t?.message,n)},[t?.message,t?._t,n]),l(()=>{t?._t&&u(!0)},[t?._t]),Ow.jsx(Iie,{config:n,data:i,loading:o,visible:c,setVisible:u})};const Lie=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r{const{logo:t={},placeholder:n,welcome:r,type:i,aiOverview:a,widgets:s=[],onSearch:c,onAsk:u,config:p={},root:f,isFirst:g=!1,rightMenuWidth:m,queryParams:y={},setQueryParams:v}=e,[b,x]=d(sie()),[w,E]=d(),[k,T]=d(!1),[_,C]=d(!1),S=o(!0),A=(e,t)=>{S.current=t,v({...e,t:(new Date).valueOf()})};l(()=>{const e=()=>{C(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{if(y.query){const e=y.filter&&0===Object.keys(y.filter).length;c(y,e=>{let t;e&&!e.error?(t=sie(e),x(n=>({...t,aggregations:e?.aggregations?t.aggregations:n.aggregations}))):x(sie()),S.current&&(S.current=!1,E({message:JSON.stringify({query:y.query,result:t.hits}),t:(new Date).valueOf()}))},T,e)}},[y]),l(()=>(window.onsearch=e=>A({...y,from:0,query:e},!0),()=>{window.onsearch=void 0}),[y]);const N=h(()=>{if(oie&&0!==oie.length)return oie.find(e=>e.type===i)||oie[0]},[i]),I={isMobile:_},{query:O,from:L,size:M,filter:R}=y,{hits:D,aggregations:P}=b;return Ow.jsx(Rw,{rootID:Lie,isFirst:g,loading:k,logo:Ow.jsx(rE,{isFirst:g,onLogoClick:()=>{v({from:0,size:10,query:"",filter:{},sort:""})},...I,...t}),welcome:r?Ow.jsx(lie,{...I,text:r}):null,searchbox:Ow.jsx(nE,{...I,placeholder:n,query:O,onSearch:e=>A({...y,from:0,query:e},!0)}),rightMenuWidth:m,aggregations:Ow.jsx(oE,{...I,config:p.aggregations,aggregations:P,filter:R,onSearch:e=>A({...y,filter:e})}),resultHeader:Ow.jsx(sE,{hits:D,...I}),aiOverview:a?.enabled?Ow.jsx(Oie,{askBody:w,config:a,onAsk:u}):null,resultList:N?Ow.jsx(N.component,{...I,getDetailContainer:()=>f.getElementById(Lie),from:L,size:M,hits:D,query:O,onSearch:(e,t)=>A({...y,from:e,size:t})}):null,widgets:Ow.jsx(Ow.Fragment,{children:s.map((e,t)=>Ow.jsx(Oie,{askBody:w,config:e,onAsk:u},t))}),...I})},Rie=e=>{const{onSearch:t,queryParams:n}=e,[r,i]=d(!0),a=o(!0);return Ow.jsx(Mie,{...e,isFirst:!n.query&&r,onSearch:(e,n,r,o)=>{a.current&&(i(!1),a.current=!1),t(e,n,r,o)}})};function Die(e){const{placeholder:t}=e,n=o(null),r=o(null),[i,a]=d({key:!0,placeholder:!0});return l(()=>{n.current&&n.current.disconnect();const e=r.current;if(e)return n.current=new ResizeObserver(e=>{for(const t of e)t.target.offsetWidth<48?a({key:!1,placeholder:!1}):t.target.offsetWidth<120?a({key:!1,placeholder:!0}):a({key:!0,placeholder:!0})}),n.current.observe(e),()=>{n.current.disconnect()}},[t,r.current]),Ow.jsxs(Kc,{ref:r,size:"large",className:"min-w-42px max-w-100% flex items-center justify-between px-12px",children:[Ow.jsx(Kw,{className:"w-16px h-16px"}),i.placeholder&&Ow.jsx("div",{className:"text-left truncate w-[calc(100%-64px)]",children:t}),i.key&&Ow.jsxs("div",{className:"flex gap-12px items-center",children:[Ow.jsx(Xw,{className:"w-16px h-16px"}),Ow.jsx(Kc,{className:"w-20px h-20px rounded-50% p-0",type:"primary",children:Ow.jsx(Vw,{className:"w-10px h-10px"})})]})]})}const Pie=e=>{const{children:t,...n}=e,{root:r}=n,[i,a]=d(!1);return Ow.jsxs(Ow.Fragment,{children:[t?m(t,{onClick:()=>a(!0)}):Ow.jsx("div",{style:{minWidth:42,maxWidth:"100%"},onClick:()=>a(!0),children:Ow.jsx(Die,{placeholder:e.placeholder})}),Ow.jsx(fx,{open:i,style:{top:0,margin:0,padding:0,maxWidth:"100vw"},width:"100%",onCancel:()=>a(!1),destroyOnClose:!0,getContainer:r,footer:null,styles:{content:{padding:0,minHeight:"100vh"}},keyboard:!0,children:Ow.jsx(Rie,{...n})})]})},$ie=e=>{const{shadow:n}=e;return Ow.jsx(t.StrictMode,{children:Ow.jsx(fe,{container:n,children:Ow.jsx(Rie,{...e,root:n||document})})})},Bie=e=>{const{shadow:n}=e;return Ow.jsx(t.StrictMode,{children:Ow.jsx(fe,{container:n,children:Ow.jsx(Pie,{...e,root:n||document})})})};function Fie(e){return"symbol"==typeof e||o3(e)&&"[object Symbol]"==h4(e)}function zie(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n-1}function oae(e){return f3(e)?z3(e):Mte(e)}var sae=Object.prototype.hasOwnProperty,lae=t5(function(e,t){if(i3(t)||f3(t))P3(t,oae(t),e);else for(var n in t)sae.call(t,n)&&D3(e,n,t[n])}),cae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uae=/^\w*$/;function hae(e,t){if(d3(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Fie(e))||(uae.test(e)||!cae.test(e)||null!=t&&e in Object(t))}var dae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pae=/\\(\\)?/g,fae=function(e){var t=B4(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(dae,function(e,n,r,i){t.push(r?i.replace(pae,"$1"):n||e)}),t});function gae(e){return null==e?"":Uie(e)}function mae(e,t){return d3(e)?e:hae(e,t)?[e]:fae(gae(e))}function yae(e){if("string"==typeof e||Fie(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function vae(e,t){for(var n=0,r=(t=mae(t,e)).length;null!=e&&ni?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,p=2&n?new Zae:void 0;for(a.set(e,t),a.set(t,e);++h2?t[2]:void 0;for(i&&e5(t[0],t[1],i)&&(r=1);++n=200&&(a=eoe,o=!1,t=new Zae(t));e:for(;++i-1?r[i?e[a]:a]:void 0});function Goe(e){return e&&e.length?e[0]:void 0}function qoe(e,t){var n=-1,r=f3(e)?Array(e.length):[];return _oe(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Woe(e,t){return(d3(e)?zie:qoe)(e,woe(t))}function Voe(e,t){return Eae(Woe(e,t))}var Yoe,Xoe,Koe=Object.prototype.hasOwnProperty,Qoe=(Yoe=function(e,t,n){Koe.call(e,n)?e[n].push(t):j4(e,n,[t])},function(e,t){var n=d3(e)?Eoe:Coe,r=Xoe?Xoe():{};return n(e,Yoe,woe(t),r)});function Zoe(e,t){return e>t}var Joe=Object.prototype.hasOwnProperty;function ese(e,t){return null!=e&&Joe.call(e,t)}function tse(e,t){return null!=e&&yoe(e,t,ese)}function nse(e){return"string"==typeof e||!d3(e)&&o3(e)&&"[object String]"==h4(e)}function rse(e){return null==e?[]:function(e,t){return zie(t,function(t){return e[t]})}(e,oae(e))}var ise=Math.max;function ase(e,t,n,r){e=f3(e)?e:rse(e),n=n?Jie(n):0;var i=e.length;return n<0&&(n=ise(i+n,0)),nse(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&iae(e,t,n)>-1}function ose(e,t,n){if(!(null==e?0:e.length))return-1;return iae(e,t,0)}var sse=I3&&I3.isRegExp,lse=sse?C3(sse):function(e){return o3(e)&&"[object RegExp]"==h4(e)};function cse(e){return void 0===e}function use(e,t){return et||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&e=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}var wse=function(e){return Z3(Y3(e,void 0,kae),e+"")}(function(e,t){return null==e?{}:function(e,t){return yse(e,t,function(t,n){return voe(e,n)})}(e,t)}),Ese=Math.ceil,kse=Math.max;var Tse=function(e,t,n){return n&&"number"!=typeof n&&e5(e,t,n)&&(t=n=void 0),e=Zie(e),void 0===t?(t=e,e=0):t=Zie(t),function(e,t,n){for(var r=-1,i=kse(Ese((t-e)/(n||1)),0),a=Array(i);i--;)a[++r]=e,e+=n;return a}(e,t,n=void 0===n?e1&&e5(e,t[0],t[1])?t=[]:n>2&&e5(t[0],t[1],t[2])&&(t=[t[0]]),xse(e,Eae(t),[])}),Ose=Pte&&1/roe(new Pte([,-0]))[1]==1/0?function(e){return new Pte(e)}:eae;function Lse(e,t,n){var r=-1,i=aae,a=e.length,o=!0,s=[],l=s;if(a>=200){var c=t?null:Ose(e);if(c)return roe(c);o=!1,i=eoe,l=new Zae}else l=t?[]:s;e:for(;++r1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=$se,this._children[e]={},this._children[$se][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Doe(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),Doe(oae(this._in[e]),t),delete this._in[e],delete this._preds[e],Doe(oae(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(cse(t))t=$se;else{for(var n=t+="";!cse(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==$se)return t}}children(e){if(cse(e)&&(e=$se),this._isCompound){var t=this._children[e];if(t)return oae(t)}else{if(e===$se)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return oae(t)}successors(e){var t=this._sucs[e];if(t)return oae(t)}neighbors(e){var t=this.predecessors(e);if(t)return Mse(t,this.successors(e))}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Doe(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),Doe(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return void 0===a||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&Doe(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return p4(e)||(e=X3(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return rse(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return Cse(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=""+e,t=""+t,cse(n)||(n=""+n);var o=jse(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!cse(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=function(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};r&&(s.name=r);return s}(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,Fse(this._preds[t],e),Fse(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=1===arguments.length?Hse(this._isDirected,arguments[0]):jse(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=1===arguments.length?Hse(this._isDirected,arguments[0]):jse(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=1===arguments.length?Hse(this._isDirected,arguments[0]):jse(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],zse(this._preds[t],e),zse(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=rse(n);return t?zoe(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=rse(n);return t?zoe(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}function Fse(e,t){e[t]?e[t]++:e[t]=1}function zse(e,t){--e[t]||delete e[t]}function jse(e,t,n,r){var i=""+t,a=""+n;if(!e&&i>a){var o=i;i=a,a=o}return i+""+a+""+(cse(r)?"\0":r)}function Hse(e,t){return jse(e,t.v,t.w,t.name)}Bse.prototype._nodeCount=0,Bse.prototype._edgeCount=0;class Use{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return Gse(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&Gse(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,qse)),n=n._prev;return"["+e.join(", ")+"]"}}function Gse(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qse(e,t){if("_next"!==e&&"_prev"!==e)return t}var Wse=X3(1);function Vse(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new Bse,r=0,i=0;Doe(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),Doe(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=Tse(i+r+3).map(function(){return new Use}),o=r+1;return Doe(n.nodes(),function(e){Xse(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}(e,t||Wse),r=function(e,t,n){var r,i=[],a=t[t.length-1],o=t[0];for(;e.nodeCount();){for(;r=o.dequeue();)Yse(e,t,n,r);for(;r=a.dequeue();)Yse(e,t,n,r);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(r=t[s].dequeue()){i=i.concat(Yse(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return kae(Woe(r,function(t){return e.outEdges(t.v,t.w)}))}function Yse(e,t,n,r,i){var a=i?[]:void 0;return Doe(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Xse(t,n,s)}),Doe(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Xse(t,n,o)}),e.removeNode(r.v),a}function Xse(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Kse(e){var t="greedy"===e.graph().acyclicer?Vse(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,Doe(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return Doe(e.nodes(),i),t}(e);Doe(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Pse("rev"))})}function Qse(e,t,n,r){var i;do{i=Pse(r)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function Zse(e){var t=new Bse({multigraph:e.isMultigraph()}).setGraph(e.graph());return Doe(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),Doe(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function Jse(e,t){var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=c*o/s,r=c):(o<0&&(l=-l),n=l,r=l*s/o),{x:i+n,y:a+r}}function ele(e){var t=Woe(Tse(nle(e)+1),function(){return[]});return Doe(e.nodes(),function(n){var r=e.node(n),i=r.rank;cse(i)||(t[i][r.order]=n)}),t}function tle(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Qse(e,"border",i,t)}function nle(e){return pse(Woe(e.nodes(),function(t){var n=e.node(t).rank;if(!cse(n))return n}))}function rle(e,t){return t()}function ile(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],l=Qse(e,"border",o,n);i[t][a]=l,e.setParent(l,r),s&&e.setEdge(s,l,{weight:1})}function ale(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){Doe(e.nodes(),function(t){lle(e.node(t))}),Doe(e.edges(),function(t){var n=e.edge(t);Doe(n.points,lle),Object.prototype.hasOwnProperty.call(n,"y")&&lle(n)})}(e),"lr"!==t&&"rl"!==t||(!function(e){Doe(e.nodes(),function(t){cle(e.node(t))}),Doe(e.edges(),function(t){var n=e.edge(t);Doe(n.points,cle),Object.prototype.hasOwnProperty.call(n,"x")&&cle(n)})}(e),ole(e))}function ole(e){Doe(e.nodes(),function(t){sle(e.node(t))}),Doe(e.edges(),function(t){sle(e.edge(t))})}function sle(e){var t=e.width;e.width=e.height,e.height=t}function lle(e){e.y=-e.y}function cle(e){var t=e.x;e.x=e.y,e.y=t}function ule(e){e.graph().dummyChains=[],Doe(e.edges(),function(t){!function(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a===r+1)return;e.removeEdge(t);var c,u,h=void 0;for(u=0,++r;ro.lim&&(s=o,l=!0);var c=zoe(t.edges(),function(t){return l===Sle(e,e.node(t.v),s)&&l!==Sle(e,e.node(t.w),s)});return gse(c,function(e){return dle(t,e)})}function Cle(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Ele(e),xle(e,t),function(e,t){var n=Uoe(e.nodes(),function(e){return!t.node(e).parent}),r=function(e,t){return yle(e,t,"pre")}(e,n);Doe(r=r.slice(1),function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}(e,t)}function Sle(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Ale(e){switch(e.graph().ranker){case"network-simplex":default:Ile(e);break;case"tight-tree":!function(e){hle(e),ple(e)}(e);break;case"longest-path":Nle(e)}}new Error,ble.initLowLimValues=Ele,ble.initCutValues=xle,ble.calcCutValue=wle,ble.leaveEdge=Tle,ble.enterEdge=_le,ble.exchangeEdges=Cle;var Nle=hle;function Ile(e){ble(e)}function Ole(e){var t=Qse(e,"root",{},"_root"),n=function(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&Doe(a,function(e){n(e,i+1)}),t[r]=i}return Doe(e.children(),function(e){n(e,1)}),t}(e),r=pse(rse(n))-1,i=2*r+1;e.graph().nestingRoot=t,Doe(e.edges(),function(t){e.edge(t).minlen*=i});var a=function(e){return Cse(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;Doe(e.children(),function(o){Lle(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Lle(e,t,n,r,i,a,o){var s=e.children(o);if(s.length){var l=tle(e,"_bt"),c=tle(e,"_bb"),u=e.node(o);e.setParent(l,o),u.borderTop=l,e.setParent(c,o),u.borderBottom=c,Doe(s,function(s){Lle(e,t,n,r,i,a,s);var u=e.node(s),h=u.borderTop?u.borderTop:s,d=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,f=h!==d?1:i-a[o]+1;e.setEdge(l,h,{weight:p,minlen:f,nestingEdge:!0}),e.setEdge(d,c,{weight:p,minlen:f,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}else o!==t&&e.setEdge(t,o,{weight:0,minlen:n})}function Mle(e,t,n){var r=function(e){var t;for(;e.hasNode(t=Pse("_root")););return t}(e),i=new Bse({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return Doe(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),Doe(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=cse(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Rle(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),s[t=t-1>>1]+=e.weight;l+=e.weight*n})),l}function Ple(e,t){var n={};return Doe(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};cse(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),Doe(t.edges(),function(e){var t=n[e.v],r=n[e.w];cse(t)||cse(r)||(r.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){t.merged||(cse(t.barycenter)||cse(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function r(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),Doe(i.in.reverse(),n(i)),Doe(i.out,r(i))}return Woe(zoe(t,function(e){return!e.merged}),function(e){return wse(e,["vs","i","barycenter","weight"])})}(zoe(n,function(e){return!e.indegree}))}function $le(e,t){var n,r=function(e,t){var n={lhs:[],rhs:[]};return Doe(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}(e,function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}),i=r.lhs,a=Ise(r.rhs,function(e){return-e.i}),o=[],s=0,l=0,c=0;i.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),c=Ble(o,a,c),Doe(i,function(e){c+=e.vs.length,o.push(e.vs),s+=e.barycenter*e.weight,l+=e.weight,c=Ble(o,a,c)});var u={vs:kae(o)};return l&&(u.barycenter=s/l,u.weight=l),u}function Ble(e,t,n){for(var r;t.length&&(r=Ooe(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Fle(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=zoe(i,function(e){return e!==o&&e!==s}));var c=function(e,t){return Woe(t,function(t){var n=e.inEdges(t);if(n.length){var r=Cse(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}(e,i);Doe(c,function(t){if(e.children(t.v).length){var i=Fle(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&function(e,t){cse(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}(t,i)}});var u=Ple(c,n);!function(e,t){Doe(e,function(e){e.vs=kae(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}(u,l);var h=$le(u,r);if(o&&(h.vs=kae([o,h.vs,s]),e.predecessors(o).length)){var d=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+d.order+p.order)/(h.weight+2),h.weight+=2}return h}function zle(e){var t=nle(e),n=jle(e,Tse(1,t+1),"inEdges"),r=jle(e,Tse(t-1,-1,-1),"outEdges"),i=function(e){var t={},n=zoe(e.nodes(),function(t){return!e.children(t).length}),r=pse(Woe(n,function(t){return e.node(t).rank})),i=Woe(Tse(r+1),function(){return[]}),a=Ise(n,function(t){return e.node(t).rank});return Doe(a,function n(r){if(!tse(t,r)){t[r]=!0;var a=e.node(r);i[a.rank].push(r),Doe(e.successors(r),n)}}),i}(e);Ule(e,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,l=0;l<4;++s,++l){Hle(s%2?n:r,s%4>=2);var c=Rle(e,i=ele(e));cl||c>t[i].lim));a=i,i=r;for(;(i=e.parent(i))!==a;)s.push(i);return{path:o.concat(s.reverse()),lca:a}}(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,c=o[l],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(c=o[l])!==s&&e.node(c).maxRankn){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function Vle(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Yle(e,t,n,r,i){var a={},o=function(e,t,n,r){var i=new Bse,a=e.graph(),o=function(e,t,n){return function(r,i,a){var o,s=r.node(i),l=r.node(a),c=0;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":o=-s.width/2;break;case"r":o=s.width/2}if(o&&(c+=n?o:-o),o=0,c+=(s.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":o=l.width/2;break;case"r":o=-l.width/2}return o&&(c+=n?o:-o),o=0,c}}(a.nodesep,a.edgesep,r);return Doe(t,function(t){var r;Doe(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],l=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),l||0))}r=t})}),i}(e,t,n,i),s=i?"borderLeft":"borderRight";function l(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return l(function(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)},o.predecessors.bind(o)),l(function(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[t]=Math.max(a[t],n))},o.successors.bind(o)),Doe(r,function(e){a[e]=a[n[e]]}),a}function Xle(e,t){return gse(rse(t),function(t){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return function(e,t){null==e||U4(e,Roe(t),U3)}(t,function(t,i){var a=function(e,t){return e.node(t).width}(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Kle(e){var t,n=ele(e),r=n5(qle(e,n),function(e,t){var n={};function r(t,r,i,a,o){var s;Doe(Tse(r,i),function(r){s=t[r],e.node(s).dummy&&Doe(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.ordero)&&Wle(n,t,s)})})}return Cse(t,function(t,n){var i,a=-1,o=0;return Doe(n,function(s,l){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(i=e.node(c[0]).order,r(n,o,l,a,i),o=l,a=i)}r(n,o,n.length,i,t.length)}),n}),n}(e,n)),i={};Doe(["u","d"],function(a){t="u"===a?n:rse(n).reverse(),Doe(["l","r"],function(n){"r"===n&&(t=Woe(t,function(e){return rse(e).reverse()}));var o=("u"===a?e.predecessors:e.successors).bind(e),s=function(e,t,n,r){var i={},a={},o={};return Doe(t,function(e){Doe(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),Doe(t,function(e){var t=-1;Doe(e,function(e){var s=r(e);if(s.length){s=Ise(s,function(e){return o[e]});for(var l=(s.length-1)/2,c=Math.floor(l),u=Math.ceil(l);c<=u;++c){var h=s[c];a[e]===e&&t{var t=n(" buildLayoutGraph",()=>function(e){var t=new Bse({multigraph:!0,compound:!0}),n=lce(e.graph());return t.setGraph(n5({},ece,sce(n,Jle),wse(n,tce))),Doe(e.nodes(),function(n){var r=lce(e.node(n));t.setNode(n,Noe(sce(r,nce),rce)),t.setParent(n,e.parent(n))}),Doe(e.edges(),function(n){var r=lce(e.edge(n));t.setEdge(n,n5({},ace,sce(r,ice),wse(r,oce)))}),t}(e));n(" runLayout",()=>function(e,t){t(" makeSpaceForEdgeLabels",()=>function(e){var t=e.graph();t.ranksep/=2,Doe(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)),t(" removeSelfEdges",()=>function(e){Doe(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)),t(" acyclic",()=>Kse(e)),t(" nestingGraph.run",()=>Ole(e)),t(" rank",()=>Ale(Zse(e))),t(" injectEdgeLabelProxies",()=>function(e){Doe(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};Qse(e,"edge-proxy",i,"_ep")}})}(e)),t(" removeEmptyRanks",()=>function(e){var t=fse(Woe(e.nodes(),function(t){return e.node(t).rank})),n=[];Doe(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;Doe(n,function(t,n){cse(t)&&n%i!==0?--r:r&&Doe(t,function(t){e.node(t).rank+=r})})}(e)),t(" nestingGraph.cleanup",()=>function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,Doe(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}(e)),t(" normalizeRanks",()=>function(e){var t=fse(Woe(e.nodes(),function(t){return e.node(t).rank}));Doe(e.nodes(),function(n){var r=e.node(n);tse(r,"rank")&&(r.rank-=t)})}(e)),t(" assignRankMinMax",()=>function(e){var t=0;Doe(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=pse(t,r.maxRank))}),e.graph().maxRank=t}(e)),t(" removeEdgeLabelProxies",()=>function(e){Doe(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)),t(" normalize.run",()=>ule(e)),t(" parentDummyChains",()=>Gle(e)),t(" addBorderSegments",()=>function(e){Doe(e.children(),function t(n){var r=e.children(n),i=e.node(n);if(r.length&&Doe(r,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;azle(e)),t(" insertSelfEdges",()=>function(e){var t=ele(e);Doe(t,function(t){var n=0;Doe(t,function(t,r){var i=e.node(t);i.order=r+n,Doe(i.selfEdges,function(t){Qse(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},"_se")}),delete i.selfEdges})})}(e)),t(" adjustCoordinateSystem",()=>function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||ole(e)}(e)),t(" position",()=>Qle(e)),t(" positionSelfEdges",()=>function(e){Doe(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}(e)),t(" removeBorderNodes",()=>function(e){Doe(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(Ooe(n.borderLeft)),o=e.node(Ooe(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),Doe(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)),t(" normalize.undo",()=>function(e){Doe(e.graph().dummyChains,function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)})}(e)),t(" fixupEdgeLabelCoords",()=>function(e){Doe(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)),t(" undoCoordinateSystem",()=>ale(e)),t(" translateGraph",()=>function(e){var t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(e){var a=e.x,o=e.y,s=e.width,l=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-l/2),i=Math.max(i,o+l/2)}Doe(e.nodes(),function(t){l(e.node(t))}),Doe(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,"x")&&l(n)}),t-=o,r-=s,Doe(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),Doe(e.edges(),function(n){var i=e.edge(n);Doe(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}(e)),t(" assignNodeIntersects",()=>function(e){Doe(e.edges(),function(t){var n,r,i=e.edge(t),a=e.node(t.v),o=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=a),i.points.unshift(Jse(a,n)),i.points.push(Jse(o,r))})}(e)),t(" reversePoints",()=>function(e){Doe(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)),t(" acyclic.undo",()=>function(e){Doe(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}(e))}(t,n)),n(" updateInputGraph",()=>function(e,t){Doe(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),Doe(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t))})}var Jle=["nodesep","edgesep","ranksep","marginx","marginy"],ece={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},tce=["acyclicer","ranker","rankdir","align"],nce=["width","height"],rce={width:0,height:0},ice=["minlen","weight","width","height","labeloffset"],ace={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},oce=["labelpos"];function sce(e,t){return hse(wse(e,t),Number)}function lce(e){var t={};return Doe(e,function(e,n){t[n.toLowerCase()]=e}),t}function cce(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:uce(e),edges:hce(e)};return cse(e.graph())||(t.value=Xae(e.graph())),t}function uce(e){return Woe(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return cse(n)||(i.value=n),cse(r)||(i.parent=r),i})}function hce(e){return Woe(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return cse(t.name)||(r.name=t.name),cse(n)||(r.value=n),r})}var dce=new Map,pce=new Map,fce=new Map,gce=JH(()=>{pce.clear(),fce.clear(),dce.clear()},"clear"),mce=JH((e,t)=>{const n=pce.get(t)||[];return nU.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),yce=JH((e,t)=>{const n=pce.get(t)||[];return nU.info("Descendants of ",t," is ",n),nU.info("Edge is ",e),e.v!==t&&e.w!==t&&(n?n.includes(e.v)||mce(e.v,t)||mce(e.w,t)||n.includes(e.w):(nU.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),vce=JH((e,t,n,r)=>{nU.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),nU.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(i=>{if(t.children(i).length>0)vce(i,t,n,r);else{const a=t.node(i);nU.info("cp ",i," to ",r," with parent ",e),n.setNode(i,a),r!==t.parent(i)&&(nU.warn("Setting parent",i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(nU.debug("Setting parent",i,e),n.setParent(i,e)):(nU.info("In copy ",e,"root",r,"data",t.node(e),r),nU.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const o=t.edges(i);nU.debug("Copying Edges",o),o.forEach(i=>{nU.info("Edge",i);const a=t.edge(i.v,i.w,i.name);nU.info("Edge data",a,r);try{yce(i,r)?(nU.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),nU.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):nU.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(e){nU.error(e)}})}nU.debug("Removing node",i),t.removeNode(i)})},"copy"),bce=JH((e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)fce.set(i,e),r=[...r,...bce(i,t)];return r},"extractDescendants"),xce=JH((e,t,n)=>{const r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},"findCommonEdges"),wce=JH((e,t,n)=>{const r=t.children(e);if(nU.trace("Searching children of id ",e,r),r.length<1)return e;let i;for(const e of r){const r=wce(e,t,n),a=xce(t,n,r);if(r){if(!(a.length>0))return r;i=r}}return i},"findNonClusterChild"),Ece=JH(e=>dce.has(e)&&dce.get(e).externalConnections&&dce.has(e)?dce.get(e).id:e,"getAnchorId"),kce=JH((e,t)=>{if(!e||t>10)nU.debug("Opting out, no graph ");else{nU.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(nU.warn("Cluster identified",t," Replacement id in edges: ",wce(t,e,t)),pce.set(t,bce(t,e)),dce.set(t,{id:wce(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const n=e.children(t),r=e.edges();n.length>0?(nU.debug("Cluster identified",t,pce),r.forEach(e=>{mce(e.v,t)^mce(e.w,t)&&(nU.warn("Edge: ",e," leaves cluster ",t),nU.warn("Descendants of XXX ",t,": ",pce.get(t)),dce.get(t).externalConnections=!0)})):nU.debug("Not a cluster ",t,pce)});for(let t of dce.keys()){const n=dce.get(t).id,r=e.parent(n);r!==t&&dce.has(r)&&!dce.get(r).externalConnections&&(dce.get(t).id=r)}e.edges().forEach(function(t){const n=e.edge(t);nU.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),nU.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(nU.warn("Fix XXX",dce,"ids:",t.v,t.w,"Translating: ",dce.get(t.v)," --- ",dce.get(t.w)),dce.get(t.v)||dce.get(t.w)){if(nU.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),r=Ece(t.v),i=Ece(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){const i=e.parent(r);dce.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){const r=e.parent(i);dce.get(r).externalConnections=!0,n.toCluster=t.w}nU.warn("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,n,t.name)}}),nU.warn("Adjusted Graph",cce(e)),Tce(e,0),nU.trace(dce)}},"adjustClustersAndEdges"),Tce=JH((e,t)=>{if(nU.warn("extractor - ",t,cce(e),e.children("D")),t>10)return void nU.error("Bailing out");let n=e.nodes(),r=!1;for(const t of n){const n=e.children(t);r=r||n.length>0}if(r){nU.debug("Nodes = ",n,t);for(const r of n)if(nU.debug("Extracting node",r,dce,dce.has(r)&&!dce.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),dce.has(r))if(!dce.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){nU.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";dce.get(r)?.clusterData?.dir&&(n=dce.get(r).clusterData.dir,nU.warn("Fixing dir",dce.get(r).clusterData.dir,n));const i=new Bse({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});nU.warn("Old graph before copy",cce(e)),vce(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:dce.get(r).clusterData,label:dce.get(r).label,graph:i}),nU.warn("New graph after copy node: (",r,")",cce(i)),nU.debug("Old graph after copy",cce(e))}else nU.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!dce.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),nU.debug(dce);else nU.debug("Not a cluster",r,t);n=e.nodes(),nU.warn("New list of nodes",n);for(const r of n){const n=e.node(r);nU.warn(" Now next level",r,n),n?.clusterNode&&Tce(n.graph,t+1)}}else nU.debug("Done, no node has children",e.nodes())},"extractor"),_ce=JH((e,t)=>{if(0===t.length)return[];let n=Object.assign([],t);return t.forEach(t=>{const r=e.children(t),i=_ce(e,r);n=[...n,...i]}),n},"sorter"),Cce=JH(e=>_ce(e,e.children()),"sortNodesByHierarchy"),Sce=JH(async(e,t,n,r,i,a)=>{nU.warn("Graph in recursive render:XAX",cce(t),i);const o=t.graph().rankdir;nU.trace("Dir in recursive render - dir:",o);const s=e.insert("g").attr("class","root");t.nodes()?nU.info("Recursive render XXX",t.nodes()):nU.info("No nodes found for",t),t.edges().length>0&&nU.info("Recursive edges",t.edge(t.edges()[0]));const l=s.insert("g").attr("class","clusters"),c=s.insert("g").attr("class","edgePaths"),u=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(e){const s=t.node(e);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));nU.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",n.height,"\nParent cluster",i.height),t.setNode(i.id,n),t.parent(e)||(nU.trace("Setting parent",e,i.id),t.setParent(e,i.id,n))}if(nU.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),s?.clusterNode){nU.info("Cluster identified XBX",e,s.width,t.node(e));const{ranksep:i,nodesep:o}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:i+25,nodesep:o});const l=await Sce(h,s.graph,n,r,t.node(e),a),c=l.elem;w8(s,c),s.diff=l.diff||0,nU.info("New compound node after recursive render XAX",e,"width",s.width,"height",s.height),zee(c,s)}else t.children(e).length>0?(nU.trace("Cluster - the non recursive path XBX",e,s.id,s,s.width,"Graph:",t),nU.trace(wce(s.id,t)),dce.set(s.id,{id:wce(s.id,t),node:s})):(nU.trace("Node - the non recursive path XAX",e,h,t.node(e),o),await Fee(h,t.node(e),{config:a,dir:o}))}));const d=JH(async()=>{const e=t.edges().map(async function(e){const n=t.edge(e.v,e.w,e.name);nU.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),nU.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),nU.info("Fix",dce,"ids:",e.v,e.w,"Translating: ",dce.get(e.v),dce.get(e.w)),await Kee(u,n)});await Promise.all(e)},"processEdges");await d(),nU.info("Graph before layout:",JSON.stringify(cce(t))),nU.info("############################################# XXX"),nU.info("### Layout ### XXX"),nU.info("############################################# XXX"),Zle(t),nU.info("Graph after layout:",JSON.stringify(cce(t)));let p=0,{subGraphTitleTotalMargin:f}=lY(a);return await Promise.all(Cce(t).map(async function(e){const n=t.node(e);if(nU.info("Position XBX => "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=f,nU.info("A tainted cluster node XBX1",e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),dce.get(n.id).node=n,Hee(n);else if(t.children(e).length>0){nU.info("A pure cluster node XBX1",e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=f,t.node(n.parentId);const r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;nU.debug("OffsetY",a,"labelHeight",i,"halfPadding",r),await W8(l,n),dce.get(n.id).node=n}else{const e=t.node(n.parentId);n.y+=f/2,nU.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",e,e?.offsetY,n),Hee(n)}})),t.edges().forEach(function(e){const i=t.edge(e);nU.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(i),i),i.points.forEach(e=>e.y+=f/2);const a=t.node(e.v);var o=t.node(e.w);const s=ate(c,i,dce,n,a,o,r);Zee(i,s)}),t.nodes().forEach(function(e){const n=t.node(e);nU.info(e,n.type,n.diff),n.isGroup&&(p=n.diff)}),nU.warn("Returning from recursive render XAX",s,p),{elem:s,diff:p}},"recursiveRender"),Ace=JH(async(e,t)=>{const n=new Bse({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),r=t.select("g");kte(r,e.markers,e.type,e.diagramId),jee(),Yee(),V8(),gce(),e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),nU.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const t=e.start,r=t+"---"+t+"---1",i=t+"---"+t+"---2",a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(i,a.parentId);const o=structuredClone(e),s=structuredClone(e),l=structuredClone(e);o.label="",o.arrowTypeEnd="none",o.id=t+"-cyclic-special-1",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=t+"-cyclic-special-mid",l.label="",a.isGroup&&(o.fromCluster=t,l.toCluster=t),l.id=t+"-cyclic-special-2",l.arrowTypeStart="none",n.setEdge(t,r,o,t+"-cyclic-special-0"),n.setEdge(r,i,s,t+"-cyclic-special-1"),n.setEdge(i,t,l,t+"-cyc{const n=e.append("rect");if(n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),t.name&&n.attr("name",t.name),t.rx&&n.attr("rx",t.rx),t.ry&&n.attr("ry",t.ry),void 0!==t.attrs)for(const e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr("class",t.class),n},"drawRect"),Oce=JH((e,t)=>{const n={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};Ice(e,n).lower()},"drawBackgroundRect"),Lce=JH((e,t)=>{const n=t.text.replace(eG," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const i=r.append("tspan");return i.attr("x",t.x+2*t.textMargin),i.text(n),r},"drawText"),Mce=JH((e,t,n,r)=>{const i=e.append("image");i.attr("x",t),i.attr("y",n);const a=MY(r);i.attr("xlink:href",a)},"drawImage"),Rce=JH((e,t,n,r)=>{const i=e.append("use");i.attr("x",t),i.attr("y",n);const a=MY(r);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Dce=JH(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Pce=JH(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),$ce=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,24],n=[1,25],r=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],p=[1,69],f=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],b=[1,34],x=[1,35],w=[1,36],E=[1,37],k=[1,38],T=[1,39],_=[1,40],C=[1,41],S=[1,42],A=[1,43],N=[1,44],I=[1,45],O=[1,46],L=[1,47],M=[1,48],R=[1,50],D=[1,51],P=[1,52],$=[1,53],B=[1,54],F=[1,55],z=[1,56],j=[1,57],H=[1,58],U=[1,59],G=[1,60],q=[14,42],W=[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],V=[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],Y=[1,82],X=[1,83],K=[1,84],Q=[1,85],Z=[12,14,42],J=[12,14,33,42],ee=[12,14,33,42,76,77,79,80],te=[12,33],ne=[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],re={trace:JH(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:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection("TB");break;case 4:r.setDirection("BT");break;case 5:r.setDirection("RL");break;case 6:r.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,"ENTERPRISE"),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,"SYSTEM"),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,"CONTAINER"),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode("node",...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode("nodeL",...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode("nodeR",...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem("person",...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem("external_person",...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem("system",...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem("system_db",...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem("system_queue",...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem("external_system",...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem("external_system_db",...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem("external_system_queue",...a[s]),this.$=a[s];break;case 47:r.addContainer("container",...a[s]),this.$=a[s];break;case 48:r.addContainer("container_db",...a[s]),this.$=a[s];break;case 49:r.addContainer("container_queue",...a[s]),this.$=a[s];break;case 50:r.addContainer("external_container",...a[s]),this.$=a[s];break;case 51:r.addContainer("external_container_db",...a[s]),this.$=a[s];break;case 52:r.addContainer("external_container_queue",...a[s]),this.$=a[s];break;case 53:r.addComponent("component",...a[s]),this.$=a[s];break;case 54:r.addComponent("component_db",...a[s]),this.$=a[s];break;case 55:r.addComponent("component_queue",...a[s]),this.$=a[s];break;case 56:r.addComponent("external_component",...a[s]),this.$=a[s];break;case 57:r.addComponent("external_component_db",...a[s]),this.$=a[s];break;case 58:r.addComponent("external_component_queue",...a[s]),this.$=a[s];break;case 60:r.addRel("rel",...a[s]),this.$=a[s];break;case 61:r.addRel("birel",...a[s]),this.$=a[s];break;case 62:r.addRel("rel_u",...a[s]),this.$=a[s];break;case 63:r.addRel("rel_d",...a[s]),this.$=a[s];break;case 64:r.addRel("rel_l",...a[s]),this.$=a[s];break;case 65:r.addRel("rel_r",...a[s]),this.$=a[s];break;case 66:r.addRel("rel_b",...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel("rel",...a[s]),this.$=a[s];break;case 68:r.updateElStyle("update_el_style",...a[s]),this.$=a[s];break;case 69:r.updateRelStyle("update_rel_style",...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig("update_layout_config",...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=""}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:70,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:71,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:72,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{13:73,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{14:[1,74]},e(q,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:h,40:d,41:p,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G}),e(q,[2,14]),e(W,[2,16],{12:[1,76]}),e(q,[2,36],{12:[1,77]}),e(V,[2,19]),e(V,[2,20]),{25:[1,78]},{27:[1,79]},e(V,[2,23]),{35:80,75:81,76:Y,77:X,79:K,80:Q},{35:86,75:81,76:Y,77:X,79:K,80:Q},{35:87,75:81,76:Y,77:X,79:K,80:Q},{35:88,75:81,76:Y,77:X,79:K,80:Q},{35:89,75:81,76:Y,77:X,79:K,80:Q},{35:90,75:81,76:Y,77:X,79:K,80:Q},{35:91,75:81,76:Y,77:X,79:K,80:Q},{35:92,75:81,76:Y,77:X,79:K,80:Q},{35:93,75:81,76:Y,77:X,79:K,80:Q},{35:94,75:81,76:Y,77:X,79:K,80:Q},{35:95,75:81,76:Y,77:X,79:K,80:Q},{35:96,75:81,76:Y,77:X,79:K,80:Q},{35:97,75:81,76:Y,77:X,79:K,80:Q},{35:98,75:81,76:Y,77:X,79:K,80:Q},{35:99,75:81,76:Y,77:X,79:K,80:Q},{35:100,75:81,76:Y,77:X,79:K,80:Q},{35:101,75:81,76:Y,77:X,79:K,80:Q},{35:102,75:81,76:Y,77:X,79:K,80:Q},{35:103,75:81,76:Y,77:X,79:K,80:Q},{35:104,75:81,76:Y,77:X,79:K,80:Q},e(Z,[2,59]),{35:105,75:81,76:Y,77:X,79:K,80:Q},{35:106,75:81,76:Y,77:X,79:K,80:Q},{35:107,75:81,76:Y,77:X,79:K,80:Q},{35:108,75:81,76:Y,77:X,79:K,80:Q},{35:109,75:81,76:Y,77:X,79:K,80:Q},{35:110,75:81,76:Y,77:X,79:K,80:Q},{35:111,75:81,76:Y,77:X,79:K,80:Q},{35:112,75:81,76:Y,77:X,79:K,80:Q},{35:113,75:81,76:Y,77:X,79:K,80:Q},{35:114,75:81,76:Y,77:X,79:K,80:Q},{35:115,75:81,76:Y,77:X,79:K,80:Q},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:h,40:d,41:p,43:23,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:Y,77:X,79:K,80:Q},{35:120,75:81,76:Y,77:X,79:K,80:Q},{35:121,75:81,76:Y,77:X,79:K,80:Q},{35:122,75:81,76:Y,77:X,79:K,80:Q},{35:123,75:81,76:Y,77:X,79:K,80:Q},{35:124,75:81,76:Y,77:X,79:K,80:Q},{35:125,75:81,76:Y,77:X,79:K,80:Q},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(q,[2,15]),e(W,[2,17],{21:22,19:130,22:t,23:n,24:r,26:i,28:a}),e(q,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:n,24:r,26:i,28:a,34:o,36:s,37:l,38:u,39:h,40:d,41:p,44:f,45:g,46:m,47:y,48:v,49:b,50:x,51:w,52:E,53:k,54:T,55:_,56:C,57:S,58:A,59:N,60:I,61:O,62:L,63:M,64:R,65:D,66:P,67:$,68:B,69:F,70:z,71:j,72:H,73:U,74:G}),e(V,[2,21]),e(V,[2,22]),e(Z,[2,39]),e(J,[2,71],{75:81,35:132,76:Y,77:X,79:K,80:Q}),e(ee,[2,73]),{78:[1,133]},e(ee,[2,75]),e(ee,[2,76]),e(Z,[2,40]),e(Z,[2,41]),e(Z,[2,42]),e(Z,[2,43]),e(Z,[2,44]),e(Z,[2,45]),e(Z,[2,46]),e(Z,[2,47]),e(Z,[2,48]),e(Z,[2,49]),e(Z,[2,50]),e(Z,[2,51]),e(Z,[2,52]),e(Z,[2,53]),e(Z,[2,54]),e(Z,[2,55]),e(Z,[2,56]),e(Z,[2,57]),e(Z,[2,58]),e(Z,[2,60]),e(Z,[2,61]),e(Z,[2,62]),e(Z,[2,63]),e(Z,[2,64]),e(Z,[2,65]),e(Z,[2,66]),e(Z,[2,67]),e(Z,[2,68]),e(Z,[2,69]),e(Z,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(te,[2,28]),e(te,[2,29]),e(te,[2,30]),e(te,[2,31]),e(te,[2,32]),e(te,[2,33]),e(te,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(W,[2,18]),e(q,[2,38]),e(J,[2,72]),e(ee,[2,74]),e(Z,[2,24]),e(Z,[2,35]),e(ne,[2,25]),e(ne,[2,26],{12:[1,138]}),e(ne,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ie=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:JH(function(e,t,n,r){switch(n){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:case 73:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 16:case 70:break;case 14:c;break;case 15:return 12;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: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:case 53:return this.begin("rel_u"),66;case 54:case 55:return this.begin("rel_d"),67;case 56:case 57:return this.begin("rel_l"),68;case 58: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:case 79:this.popState(),this.popState();break;case 69:case 71:return 80;case 72:this.begin("string");break;case 74:case 80: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 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\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,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,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return e}();function ae(){this.yy={}}return re.lexer=ie,JH(ae,"Parser"),ae.prototype=re,re.Parser=ae,new ae}();$ce.parser=$ce;var Bce,Fce=$ce,zce=[],jce=[""],Hce="global",Uce="",Gce=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],qce=[],Wce="",Vce=!1,Yce=4,Xce=2,Kce=JH(function(){return Bce},"getC4Type"),Qce=JH(function(e){let t=oG(e,YG());Bce=t},"setC4Type"),Zce=JH(function(e,t,n,r,i,a,o,s,l){if(null==e||null==t||null==n||null==r)return;let c={};const u=qce.find(e=>e.from===t&&e.to===n);if(u?c=u:qce.push(c),c.type=e,c.from=t,c.to=n,c.label={text:r},null==i)c.techn={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];c[e]={text:t}}else c.techn={text:i};if(null==a)c.descr={text:""};else if("object"==typeof a){let[e,t]=Object.entries(a)[0];c[e]={text:t}}else c.descr={text:a};if("object"==typeof o){let[e,t]=Object.entries(o)[0];c[e]=t}else c.sprite=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];c[e]=t}else c.tags=s;if("object"==typeof l){let[e,t]=Object.entries(l)[0];c[e]=t}else c.link=l;c.wrap=wue()},"addRel"),Jce=JH(function(e,t,n,r,i,a,o){if(null===t||null===n)return;let s={};const l=zce.find(e=>e.alias===t);if(l&&t===l.alias?s=l:(s.alias=t,zce.push(s)),s.label=null==n?{text:""}:{text:n},null==r)s.descr={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];s[e]={text:t}}else s.descr={text:r};if("object"==typeof i){let[e,t]=Object.entries(i)[0];s[e]=t}else s.sprite=i;if("object"==typeof a){let[e,t]=Object.entries(a)[0];s[e]=t}else s.tags=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];s[e]=t}else s.link=o;s.typeC4Shape={text:e},s.parentBoundary=Hce,s.wrap=wue()},"addPersonOrSystem"),eue=JH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=zce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,zce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof a){let[e,t]=Object.entries(a)[0];l[e]=t}else l.sprite=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.wrap=wue(),l.typeC4Shape={text:e},l.parentBoundary=Hce},"addContainer"),tue=JH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=zce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,zce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.techn={text:""};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof a){let[e,t]=Object.entries(a)[0];l[e]=t}else l.sprite=a;if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.wrap=wue(),l.typeC4Shape={text:e},l.parentBoundary=Hce},"addComponent"),nue=JH(function(e,t,n,r,i){if(null===e||null===t)return;let a={};const o=Gce.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Gce.push(a)),a.label=null==t?{text:""}:{text:t},null==n)a.type={text:"system"};else if("object"==typeof n){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};if("object"==typeof r){let[e,t]=Object.entries(r)[0];a[e]=t}else a.tags=r;if("object"==typeof i){let[e,t]=Object.entries(i)[0];a[e]=t}else a.link=i;a.parentBoundary=Hce,a.wrap=wue(),Uce=Hce,Hce=e,jce.push(Uce)},"addPersonOrSystemBoundary"),rue=JH(function(e,t,n,r,i){if(null===e||null===t)return;let a={};const o=Gce.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Gce.push(a)),a.label=null==t?{text:""}:{text:t},null==n)a.type={text:"container"};else if("object"==typeof n){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};if("object"==typeof r){let[e,t]=Object.entries(r)[0];a[e]=t}else a.tags=r;if("object"==typeof i){let[e,t]=Object.entries(i)[0];a[e]=t}else a.link=i;a.parentBoundary=Hce,a.wrap=wue(),Uce=Hce,Hce=e,jce.push(Uce)},"addContainerBoundary"),iue=JH(function(e,t,n,r,i,a,o,s){if(null===t||null===n)return;let l={};const c=Gce.find(e=>e.alias===t);if(c&&t===c.alias?l=c:(l.alias=t,Gce.push(l)),l.label=null==n?{text:""}:{text:n},null==r)l.type={text:"node"};else if("object"==typeof r){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.type={text:r};if(null==i)l.descr={text:""};else if("object"==typeof i){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};if("object"==typeof o){let[e,t]=Object.entries(o)[0];l[e]=t}else l.tags=o;if("object"==typeof s){let[e,t]=Object.entries(s)[0];l[e]=t}else l.link=s;l.nodeType=e,l.parentBoundary=Hce,l.wrap=wue(),Uce=Hce,Hce=t,jce.push(Uce)},"addDeploymentNode"),aue=JH(function(){Hce=Uce,jce.pop(),Uce=jce.pop(),jce.push(Uce)},"popBoundaryParseStack"),oue=JH(function(e,t,n,r,i,a,o,s,l,c,u){let h=zce.find(e=>e.alias===t);if(void 0!==h||(h=Gce.find(e=>e.alias===t),void 0!==h)){if(null!=n)if("object"==typeof n){let[e,t]=Object.entries(n)[0];h[e]=t}else h.bgColor=n;if(null!=r)if("object"==typeof r){let[e,t]=Object.entries(r)[0];h[e]=t}else h.fontColor=r;if(null!=i)if("object"==typeof i){let[e,t]=Object.entries(i)[0];h[e]=t}else h.borderColor=i;if(null!=a)if("object"==typeof a){let[e,t]=Object.entries(a)[0];h[e]=t}else h.shadowing=a;if(null!=o)if("object"==typeof o){let[e,t]=Object.entries(o)[0];h[e]=t}else h.shape=o;if(null!=s)if("object"==typeof s){let[e,t]=Object.entries(s)[0];h[e]=t}else h.sprite=s;if(null!=l)if("object"==typeof l){let[e,t]=Object.entries(l)[0];h[e]=t}else h.techn=l;if(null!=c)if("object"==typeof c){let[e,t]=Object.entries(c)[0];h[e]=t}else h.legendText=c;if(null!=u)if("object"==typeof u){let[e,t]=Object.entries(u)[0];h[e]=t}else h.legendSprite=u}},"updateElStyle"),sue=JH(function(e,t,n,r,i,a,o){const s=qce.find(e=>e.from===t&&e.to===n);if(void 0!==s){if(null!=r)if("object"==typeof r){let[e,t]=Object.entries(r)[0];s[e]=t}else s.textColor=r;if(null!=i)if("object"==typeof i){let[e,t]=Object.entries(i)[0];s[e]=t}else s.lineColor=i;if(null!=a)if("object"==typeof a){let[e,t]=Object.entries(a)[0];s[e]=parseInt(t)}else s.offsetX=parseInt(a);if(null!=o)if("object"==typeof o){let[e,t]=Object.entries(o)[0];s[e]=parseInt(t)}else s.offsetY=parseInt(o)}},"updateRelStyle"),lue=JH(function(e,t,n){let r=Yce,i=Xce;if("object"==typeof t){const e=Object.values(t)[0];r=parseInt(e)}else r=parseInt(t);if("object"==typeof n){const e=Object.values(n)[0];i=parseInt(e)}else i=parseInt(n);r>=1&&(Yce=r),i>=1&&(Xce=i)},"updateLayoutConfig"),cue=JH(function(){return Yce},"getC4ShapeInRow"),uue=JH(function(){return Xce},"getC4BoundaryInRow"),hue=JH(function(){return Hce},"getCurrentBoundaryParse"),due=JH(function(){return Uce},"getParentBoundaryParse"),pue=JH(function(e){return null==e?zce:zce.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),fue=JH(function(e){return zce.find(t=>t.alias===e)},"getC4Shape"),gue=JH(function(e){return Object.keys(pue(e))},"getC4ShapeKeys"),mue=JH(function(e){return null==e?Gce:Gce.filter(t=>t.parentBoundary===e)},"getBoundaries"),yue=mue,vue=JH(function(){return qce},"getRels"),bue=JH(function(){return Wce},"getTitle"),xue=JH(function(e){Vce=e},"setWrap"),wue=JH(function(){return Vce},"autoWrap"),Eue=JH(function(){zce=[],Gce=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Uce="",Hce="global",jce=[""],qce=[],jce=[""],Wce="",Vce=!1,Yce=4,Xce=2},"clear"),kue=JH(function(e){let t=oG(e,YG());Wce=t},"setTitle"),Tue={addPersonOrSystem:Jce,addPersonOrSystemBoundary:nue,addContainer:eue,addContainerBoundary:rue,addComponent:tue,addDeploymentNode:iue,popBoundaryParseStack:aue,addRel:Zce,updateElStyle:oue,updateRelStyle:sue,updateLayoutConfig:lue,autoWrap:wue,setWrap:xue,getC4ShapeArray:pue,getC4Shape:fue,getC4ShapeKeys:gue,getBoundaries:mue,getBoundarys:yue,getCurrentBoundaryParse:hue,getParentBoundaryParse:due,getRels:vue,getTitle:bue,getC4Type:Kce,getC4ShapeInRow:cue,getC4BoundaryInRow:uue,setAccTitle:zG,getAccTitle:jG,getAccDescription:UG,setAccDescription:HG,getConfig:JH(()=>YG().c4,"getConfig"),clear:Eue,LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:kue,setC4Type:Qce},_ue=JH(function(e,t){return Ice(e,t)},"drawRect"),Cue=JH(function(e,t,n,r,i,a){const o=e.append("image");o.attr("width",t),o.attr("height",n),o.attr("x",r),o.attr("y",i);let s=a.startsWith("data:image/png;base64")?a:MY(a);o.attr("xlink:href",s)},"drawImage"),Sue=JH((e,t,n)=>{const r=e.append("g");let i=0;for(let e of t){let t=e.textColor?e.textColor:"#444444",a=e.lineColor?e.lineColor:"#444444",o=e.offsetX?parseInt(e.offsetX):0,s=e.offsetY?parseInt(e.offsetY):0,l="";if(0===i){let t=r.append("line");t.attr("x1",e.startPoint.x),t.attr("y1",e.startPoint.y),t.attr("x2",e.endPoint.x),t.attr("y2",e.endPoint.y),t.attr("stroke-width","1"),t.attr("stroke",a),t.style("fill","none"),"rel_b"!==e.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==e.type&&"rel_b"!==e.type||t.attr("marker-start","url("+l+"#arrowend)"),i=-1}else{let t=r.append("path");t.attr("fill","none").attr("stroke-width","1").attr("stroke",a).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",e.startPoint.x).replaceAll("starty",e.startPoint.y).replaceAll("controlx",e.startPoint.x+(e.endPoint.x-e.startPoint.x)/2-(e.endPoint.x-e.startPoint.x)/4).replaceAll("controly",e.startPoint.y+(e.endPoint.y-e.startPoint.y)/2).replaceAll("stopx",e.endPoint.x).replaceAll("stopy",e.endPoint.y)),"rel_b"!==e.type&&t.attr("marker-end","url("+l+"#arrowhead)"),"birel"!==e.type&&"rel_b"!==e.type||t.attr("marker-start","url("+l+"#arrowend)")}let c=n.messageFont();Fue(n)(e.label.text,r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+o,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+s,e.label.width,e.label.height,{fill:t},c),e.techn&&""!==e.techn.text&&(c=n.messageFont(),Fue(n)("["+e.techn.text+"]",r,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+o,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+n.messageFontSize+5+s,Math.max(e.label.width,e.techn.width),e.techn.height,{fill:t,"font-style":"italic"},c))}},"drawRels"),Aue=JH(function(e,t,n){const r=e.append("g");let i=t.bgColor?t.bgColor:"none",a=t.borderColor?t.borderColor:"#444444",o=t.fontColor?t.fontColor:"black",s={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(s={"stroke-width":1});let l={x:t.x,y:t.y,fill:i,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:s};_ue(r,l);let c=n.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=o,Fue(n)(t.label.text,r,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},c),t.type&&""!==t.type.text&&(c=n.boundaryFont(),c.fontColor=o,Fue(n)(t.type.text,r,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},c)),t.descr&&""!==t.descr.text&&(c=n.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=o,Fue(n)(t.descr.text,r,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},c))},"drawBoundary"),Nue=JH(function(e,t,n){let r=t.bgColor?t.bgColor:n[t.typeC4Shape.text+"_bg_color"],i=t.borderColor?t.borderColor:n[t.typeC4Shape.text+"_border_color"],a=t.fontColor?t.fontColor:"#FFFFFF",o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="}const s=e.append("g");s.attr("class","person-man");const l=Dce();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=t.x,l.y=t.y,l.fill=r,l.width=t.width,l.height=t.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},_ue(s,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2))}let c=Bue(n,t.typeC4Shape.text);switch(s.append("text").attr("fill",a).attr("font-family",c.fontFamily).attr("font-size",c.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":Cue(s,48,48,t.x+t.width/2-24,t.y+t.image.Y,o)}let u=n[t.typeC4Shape.text+"Font"]();return u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Fue(n)(t.label.text,s,t.x,t.y+t.label.Y,t.width,t.height,{fill:a},u),u=n[t.typeC4Shape.text+"Font"](),u.fontColor=a,t.techn&&""!==t.techn?.text?Fue(n)(t.techn.text,s,t.x,t.y+t.techn.Y,t.width,t.height,{fill:a,"font-style":"italic"},u):t.type&&""!==t.type.text&&Fue(n)(t.type.text,s,t.x,t.y+t.type.Y,t.width,t.height,{fill:a,"font-style":"italic"},u),t.descr&&""!==t.descr.text&&(u=n.personFont(),u.fontColor=a,Fue(n)(t.descr.text,s,t.x,t.y+t.descr.Y,t.width,t.height,{fill:a},u)),t.height},"drawC4Shape"),Iue=JH(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Oue=JH(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Lue=JH(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Mue=JH(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),Rue=JH(function(e){e.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Due=JH(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Pue=JH(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),$ue=JH(function(e){const t=e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);t.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),t.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Bue=JH((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Fue=function(){function e(e,t,n,i,a,o,s){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l){const{fontSize:c,fontFamily:u,fontWeight:h}=l,d=e.split(_G.lineBreakRegex);for(let e=0;e=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Uue)&&(t=this.nextData.startx+e.margin+que.nextLinePaddingX,r=this.nextData.stopy+2*e.margin,this.nextData.stopx=n=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=r+e.height,this.nextData.cnt=1),e.x=t,e.y=r,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",r,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",r,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",i,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Vue(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},Vue=JH(function(e){gU(que,e),e.fontFamily&&(que.personFontFamily=que.systemFontFamily=que.messageFontFamily=e.fontFamily),e.fontSize&&(que.personFontSize=que.systemFontSize=que.messageFontSize=e.fontSize),e.fontWeight&&(que.personFontWeight=que.systemFontWeight=que.messageFontWeight=e.fontWeight)},"setConf"),Yue=JH((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Xue=JH(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),Kue=JH(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function Que(e,t,n,r,i){if(!t[e].width)if(n)t[e].text=C5(t[e].text,i,r),t[e].textLines=t[e].text.split(_G.lineBreakRegex).length,t[e].width=i,t[e].height=A5(t[e].text,r);else{let n=t[e].text.split(_G.lineBreakRegex);t[e].textLines=n.length;let i=0;t[e].height=0,t[e].width=0;for(const a of n)t[e].width=Math.max(N5(a,r),t[e].width),i=A5(a,r),t[e].height=t[e].height+i}}JH(Que,"calcC4ShapeTextWH");var Zue=JH(function(e,t,n){t.x=n.data.startx,t.y=n.data.starty,t.width=n.data.stopx-n.data.startx,t.height=n.data.stopy-n.data.starty,t.label.y=que.c4ShapeMargin-35;let r=t.wrap&&que.wrap,i=Xue(que);i.fontSize=i.fontSize+2,i.fontWeight="bold",Que("label",t,r,i,N5(t.label.text,i)),zue.drawBoundary(e,t,que)},"drawBoundary"),Jue=JH(function(e,t,n,r){let i=0;for(const a of r){i=0;const r=n[a];let o=Yue(que,r.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,r.typeC4Shape.width=N5("«"+r.typeC4Shape.text+"»",o),r.typeC4Shape.height=o.fontSize+2,r.typeC4Shape.Y=que.c4ShapePadding,i=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=i,i=r.image.Y+r.image.height);let s=r.wrap&&que.wrap,l=que.width-2*que.c4ShapePadding,c=Yue(que,r.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Que("label",r,s,c,l),r.label.Y=i+8,i=r.label.Y+r.label.height,r.type&&""!==r.type.text){r.type.text="["+r.type.text+"]",Que("type",r,s,Yue(que,r.typeC4Shape.text),l),r.type.Y=i+5,i=r.type.Y+r.type.height}else if(r.techn&&""!==r.techn.text){r.techn.text="["+r.techn.text+"]",Que("techn",r,s,Yue(que,r.techn.text),l),r.techn.Y=i+5,i=r.techn.Y+r.techn.height}let u=i,h=r.label.width;if(r.descr&&""!==r.descr.text){Que("descr",r,s,Yue(que,r.typeC4Shape.text),l),r.descr.Y=i+20,i=r.descr.Y+r.descr.height,h=Math.max(r.label.width,r.descr.width),u=i-5*r.descr.textLines}h+=que.c4ShapePadding,r.width=Math.max(r.width||que.width,h,que.width),r.height=Math.max(r.height||que.height,u,que.height),r.margin=r.margin||que.c4ShapeMargin,e.insert(r),zue.drawC4Shape(t,r,que)}e.bumpLastMargin(que.c4ShapeMargin)},"drawC4ShapeArray"),ehe=class{static{JH(this,"Point")}constructor(e,t){this.x=e,this.y=t}},the=JH(function(e,t){let n=e.x,r=e.y,i=t.x,a=t.y,o=n+e.width/2,s=r+e.height/2,l=Math.abs(n-i),c=Math.abs(r-a),u=c/l,h=e.height/e.width,d=null;return r==a&&ni?d=new ehe(n,s):n==i&&ra&&(d=new ehe(o,r)),n>i&&r=u?new ehe(n,s+u*e.width/2):new ehe(o-l/c*e.height/2,r+e.height):n=u?new ehe(n+e.width,s+u*e.width/2):new ehe(o+l/c*e.height/2,r+e.height):na?d=h>=u?new ehe(n+e.width,s-u*e.width/2):new ehe(o+e.height/2*l/c,r):n>i&&r>a&&(d=h>=u?new ehe(n,s-e.width/2*u):new ehe(o-e.height/2*l/c,r)),d},"getIntersectPoint"),nhe=JH(function(e,t){let n={x:0,y:0};n.x=t.x+t.width/2,n.y=t.y+t.height/2;let r=the(e,n);return n.x=e.x+e.width/2,n.y=e.y+e.height/2,{startPoint:r,endPoint:the(t,n)}},"getIntersectPoints"),rhe=JH(function(e,t,n,r){let i=0;for(let e of t){i+=1;let t=e.wrap&&que.wrap,a=Kue(que);"C4Dynamic"===r.db.getC4Type()&&(e.label.text=i+": "+e.label.text);let o=N5(e.label.text,a);Que("label",e,t,a,o),e.techn&&""!==e.techn.text&&(o=N5(e.techn.text,a),Que("techn",e,t,a,o)),e.descr&&""!==e.descr.text&&(o=N5(e.descr.text,a),Que("descr",e,t,a,o));let s=n(e.from),l=n(e.to),c=nhe(s,l);e.startPoint=c.startPoint,e.endPoint=c.endPoint}zue.drawRels(e,t,que)},"drawRels");function ihe(e,t,n,r,i){let a=new Wue(i);a.data.widthLimit=n.data.widthLimit/Math.min(Gue,r.length);for(let[o,s]of r.entries()){let r=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=r,r=s.image.Y+s.image.height);let l=s.wrap&&que.wrap,c=Xue(que);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",Que("label",s,l,c,a.data.widthLimit),s.label.Y=r+8,r=s.label.Y+s.label.height,s.type&&""!==s.type.text){s.type.text="["+s.type.text+"]",Que("type",s,l,Xue(que),a.data.widthLimit),s.type.Y=r+5,r=s.type.Y+s.type.height}if(s.descr&&""!==s.descr.text){let e=Xue(que);e.fontSize=e.fontSize-2,Que("descr",s,l,e,a.data.widthLimit),s.descr.Y=r+20,r=s.descr.Y+s.descr.height}if(0==o||o%Gue===0){let e=n.data.startx+que.diagramMarginX,t=n.data.stopy+que.diagramMarginY+r;a.setData(e,e,t,t)}else{let e=a.data.stopx!==a.data.startx?a.data.stopx+que.diagramMarginX:a.data.startx,t=a.data.starty;a.setData(e,e,t,t)}a.name=s.alias;let u=i.db.getC4ShapeArray(s.alias),h=i.db.getC4ShapeKeys(s.alias);h.length>0&&Jue(a,e,u,h),t=s.alias;let d=i.db.getBoundarys(t);d.length>0&&ihe(e,t,a,d,i),"global"!==s.alias&&Zue(e,s,a),n.data.stopy=Math.max(a.data.stopy+que.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(a.data.stopx+que.c4ShapeMargin,n.data.stopx),jue=Math.max(jue,n.data.stopx),Hue=Math.max(Hue,n.data.stopy)}}JH(ihe,"drawInsideBoundary");var ahe=JH(function(e,t,n,r){que=YG().c4;const i=YG().securityLevel;let a;"sandbox"===i&&(a=TK("#i"+t));const o=TK("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let s=r.db;r.db.setWrap(que.wrap),Uue=s.getC4ShapeInRow(),Gue=s.getC4BoundaryInRow(),nU.debug(`C:${JSON.stringify(que,null,2)}`);const l="sandbox"===i?o.select(`[id="${t}"]`):TK(`[id="${t}"]`);zue.insertComputerIcon(l),zue.insertDatabaseIcon(l),zue.insertClockIcon(l);let c=new Wue(r);c.setData(que.diagramMarginX,que.diagramMarginX,que.diagramMarginY,que.diagramMarginY),c.data.widthLimit=screen.availWidth,jue=que.diagramMarginX,Hue=que.diagramMarginY;const u=r.db.getTitle();ihe(l,"",c,r.db.getBoundarys(""),r),zue.insertArrowHead(l),zue.insertArrowEnd(l),zue.insertArrowCrossHead(l),zue.insertArrowFilledHead(l),rhe(l,r.db.getRels(),r.db.getC4Shape,r),c.data.stopx=jue,c.data.stopy=Hue;const h=c.data;let d=h.stopy-h.starty+2*que.diagramMarginY;const p=h.stopx-h.startx+2*que.diagramMarginX;u&&l.append("text").text(u).attr("x",(h.stopx-h.startx)/2-4*que.diagramMarginX).attr("y",h.starty+que.diagramMarginY),AG(l,d,p,que.useMaxWidth);const f=u?60:0;l.attr("viewBox",h.startx-que.diagramMarginX+" -"+(que.diagramMarginY+f)+" "+p+" "+(d+f)),nU.debug("models:",h)},"draw"),ohe={drawPersonOrSystemArray:Jue,drawBoundary:Zue,setConf:Vue,draw:ahe},she={parser:Fce,db:Tue,renderer:ohe,styles:JH(e=>`.person {\n stroke: ${e.personBorder};\n fill: ${e.personBkg};\n }\n`,"getStyles"),init:JH(({c4:e,wrap:t})=>{ohe.setConf(e),Tue.setWrap(t)},"init")},lhe=Object.freeze({__proto__:null,diagram:she}),che=JH((e,t)=>{let n;"sandbox"===t&&(n=TK("#i"+e));return TK("sandbox"===t?n.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`)},"getDiagramElement"),uhe=JH((e,t,n,r)=>{e.attr("class",n);const{width:i,height:a,x:o,y:s}=hhe(e,t);AG(e,a,i,r);const l=dhe(o,s,i,a,t);e.attr("viewBox",l),nU.debug(`viewBox configured: ${l} with padding: ${t}`)},"setupViewPortForSVG"),hhe=JH((e,t)=>{const n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+2*t,height:n.height+2*t,x:n.x,y:n.y}},"calculateDimensionsWithPadding"),dhe=JH((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,"createViewBox"),phe=class{constructor(){this.vertexCounter=0,this.config=YG(),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=zG,this.setAccDescription=HG,this.setDiagramTitle=GG,this.getAccTitle=jG,this.getAccDescription=UG,this.getDiagramTitle=qG,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")}static{JH(this,"FlowDB")}sanitizeText(e){return _G.sanitizeText(e,this.config)}lookUpDomId(e){for(const t of this.vertices.values())if(t.id===e)return t.domId;return e}addVertex(e,t,n,r,i,a,o={},s){if(!e||0===e.trim().length)return;let l;if(void 0!==s){let e;e=s.includes("\n")?s+"\n":"{\n"+s+"\n}",l=rY(e,{schema:nY})}const c=this.edges.find(t=>t.id===e);if(c){const e=l;return void 0!==e?.animate&&(c.animate=e.animate),void(void 0!==e?.animation&&(c.animation=e.animation))}let u,h=this.vertices.get(e);if(void 0===h&&(h={id:e,labelType:"text",domId:"flowchart-"+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,h)),this.vertexCounter++,void 0!==t?(this.config=YG(),u=this.sanitizeText(t.text.trim()),h.labelType=t.type,u.startsWith('"')&&u.endsWith('"')&&(u=u.substring(1,u.length-1)),h.text=u):void 0===h.text&&(h.text=e),void 0!==n&&(h.type=n),null!=r&&r.forEach(e=>{h.styles.push(e)}),null!=i&&i.forEach(e=>{h.classes.push(e)}),void 0!==a&&(h.dir=a),void 0===h.props?h.props=o:void 0!==o&&Object.assign(h.props,o),void 0!==l){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_"))throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!$ee(l.shape))throw new Error(`No such shape: ${l.shape}.`);h.type=l?.shape}l?.label&&(h.text=l?.label),l?.icon&&(h.icon=l?.icon,l.label?.trim()||h.text!==e||(h.text="")),l?.form&&(h.form=l?.form),l?.pos&&(h.pos=l?.pos),l?.img&&(h.img=l?.img,l.label?.trim()||h.text!==e||(h.text="")),l?.constraint&&(h.constraint=l.constraint),l.w&&(h.assetWidth=Number(l.w)),l.h&&(h.assetHeight=Number(l.h))}}addSingleLink(e,t,n,r){const i={start:e,end:t,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};nU.info("abc78 Got edge...",i);const a=n.text;if(void 0!==a&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith('"')&&i.text.endsWith('"')&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=a.type),void 0!==n&&(i.type=n.type,i.stroke=n.stroke,i.length=n.length>10?10:n.length),r&&!this.edges.some(e=>e.id===r))i.id=r,i.isUserDefinedId=!0;else{const e=this.edges.filter(e=>e.start===i.start&&e.end===i.end);0===e.length?i.id=j5(i.start,i.end,{counter:0,prefix:"L"}):i.id=j5(i.start,i.end,{counter:e.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);nU.info("Pushing edge..."),this.edges.push(i)}isLinkData(e){return null!==e&&"object"==typeof e&&"id"in e&&"string"==typeof e.id}addLink(e,t,n){const r=this.isLinkData(n)?n.id.replace("@",""):void 0;nU.info("addLink",e,t,r);for(const i of e)for(const a of t){const o=i===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(i,a,n,r):this.addSingleLink(i,a,n,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{"default"===e?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if("number"==typeof e&&e>=this.edges.length)throw new Error(`The index ${e} 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.)`);"default"===e?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith("fill"))&&this.edges[e]?.style?.push("fill:none"))})}addClass(e,t){const n=t.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(e=>{let t=this.classes.get(e);void 0===t&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),null!=n&&n.forEach(e=>{if(/color/.exec(e)){const n=e.replace("fill","bgFill");t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e,/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(e,t){for(const n of e.split(",")){const e=this.vertices.get(n);e&&e.classes.push(t);const r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);const i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(void 0!==t){t=this.sanitizeText(t);for(const n of e.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){const r=this.lookUpDomId(e);if("loose"!==YG().securityLevel)return;if(void 0===t)return;let i=[];if("string"==typeof n){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{const e=document.querySelector(`[id="${r}"]`);null!==e&&e.addEventListener("click",()=>{B5.runFunc(t,...i)},!1)}))}setLink(e,t,n){e.split(",").forEach(e=>{const r=this.vertices.get(e);void 0!==r&&(r.link=B5.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(",").forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let t=TK(".mermaidTooltip");null===(t._groups||t)[0][0]&&(t=TK("body").append("div").attr("class","mermaidTooltip").style("opacity",0));TK(e).select("svg").selectAll("g.node").on("mouseover",e=>{const n=TK(e.currentTarget);if(null===n.attr("title"))return;const r=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.text(n.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),t.html(t.html().replace(/<br\/>/g,"
    ")),n.classed("hover",!0)}).on("mouseout",e=>{t.transition().duration(500).style("opacity",0);TK(e.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=YG(),FG()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text;e===n&&/\s/.exec(n.text)&&(r=void 0);const a=JH(e=>{const t={boolean:{},number:{},string:{}},n=[];let r;const i=e.filter(function(e){const i=typeof e;return e.stmt&&"dir"===e.stmt?(r=e.value,!1):""!==e.trim()&&(i in t?!t[i].hasOwnProperty(e)&&(t[i][e]=!0):!n.includes(e)&&n.push(e))});return{nodeList:i,dir:r}},"uniq"),{nodeList:o,dir:s}=a(t.flat());if("gen-1"===this.version)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){const n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(e){let t=e.trim(),n="arrow_open";switch(t[0]){case"<":n="arrow_point",t=t.slice(1);break;case"x":n="arrow_cross",t=t.slice(1);break;case"o":n="arrow_circle",t=t.slice(1)}let r="normal";return t.includes("=")&&(r="thick"),t.includes(".")&&(r="dotted"),{type:n,stroke:r}}countChar(e,t){const n=t.length;let r=0;for(let i=0;i":r="arrow_point",t.startsWith("<")&&(r="double_"+r,n=n.slice(1));break;case"o":r="arrow_circle",t.startsWith("o")&&(r="double_"+r,n=n.slice(1))}let i="normal",a=n.length-1;n.startsWith("=")&&(i="thick"),n.startsWith("~")&&(i="invisible");const o=this.countChar(".",n);return o&&(i="dotted",a=o),{type:r,stroke:i,length:a}}destructLink(e,t){const n=this.destructEndLink(e);let r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===r.type)r.type=n.type;else{if(r.type!==n.type)return{type:"INVALID",stroke:"INVALID"};r.type="double_"+r.type}return"double_arrow"===r.type&&(r.type="double_arrow_point"),r.length=n.length,r}return n}exists(e,t){for(const n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){const n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return"circle"===e.form?"iconCircle":"square"===e.form?"iconSquare":"rounded"===e.form?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":t=e.replace("double_",""),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){const o=n.get(e.id),s=r.get(e.id)??!1,l=this.findNode(t,e.id);if(l)l.cssStyles=e.styles,l.cssCompiledStyles=this.getCompiledStyles(e.classes),l.cssClasses=e.classes.join(" ");else{const n={id:e.id,label:e.text,labelStyle:"",parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:"rect"}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let t=[];for(const n of e){const e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){const e=YG(),t=[],n=[],r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){const t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(const e of t.nodes)i.set(e,t.id)}for(let n=r.length-1;n>=0;n--){const a=r[n];t.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,t,i,a,e,e.look||"classic")});const o=this.getEdges();return o.forEach((t,r)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),s=[...o.defaultStyle??[]];t.style&&s.push(...t.style);const l={id:j5(t.start,t.end,{counter:r,prefix:"L"},t.id),isUserDefinedId:t.isUserDefinedId,start:t.start,end:t.end,type:t.type??"normal",label:t.text,labelpos:"c",thickness:t.stroke,minlen:t.length,classes:"invisible"===t?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===t?.stroke||"arrow_open"===t?.type?"none":i,arrowTypeEnd:"invisible"===t?.stroke||"arrow_open"===t?.type?"none":a,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:s,style:s,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};n.push(l)}),{nodes:t,edges:n,other:{},config:e}}defaultConfig(){return KG.flowchart}},fhe=JH(function(e,t){return t.db.getClasses()},"getClasses"),ghe=JH(async function(e,t,n,r){nU.info("REF0:"),nU.info("Drawing state diagram (v2)",t);const{securityLevel:i,flowchart:a,layout:o}=YG();let s;"sandbox"===i&&(s=TK("#i"+t));const l="sandbox"===i?s.nodes()[0].contentDocument:document;nU.debug("Before getData: ");const c=r.db.getData();nU.debug("Data: ",c);const u=che(t,i),h=r.db.getDirection();c.type=r.type,c.layoutAlgorithm=Ate(o),"dagre"===c.layoutAlgorithm&&"elk"===o&&nU.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=h,c.nodeSpacing=a?.nodeSpacing||50,c.rankSpacing=a?.rankSpacing||50,c.markers=["point","circle","cross"],c.diagramId=t,nU.debug("REF1:",c),await Ste(c,u);const d=c.config.flowchart?.diagramPadding??8;B5.insertTitle(u,"flowchartTitleText",a?.titleTopMargin||0,r.db.getDiagramTitle()),uhe(u,d,"flowchart",a?.useMaxWidth||!1);for(const e of c.nodes){const n=TK(`#${t} [id="${e.id}"]`);if(!n||!e.link)continue;const r=l.createElementNS("http://www.w3.org/2000/svg","a");r.setAttributeNS("http://www.w3.org/2000/svg","class",e.cssClasses),r.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?r.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):e.linkTarget&&r.setAttributeNS("http://www.w3.org/2000/svg","target",e.linkTarget);const a=n.insert(function(){return r},":first-child"),o=n.select(".label-container");o&&a.append(function(){return o.node()});const s=n.select(".label");s&&a.append(function(){return s.node()})}},"draw"),mhe={getClasses:fhe,draw:ghe},yhe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],a=[2,2],o=[1,13],s=[1,14],l=[1,15],c=[1,16],u=[1,23],h=[1,25],d=[1,26],p=[1,27],f=[1,49],g=[1,48],m=[1,29],y=[1,30],v=[1,31],b=[1,32],x=[1,33],w=[1,44],E=[1,46],k=[1,42],T=[1,47],_=[1,43],C=[1,50],S=[1,45],A=[1,51],N=[1,52],I=[1,34],O=[1,35],L=[1,36],M=[1,37],R=[1,57],D=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],P=[1,61],$=[1,60],B=[1,62],F=[8,9,11,75,77,78],z=[1,78],j=[1,91],H=[1,96],U=[1,95],G=[1,92],q=[1,88],W=[1,94],V=[1,90],Y=[1,97],X=[1,93],K=[1,98],Q=[1,89],Z=[8,9,10,11,40,75,77,78],J=[8,9,10,11,40,46,75,77,78],ee=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ne=[44,60,89,102,105,106,109,111,114,115,116],re=[1,121],ie=[1,122],ae=[1,124],oe=[1,123],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],le=[1,133],ce=[1,147],ue=[1,148],he=[1,149],de=[1,150],pe=[1,135],fe=[1,137],ge=[1,141],me=[1,142],ye=[1,143],ve=[1,144],be=[1,145],xe=[1,146],we=[1,151],Ee=[1,152],ke=[1,131],Te=[1,132],_e=[1,139],Ce=[1,134],Se=[1,138],Ae=[1,136],Ne=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],Ie=[1,154],Oe=[1,156],Le=[8,9,11],Me=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Re=[1,176],De=[1,172],Pe=[1,173],$e=[1,177],Be=[1,174],Fe=[1,175],ze=[77,116,119],je=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],He=[10,106],Ue=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ge=[1,247],qe=[1,245],We=[1,249],Ve=[1,243],Ye=[1,244],Xe=[1,246],Ke=[1,248],Qe=[1,250],Ze=[1,268],Je=[8,9,11,106],et=[8,9,10,11,60,84,105,106,109,110,111,112],tt={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:case 44:case 54:case 76:case 181:this.$=a[s];break;case 11:r.setDirection("TB"),this.$="TB";break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:case 133:this.$=a[s-1]+a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:case 128:case 130:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"square");break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"doublecircle");break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"circle");break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"ellipse");break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"stadium");break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"subroutine");break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"cylinder");break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"round");break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"diamond");break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],"hexagon");break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"odd");break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"trapezoid");break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"inv_trapezoid");break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_right");break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],"lean_left");break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 77:var l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1]};break;case 78:l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1],id:a[s-3]};break;case 79:case 86:case 101:case 103:this.$={text:a[s],type:"text"};break;case 80:case 87:case 102:this.$={text:a[s-1].text+""+a[s],type:a[s-1].type};break;case 81:case 88:this.$={text:a[s],type:"string"};break;case 82:case 89:case 104:this.$={text:a[s],type:"markdown"};break;case 83:l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 182:case 184:this.$=a[s-1]+""+a[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"}}},"anonymous"),table:[{3:1,4:2,9:t,10:n,12:r},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:n,12:r},{4:8,9:t,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,54],9:[1,55],10:R,15:53,18:56},e(D,[2,3]),e(D,[2,4]),e(D,[2,5]),e(D,[2,6]),e(D,[2,7]),e(D,[2,8]),{8:P,9:$,11:B,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:P,9:$,11:B,21:67},{8:P,9:$,11:B,21:68},{8:P,9:$,11:B,21:69},{8:P,9:$,11:B,21:70},{8:P,9:$,11:B,21:71},{8:P,9:$,10:[1,72],11:B,21:73},e(D,[2,36]),{35:[1,74]},{37:[1,75]},e(D,[2,39]),e(F,[2,50],{18:76,39:77,10:R,40:z}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:j,44:H,60:U,80:[1,86],89:G,95:[1,83],97:[1,84],101:85,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},e(D,[2,185]),e(D,[2,186]),e(D,[2,187]),e(D,[2,188]),e(Z,[2,51]),e(Z,[2,54],{46:[1,99]}),e(J,[2,72],{113:112,29:[1,100],44:f,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:g,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),e(ee,[2,181]),e(ee,[2,142]),e(ee,[2,143]),e(ee,[2,144]),e(ee,[2,145]),e(ee,[2,146]),e(ee,[2,147]),e(ee,[2,148]),e(ee,[2,149]),e(ee,[2,150]),e(ee,[2,151]),e(ee,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,113]},e(te,[2,26],{18:114,10:R}),e(D,[2,27]),{42:115,43:38,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(D,[2,40]),e(D,[2,41]),e(D,[2,42]),e(ne,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:re,81:ie,116:ae,119:oe},{75:[1,125],77:[1,126]},e(se,[2,83]),e(D,[2,28]),e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),{10:le,12:ce,14:ue,27:he,28:127,32:de,44:pe,60:fe,75:ge,80:[1,129],81:[1,130],83:140,84:me,85:ye,86:ve,87:be,88:xe,89:we,90:Ee,91:128,105:ke,109:Te,111:_e,114:Ce,115:Se,116:Ae},e(Ne,a,{5:153}),e(D,[2,37]),e(D,[2,38]),e(F,[2,48],{44:Ie}),e(F,[2,49],{18:155,10:R,40:Oe}),e(Z,[2,44]),{44:f,47:157,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{102:[1,158],103:159,105:[1,160]},{44:f,47:161,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{44:f,47:162,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},e(Le,[2,115],{120:167,10:[1,166],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,117],{10:[1,168]}),e(Me,[2,183]),e(Me,[2,170]),e(Me,[2,171]),e(Me,[2,172]),e(Me,[2,173]),e(Me,[2,174]),e(Me,[2,175]),e(Me,[2,176]),e(Me,[2,177]),e(Me,[2,178]),e(Me,[2,179]),e(Me,[2,180]),{44:f,47:169,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{30:170,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:178,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:180,50:[1,179],67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:181,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:182,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:183,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{109:[1,184]},{30:185,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:186,65:[1,187],67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:188,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:189,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{30:190,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(ee,[2,182]),e(i,[2,20]),e(te,[2,25]),e(F,[2,46],{39:191,18:192,10:R,40:z}),e(ne,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{77:[1,196],79:197,116:ae,119:oe},e(ze,[2,79]),e(ze,[2,81]),e(ze,[2,82]),e(ze,[2,168]),e(ze,[2,169]),{76:198,79:120,80:re,81:ie,116:ae,119:oe},e(se,[2,84]),{8:P,9:$,10:le,11:B,12:ce,14:ue,21:200,27:he,29:[1,199],32:de,44:pe,60:fe,75:ge,83:140,84:me,85:ye,86:ve,87:be,88:xe,89:we,90:Ee,91:201,105:ke,109:Te,111:_e,114:Ce,115:Se,116:Ae},e(je,[2,101]),e(je,[2,103]),e(je,[2,104]),e(je,[2,157]),e(je,[2,158]),e(je,[2,159]),e(je,[2,160]),e(je,[2,161]),e(je,[2,162]),e(je,[2,163]),e(je,[2,164]),e(je,[2,165]),e(je,[2,166]),e(je,[2,167]),e(je,[2,90]),e(je,[2,91]),e(je,[2,92]),e(je,[2,93]),e(je,[2,94]),e(je,[2,95]),e(je,[2,96]),e(je,[2,97]),e(je,[2,98]),e(je,[2,99]),e(je,[2,100]),{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,202],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},{10:R,18:203},{44:[1,204]},e(Z,[2,43]),{10:[1,205],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{10:[1,206]},{10:[1,207],106:[1,208]},e(He,[2,128]),{10:[1,209],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{10:[1,210],44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:112,114:S,115:A,116:N},{80:[1,211]},e(Le,[2,109],{10:[1,212]}),e(Le,[2,111],{10:[1,213]}),{80:[1,214]},e(Me,[2,184]),{80:[1,215],98:[1,216]},e(Z,[2,55],{113:112,44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),{31:[1,217],67:Re,82:218,116:$e,117:Be,118:Fe},e(Ue,[2,86]),e(Ue,[2,88]),e(Ue,[2,89]),e(Ue,[2,153]),e(Ue,[2,154]),e(Ue,[2,155]),e(Ue,[2,156]),{49:[1,219],67:Re,82:218,116:$e,117:Be,118:Fe},{30:220,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{51:[1,221],67:Re,82:218,116:$e,117:Be,118:Fe},{53:[1,222],67:Re,82:218,116:$e,117:Be,118:Fe},{55:[1,223],67:Re,82:218,116:$e,117:Be,118:Fe},{57:[1,224],67:Re,82:218,116:$e,117:Be,118:Fe},{60:[1,225]},{64:[1,226],67:Re,82:218,116:$e,117:Be,118:Fe},{66:[1,227],67:Re,82:218,116:$e,117:Be,118:Fe},{30:228,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},{31:[1,229],67:Re,82:218,116:$e,117:Be,118:Fe},{67:Re,69:[1,230],71:[1,231],82:218,116:$e,117:Be,118:Fe},{67:Re,69:[1,233],71:[1,232],82:218,116:$e,117:Be,118:Fe},e(F,[2,45],{18:155,10:R,40:Oe}),e(F,[2,47],{44:Ie}),e(ne,[2,75]),e(ne,[2,74]),{62:[1,234],67:Re,82:218,116:$e,117:Be,118:Fe},e(ne,[2,77]),e(ze,[2,80]),{77:[1,235],79:197,116:ae,119:oe},{30:236,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(Ne,a,{5:237}),e(je,[2,102]),e(D,[2,35]),{43:238,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},{10:R,18:239},{10:Ge,60:qe,84:We,92:240,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:251,104:[1,252],105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:253,104:[1,254],105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{105:[1,255]},{10:Ge,60:qe,84:We,92:256,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{44:f,47:257,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},e(Le,[2,116]),e(Le,[2,118],{10:[1,261]}),e(Le,[2,119]),e(J,[2,56]),e(Ue,[2,87]),e(J,[2,57]),{51:[1,262],67:Re,82:218,116:$e,117:Be,118:Fe},e(J,[2,64]),e(J,[2,59]),e(J,[2,60]),e(J,[2,61]),{109:[1,263]},e(J,[2,63]),e(J,[2,65]),{66:[1,264],67:Re,82:218,116:$e,117:Be,118:Fe},e(J,[2,67]),e(J,[2,68]),e(J,[2,70]),e(J,[2,69]),e(J,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(ne,[2,78]),{31:[1,265],67:Re,82:218,116:$e,117:Be,118:Fe},{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,266],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},e(Z,[2,53]),{43:267,44:f,45:39,47:40,60:g,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N},e(Le,[2,121],{106:Ze}),e(Je,[2,130],{108:269,10:Ge,60:qe,84:We,105:Ve,109:Ye,110:Xe,111:Ke,112:Qe}),e(et,[2,132]),e(et,[2,134]),e(et,[2,135]),e(et,[2,136]),e(et,[2,137]),e(et,[2,138]),e(et,[2,139]),e(et,[2,140]),e(et,[2,141]),e(Le,[2,122],{106:Ze}),{10:[1,270]},e(Le,[2,123],{106:Ze}),{10:[1,271]},e(He,[2,129]),e(Le,[2,105],{106:Ze}),e(Le,[2,106],{113:112,44:f,60:g,89:w,102:E,105:k,106:T,109:_,111:C,114:S,115:A,116:N}),e(Le,[2,110]),e(Le,[2,112],{10:[1,272]}),e(Le,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:P,9:$,11:B,21:277},e(D,[2,34]),e(Z,[2,52]),{10:Ge,60:qe,84:We,105:Ve,107:278,108:242,109:Ye,110:Xe,111:Ke,112:Qe},e(et,[2,133]),{14:j,44:H,60:U,89:G,101:279,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},{14:j,44:H,60:U,89:G,101:280,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q,120:87},{98:[1,281]},e(Le,[2,120]),e(J,[2,58]),{30:282,67:Re,80:De,81:Pe,82:171,116:$e,117:Be,118:Fe},e(J,[2,66]),e(Ne,a,{5:283}),e(Je,[2,131],{108:269,10:Ge,60:qe,84:We,105:Ve,109:Ye,110:Xe,111:Ke,112:Qe}),e(Le,[2,126],{120:167,10:[1,284],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,127],{120:167,10:[1,285],14:j,44:H,60:U,89:G,105:q,106:W,109:V,111:Y,114:X,115:K,116:Q}),e(Le,[2,114]),{31:[1,286],67:Re,82:218,116:$e,117:Be,118:Fe},{6:11,7:12,8:o,9:s,10:l,11:c,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,287],33:24,34:h,36:d,38:p,42:28,43:38,44:f,45:39,47:40,60:g,84:m,85:y,86:v,87:b,88:x,89:w,102:E,105:k,106:T,109:_,111:C,113:41,114:S,115:A,116:N,121:I,122:O,123:L,124:M},{10:Ge,60:qe,84:We,92:288,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},{10:Ge,60:qe,84:We,92:289,105:Ve,107:241,108:242,109:Ye,110:Xe,111:Ke,112:Qe},e(J,[2,62]),e(D,[2,33]),e(Le,[2,124],{106:Ze}),e(Le,[2,125],{106:Ze})],defaultActions:{},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},nt=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:JH(function(e,t,n,r){switch(n){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:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),t.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const n=/\n\s*/g;return t.yytext=t.yytext.replace(n,"
    "),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";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 34:return 88;case 35:case 36:case 37:return e.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:case 41:case 42:case 43:return 98;case 44:return this.popState(),13;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:case 102:return 111;case 62:return 46;case 63:return 60;case 64:case 103:return 44;case 65:return 8;case 66:return 106;case 67:case 101:return 115;case 68:case 71:case 74:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:case 73:case 76:return 119;case 72:return this.pushState("thickEdgeText"),75;case 75:return this.pushState("dottedEdgeText"),75;case 77:return 77;case 78:return this.popState(),53;case 79:case 115:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-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]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return e}();function rt(){this.yy={}}return tt.lexer=nt,JH(rt,"Parser"),rt.prototype=tt,tt.Parser=rt,new rt}();yhe.parser=yhe;var vhe=yhe,bhe=Object.assign({},vhe);bhe.parse=e=>{const t=e.replace(/}\s*\n/g,"}\n");return vhe.parse(t)};var xhe=bhe,whe=JH((e,t)=>{const n=Bj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return $j(r,i,a,t)},"fade"),Ehe=JH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span {\n color: ${e.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .katex path {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${e.lineColor} !important;\n stroke-width: 0;\n stroke: ${e.lineColor};\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${whe(e.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n padding: 2px;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n`,"getStyles"),khe={parser:xhe,get db(){return new phe},renderer:mhe,styles:Ehe,init:JH(e=>{e.flowchart||(e.flowchart={}),e.layout&&XG({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,XG({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")},The=Object.freeze({__proto__:null,diagram:khe}),_he=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],n=[1,10],r=[1,11],i=[1,12],a=[1,13],o=[1,20],s=[1,21],l=[1,22],c=[1,23],u=[1,24],h=[1,19],d=[1,25],p=[1,26],f=[1,18],g=[1,33],m=[1,34],y=[1,35],v=[1,36],b=[1,37],x=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],w=[1,42],E=[1,43],k=[1,52],T=[40,50,68,69],_=[1,63],C=[1,61],S=[1,58],A=[1,62],N=[1,64],I=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],O=[63,64,65,66,67],L=[1,81],M=[1,80],R=[1,78],D=[1,79],P=[6,10,42,47],$=[6,10,13,41,42,47,48,49],B=[1,89],F=[1,88],z=[1,87],j=[19,56],H=[1,98],U=[1,97],G=[19,56,58,60],q={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes: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:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:case 55:case 78:case 62:case 63:case 66:this.$=a[s];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 56:case 64:case 43:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 44:case 65:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 76:case 77:case 67:this.$=a[s].replace(/"/g,"");break;case 57:a[s].push(a[s-1]),this.$=a[s];break;case 58:this.$={type:a[s-1],name:a[s]};break;case 59:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 60:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 61:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 68:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 69:this.$=r.Cardinality.ZERO_OR_ONE;break;case 70:this.$=r.Cardinality.ZERO_OR_MORE;break;case 71:this.$=r.Cardinality.ONE_OR_MORE;break;case 72:this.$=r.Cardinality.ONLY_ONE;break;case 73:this.$=r.Cardinality.MD_PARENT;break;case 74:this.$=r.Identification.NON_IDENTIFYING;break;case 75:this.$=r.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:n,24:r,26:i,28:a,29:14,30:15,31:16,32:17,33:o,34:s,35:l,36:c,37:u,40:h,43:d,44:p,50:f},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:27,11:9,22:n,24:r,26:i,28:a,29:14,30:15,31:16,32:17,33:o,34:s,35:l,36:c,37:u,40:h,43:d,44:p,50:f},e(t,[2,5]),e(t,[2,6]),e(t,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:g,64:m,65:y,66:v,67:b}),{23:[1,38]},{25:[1,39]},{27:[1,40]},e(t,[2,27]),e(t,[2,28]),e(t,[2,29]),e(t,[2,30]),e(t,[2,31]),e(x,[2,54]),e(x,[2,55]),e(t,[2,32]),e(t,[2,33]),e(t,[2,34]),e(t,[2,35]),{16:41,40:w,41:E},{16:44,40:w,41:E},{16:45,40:w,41:E},e(t,[2,4]),{11:46,40:h,50:f},{16:47,40:w,41:E},{18:48,19:[1,49],51:50,52:51,56:k},{11:53,40:h,50:f},{62:54,68:[1,55],69:[1,56]},e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),{13:_,38:57,41:C,42:S,45:59,46:60,48:A,49:N},e(I,[2,37]),e(I,[2,38]),{16:65,40:w,41:E,42:S},{13:_,38:66,41:C,42:S,45:59,46:60,48:A,49:N},{13:[1,67],15:[1,68]},e(t,[2,17],{61:32,12:69,17:[1,70],42:S,63:g,64:m,65:y,66:v,67:b}),{19:[1,71]},e(t,[2,14]),{18:72,19:[2,56],51:50,52:51,56:k},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:g,64:m,65:y,66:v,67:b},e(O,[2,74]),e(O,[2,75]),{6:L,10:M,39:77,42:R,47:D},{40:[1,82],41:[1,83]},e(P,[2,43],{46:84,13:_,41:C,48:A,49:N}),e($,[2,45]),e($,[2,50]),e($,[2,51]),e($,[2,52]),e($,[2,53]),e(t,[2,41],{42:S}),{6:L,10:M,39:85,42:R,47:D},{14:86,40:B,50:F,70:z},{16:90,40:w,41:E},{11:91,40:h,50:f},{18:92,19:[1,93],51:50,52:51,56:k},e(t,[2,12]),{19:[2,57]},e(j,[2,58],{54:94,55:95,57:96,59:H,60:U}),e([19,56,59,60],[2,63]),e(t,[2,22],{15:[1,100],17:[1,99]}),e([40,50],[2,68]),e(t,[2,36]),{13:_,41:C,45:101,46:60,48:A,49:N},e(t,[2,47]),e(t,[2,48]),e(t,[2,49]),e(I,[2,39]),e(I,[2,40]),e($,[2,46]),e(t,[2,42]),e(t,[2,8]),e(t,[2,76]),e(t,[2,77]),e(t,[2,78]),{13:[1,102],42:S},{13:[1,104],15:[1,103]},{19:[1,105]},e(t,[2,15]),e(j,[2,59],{55:106,58:[1,107],60:U}),e(j,[2,60]),e(G,[2,64]),e(j,[2,67]),e(G,[2,66]),{18:108,19:[1,109],51:50,52:51,56:k},{16:110,40:w,41:E},e(P,[2,44],{46:84,13:_,41:C,48:A,49:N}),{14:111,40:B,50:F,70:z},{16:112,40:w,41:E},{14:113,40:B,50:F,70:z},e(t,[2,13]),e(j,[2,61]),{57:114,59:H},{19:[1,115]},e(t,[2,20]),e(t,[2,23],{17:[1,116],42:S}),e(t,[2,11]),{13:[1,117],42:S},e(t,[2,10]),e(G,[2,65]),e(t,[2,18]),{18:118,19:[1,119],51:50,52:51,56:k},{14:120,40:B,50:F,70:z},{19:[1,121]},e(t,[2,21]),e(t,[2,9]),e(t,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},W=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;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 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 59;case 25:case 26:return 56;case 27:return 60;case 29:return this.popState(),19;case 30:case 73:return t.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 59:return 63;case 42:case 43:case 44:case 52:case 54:case 61:return 65;case 47:case 48:case 49:case 50:case 51:case 53:case 60:return 64;case 55:case 56:case 57:case 58:return 66;case 62:return 67;case 63:case 66:case 67:case 68:return 68;case 64:case 65:return 69;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 74: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,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/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,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/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,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,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,71,72,73,74],inclusive:!0}}};return e}();function V(){this.yy={}}return q.lexer=W,JH(V,"Parser"),V.prototype=q,q.Parser=V,new V}();_he.parser=_he;var Che=_he,She=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=zG,this.getAccTitle=jG,this.setAccDescription=HG,this.getAccDescription=UG,this.setDiagramTitle=GG,this.getDiagramTitle=qG,this.getConfig=JH(()=>YG().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{JH(this,"ErDB")}addEntity(e,t=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,nU.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:"erBox",look:YG().look??"default",cssClasses:"default",cssStyles:[]}),nU.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){const n=this.addEntity(e);let r;for(r=t.length-1;r>=0;r--)t[r].keys||(t[r].keys=[]),t[r].comment||(t[r].comment=""),n.attributes.push(t[r]),nU.debug("Added attribute ",t[r].name)}addRelationship(e,t,n,r){const i=this.entities.get(e),a=this.entities.get(n);if(!i||!a)return;const o={entityA:i.id,roleA:t,entityB:a.id,relSpec:r};this.relationships.push(o),nU.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(const n of e){const e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(const n of e){const e=this.entities.get(n);if(!t||!e)return;for(const n of t)e.cssStyles.push(n)}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);void 0===n&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){const t=e.replace("fill","bgFill");n.textStyles.push(t)}n.styles.push(e)})})}setClass(e,t){for(const n of e){const e=this.entities.get(n);if(e)for(const n of t)e.cssClasses+=" "+n}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],FG()}getData(){const e=[],t=[],n=YG();for(const t of this.entities.keys()){const n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(" ")),e.push(n))}let r=0;for(const e of this.relationships){const i={id:j5(e.entityA,e.entityB,{prefix:"id",counter:r++}),type:"normal",curve:"basis",start:e.entityA,end:e.entityB,label:e.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==e.relSpec.relType?"solid":"dashed",look:n.look};t.push(i)}return{nodes:e,edges:t,other:{},config:n,direction:"TB"}}},Ahe={};eU(Ahe,{draw:()=>Nhe});var Nhe=JH(async function(e,t,n,r){nU.info("REF0:"),nU.info("Drawing er diagram (unified)",t);const{securityLevel:i,er:a,layout:o}=YG(),s=r.db.getData(),l=che(t,i);s.type=r.type,s.layoutAlgorithm=Ate(o),s.config.flowchart.nodeSpacing=a?.nodeSpacing||140,s.config.flowchart.rankSpacing=a?.rankSpacing||80,s.direction=r.db.getDirection(),s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],s.diagramId=t,await Ste(s,l),"elk"===s.layoutAlgorithm&&l.select(".edges").lower();const c=l.selectAll('[id*="-background"]');Array.from(c).length>0&&c.each(function(){const e=TK(this),t=e.attr("id").replace("-background",""),n=l.select(`#${CSS.escape(t)}`);if(!n.empty()){const t=n.attr("transform");e.attr("transform",t)}});B5.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),uhe(l,8,"erDiagram",a?.useMaxWidth??!0)},"draw"),Ihe=JH((e,t)=>{const n=Bj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return $j(r,i,a,t)},"fade"),Ohe=JH(e=>`\n .entityBox {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${e.tertiaryColor};\n opacity: 0.7;\n background-color: ${e.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${Ihe(e.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${e.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${e.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n }\n`,"getStyles"),Lhe={parser:Che,get db(){return new She},renderer:Ahe,styles:Ohe},Mhe=Object.freeze({__proto__:null,diagram:Lhe});function Rhe(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}JH(Rhe,"populateCommonDb");var Dhe=class{constructor(e){this.init=e,this.records=this.init()}static{JH(this,"ImperativeState")}reset(){this.records=this.init()}};function Phe(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$type}function $he(e){return"object"==typeof e&&null!==e&&"string"==typeof e.$refText}function Bhe(e){return"object"==typeof e&&null!==e&&Phe(e.container)&&$he(e.reference)&&"string"==typeof e.message}class Fhe{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return Phe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const r=n[t];if(void 0!==r)return r;{const r=this.computeIsSubtype(e,t);return n[t]=r,r}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const t=this.getAllTypes(),n=[];for(const r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}}function zhe(e){return"object"==typeof e&&null!==e&&Array.isArray(e.content)}function jhe(e){return"object"==typeof e&&null!==e&&"object"==typeof e.tokenType}function Hhe(e){return zhe(e)&&"string"==typeof e.fullText}class Uhe{constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){const e=this.iterator();return Boolean(e.next().done)}count(){const e=this.iterator();let t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){const e=[],t=this.iterator();let n;do{n=t.next(),void 0!==n.value&&e.push(n.value)}while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){const n=this.map(n=>[e?e(n):n,t?t(n):n]);return new Map(n)}toString(){return this.join()}concat(e){return new Uhe(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),e=>{let t;if(!e.firstDone){do{if(t=this.nextFn(e.first),!t.done)return t}while(!t.done);e.firstDone=!0}do{if(t=e.iterator.next(),!t.done)return t}while(!t.done);return Vhe})}join(e=","){const t=this.iterator();let n,r="",i=!1;do{n=t.next(),n.done||(i&&(r+=e),r+=Ghe(n.value)),i=!0}while(!n.done);return r}indexOf(e,t=0){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(e){return new Uhe(this.startFn,t=>{const{done:n,value:r}=this.nextFn(t);return n?Vhe:{done:!1,value:e(r)}})}filter(e){return new Uhe(this.startFn,t=>{let n;do{if(n=this.nextFn(t),!n.done&&e(n.value))return n}while(!n.done);return Vhe})}nonNullable(){return this.filter(e=>null!=e)}reduce(e,t){const n=this.iterator();let r=t,i=n.next();for(;!i.done;)r=void 0===r?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){const r=e.next();if(r.done)return n;const i=this.recursiveReduce(e,t,n);return void 0===i?r.value:t(i,r.value)}find(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){const t=this.iterator();let n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){const t=this.iterator();let n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(e){return new Uhe(()=>({this:this.startFn()}),t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:n,value:r}=this.nextFn(t.this);if(!n){const n=e(r);if(!qhe(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return Vhe})}flat(e){if(void 0===e&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new Uhe(()=>({this:t.startFn()}),e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;e.iterator=void 0}const{done:n,value:r}=t.nextFn(e.this);if(!n){if(!qhe(r))return{done:!1,value:r};e.iterator=r[Symbol.iterator]()}}while(e.iterator);return Vhe})}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new Uhe(()=>{const t=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),t=>(t.size++,t.size>e?Vhe:this.nextFn(t.state)))}distinct(e){return new Uhe(()=>({set:new Set,internalState:this.startFn()}),t=>{let n;do{if(n=this.nextFn(t.internalState),!n.done){const r=e?e(n.value):n.value;if(!t.set.has(r))return t.set.add(r),n}}while(!n.done);return Vhe})}exclude(e,t){const n=new Set;for(const r of e){const e=t?t(r):r;n.add(e)}return this.filter(e=>{const r=t?t(e):e;return!n.has(r)})}}function Ghe(e){return"string"==typeof e?e:void 0===e?"undefined":"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}function qhe(e){return!!e&&"function"==typeof e[Symbol.iterator]}const Whe=new Uhe(()=>{},()=>Vhe),Vhe=Object.freeze({done:!0,value:void 0});function Yhe(...e){if(1===e.length){const t=e[0];if(t instanceof Uhe)return t;if(qhe(t))return new Uhe(()=>t[Symbol.iterator](),e=>e.next());if("number"==typeof t.length)return new Uhe(()=>({index:0}),e=>e.index1?new Uhe(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:(null==n?void 0:n.includeRoot)?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),e=>{for(e.pruned&&(e.iterators.pop(),e.pruned=!1);e.iterators.length>0;){const n=e.iterators[e.iterators.length-1].next();if(!n.done)return e.iterators.push(t(n.value)[Symbol.iterator]()),n;e.iterators.pop()}return Vhe})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Khe,Qhe;function Zhe(e){return new Xhe(e,e=>zhe(e)?e.content:[],{includeRoot:!0})}function Jhe(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function ede(e){if(!e)return;const{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function tde(e,t){const n=function(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Qhe.After;const n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.lineQhe.After}!function(e){e.sum=function(e){return e.reduce((e,t)=>e+t,0)},e.product=function(e){return e.reduce((e,t)=>e*t,0)},e.min=function(e){return e.reduce((e,t)=>Math.min(e,t))},e.max=function(e){return e.reduce((e,t)=>Math.max(e,t))}}(Khe||(Khe={})),function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"}(Qhe||(Qhe={}));const nde=/^[\w\p{L}]$/u;function rde(e,t){if(e){const n=function(e,t=!0){for(;e.container;){const n=e.container;let r=n.content.indexOf(e);for(;r>0;){r--;const e=n.content[r];if(t||!e.hidden)return e}e=n}return}(e,!0);if(n&&ide(n,t))return n;if(Hhe(e)){const n=e.content.findIndex(e=>!e.hidden);for(let r=n-1;r>=0;r--){const n=e.content[r];if(ide(n,t))return n}}}}function ide(e,t){return jhe(e)&&t.includes(e.tokenType.name)}class ade extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function ode(e){throw new Error("Error! The input value was not handled.")}const sde="AbstractRule",lde="AbstractType",cde="Condition",ude="TypeDefinition",hde="ValueLiteral",dde="AbstractElement";function pde(e){return gpe.isInstance(e,dde)}const fde="ArrayLiteral",gde="ArrayType",mde="BooleanLiteral";const yde="Conjunction";const vde="Disjunction";const bde="Grammar",xde="GrammarImport",wde="InferredType";function Ede(e){return gpe.isInstance(e,wde)}const kde="Interface";function Tde(e){return gpe.isInstance(e,kde)}const _de="NamedArgument",Cde="Negation";const Sde="NumberLiteral",Ade="Parameter",Nde="ParameterReference";const Ide="ParserRule";function Ode(e){return gpe.isInstance(e,Ide)}const Lde="ReferenceType",Mde="ReturnType";const Rde="SimpleType";function Dde(e){return gpe.isInstance(e,Rde)}const Pde="StringLiteral",$de="TerminalRule";function Bde(e){return gpe.isInstance(e,$de)}const Fde="Type";function zde(e){return gpe.isInstance(e,Fde)}const jde="TypeAttribute",Hde="UnionType",Ude="Action";function Gde(e){return gpe.isInstance(e,Ude)}const qde="Alternatives";function Wde(e){return gpe.isInstance(e,qde)}const Vde="Assignment";function Yde(e){return gpe.isInstance(e,Vde)}const Xde="CharacterRange";const Kde="CrossReference";function Qde(e){return gpe.isInstance(e,Kde)}const Zde="EndOfFile";const Jde="Group";function epe(e){return gpe.isInstance(e,Jde)}const tpe="Keyword";function npe(e){return gpe.isInstance(e,tpe)}const rpe="NegatedToken";const ipe="RegexToken";const ape="RuleCall";function ope(e){return gpe.isInstance(e,ape)}const spe="TerminalAlternatives";const lpe="TerminalGroup";const cpe="TerminalRuleCall";const upe="UnorderedGroup";function hpe(e){return gpe.isInstance(e,upe)}const dpe="UntilToken";const ppe="Wildcard";class fpe extends Fhe{getAllTypes(){return[dde,sde,lde,Ude,qde,fde,gde,Vde,mde,Xde,cde,yde,Kde,vde,Zde,bde,xde,Jde,wde,kde,tpe,_de,rpe,Cde,Sde,Ade,Nde,Ide,Lde,ipe,Mde,ape,Rde,Pde,spe,lpe,$de,cpe,Fde,jde,ude,Hde,upe,dpe,hde,ppe]}computeIsSubtype(e,t){switch(e){case Ude:case qde:case Vde:case Xde:case Kde:case Zde:case Jde:case tpe:case rpe:case ipe:case ape:case spe:case lpe:case cpe:case upe:case dpe:case ppe:return this.isSubtype(dde,t);case fde:case Sde:case Pde:return this.isSubtype(hde,t);case gde:case Lde:case Rde:case Hde:return this.isSubtype(ude,t);case mde:return this.isSubtype(cde,t)||this.isSubtype(hde,t);case yde:case vde:case Cde:case Nde:return this.isSubtype(cde,t);case wde:case kde:case Fde:return this.isSubtype(lde,t);case Ide:return this.isSubtype(sde,t)||this.isSubtype(lde,t);case $de:return this.isSubtype(sde,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return lde;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return sde;case"Grammar:usedGrammars":return bde;case"NamedArgument:parameter":case"ParameterReference:parameter":return Ade;case"TerminalRuleCall:rule":return $de;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case dde:return{name:dde,properties:[{name:"cardinality"},{name:"lookahead"}]};case fde:return{name:fde,properties:[{name:"elements",defaultValue:[]}]};case gde:return{name:gde,properties:[{name:"elementType"}]};case mde:return{name:mde,properties:[{name:"true",defaultValue:!1}]};case yde:return{name:yde,properties:[{name:"left"},{name:"right"}]};case vde:return{name:vde,properties:[{name:"left"},{name:"right"}]};case bde:return{name:bde,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case xde:return{name:xde,properties:[{name:"path"}]};case wde:return{name:wde,properties:[{name:"name"}]};case kde:return{name:kde,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case _de:return{name:_de,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Cde:return{name:Cde,properties:[{name:"value"}]};case Sde:return{name:Sde,properties:[{name:"value"}]};case Ade:return{name:Ade,properties:[{name:"name"}]};case Nde:return{name:Nde,properties:[{name:"parameter"}]};case Ide:return{name:Ide,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Lde:return{name:Lde,properties:[{name:"referenceType"}]};case Mde:return{name:Mde,properties:[{name:"name"}]};case Rde:return{name:Rde,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Pde:return{name:Pde,properties:[{name:"value"}]};case $de:return{name:$de,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Fde:return{name:Fde,properties:[{name:"name"},{name:"type"}]};case jde:return{name:jde,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Hde:return{name:Hde,properties:[{name:"types",defaultValue:[]}]};case Ude:return{name:Ude,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case qde:return{name:qde,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Vde:return{name:Vde,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Xde:return{name:Xde,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Kde:return{name:Kde,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Zde:return{name:Zde,properties:[{name:"cardinality"},{name:"lookahead"}]};case Jde:return{name:Jde,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case tpe:return{name:tpe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case rpe:return{name:rpe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ipe:return{name:ipe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case ape:return{name:ape,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case spe:return{name:spe,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case lpe:return{name:lpe,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case cpe:return{name:cpe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case upe:return{name:upe,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case dpe:return{name:dpe,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ppe:return{name:ppe,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const gpe=new fpe;function mpe(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function ype(e){const t=vpe(e).$document;if(!t)throw new Error("AST node has no document.");return t}function vpe(e){for(;e.$container;)e=e.$container;return e}function bpe(e,t){if(!e)throw new Error("Node must be an AstNode.");const n=null==t?void 0:t.range;return new Uhe(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexbpe(e,t))}function wpe(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new Xhe(e,e=>bpe(e,t),{includeRoot:!0})}function Epe(e,t){var n;if(!t)return!0;const r=null===(n=e.$cstNode)||void 0===n?void 0:n.range;return!!r&&tde(r,t)}function kpe(e){return new Uhe(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class $pe{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},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"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)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const Bpe=/\r?\n/gm,Fpe=new Ppe;const zpe=new class extends $pe{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 t=String.fromCharCode(e.value);if(this.multiline||"\n"!==t||(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const e=Gpe(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=Boolean("\n".match(n))}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){if("Group"===e.type){if(e.quantifier)return}super.visitChildren(e)}};function jpe(e){try{return"string"==typeof e&&(e=new RegExp(e)),e=e.toString(),zpe.reset(e),zpe.visit(Fpe.pattern(e)),zpe.multiline}catch(e){return!1}}const Hpe="\f\n\r\t\v              \u2028\u2029   \ufeff".split("");function Upe(e){const t="string"==typeof e?new RegExp(e):e;return Hpe.some(e=>t.test(e))}function Gpe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qpe(e,t){const n=function(e){"string"==typeof e&&(e=new RegExp(e));const t=e,n=e.source;let r=0;function i(){let e,a="";function o(e){a+=n.substr(r,e),r+=e}function s(e){a+="(?:"+n.substr(r,e)+"|$)",r+=e}for(;r",r)-r+1);break;default:s(2)}break;case"[":e=/\[(?:\\.|.)*?\]/g,e.lastIndex=r,e=e.exec(n)||[],s(e[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":e=/\{\d+,?\d*\}/g,e.lastIndex=r,e=e.exec(n),e?o(e[0].length):s(1);break;case"(":if("?"===n[r+1])switch(n[r+2]){case":":a+="(?:",r+=3,a+=i()+"|$)";break;case"=":a+="(?=",r+=3,a+=i()+")";break;case"!":e=r,r+=3,i(),a+=n.substr(e,r-e);break;case"<":switch(n[r+3]){case"=":case"!":e=r,r+=4,i(),a+=n.substr(e,r-e);break;default:o(n.indexOf(">",r)-r+1),a+=i()+"|$)"}}else o(1),a+=i()+"|$)";break;case")":return++r,a;default:s(1)}return a}return new RegExp(i(),e.flags)}(e),r=t.match(n);return!!r&&r[0].length>0}function Wpe(e,t){const n=new Set,r=function(e){return e.rules.find(e=>Ode(e)&&e.entry)}(e);if(!r)return new Set(e.rules);const i=[r].concat(function(e){return e.rules.filter(e=>Bde(e)&&e.hidden)}(e));for(const e of i)Vpe(e,n,t);const a=new Set;for(const t of e.rules)(n.has(t.name)||Bde(t)&&t.hidden)&&a.add(t);return a}function Vpe(e,t,n){t.add(e.name),xpe(e).forEach(e=>{if(ope(e)||n){const r=e.rule.ref;r&&!t.has(r.name)&&Vpe(r,t,n)}})}function Ype(e){return e.hidden&&!Upe(ife(e))}function Xpe(e,t,n){if(!e||!t)return;const r=Kpe(e,t,e.astNode,!0);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function Kpe(e,t,n,r){if(!r){const n=mpe(e.grammarSource,Yde);if(n&&n.feature===t)return[e]}return zhe(e)&&e.astNode===n?e.content.flatMap(e=>Kpe(e,t,n,!1)):[]}function Qpe(e,t,n){if(!e)return;const r=function(e,t,n){if(e.astNode!==n)return[];if(npe(e.grammarSource)&&e.grammarSource.value===t)return[e];const r=Zhe(e).iterator();let i;const a=[];do{if(i=r.next(),!i.done){const e=i.value;e.astNode===n?npe(e.grammarSource)&&e.grammarSource.value===t&&a.push(e):r.prune()}}while(!i.done);return a}(e,t,null==e?void 0:e.astNode);return 0!==r.length?r[n=void 0!==n?Math.max(0,Math.min(n,r.length-1)):0]:void 0}function Zpe(e){let t=e;return Ede(t)&&(Gde(t.$container)?t=t.$container.$container:Ode(t.$container)?t=t.$container:ode(t.$container)),Jpe(e,t,new Map)}function Jpe(e,t,n){var r;function i(t,r){let i;return mpe(t,Yde)||(i=Jpe(r,r,n)),n.set(e,i),i}if(n.has(e))return n.get(e);n.set(e,void 0);for(const a of xpe(t)){if(Yde(a)&&"name"===a.feature.toLowerCase())return n.set(e,a),a;if(ope(a)&&Ode(a.rule.ref))return i(a,a.rule.ref);if(Dde(a)&&(null===(r=a.typeRef)||void 0===r?void 0:r.ref))return i(a,a.typeRef.ref)}}function efe(e){return tfe(e,new Set)}function tfe(e,t){if(t.has(e))return!0;t.add(e);for(const n of xpe(e))if(ope(n)){if(!n.rule.ref)return!1;if(Ode(n.rule.ref)&&!tfe(n.rule.ref,t))return!1}else{if(Yde(n))return!1;if(Gde(n))return!1}return Boolean(e.definition)}function nfe(e){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t){if(Ode(t))return t.name;if(Tde(t)||zde(t))return t.name}}}function rfe(e){var t,n;if(Ode(e))return efe(e)?e.name:null!==(t=nfe(e))&&void 0!==t?t:e.name;if(Tde(e)||zde(e)||(n=e,gpe.isInstance(n,Mde)))return e.name;if(Gde(e)){const t=function(e){var t;if(e.inferredType)return e.inferredType.name;if(null===(t=e.type)||void 0===t?void 0:t.ref)return rfe(e.type.ref);return}(e);if(t)return t}else if(Ede(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function ife(e){const t={s:!1,i:!1,u:!1},n=ofe(e.definition,t),r=Object.entries(t).filter(([,e])=>e).map(([e])=>e).join("");return new RegExp(n,r)}const afe=/[\s\S]/.source;function ofe(e,t){if(a=e,gpe.isInstance(a,spe))return lfe((i=e).elements.map(e=>ofe(e)).join("|"),{cardinality:i.cardinality,lookahead:i.lookahead});if(function(e){return gpe.isInstance(e,lpe)}(e))return lfe((r=e).elements.map(e=>ofe(e)).join(""),{cardinality:r.cardinality,lookahead:r.lookahead});if(function(e){return gpe.isInstance(e,Xde)}(e))return function(e){if(e.right)return lfe(`[${sfe(e.left)}-${sfe(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1});return lfe(sfe(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}(e);if(function(e){return gpe.isInstance(e,cpe)}(e)){const t=e.rule.ref;if(!t)throw new Error("Missing rule reference.");return lfe(ofe(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead})}if(function(e){return gpe.isInstance(e,rpe)}(e))return function(e){return lfe(`(?!${ofe(e.terminal)})${afe}*?`,{cardinality:e.cardinality,lookahead:e.lookahead})}(e);if(function(e){return gpe.isInstance(e,dpe)}(e))return lfe(`${afe}*?${ofe((n=e).terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead});if(function(e){return gpe.isInstance(e,ipe)}(e)){const n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),lfe(r,{cardinality:e.cardinality,lookahead:e.lookahead,wrap:!1})}if(function(e){return gpe.isInstance(e,ppe)}(e))return lfe(afe,{cardinality:e.cardinality,lookahead:e.lookahead});throw new Error(`Invalid terminal element: ${null==e?void 0:e.$type}`);var n,r,i,a}function sfe(e){return Gpe(e.value)}function lfe(e,t){var n;return(!1!==t.wrap||t.lookahead)&&(e=`(${null!==(n=t.lookahead)&&void 0!==n?n:""}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function cfe(e){console&&console.error&&console.error(`Error: ${e}`)}function ufe(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function hfe(e){const t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}function dfe(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}function pfe(e){return nse((t=e).LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}class ffe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Doe(this.definition,t=>{t.accept(e)})}}class gfe extends ffe{constructor(e){super([]),this.idx=1,lae(this,vse(e,e=>void 0!==e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class mfe extends ffe{constructor(e){super(e.definition),this.orgText="",lae(this,vse(e,e=>void 0!==e))}}class yfe extends ffe{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,lae(this,vse(e,e=>void 0!==e))}}let vfe=class extends ffe{constructor(e){super(e.definition),this.idx=1,lae(this,vse(e,e=>void 0!==e))}};class bfe extends ffe{constructor(e){super(e.definition),this.idx=1,lae(this,vse(e,e=>void 0!==e))}}class xfe extends ffe{constructor(e){super(e.definition),this.idx=1,lae(this,vse(e,e=>void 0!==e))}}class wfe extends ffe{constructor(e){super(e.definition),this.idx=1,lae(this,vse(e,e=>void 0!==e))}}class Efe extends ffe{constructor(e){super(e.definition),this.idx=1,lae(this,vse(e,e=>void 0!==e))}}class kfe extends ffe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,lae(this,vse(e,e=>void 0!==e))}}class Tfe{constructor(e){this.idx=1,lae(this,vse(e,e=>void 0!==e))}accept(e){e.visit(this)}}function _fe(e){function t(e){return Woe(e,_fe)}if(e instanceof gfe){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return nse(e.label)&&(t.label=e.label),t}if(e instanceof yfe)return{type:"Alternative",definition:t(e.definition)};if(e instanceof vfe)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof bfe)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof xfe)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:_fe(new Tfe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Efe)return{type:"RepetitionWithSeparator",idx:e.idx,separator:_fe(new Tfe({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof wfe)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof kfe)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Tfe){const t={type:"Terminal",name:e.terminalType.name,label:pfe(e.terminalType),idx:e.idx};nse(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=lse(n)?n.source:n),t}if(e instanceof mfe)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class Cfe{visit(e){const t=e;switch(t.constructor){case gfe:return this.visitNonTerminal(t);case yfe:return this.visitAlternative(t);case vfe:return this.visitOption(t);case bfe:return this.visitRepetitionMandatory(t);case xfe:return this.visitRepetitionMandatoryWithSeparator(t);case Efe:return this.visitRepetitionWithSeparator(t);case wfe:return this.visitRepetition(t);case kfe:return this.visitAlternation(t);case Tfe:return this.visitTerminal(t);case mfe:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Sfe(e,t=[]){return!!(e instanceof vfe||e instanceof wfe||e instanceof Efe)||(e instanceof kfe?Nse(e.definition,e=>Sfe(e,t)):!(e instanceof gfe&&ase(t,e))&&(e instanceof ffe&&(e instanceof gfe&&t.push(e),Boe(e.definition,e=>Sfe(e,t)))))}function Afe(e){if(e instanceof gfe)return"SUBRULE";if(e instanceof vfe)return"OPTION";if(e instanceof kfe)return"OR";if(e instanceof bfe)return"AT_LEAST_ONE";if(e instanceof xfe)return"AT_LEAST_ONE_SEP";if(e instanceof Efe)return"MANY_SEP";if(e instanceof wfe)return"MANY";if(e instanceof Tfe)return"CONSUME";throw Error("non exhaustive match")}class Nfe{walk(e,t=[]){Doe(e.definition,(n,r)=>{const i=Loe(e.definition,r+1);if(n instanceof gfe)this.walkProdRef(n,i,t);else if(n instanceof Tfe)this.walkTerminal(n,i,t);else if(n instanceof yfe)this.walkFlat(n,i,t);else if(n instanceof vfe)this.walkOption(n,i,t);else if(n instanceof bfe)this.walkAtLeastOne(n,i,t);else if(n instanceof xfe)this.walkAtLeastOneSep(n,i,t);else if(n instanceof Efe)this.walkManySep(n,i,t);else if(n instanceof wfe)this.walkMany(n,i,t);else{if(!(n instanceof kfe))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new vfe({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Ife(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new vfe({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Ife(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);Doe(e.definition,e=>{const t=new yfe({definition:[e]});this.walk(t,r)})}}function Ife(e,t,n){return[new vfe({definition:[new Tfe({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Ofe(e){if(e instanceof gfe)return Ofe(e.referencedRule);if(e instanceof Tfe)return[e.terminalType];if(function(e){return e instanceof yfe||e instanceof vfe||e instanceof wfe||e instanceof bfe||e instanceof xfe||e instanceof Efe||e instanceof Tfe||e instanceof mfe}(e))return function(e){let t=[];const n=e.definition;let r,i=0,a=n.length>i,o=!0;for(;a&&o;)r=n[i],o=Sfe(r),t=t.concat(Ofe(r)),i+=1,a=n.length>i;return Rse(t)}(e);if(function(e){return e instanceof kfe}(e))return function(e){const t=Woe(e.definition,e=>Ofe(e));return Rse(kae(t))}(e);throw Error("non exhaustive match")}const Lfe="_~IN~_";class Mfe extends Nfe{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=function(e,t){return e.name+t+Lfe}(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(n),a=Ofe(new yfe({definition:i}));this.follows[r]=a}}let Rfe={};const Dfe=new Ppe;function Pfe(e){const t=e.toString();if(Rfe.hasOwnProperty(t))return Rfe[t];{const e=Dfe.pattern(t);return Rfe[t]=e,e}}const $fe="Complement Sets are not supported for first char optimization",Bfe='Unable to use "first char" lexer optimizations:\n';function Ffe(e,t=!1){try{const t=Pfe(e);return zfe(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===$fe)t&&ufe(`${Bfe}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),cfe(`${Bfe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function zfe(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)jfe(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)jfe(e,t,n);else{for(let e=r.from;e<=r.to&&e=cge){const e=r.from>=cge?r.from:cge,n=r.to,i=hge(e),a=hge(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case"Group":zfe(a.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===Ufe(a)||"Group"!==a.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return rse(t)}function jfe(e,t,n){const r=hge(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hge(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hge(e.charCodeAt(0));t[n]=n}}}(e,t)}function Hfe(e,t){return Uoe(e.value,e=>{if("number"==typeof e)return ase(t,e);{const n=e;return void 0!==Uoe(t,e=>n.from<=e&&e<=n.to)}})}function Ufe(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(d3(e.value)?Boe(e.value,Ufe):Ufe(e.value))}class Gfe extends $pe{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){ase(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Hfe(e,this.targetCharCodes)&&(this.found=!0):void 0!==Hfe(e,this.targetCharCodes)&&(this.found=!0)}}function qfe(e,t){if(t instanceof RegExp){const n=Pfe(t),r=new Gfe(e);return r.visit(n),r.found}return void 0!==Uoe(t,t=>ase(e,t.charCodeAt(0)))}const Wfe="PATTERN",Vfe="defaultMode",Yfe="modes";let Xfe="boolean"==typeof new RegExp("(?:)").sticky;function Kfe(e,t){const n=(t=Noe(t,{useSticky:Xfe,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(Kte(uge)){uge=new Array(65536);for(let e=0;e<65536;e++)uge[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=Sse(e,e=>e[Wfe]===Tge.NA)});let i,a,o,s,l,c,u,h,d,p,f,g=!1;n("Transform Patterns",()=>{g=!1,i=Woe(r,e=>{const n=e[Wfe];if(lse(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||ase(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?tge(n):ege(n):e[1]:e}if(p4(n))return g=!0,{exec:n};if("object"==typeof n)return g=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?tge(r):ege(r)}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{a=Woe(r,e=>e.tokenTypeIdx),o=Woe(r,e=>{const t=e.GROUP;if(t!==Tge.SKIPPED){if(nse(t))return t;if(cse(t))return!1;throw Error("non exhaustive match")}}),s=Woe(r,e=>{const t=e.LONGER_ALT;if(t){const e=d3(t)?Woe(t,e=>ose(r,e)):[ose(r,t)];return e}}),l=Woe(r,e=>e.PUSH_MODE),c=Woe(r,e=>tse(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=sge(t.lineTerminatorCharacters);u=Woe(r,e=>!1),"onlyOffset"!==t.positionTracking&&(u=Woe(r,t=>tse(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===oge(t,e)&&qfe(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=Woe(r,rge),d=Woe(i,ige),p=Cse(r,(e,t)=>{const n=t.GROUP;return nse(n)&&n!==Tge.SKIPPED&&(e[n]=[]),e},{}),f=Woe(i,(e,t)=>({pattern:i[t],longerAlt:s[t],canLineTerminator:u[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:c[t],tokenTypeIdx:a[t],tokenType:r[t]}))});let m=!0,y=[];return t.safeMode||n("First Char Optimization",()=>{y=Cse(r,(e,n,r)=>{if("string"==typeof n.PATTERN){const t=hge(n.PATTERN.charCodeAt(0));lge(e,t,f[r])}else if(d3(n.START_CHARS_HINT)){let t;Doe(n.START_CHARS_HINT,n=>{const i=hge("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,lge(e,i,f[r]))})}else if(lse(n.PATTERN))if(n.PATTERN.unicode)m=!1,t.ensureOptimizations&&cfe(`${Bfe}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ffe(n.PATTERN,t.ensureOptimizations);Kte(i)&&(m=!1),Doe(i,t=>{lge(e,t,f[r])})}else t.ensureOptimizations&&cfe(`${Bfe}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),m=!1;return e},[])}),{emptyGroups:p,patternIdxToConfig:f,charCodeToPatternIdxToConfig:y,hasCustom:g,canBeOptimized:m}}function Qfe(e,t){let n=[];const r=function(e){const t=zoe(e,e=>!tse(e,Wfe)),n=Woe(t,e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Ege.MISSING_PATTERN,tokenTypes:[e]})),r=Ioe(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);const i=function(e){const t=zoe(e,e=>{const t=e[Wfe];return!(lse(t)||p4(t)||tse(t,"exec")||nse(t))}),n=Woe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ege.INVALID_PATTERN,tokenTypes:[e]})),r=Ioe(e,t);return{errors:n,valid:r}}(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=zoe(e,e=>lse(e[Wfe]));return t=t.concat(function(e){class t extends $pe{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=zoe(e,e=>{const n=e.PATTERN;try{const e=Pfe(n),r=new t;return r.visit(e),r.found}catch(e){return Zfe.test(n.source)}}),r=Woe(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ege.EOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){class t extends $pe{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=zoe(e,e=>{const n=e.PATTERN;try{const e=Pfe(n),r=new t;return r.visit(e),r.found}catch(e){return Jfe.test(n.source)}}),r=Woe(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ege.SOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){const t=zoe(e,e=>{const t=e[Wfe];return t instanceof RegExp&&(t.multiline||t.global)}),n=Woe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ege.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}));return n}(n)),t=t.concat(function(e){const t=[];let n=Woe(e,n=>Cse(e,(e,r)=>(n.PATTERN.source!==r.PATTERN.source||ase(t,r)||r.PATTERN===Tge.NA||(t.push(r),e.push(r)),e),[]));n=Qae(n);const r=Woe(zoe(n,e=>e.length>1),e=>{const t=Woe(e,e=>e.name);return{message:`The same RegExp pattern ->${Goe(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Ege.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}});return r}(n)),t=t.concat(function(e){const t=zoe(e,e=>e.PATTERN.test("")),n=Woe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Ege.EMPTY_MATCH_PATTERN,tokenTypes:[e]}));return n}(n)),t}(a)),n=n.concat(function(e){const t=zoe(e,e=>{if(!tse(e,"GROUP"))return!1;const t=e.GROUP;return t!==Tge.SKIPPED&&t!==Tge.NA&&!nse(t)}),n=Woe(t,e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ege.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}));return n}(a)),n=n.concat(function(e,t){const n=zoe(e,e=>void 0!==e.PUSH_MODE&&!ase(t,e.PUSH_MODE)),r=Woe(n,e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Ege.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}));return r}(a,t)),n=n.concat(function(e){const t=[],n=Cse(e,(e,t,n)=>{const r=t.PATTERN;return r===Tge.NA||(nse(r)?e.push({str:r,idx:n,tokenType:t}):lse(r)&&(i=r,void 0===Uoe([".","\\","[","]","|","^","$","(",")","?","*","+","{"],e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return Doe(e,(e,r)=>{Doe(n,({str:n,idx:i,tokenType:a})=>{if(r${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Ege.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}(a)),n}const Zfe=/[^\\][$]/;const Jfe=/[^\\[][\^]|^\^/;function ege(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function tge(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function nge(e,t,n){const r=[];let i=!1;const a=Sse(Qae(kae(rse(e.modes))),e=>e[Wfe]===Tge.NA),o=sge(n);return t&&Doe(a,e=>{const t=oge(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Ege.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ege.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else tse(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qfe(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Ege.NO_LINE_BREAKS_FLAGS}),r}function rge(e){const t=e.PATTERN;if(lse(t))return!1;if(p4(t))return!0;if(tse(t,"exec"))return!0;if(nse(t))return!1;throw Error("non exhaustive match")}function ige(e){return!(!nse(e)||1!==e.length)&&e.charCodeAt(0)}const age={test:function(e){const t=e.length;for(let n=this.lastIndex;nnse(e)?e.charCodeAt(0):e)}function lge(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const cge=256;let uge=[];function hge(e){return ee.CATEGORIES)));const e=Ioe(n,t);t=t.concat(e),Kte(e)?r=!1:n=e}return t}(e);!function(e){Doe(e,e=>{vge(e)||(gge[fge]=e,e.tokenTypeIdx=fge++),bge(e)&&!d3(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),bge(e)||(e.CATEGORIES=[]),tse(e,"categoryMatches")||(e.categoryMatches=[]),function(e){return tse(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){Doe(e,e=>{yge([],e)})}(t),function(e){Doe(e,e=>{e.categoryMatches=[],Doe(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(gge[n].tokenTypeIdx)})})}(t),Doe(t,e=>{e.isParent=e.categoryMatches.length>0})}function yge(e,t){Doe(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),Doe(t.CATEGORIES,n=>{const r=e.concat(t);ase(r,n)||yge(r,n)})}function vge(e){return tse(e,"tokenTypeIdx")}function bge(e){return tse(e,"CATEGORIES")}function xge(e){return tse(e,"tokenTypeIdx")}const wge={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};var Ege;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Ege||(Ege={}));const kge={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:wge,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(kge);class Tge{constructor(e,t=kge){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=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=hfe(t),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=lae({},kge,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===kge.lineTerminatorsPattern)this.config.lineTerminatorsPattern=age;else if(this.config.lineTerminatorCharacters===kge.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.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),d3(e)?n={modes:{defaultMode:Xae(e)},defaultMode:Vfe}:(r=!1,n=Xae(e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return tse(e,Vfe)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Vfe+"> property in its definition\n",type:Ege.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),tse(e,Yfe)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Ege.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),tse(e,Yfe)&&tse(e,Vfe)&&!tse(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Vfe}: <${e.defaultMode}>which does not exist\n`,type:Ege.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),tse(e,Yfe)&&Doe(e.modes,(e,n)=>{Doe(e,(r,i)=>{cse(r)?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Ege.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):tse(r,"LONGER_ALT")&&Doe(d3(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT],i=>{cse(i)||ase(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:Ege.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(nge(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Doe(n.modes,(e,t)=>{n.modes[t]=Sse(e,e=>cse(e))});const i=oae(n.modes);if(Doe(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Qfe(e,i))}),Kte(this.lexerDefinitionErrors)){let r;mge(e),this.TRACE_INIT("analyzeTokenTypes",()=>{r=Kfe(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=lae({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!Kte(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=Woe(this.lexerDefinitionErrors,e=>e.message),t=e.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+t)}Doe(this.lexerDefinitionWarning,e=>{ufe(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Xfe?(this.chopInput=W3,this.match=this.matchWithTest):(this.updateLastIndex=eae,this.match=this.matchWithExec),r&&(this.handleModes=eae),!1===this.trackStartLines&&(this.computeNewColumn=W3),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=eae),/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))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}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 e=Cse(this.canModeBeOptimized,(e,t,n)=>(!1===t&&e.push(n),e),[]);if(t.ensureOptimizations&&!Kte(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Rfe={}}),this.TRACE_INIT("toFastProperties",()=>{dfe(this)})})}tokenize(e,t=this.defaultMode){if(!Kte(this.lexerDefinitionErrors)){const e=Woe(this.lexerDefinitionErrors,e=>e.message),t=e.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+t)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,l,c,u,h,d,p,f,g,m;const y=e,v=y.length;let b=0,x=0;const w=this.hasCustom?0:Math.floor(e.length/10),E=new Array(w),k=[];let T=this.trackStartLines?1:void 0,_=this.trackStartLines?1:void 0;const C=function(e){const t={};return Doe(oae(e),n=>{const r=e[n];if(!d3(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),S=this.trackStartLines,A=this.config.lineTerminatorsPattern;let N=0,I=[],O=[];const L=[],M=[];let R;function D(){return I}function P(e){const t=hge(e),n=O[t];return void 0===n?M:n}Object.freeze(M);const $=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);k.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=Ooe(L);I=this.patternIdxToConfig[e],O=this.charCodeToPatternIdxToConfig[e],N=I.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;R=O&&t?P:D}};function B(e){L.push(e),O=this.charCodeToPatternIdxToConfig[e],I=this.patternIdxToConfig[e],N=I.length,N=I.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;R=O&&t?P:D}let F;B.call(this,t);const z=this.config.recoveryEnabled;for(;bs.length){s=a,l=c,F=t;break}}}break}}if(null!==s){if(u=s.length,h=F.group,void 0!==h&&(d=F.tokenTypeIdx,p=this.createTokenInstance(s,b,d,F.tokenType,T,_,u),this.handlePayload(p,l),!1===h?x=this.addToken(E,x,p):C[h].push(p)),e=this.chopInput(e,u),b+=u,_=this.computeNewColumn(_,u),!0===S&&!0===F.canLineTerminator){let e,t,n=0;A.lastIndex=0;do{e=A.test(s),!0===e&&(t=A.lastIndex-1,n++)}while(!0===e);0!==n&&(T+=n,_=u-t,this.updateTokenEndLineColumnLocation(p,h,t,n,T,_,u))}this.handleModes(F,$,B,p)}else{const t=b,n=T,i=_;let a=!1===z;for(;!1===a&&b`Expecting ${Cge(e)?`--\x3e ${_ge(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const a="Expecting: ",o="\nbut found: '"+Goe(t).image+"'";if(r)return a+r+o;{const t=Woe(Cse(e,(e,t)=>e.concat(t),[]),e=>`[${Woe(e,e=>_ge(e)).join(", ")}]`);return a+`one of these possible Token sequences:\n${Woe(t,(e,t)=>` ${t+1}. ${e}`).join("\n")}`+o}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",a="\nbut found: '"+Goe(t).image+"'";if(n)return i+n+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${Woe(e,e=>`[${Woe(e,e=>_ge(e)).join(",")}]`).join(" ,")}>`+a}};Object.freeze(zge);const jge={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},Hge={buildDuplicateFoundError(e,t){const n=e.name,r=Goe(t),i=r.idx,a=Afe(r),o=(s=r)instanceof Tfe?s.terminalType.name:s instanceof gfe?s.nonTerminalName:"";var s;let l=`->${a}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=Woe(e.prefixPath,e=>_ge(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=Woe(e.prefixPath,e=>_ge(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=Afe(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);return`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${Woe(e.leftRecursionPath,e=>e.name).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;t=e.topLevelRule instanceof mfe?e.topLevelRule.name:e.topLevelRule;return`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Uge extends Cfe{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Doe(rse(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:hye.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Gge extends Nfe{constructor(e,t){super(),this.topProd=e,this.path=t,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=Xae(this.path.ruleStack).reverse(),this.occurrenceStack=Xae(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){Kte(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class qge extends Gge{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new yfe({definition:e});this.possibleTokTypes=Ofe(r),this.found=!0}}}class Wge extends Nfe{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Vge extends Wge{walkMany(e,t,n){if(e.idx===this.occurrence){const e=Goe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Tfe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class Yge extends Wge{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=Goe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Tfe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xge extends Wge{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=Goe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Tfe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kge extends Wge{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=Goe(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Tfe&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Qge(e,t,n=[]){n=Xae(n);let r=[],i=0;function a(a){const o=Qge(a.concat(Loe(e,i+1)),t,n);return r.concat(o)}for(;n.length{!1===Kte(e.definition)&&(r=a(e.definition))}),r;if(!(t instanceof Tfe))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:Loe(e,i)}),r}function Zge(e,t,n,r){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let s=!1;const l=t.length,c=l-r-1,u=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Kte(h);){const e=h.pop();if(e===o){s&&Ooe(h).idx<=c&&h.pop();continue}const r=e.def,d=e.idx,p=e.ruleStack,f=e.occurrenceStack;if(Kte(r))continue;const g=r[0];if(g===i){const e={idx:d,def:Loe(r),ruleStack:Moe(p),occurrenceStack:Moe(f)};h.push(e)}else if(g instanceof Tfe)if(d=0;e--){const t={idx:d,def:g.definition[e].definition.concat(Loe(r)),ruleStack:p,occurrenceStack:f};h.push(t),h.push(o)}else if(g instanceof yfe)h.push({idx:d,def:g.definition.concat(Loe(r)),ruleStack:p,occurrenceStack:f});else{if(!(g instanceof mfe))throw Error("non exhaustive match");h.push(Jge(g,d,p,f))}}return u}function Jge(e,t,n,r){const i=Xae(n);i.push(e.name);const a=Xae(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var eme;function tme(e){if(e instanceof vfe||"Option"===e)return eme.OPTION;if(e instanceof wfe||"Repetition"===e)return eme.REPETITION;if(e instanceof bfe||"RepetitionMandatory"===e)return eme.REPETITION_MANDATORY;if(e instanceof xfe||"RepetitionMandatoryWithSeparator"===e)return eme.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Efe||"RepetitionWithSeparator"===e)return eme.REPETITION_WITH_SEPARATOR;if(e instanceof kfe||"Alternation"===e)return eme.ALTERNATION;throw Error("non exhaustive match")}function nme(e){const{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=tme(r);return a===eme.ALTERNATION?hme(t,n,i):dme(t,n,a,i)}function rme(e,t,n,r){const i=e.length,a=Boe(e,e=>Boe(e,e=>1===e.length));if(t)return function(t){const r=Woe(t,e=>e.GATE);for(let t=0;tkae(e)),(e,t,n)=>(Doe(t,t=>{tse(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),Doe(t.categoryMatches,t=>{tse(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=kae(e);if(1===t.length&&Kte(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=Cse(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,Doe(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nQge([e],1)),r=sme(n.length),i=Woe(n,e=>{const t={};return Doe(e,e=>{Doe(lme(e.partialPath),e=>{t[e]=!0})}),t});let a=n;for(let e=1;e<=t;e++){const n=a;a=sme(n.length);for(let o=0;o{Doe(lme(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}function hme(e,t,n,r){const i=new ome(e,eme.ALTERNATION,r);return t.accept(i),ume(i.result,n)}function dme(e,t,n,r){const i=new ome(e,n);t.accept(i);const a=i.result,o=new ame(t,e,n).startWalking();return ume([new yfe({definition:a}),new yfe({definition:o})],r)}function pme(e,t){e:for(let n=0;nBoe(e,e=>Boe(e,e=>Kte(e.categoryMatches))))}function gme(e,t,n,r){const i=Voe(e,e=>function(e,t){const n=new vme;e.accept(n);const r=n.allProductions,i=Qoe(r,mme),a=Woe(rse(vse(i,e=>e.length>1)),n=>{const r=Goe(n),i=t.buildDuplicateFoundError(e,n),a=Afe(r),o={message:i,type:hye.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=yme(r);return s&&(o.parameter=s),o});return a}(e,n)),a=function(e,t,n){const r=[],i=Woe(t,e=>e.name);return Doe(e,e=>{const t=e.name;if(ase(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:hye.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=Voe(e,e=>function(e,t){const n=new wme;e.accept(n);const r=Voe(n.alternations,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:hye.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]);return r}(e,n)),s=Voe(e,t=>function(e,t,n,r){const i=[],a=Cse(t,(t,n)=>n.name===e.name?t+1:t,0);if(a>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:hye.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(a,o,s)}function mme(e){return`${Afe(e)}_#_${e.idx}_#_${yme(e)}`}function yme(e){return e instanceof Tfe?e.terminalType.name:e instanceof gfe?e.nonTerminalName:""}class vme extends Cfe{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function bme(e,t,n,r=[]){const i=[],a=xme(t.definition);if(Kte(a))return[];{const t=e.name;ase(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:hye.LEFT_RECURSION,ruleName:t});const o=Voe(Ioe(a,r.concat([e])),t=>{const i=Xae(r);return i.push(t),bme(e,t,n,i)});return i.concat(o)}}function xme(e){let t=[];if(Kte(e))return t;const n=Goe(e);if(n instanceof gfe)t.push(n.referencedRule);else if(n instanceof yfe||n instanceof vfe||n instanceof bfe||n instanceof xfe||n instanceof Efe||n instanceof wfe)t=t.concat(xme(n.definition));else if(n instanceof kfe)t=kae(Woe(n.definition,e=>xme(e.definition)));else if(!(n instanceof Tfe))throw Error("non exhaustive match");const r=Sfe(n),i=e.length>1;if(r&&i){const n=Loe(e);return t.concat(xme(n))}return t}class wme extends Cfe{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Eme(e,t,n){const r=new wme;e.accept(r);let i=r.alternations;i=Sse(i,e=>!0===e.ignoreAmbiguities);const a=Voe(i,r=>{const i=r.idx,a=r.maxLookahead||t,o=hme(i,e,a,r),s=function(e,t,n,r){const i=[],a=Cse(e,(n,r,a)=>(!0===t.definition[a].ignoreAmbiguities||Doe(r,r=>{const o=[a];Doe(e,(e,n)=>{a!==n&&pme(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!pme(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),o=Woe(a,e=>{const i=Woe(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:hye.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}});return o}(o,r,e,n),l=function(e,t,n,r){const i=Cse(e,(e,t,n)=>{const r=Woe(t,e=>({idx:n,path:e}));return e.concat(r)},[]),a=Qae(Voe(i,e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const a=e.idx,o=e.path,s=zoe(i,e=>!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}(e.path,o));return Woe(s,e=>{const i=[e.idx+1,a+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:hye.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}));return a}(o,r,e,n);return s.concat(l)});return a}class kme extends Cfe{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Tme(e){const t=Noe(e,{errMsgProvider:jge}),n={};return Doe(e.rules,e=>{n[e.name]=e}),function(e,t){const n=new Uge(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}const _me="MismatchedTokenException",Cme="NoViableAltException",Sme="EarlyExitException",Ame="NotAllInputParsedException",Nme=[_me,Cme,Sme,Ame];function Ime(e){return ase(Nme,e.name)}Object.freeze(Nme);class Ome extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Lme extends Ome{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=_me}}class Mme extends Ome{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cme}}class Rme extends Ome{constructor(e,t){super(e,t),this.name=Ame}}class Dme extends Ome{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Sme}}const Pme={},$me="InRuleRecoveryException";class Bme extends Error{constructor(e){super(e),this.name=$me}}function Fme(e,t,n,r,i,a,o){const s=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[s];if(void 0===l){const e=this.getCurrRuleFullName();l=new a(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[s]=l}let c=l.token,u=l.occurrence;const h=l.isEndOfRule;1===this.RULE_STACK.length&&h&&void 0===c&&(c=$ge,u=1),void 0!==c&&void 0!==u&&this.shouldInRepetitionRecoveryBeTried(c,u,o)&&this.tryInRepetitionRecovery(e,t,n,c)}const zme=1024,jme=1280,Hme=1536;function Ume(e,t,n){return n|t|e}class Gme{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:cye.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(Kte(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return Voe(e,e=>bme(e,e,Hge))}validateEmptyOrAlternatives(e){return Voe(e,e=>function(e,t){const n=new wme;return e.accept(n),Voe(n.alternations,n=>Voe(Moe(n.definition),(r,i)=>Kte(Zge([r],[],dge,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:hye.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,Hge))}validateAmbiguousAlternationAlternatives(e,t){return Voe(e,e=>Eme(e,t,Hge))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return Doe(e,e=>{const i=new kme;e.accept(i),Doe(i.allProductions,i=>{const a=tme(i),o=i.maxLookahead||t;if(Kte(kae(dme(i.idx,e,a,o)[0]))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:hye.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,Hge)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,a){const o=hme(e,t,n);return a(o,r,fme(o)?pge:dge,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,rme)}buildLookaheadForOptional(e){return function(e,t,n,r,i,a){const o=dme(e,t,i,n),s=fme(o)?pge:dge;return a(o[0],s,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,tme(e.prodType),ime)}}const qme=new class extends Cfe{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Wme(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset!1===p4(e[t])),r=Woe(n,t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Qme.MISSING_METHOD,methodName:t}));return Qae(r)}(e,t);return n}(this,t);if(!Kte(e)){const t=Woe(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}var Qme;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Qme||(Qme={}));const Zme={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Zme);const Jme=!0,eye=Math.pow(2,8)-1,tye=Pge({name:"RECORDING_PHASE_TOKEN",pattern:Tge.NA});mge([tye]);const nye=Bge(tye,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(nye);const rye={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function iye(e,t,n,r=!1){sye(n);const i=Ooe(this.recordingProdStack),a=p4(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),tse(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),Zme}function aye(e,t){sye(t);const n=Ooe(this.recordingProdStack),r=!1===d3(e),i=!1===r?e:e.DEF,a=new kfe({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});tse(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD);const o=Nse(i,e=>p4(e.GATE));return a.hasPredicates=o,n.definition.push(a),Doe(i,e=>{const t=new yfe({definition:[]});a.definition.push(t),tse(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:tse(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Zme}function oye(e){return 0===e?"":`${e}`}function sye(e){if(e<0||e>eye){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${eye+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const lye=Bge($ge,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(lye);const cye=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:zge,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),uye=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var hye,dye,pye;function fye(e=void 0){return function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(hye||(hye={}));class gye{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{dfe(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Doe(this.definedRulesNames,e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Tme({rules:rse(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Kte(n)&&!1===this.skipValidations){const n=(e={rules:rse(this.gastProductionsCache),tokenTypes:rse(this.tokensMap),errMsgProvider:Hge,grammarName:t},gme((e=Noe(e,{errMsgProvider:Hge})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){return Woe(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:hye.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:rse(this.gastProductionsCache),tokenTypes:rse(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e}),Kte(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return Doe(e,e=>{const n=new Mfe(e).startWalking();lae(t,n)}),t}(rse(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:rse(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(rse(this.gastProductionsCache))})),!gye.DEFER_DEFINITION_ERRORS_HANDLING&&!Kte(this.definitionErrors))throw e=Woe(this.definitionErrors,e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),tse(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=tse(t,"skipValidations")?t.skipValidations:cye.skipValidations}}gye.DEFER_DEFINITION_ERRORS_HANDLING=!1,dye=gye,pye=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=tse(e,"recoveryEnabled")?e.recoveryEnabled:cye.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Fme)}getTokenToInsert(e){const t=Bge(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let s=!1;const l=this.LA(1);let c=this.LA(1);const u=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new Lme(t,l,this.LA(0));n.resyncedTokens=Moe(o),this.SAVE_ERROR(n)};for(;!s;){if(this.tokenMatcher(c,r))return void u();if(n.call(this))return u(),void e.apply(this,t);this.tokenMatcher(c,i)?s=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Bme("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Kte(t))return!1;const n=this.LA(1);return void 0!==Uoe(t,e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return ase(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=Uoe(e,e=>Fge(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return Pme;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return Woe(e,(n,r)=>0===r?Pme:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return kae(Woe(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===Pme)return[$ge];const t=e.ruleName+e.idxInCallingRule+Lfe+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,$ge)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Moe(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:Xae(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return Woe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},class{initLooksAhead(e){this.dynamicTokensEnabled=tse(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:cye.dynamicTokensEnabled,this.maxLookahead=tse(e,"maxLookahead")?e.maxLookahead:cye.maxLookahead,this.lookaheadStrategy=tse(e,"lookaheadStrategy")?e.lookaheadStrategy:new Gme({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Doe(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=function(e){qme.reset(),e.accept(qme);const t=qme.dslMethods;return qme.reset(),t}(e);Doe(t,t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${Afe(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Ume(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),Doe(n,t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,Afe(t))}),Doe(r,t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,Afe(t))}),Doe(i,t=>{this.computeLookaheadFunc(e,t.idx,zme,"RepetitionMandatory",t.maxLookahead,Afe(t))}),Doe(a,t=>{this.computeLookaheadFunc(e,t.idx,Hme,"RepetitionMandatoryWithSeparator",t.maxLookahead,Afe(t))}),Doe(o,t=>{this.computeLookaheadFunc(e,t.idx,jme,"RepetitionWithSeparator",t.maxLookahead,Afe(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${0===t?"":t}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Ume(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return Ume(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=tse(e,"nodeLocationTracking")?e.nodeLocationTracking:cye.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Vme,this.setNodeLocationFromNode=Vme,this.cstPostRule=eae,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=eae,this.setNodeLocationFromNode=eae,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Wme,this.setNodeLocationFromNode=Wme,this.cstPostRule=eae,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=eae,this.setNodeLocationFromNode=eae,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=eae,this.setNodeLocationFromNode=eae,this.cstPostRule=eae,this.setInitialNodeLocation=eae}else this.cstInvocationStateUpdate=eae,this.cstFinallyStateUpdate=eae,this.cstPostTerminal=eae,this.cstPostNonTerminal=eae,this.cstPostRule=eae}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 t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[n]?e.children[n]=[t]:e.children[n].push(t)}(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(cse(this.baseCstVisitorConstructor)){const e=Kme(this.className,oae(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(cse(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};Yme(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return Doe(t,e=>{i[e]=Xme}),(r.prototype=i).constructor=r,r}(this.className,oae(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]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing 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)):lye}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?lye:this.tokVector[t]}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()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pge,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},tse(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(d3(e)){if(Kte(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(d3(e))this.tokensMap=Cse(e,(e,t)=>(e[t.name]=t,e),{});else if(tse(e,"modes")&&Boe(kae(rse(e.modes)),xge)){const t=Rse(kae(rse(e.modes)));this.tokensMap=Cse(t,(e,t)=>(e[t.name]=t,e),{})}else{if(!d4(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Xae(e)}this.tokensMap.EOF=$ge;const n=Boe(tse(e,"modes")?kae(rse(e.modes)):rse(e),e=>Kte(e.categoryMatches));this.tokenMatcher=n?pge:dge,mge(rse(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=tse(n,"resyncEnabled")?n.resyncEnabled:uye.resyncEnabled,i=tse(n,"recoveryValueFunc")?n.recoveryValueFunc:uye.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Ime(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(zme,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,eme.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,zme,e,Xge)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Hme,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,eme.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kge],t,Hme,e,Kge)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,Vge,a)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(jme,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Yge],t,jme,e,Yge)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,Hme,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=d3(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Rme(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw Ime(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Lme(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===$me?n:e}}}saveRecogState(){const e=this.errors,t=Xae(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),$ge)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=uye){if(ase(this.definedRulesNames,e)){const t={message:Hge.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:hye.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=uye){const r=function(e,t,n){const r=[];let i;return ase(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:hye.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(Ime(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Woe(rse(this.gastProductionsCache),_fe)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=tse(e,"errorMessageProvider")?e.errorMessageProvider:cye.errorMessageProvider}SAVE_ERROR(e){if(Ime(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Xae(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Xae(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=dme(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Dme(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=hme(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const a=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Mme(o,this.LA(1),a))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(cse(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Zge([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Goe(e.ruleStack),n=this.getGAstProductions()[t];return new qge(n,e).startWalking()}},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 t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},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 t=0;t<10;t++){const n=t>0?t:"";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,t){return()=>!0}LA_RECORD(e){return lye}topLevelRuleRecord(e,t){try{const n=new mfe({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return iye.call(this,vfe,e,t)}atLeastOneInternalRecord(e,t){iye.call(this,bfe,t,e)}atLeastOneSepFirstInternalRecord(e,t){iye.call(this,xfe,t,e,Jme)}manyInternalRecord(e,t){iye.call(this,wfe,t,e)}manySepFirstInternalRecord(e,t){iye.call(this,Efe,t,e,Jme)}orInternalRecord(e,t){return aye.call(this,e,t)}subruleInternalRecord(e,t,n){if(sye(t),!e||!1===tse(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Ooe(this.recordingProdStack),i=e.ruleName,a=new gfe({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?rye:Zme}consumeInternalRecord(e,t,n){if(sye(t),!vge(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Ooe(this.recordingProdStack),i=new Tfe({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),nye}},class{initPerformanceTracer(e){if(tse(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=cye.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=hfe(t),a=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],pye.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(dye.prototype,n,r):dye.prototype[n]=e.prototype[n]})});class mye extends gye{constructor(e,t=cye){const n=Xae(t);n.outputCst=!1,super(e,n)}}function yye(e,t,n){return`${e.name}_${t}_${n}`}class vye{constructor(e){this.target=e}isEpsilon(){return!1}}class bye extends vye{constructor(e,t){super(e),this.tokenType=t}}class xye extends vye{constructor(e){super(e)}isEpsilon(){return!0}}class wye extends vye{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}}function Eye(e){const t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};!function(e,t){const n=t.length;for(let r=0;rkye(e,t,n)),a=Aye(e,t,r,n,...i);return a}(e,t,n):n instanceof vfe?function(e,t,n){const r=Lye(e,t,n,{type:1});Sye(e,r);const i=Aye(e,t,r,n,Tye(e,t,n));return function(e,t,n,r){const i=r.left,a=r.right;return Oye(i,a),e.decisionMap[yye(t,"Option",n.idx)]=i,r}(e,t,n,i)}(e,t,n):n instanceof wfe?function(e,t,n){const r=Lye(e,t,n,{type:5});Sye(e,r);const i=Aye(e,t,r,n,Tye(e,t,n));return Cye(e,t,n,i)}(e,t,n):n instanceof Efe?function(e,t,n){const r=Lye(e,t,n,{type:5});Sye(e,r);const i=Aye(e,t,r,n,Tye(e,t,n)),a=Nye(e,t,n.separator,n);return Cye(e,t,n,i,a)}(e,t,n):n instanceof bfe?function(e,t,n){const r=Lye(e,t,n,{type:4});Sye(e,r);const i=Aye(e,t,r,n,Tye(e,t,n));return _ye(e,t,n,i)}(e,t,n):n instanceof xfe?function(e,t,n){const r=Lye(e,t,n,{type:4});Sye(e,r);const i=Aye(e,t,r,n,Tye(e,t,n)),a=Nye(e,t,n.separator,n);return _ye(e,t,n,i,a)}(e,t,n):Tye(e,t,n)}function Tye(e,t,n){const r=zoe(Woe(n.definition,n=>kye(e,t,n)),e=>void 0!==e);return 1===r.length?r[0]:0===r.length?void 0:function(e,t){const n=t.length;for(let r=0;re.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}}function $ye(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join("_")}`}function Bye(e,t){const n={};return r=>{const i=r.toString();let a=n[i];return void 0!==a||(a={atnStartState:e,decision:t,states:{}},n[i]=a),a}}class Fye{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let n=0;nconsole.log(e)}initialize(e){this.atn=Eye(e.rules),this.dfas=function(e){const t=e.decisionStates.length,n=Array(t);for(let r=0;rWoe(e,e=>e[0]));if(Hye(c,!1)&&!i){const e=Cse(c,(e,t,n)=>(Doe(t,t=>{t&&(e[t.tokenTypeIdx]=n,Doe(t.categoryMatches,t=>{e[t]=n}))}),e),{});return r?function(t){var n;const r=this.LA(1),i=e[r.tokenTypeIdx];if(void 0!==t&&void 0!==i){const e=null===(n=t[i])||void 0===n?void 0:n.GATE;if(void 0!==e&&!1===e.call(this))return}return i}:function(){const t=this.LA(1);return e[t.tokenTypeIdx]}}return r?function(e){const t=new Fye,n=void 0===e?0:e.length;for(let r=0;rWoe(e,e=>e[0]));if(Hye(c)&&c[0][0]&&!i){const e=kae(c[0]);if(1===e.length&&Kte(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=Cse(e,(e,t)=>(void 0!==t&&(e[t.tokenTypeIdx]=!0,Doe(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const e=Uye.call(this,a,l,zye,o);return"object"!=typeof e&&0===e}}}function Hye(e,t=!0){const n=new Set;for(const r of e){const e=new Set;for(const i of r){if(void 0===i){if(t)break;return!1}const r=[i.tokenTypeIdx].concat(i.categoryMatches);for(const t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function Uye(e,t,n,r){const i=e[t](n);let a=i.start;if(void 0===a){a=Zye(i,Kye(Jye(i.atnStartState))),i.start=a}return Gye.apply(this,[i,a,n,r])}function Gye(e,t,n,r){let i=t,a=1;const o=[];let s=this.LA(a++);for(;;){let t=Yye(i,s);if(void 0===t&&(t=qye.apply(this,[e,i,s,a,n,r])),t===Dye)return Vye(o,i,s);if(!0===t.isAcceptState)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function qye(e,t,n,r,i,a){const o=function(e,t,n){const r=new Pye,i=[];for(const a of e.elements){if(!1===n.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const e=a.state.transitions.length;for(let n=0;n0&&!function(e){for(const t of e.elements)if(7===t.state.type)return!0;return!1}(a))for(const e of i)a.add(e);return a}(t.configs,n,i);if(0===o.size)return Qye(e,t,n,Dye),Dye;let s=Kye(o);const l=function(e,t){let n;for(const r of e.elements)if(!0===t.is(r.alt))if(void 0===n)n=r.alt;else if(n!==r.alt)return;return n}(o,i);if(void 0!==l)s.isAcceptState=!0,s.prediction=l,s.configs.uniqueAlt=l;else if(function(e){if(function(e){for(const t of e.elements)if(7!==t.state.type)return!1;return!0}(e))return!0;const t=function(e){const t=new Map;for(const n of e){const e=$ye(n,!1);let r=t.get(e);void 0===r&&(r={},t.set(e,r)),r[n.alt]=!0}return t}(e.elements);return function(e){for(const t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}(t)&&!function(e){for(const t of Array.from(e.values()))if(1===Object.keys(t).length)return!0;return!1}(t)}(o)){const t=fse(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,Wye.apply(this,[e,r,o.alts,a])}return s=Qye(e,t,n,s),s}function Wye(e,t,n,r){const i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);const a=e.atnStartState;r(function(e){const t=Woe(e.prefixPath,e=>_ge(e)).join(", "),n=0===e.production.idx?"":e.production.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${function(e){if(e instanceof gfe)return"SUBRULE";if(e instanceof vfe)return"OPTION";if(e instanceof kfe)return"OR";if(e instanceof bfe)return"AT_LEAST_ONE";if(e instanceof xfe)return"AT_LEAST_ONE_SEP";if(e instanceof Efe)return"MANY_SEP";if(e instanceof wfe)return"MANY";if(e instanceof Tfe)return"CONSUME";throw Error("non exhaustive match")}(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r}({topLevelRule:a.rule,ambiguityIndices:n,production:a.production,prefixPath:i}))}function Vye(e,t,n){const r=Voe(t.configs.elements,e=>e.state.transitions),i=function(e,t){return e&&e.length?Lse(e,woe(t)):[]}(r.filter(e=>e instanceof bye).map(e=>e.tokenType),e=>e.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:e}}function Yye(e,t){return e.edges[t.tokenTypeIdx]}function Xye(e,t){if(e instanceof bye&&Fge(t,e.tokenType))return e.target}function Kye(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Qye(e,t,n,r){return r=Zye(e,r),t.edges[n.tokenTypeIdx]=r,r}function Zye(e,t){if(t===Dye)return t;const n=t.configs.key,r=e.states[n];return void 0!==r?r:(t.configs.finalize(),e.states[n]=t,t)}function Jye(e){const t=new Pye,n=e.transitions.length;for(let r=0;r0){const n=[...e.stack];eve({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);const r=n.transitions.length;for(let i=0;i0&&(r.arguments=n),r},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.string(t.title)&&Abe.string(t.command)}}(xve||(xve={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){const t=e;return Abe.objectLiteral(t)&&Abe.string(t.newText)&&sve.is(t.range)}}(wve||(wve={})),function(e){e.create=function(e,t,n){const r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){const t=e;return Abe.objectLiteral(t)&&Abe.string(t.label)&&(Abe.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Abe.string(t.description)||void 0===t.description)}}(Eve||(Eve={})),function(e){e.is=function(e){const t=e;return Abe.string(t)}}(kve||(kve={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){const t=e;return wve.is(t)&&(Eve.is(t.annotationId)||kve.is(t.annotationId))}}(Tve||(Tve={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return Abe.defined(t)&&Lve.is(t.textDocument)&&Array.isArray(t.edits)}}(_ve||(_ve={})),function(e){e.create=function(e,t,n){let r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"create"===t.kind&&Abe.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Abe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Abe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||kve.is(t.annotationId))}}(Cve||(Cve={})),function(e){e.create=function(e,t,n,r){let i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&"rename"===t.kind&&Abe.string(t.oldUri)&&Abe.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Abe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Abe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||kve.is(t.annotationId))}}(Sve||(Sve={})),function(e){e.create=function(e,t,n){let r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&"delete"===t.kind&&Abe.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Abe.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Abe.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||kve.is(t.annotationId))}}(Ave||(Ave={})),function(e){e.is=function(e){let t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every(e=>Abe.string(e.kind)?Cve.is(e)||Sve.is(e)||Ave.is(e):_ve.is(e)))}}(Nve||(Nve={})),function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.string(t.uri)}}(Ive||(Ive={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.string(t.uri)&&Abe.integer(t.version)}}(Ove||(Ove={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.string(t.uri)&&(null===t.version||Abe.integer(t.version))}}(Lve||(Lve={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.string(t.uri)&&Abe.string(t.languageId)&&Abe.integer(t.version)&&Abe.string(t.text)}}(Mve||(Mve={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){const n=t;return n===e.PlainText||n===e.Markdown}}(Rve||(Rve={})),function(e){e.is=function(e){const t=e;return Abe.objectLiteral(e)&&Rve.is(t.kind)&&Abe.string(t.value)}}(Dve||(Dve={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Pve||(Pve={})),function(e){e.PlainText=1,e.Snippet=2}($ve||($ve={})),function(e){e.Deprecated=1}(Bve||(Bve={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){const t=e;return t&&Abe.string(t.newText)&&sve.is(t.insert)&&sve.is(t.replace)}}(Fve||(Fve={})),function(e){e.asIs=1,e.adjustIndentation=2}(zve||(zve={})),function(e){e.is=function(e){const t=e;return t&&(Abe.string(t.detail)||void 0===t.detail)&&(Abe.string(t.description)||void 0===t.description)}}(jve||(jve={})),function(e){e.create=function(e){return{label:e}}}(Hve||(Hve={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(Uve||(Uve={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){const t=e;return Abe.string(t)||Abe.objectLiteral(t)&&Abe.string(t.language)&&Abe.string(t.value)}}(Gve||(Gve={})),function(e){e.is=function(e){let t=e;return!!t&&Abe.objectLiteral(t)&&(Dve.is(t.contents)||Gve.is(t.contents)||Abe.typedArray(t.contents,Gve.is))&&(void 0===e.range||sve.is(e.range))}}(qve||(qve={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Wve||(Wve={})),function(e){e.create=function(e,t,...n){let r={label:e};return Abe.defined(t)&&(r.documentation=t),Abe.defined(n)?r.parameters=n:r.parameters=[],r}}(Vve||(Vve={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Yve||(Yve={})),function(e){e.create=function(e,t){let n={range:e};return Abe.number(t)&&(n.kind=t),n}}(Xve||(Xve={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Kve||(Kve={})),function(e){e.Deprecated=1}(Qve||(Qve={})),function(e){e.create=function(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}}(Zve||(Zve={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(Jve||(Jve={})),function(e){e.create=function(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==a&&(o.children=a),o},e.is=function(e){let t=e;return t&&Abe.string(t.name)&&Abe.number(t.kind)&&sve.is(t.range)&&sve.is(t.selectionRange)&&(void 0===t.detail||Abe.string(t.detail))&&(void 0===t.deprecated||Abe.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(ebe||(ebe={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(tbe||(tbe={})),function(e){e.Invoked=1,e.Automatic=2}(nbe||(nbe={})),function(e){e.create=function(e,t,n){let r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.typedArray(t.diagnostics,bve.is)&&(void 0===t.only||Abe.typedArray(t.only,Abe.string))&&(void 0===t.triggerKind||t.triggerKind===nbe.Invoked||t.triggerKind===nbe.Automatic)}}(rbe||(rbe={})),function(e){e.create=function(e,t,n){let r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):xve.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){let t=e;return t&&Abe.string(t.title)&&(void 0===t.diagnostics||Abe.typedArray(t.diagnostics,bve.is))&&(void 0===t.kind||Abe.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||xve.is(t.command))&&(void 0===t.isPreferred||Abe.boolean(t.isPreferred))&&(void 0===t.edit||Nve.is(t.edit))}}(ibe||(ibe={})),function(e){e.create=function(e,t){let n={range:e};return Abe.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return Abe.defined(t)&&sve.is(t.range)&&(Abe.undefined(t.command)||xve.is(t.command))}}(abe||(abe={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return Abe.defined(t)&&Abe.uinteger(t.tabSize)&&Abe.boolean(t.insertSpaces)}}(obe||(obe={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return Abe.defined(t)&&sve.is(t.range)&&(Abe.undefined(t.target)||Abe.string(t.target))}}(sbe||(sbe={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return Abe.objectLiteral(n)&&sve.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(lbe||(lbe={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(cbe||(cbe={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(ube||(ube={})),function(e){e.is=function(e){const t=e;return Abe.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(hbe||(hbe={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){const t=e;return null!=t&&sve.is(t.range)&&Abe.string(t.text)}}(dbe||(dbe={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){const t=e;return null!=t&&sve.is(t.range)&&Abe.boolean(t.caseSensitiveLookup)&&(Abe.string(t.variableName)||void 0===t.variableName)}}(pbe||(pbe={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){const t=e;return null!=t&&sve.is(t.range)&&(Abe.string(t.expression)||void 0===t.expression)}}(fbe||(fbe={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){const t=e;return Abe.defined(t)&&sve.is(e.stoppedLocation)}}(gbe||(gbe={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(mbe||(mbe={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){const t=e;return Abe.objectLiteral(t)&&(void 0===t.tooltip||Abe.string(t.tooltip)||Dve.is(t.tooltip))&&(void 0===t.location||lve.is(t.location))&&(void 0===t.command||xve.is(t.command))}}(ybe||(ybe={})),function(e){e.create=function(e,t,n){const r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){const t=e;return Abe.objectLiteral(t)&&ove.is(t.position)&&(Abe.string(t.label)||Abe.typedArray(t.label,ybe.is))&&(void 0===t.kind||mbe.is(t.kind))&&void 0===t.textEdits||Abe.typedArray(t.textEdits,wve.is)&&(void 0===t.tooltip||Abe.string(t.tooltip)||Dve.is(t.tooltip))&&(void 0===t.paddingLeft||Abe.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Abe.boolean(t.paddingRight))}}(vbe||(vbe={})),function(e){e.createSnippet=function(e){return{kind:"snippet",value:e}}}(bbe||(bbe={})),function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}}(xbe||(xbe={})),function(e){e.create=function(e){return{items:e}}}(wbe||(wbe={})),function(e){e.Invoked=0,e.Automatic=1}(Ebe||(Ebe={})),function(e){e.create=function(e,t){return{range:e,text:t}}}(kbe||(kbe={})),function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}}(Tbe||(Tbe={})),function(e){e.is=function(e){const t=e;return Abe.objectLiteral(t)&&rve.is(t.uri)&&Abe.string(t.name)}}(_be||(_be={})),function(e){function t(e,n){if(e.length<=1)return e;const r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);let o=0,s=0,l=0;for(;o{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),a=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),s=e.offsetAt(n.range.end);if(!(s<=a))throw new Error("Overlapping edit");r=r.substring(0,o)+n.newText+r.substring(s,r.length),a=o}return r}}(Cbe||(Cbe={}));let Sbe=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let e=[],t=this._content,n=!0;for(let r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return ove.create(0,e);for(;ne?r=i:n=i+1}let i=n-1;return ove.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1=0&&t.content.splice(n,1)}}addHiddenNodes(e){const t=[];for(const n of e){const e=new Obe(n.startOffset,n.image.length,Jhe(n),n.tokenType,!0);e.root=this.rootNode,t.push(e)}let n=this.current,r=!1;if(n.content.length>0)n.content.push(...t);else{for(;n.container;){const e=n.container.content.indexOf(n);if(e>0){n.container.content.splice(e,0,...t),r=!0;break}n=n.container}r||this.rootNode.content.unshift(...t)}}construct(e){const t=this.current;"string"==typeof e.$type&&(this.current.astNode=e),e.$cstNode=t;const n=this.nodeStack.pop();0===(null==n?void 0:n.content.length)&&this.removeNode(n)}}class Ibe{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,t;const n="string"==typeof(null===(e=this._astNode)||void 0===e?void 0:e.$type)?this._astNode:null===(t=this.container)||void 0===t?void 0:t.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Obe extends Ibe{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,n,r,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=r,this._length=t,this._range=n}}class Lbe extends Ibe{constructor(){super(...arguments),this.content=new Mbe(this)}get children(){return this.content}get offset(){var e,t;return null!==(t=null===(e=this.firstNonHiddenNode)||void 0===e?void 0:e.offset)&&void 0!==t?t:0}get length(){return this.end-this.offset}get end(){var e,t;return null!==(t=null===(e=this.lastNonHiddenNode)||void 0===e?void 0:e.end)&&void 0!==t?t:0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(void 0===this._rangeCache){const{range:n}=e,{range:r}=t;this._rangeCache={start:n.start,end:r.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class Mbe extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Mbe.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(const t of e)t.container=this.parent}}class Rbe extends Lbe{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=null!=e?e:""}}const Dbe=Symbol("Datatype");function Pbe(e){return e.$type===Dbe}const $be=e=>e.endsWith("​")?e:e+"​";class Bbe{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,n="production"===e.LanguageMetaData.mode;this.wrapper=new Gbe(t,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Fbe extends Bbe{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Nbe,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const n=this.computeRuleType(e),r=this.wrapper.DEFINE_RULE($be(e.name),this.startImplementation(n,t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}computeRuleType(e){if(!e.fragment){if(efe(e))return Dbe;{const t=nfe(e);return null!=t?t:e.name}}}parse(e,t={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const r=t.rule?this.allRules.get(t.rule):this.mainRule;if(!r)throw new Error(t.rule?`No rule found with name '${t.rule}'`:"No main rule available.");const i=r.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:i,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,t){return n=>{const r=!this.isRecording()&&void 0!==e;if(r){const t={$type:e};this.stack.push(t),e===Dbe&&(t.value="")}let i;try{i=t(n)}catch(e){i=void 0}return void 0===i&&r&&(i=this.construct()),i}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const n=e.startOffset;for(let e=0;en)return t.splice(0,e)}return t.splice(0,t.length)}consume(e,t,n){const r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){const e=this.extractHiddenTokens(r);this.nodeBuilder.addHiddenNodes(e);const t=this.nodeBuilder.buildLeafNode(r,n),{assignment:i,isCrossRef:a}=this.getAssignment(n),o=this.current;if(i){const e=npe(n)?r.image:this.converter.convert(r.image,t);this.assign(i.operator,i.feature,e,t,a)}else if(Pbe(o)){let e=r.image;npe(n)||(e=this.converter.convert(e,t).toString()),o.value+=e}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&"number"==typeof e.endOffset&&!isNaN(e.endOffset)}subrule(e,t,n,r,i){let a;this.isRecording()||n||(a=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,t,i);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,r,a)}performSubruleAssignment(e,t,n){const{assignment:r,isCrossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){const t=this.current;if(Pbe(t))t.value+=e.toString();else if("object"==typeof e&&e){const n=this.assignWithoutOverride(e,t);this.stack.pop(),this.stack.push(n)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(t.feature&&t.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode);this.nodeBuilder.buildCompositeNode(t).content.push(n.$cstNode);const r={$type:e};this.stack.push(r),this.assign(t.operator,t.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return function(e){for(const[t,n]of Object.entries(e))t.startsWith("$")||(Array.isArray(n)?n.forEach((n,r)=>{Phe(n)&&(n.$container=e,n.$containerProperty=t,n.$containerIndex=r)}):Phe(n)&&(n.$container=e,n.$containerProperty=t))}(e),this.nodeBuilder.construct(e),this.stack.pop(),Pbe(e)?this.converter.convert(e.value,e.$cstNode):(function(e,t){const n=e.getTypeMetaData(t.$type),r=t;for(const e of n.properties)void 0!==e.defaultValue&&void 0===r[e.name]&&(r[e.name]=Tpe(e.defaultValue))}(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=mpe(e,Yde);this.assignmentMap.set(e,{assignment:t,isCrossRef:!!t&&Qde(t.terminal)})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){const a=this.current;let o;switch(o=i&&"string"==typeof n?this.linker.buildReference(a,t,r,n):n,e){case"=":a[t]=o;break;case"?=":a[t]=!0;break;case"+=":Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(const[n,r]of Object.entries(t)){const t=e[n];void 0===t?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class zbe{buildMismatchTokenMessage(e){return zge.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return zge.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return zge.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return zge.buildEarlyExitMessage(e)}}class jbe extends zbe{buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Hbe extends Bbe{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const n=this.wrapper.DEFINE_RULE($be(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,t,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const Ube={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new jbe};class Gbe extends mye{constructor(e,t){const n=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},Ube),{lookaheadStrategy:n?new Gme({maxLookahead:t.maxLookahead}):new jye({logging:t.skipValidations?()=>{}:void 0})}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function qbe(e,t,n){return function(e,t){const n=Wpe(t,!1),r=Yhe(t.rules).filter(Ode).filter(e=>n.has(e));for(const t of r){const n=Object.assign(Object.assign({},e),{consume:1,optional:1,subrule:1,many:1,or:1});e.parser.rule(t,Wbe(n,t.definition))}}({parser:t,tokens:n,ruleNames:new Map},e),t}function Wbe(e,t,n=!1){let r;if(npe(t))r=function(e,t){const n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}(e,t);else if(Gde(t))r=function(e,t){const n=rfe(t);return()=>e.parser.action(n,t)}(e,t);else if(Yde(t))r=Wbe(e,t.terminal);else if(Qde(t))r=Xbe(e,t);else if(ope(t))r=function(e,t){const n=t.rule.ref;if(Ode(n)){const r=e.subrule++,i=n.fragment,a=t.arguments.length>0?function(e,t){const n=t.map(e=>Vbe(e.value));return t=>{const r={};for(let i=0;i({});return o=>e.parser.subrule(r,Qbe(e,n),i,t,a(o))}if(Bde(n)){const r=e.consume++,i=Zbe(e,n.name);return()=>e.parser.consume(r,i,t)}if(!n)throw new ade(t.$cstNode,`Undefined rule: ${t.rule.$refText}`);ode()}(e,t);else if(Wde(t))r=function(e,t){if(1===t.elements.length)return Wbe(e,t.elements[0]);{const n=[];for(const r of t.elements){const t={ALT:Wbe(e,r,!0)},i=Ybe(r);i&&(t.GATE=Vbe(i)),n.push(t)}const r=e.or++;return t=>e.parser.alternatives(r,n.map(e=>{const n={ALT:()=>e.ALT(t)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n}))}}(e,t);else if(hpe(t))r=function(e,t){if(1===t.elements.length)return Wbe(e,t.elements[0]);const n=[];for(const r of t.elements){const t={ALT:Wbe(e,r,!0)},i=Ybe(r);i&&(t.GATE=Vbe(i)),n.push(t)}const r=e.or++,i=(e,t)=>`uGroup_${e}_${t.getRuleStack().join("-")}`,a=t=>e.parser.alternatives(r,n.map((n,a)=>{const o={ALT:()=>!0},s=e.parser;o.ALT=()=>{if(n.ALT(t),!s.isRecording()){const e=i(r,s);s.unorderedGroups.get(e)||s.unorderedGroups.set(e,[]);const t=s.unorderedGroups.get(e);void 0===(null==t?void 0:t[a])&&(t[a]=!0)}};const l=n.GATE;return o.GATE=l?()=>l(t):()=>{const e=s.unorderedGroups.get(i(r,s));return!(null==e?void 0:e[a])},o})),o=Kbe(e,Ybe(t),a,"*");return t=>{o(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}(e,t);else if(epe(t))r=function(e,t){const n=t.elements.map(t=>Wbe(e,t));return e=>n.forEach(t=>t(e))}(e,t);else{if(i=t,!gpe.isInstance(i,Zde))throw new ade(t.$cstNode,`Unexpected element type: ${t.$type}`);{const n=e.consume++;r=()=>e.parser.consume(n,$ge,t)}}var i;return Kbe(e,n?void 0:Ybe(t),r,t.cardinality)}function Vbe(e){if(t=e,gpe.isInstance(t,vde)){const t=Vbe(e.left),n=Vbe(e.right);return e=>t(e)||n(e)}if(function(e){return gpe.isInstance(e,yde)}(e)){const t=Vbe(e.left),n=Vbe(e.right);return e=>t(e)&&n(e)}if(function(e){return gpe.isInstance(e,Cde)}(e)){const t=Vbe(e.value);return e=>!t(e)}if(function(e){return gpe.isInstance(e,Nde)}(e)){const t=e.parameter.ref.name;return e=>void 0!==e&&!0===e[t]}if(function(e){return gpe.isInstance(e,mde)}(e)){const t=Boolean(e.true);return()=>t}var t;ode()}function Ybe(e){if(epe(e))return e.guardCondition}function Xbe(e,t,n=t.terminal){if(n){if(ope(n)&&Ode(n.rule.ref)){const r=n.rule.ref,i=e.subrule++;return n=>e.parser.subrule(i,Qbe(e,r),!1,t,n)}if(ope(n)&&Bde(n.rule.ref)){const r=e.consume++,i=Zbe(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}if(npe(n)){const r=e.consume++,i=Zbe(e,n.value);return()=>e.parser.consume(r,i,t)}throw new Error("Could not build cross reference parser")}{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const n=Zpe(t.type.ref),r=null==n?void 0:n.terminal;if(!r)throw new Error("Could not find name assignment for type: "+rfe(t.type.ref));return Xbe(e,t,r)}}function Kbe(e,t,n,r){const i=t&&Vbe(t);if(!r){if(i){const t=e.or++;return r=>e.parser.alternatives(t,[{ALT:()=>n(r),GATE:()=>i(r)},{ALT:fye(),GATE:()=>!i(r)}])}return n}if("*"===r){const t=e.many++;return r=>e.parser.many(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}if("+"===r){const t=e.many++;if(i){const r=e.or++;return a=>e.parser.alternatives(r,[{ALT:()=>e.parser.atLeastOne(t,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:fye(),GATE:()=>!i(a)}])}return r=>e.parser.atLeastOne(t,{DEF:()=>n(r)})}if("?"===r){const t=e.optional++;return r=>e.parser.optional(t,{DEF:()=>n(r),GATE:i?()=>i(r):void 0})}ode()}function Qbe(e,t){const n=function(e,t){if(Ode(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!Ode(r);){if(epe(r)||Wde(r)||hpe(r)){i=r.elements.indexOf(n).toString()+":"+i}n=r,r=r.$container}return i=r.name+":"+i,e.ruleNames.set(t,i),i}}(e,t),r=e.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Zbe(e,t){const n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function Jbe(e){const t=function(e){const t=e.Grammar,n=e.parser.Lexer,r=new Fbe(e);return qbe(t,r,n.definition)}(e);return t.finalize(),t}class exe{constructor(){this.diagnostics=[]}buildTokens(e,t){const n=Yhe(Wpe(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return r.forEach(e=>{const t=e.PATTERN;"object"==typeof t&&t&&"test"in t&&Upe(t)?i.unshift(e):i.push(e)}),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Bde).filter(e=>!e.fragment).map(e=>this.buildTerminalToken(e)).toArray()}buildTerminalToken(e){const t=ife(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n};return"function"==typeof n&&(r.LINE_BREAKS=!0),e.hidden&&(r.GROUP=Upe(t)?Tge.SKIPPED:"hidden"),r}requiresCustomPattern(e){return!(!e.flags.includes("u")&&!e.flags.includes("s"))||!(!e.source.includes("?<=")&&!e.source.includes("?{t.lastIndex=n;return t.exec(e)}}buildKeywordTokens(e,t,n){return e.filter(Ode).flatMap(e=>xpe(e).filter(npe)).distinct(e=>e.value).toArray().sort((e,t)=>t.value.length-e.value.length).map(e=>this.buildKeywordToken(e,t,Boolean(null==n?void 0:n.caseInsensitive)))}buildKeywordToken(e,t,n){const r=this.buildKeywordPattern(e,n),i={name:e.value,PATTERN:r,LONGER_ALT:this.findLongerAlt(e,t)};return"function"==typeof r&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,t){return t?new RegExp(function(e){return Array.prototype.map.call(e,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Gpe(e)).join("")}(e.value)):e.value}findLongerAlt(e,t){return t.reduce((t,n)=>{const r=null==n?void 0:n.PATTERN;return(null==r?void 0:r.source)&&qpe("^"+r.source+"$",e.value)&&t.push(n),t},[])}}class txe{convert(e,t){let n=t.grammarSource;if(Qde(n)&&(n=function(e){if(e.terminal)return e.terminal;if(e.type.ref){const t=Zpe(e.type.ref);return null==t?void 0:t.terminal}}(n)),ope(n)){const r=n.rule.ref;if(!r)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(r,e,t)}return e}runConverter(e,t,n){var r;switch(e.name.toUpperCase()){case"INT":return nxe.convertInt(t);case"STRING":return nxe.convertString(t);case"ID":return nxe.convertID(t)}switch(null===(r=function(e){var t,n,r;return Bde(e)?null!==(n=null===(t=e.type)||void 0===t?void 0:t.name)&&void 0!==n?n:"string":null!==(r=nfe(e))&&void 0!==r?r:e.name}(e))||void 0===r?void 0:r.toLowerCase()){case"number":return nxe.convertNumber(t);case"boolean":return nxe.convertBoolean(t);case"bigint":return nxe.convertBigint(t);case"date":return nxe.convertDate(t);default:return t}}}var nxe;!function(e){function t(e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return e}}e.convertString=function(e){let n="";for(let r=1;rlxe(e))};var uxe={};Object.defineProperty(uxe,"__esModule",{value:!0});var hxe=uxe.Emitter=uxe.Event=void 0;const dxe=ixe;var pxe;!function(e){const t={dispose(){}};e.None=function(){return t}}(pxe||(uxe.Event=pxe={}));class fxe{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new fxe),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};var mxe;hxe=uxe.Emitter=gxe,gxe._noop=function(){},Object.defineProperty(rxe,"__esModule",{value:!0});var yxe=rxe.CancellationTokenSource=mxe=rxe.CancellationToken=void 0;const vxe=ixe,bxe=sxe,xxe=uxe;var wxe;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xxe.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:xxe.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||bxe.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(wxe||(mxe=rxe.CancellationToken=wxe={}));const Exe=Object.freeze(function(e,t){const n=(0,vxe.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}});class kxe{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Exe:(this._emitter||(this._emitter=new xxe.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}yxe=rxe.CancellationTokenSource=class{get token(){return this._token||(this._token=new kxe),this._token}cancel(){this._token?this._token.cancel():this._token=wxe.Cancelled}dispose(){this._token?this._token instanceof kxe&&this._token.dispose():this._token=wxe.None}};let Txe=0;const _xe=Symbol("OperationCancelled");function Cxe(e){return e===_xe}async function Sxe(e){if(e===mxe.None)return;const t=performance.now();if(t-Txe>=10&&(Txe=t,await new Promise(e=>{"undefined"==typeof setImmediate?setTimeout(e,0):setImmediate(e)}),Txe=performance.now()),e.isCancellationRequested)throw _xe}class Axe{constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)})}}class Nxe{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(const t of e)if(Nxe.isIncremental(t)){const e=Dxe(t.range),n=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,n)+t.text+this._content.substring(r,this._content.length);const i=Math.max(e.start.line,0),a=Math.max(e.end.line,0);let o=this._lineOffsets;const s=Mxe(t.text,!1,n);if(a-i===s.length)for(let e=0,t=s.length;ee?r=i:n=i+1}const i=n-1;return{line:i,character:(e=this.ensureBeforeEOL(e,t[i]))-t[i]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const n=t[e.line];if(e.character<=0)return n;const r=e.line+1t&&Rxe(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){const t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}var Ixe,Oxe;function Lxe(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Lxe(r,t),Lxe(i,t);let a=0,o=0,s=0;for(;an.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function Pxe(e){const t=Dxe(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new Nxe(e,t,n,r)},e.update=function(e,t,n){if(e instanceof Nxe)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){const n=e.getText(),r=Lxe(t.map(Pxe),(e,t)=>{const n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n});let i=0;const a=[];for(const t of r){const r=e.offsetAt(t.range.start);if(ri&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join("")}}(Ixe||(Ixe={})),(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;ic){if(47===n.charCodeAt(s+h))return n.slice(s+h+1);if(0===h)return n.slice(s+h)}else o>c&&(47===e.charCodeAt(i+h)?u=h:0===h&&(u=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(s+h))break;47===d&&(u=h)}var p="";for(h=i+u+1;h<=a;++h)h!==a&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(s+u):(s+=u,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1),s>=0&&(c===n.charCodeAt(s)?-1==--s&&(a=r):(s=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(a=!1,i=s+1),46===l?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!a){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,s=0,l=-1,c=!0,u=e.length-1,h=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===o?o=u:1!==h&&(h=1):-1!==o&&(h=-1);else if(!c){s=u+1;break}return-1===o||-1===l||0===h||1===h&&o===l-1&&o===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;if(n.r(r),n.d(r,{URI:()=>u,Utils:()=>T}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){let t=navigator.userAgent;e=t.indexOf("Windows")>=0}const t=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(e,n){if(!e.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!i.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const s="",l="/",c=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static isUri(e){return e instanceof u||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){"object"==typeof e?(this.scheme=e.scheme||s,this.authority=e.authority||s,this.path=e.path||s,this.query=e.query||s,this.fragment=e.fragment||s):(this.scheme=function(e,t){return e||t?e:"file"}(e,a),this.authority=t||s,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==l&&(t=l+t):t=l}return t}(this.scheme,n||s),this.query=r||s,this.fragment=i||s,o(this,a))}get fsPath(){return m(this)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return void 0===t?t=this.scheme:null===t&&(t=s),void 0===n?n=this.authority:null===n&&(n=s),void 0===r?r=this.path:null===r&&(r=s),void 0===i?i=this.query:null===i&&(i=s),void 0===a?a=this.fragment:null===a&&(a=s),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new d(t,n,r,i,a)}static parse(e,t=!1){const n=c.exec(e);return n?new d(n[2]||s,x(n[4]||s),x(n[5]||s),x(n[7]||s),x(n[9]||s),t):new d(s,s,s,s,s)}static file(t){let n=s;if(e&&(t=t.replace(/\\/g,l)),t[0]===l&&t[1]===l){const e=t.indexOf(l,2);-1===e?(n=t.substring(2),t=l):(n=t.substring(2,e),t=t.substring(e)||l)}return new d("file",n,t,s,s)}static from(e){const t=new d(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return y(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof u)return e;{const t=new d(e);return t._formatted=e.external,t._fsPath=e._sep===h?e.fsPath:null,t}}return e}}const h=e?1:void 0;class d extends u{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=m(this)),this._fsPath}toString(e=!1){return e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const p={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function f(e,t,n){let r,i=-1;for(let a=0;a=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o||n&&91===o||n&&93===o||n&&58===o)-1!==i&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),void 0!==r&&(r+=e.charAt(a));else{void 0===r&&(r=e.substr(0,a));const t=p[o];void 0!==t?(-1!==i&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t):-1===i&&(i=a)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function g(e){let t;for(let n=0;n1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function y(e,t){const n=t?g:f;let r="",{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=":"),(a||"file"===i)&&(r+=l,r+=l),a){let e=a.indexOf("@");if(-1!==e){const t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(":"),-1===e?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=":",r+=n(t.substr(e+1),!1,!0)),r+="@"}a=a.toLowerCase(),e=a.lastIndexOf(":"),-1===e?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+="?",r+=n(s,!1,!1)),c&&(r+="#",r+=t?c:f(c,!1,!1)),r}function v(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(e){return e.match(b)?e.replace(b,e=>v(e)):e}var w=n(470);const E=w.posix||w,k="/";var T;!function(e){e.joinPath=function(e,...t){return e.with({path:E.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==k&&(n=k+n,r=!0);let i=E.resolve(n,...t);return r&&i[0]===k&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===k)return e;let t=E.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return E.basename(e.path)},e.extname=function(e){return E.extname(e.path)}}(T||(T={}))})(),Oxe=r})();const{URI:$xe,Utils:Bxe}=Oxe;var Fxe,zxe;!function(e){e.basename=Bxe.basename,e.dirname=Bxe.dirname,e.extname=Bxe.extname,e.joinPath=Bxe.joinPath,e.resolvePath=Bxe.resolvePath,e.equals=function(e,t){return(null==e?void 0:e.toString())===(null==t?void 0:t.toString())},e.relative=function(e,t){const n="string"==typeof e?e:e.path,r="string"==typeof t?t:t.path,i=n.split("/").filter(e=>e.length>0),a=r.split("/").filter(e=>e.length>0);let o=0;for(;onull!=r?r:r=Ixe.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,null!=t?t:"")}}class Hxe{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return Yhe(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then(e=>(this.addDocument(e),e));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),n=this.documentMap.get(t);if(n){this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=zxe.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0}return n}deleteDocument(e){const t=e.toString(),n=this.documentMap.get(t);return n&&(n.state=zxe.Changed,this.documentMap.delete(t)),n}}const Uxe=Symbol("ref_resolving");class Gxe{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=mxe.None){for(const n of wpe(e.parseResult.value))await Sxe(t),kpe(n).forEach(t=>this.doLink(t,e))}doLink(e,t){var n;const r=e.reference;if(void 0===r._ref){r._ref=Uxe;try{const t=this.getCandidate(e);if(Bhe(t))r._ref=t;else if(r._nodeDescription=t,this.langiumDocuments().hasDocument(t.documentUri)){const n=this.loadAstNode(t);r._ref=null!=n?n:this.createLinkingError(e,t)}else r._ref=void 0}catch(t){console.error(`An error occurred while resolving reference to '${r.$refText}':`,t);const i=null!==(n=t.message)&&void 0!==n?n:String(t);r._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${r.$refText}': ${i}`})}t.references.push(r)}}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const t=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return null!=t?t:this.createLinkingError(e)}buildReference(e,t,n,r){const i=this,a={$refNode:n,$refText:r,get ref(){var n,o;if(Phe(this._ref))return this._ref;if("object"==typeof(o=this._nodeDescription)&&null!==o&&"string"==typeof o.name&&"string"==typeof o.type&&"string"==typeof o.path){const n=i.loadAstNode(this._nodeDescription);this._ref=null!=n?n:i.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(void 0===this._ref){this._ref=Uxe;const r=vpe(e).$document,o=i.getLinkedNode({reference:a,container:e,property:t});if(o.error&&r&&r.state=e.end)return t.ref}if(n){const t=this.nameProvider.getNameNode(n);if(t&&(t===e||function(e,t){for(;e.container;)if((e=e.container)===t)return!0;return!1}(e,t)))return n}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(null==t?void 0:t.$cstNode){const e=this.nameProvider.getNameNode(t);return null!=e?e:t.$cstNode}}findReferences(e,t){const n=[];if(t.includeDeclaration){const t=this.getReferenceToSelf(e);t&&n.push(t)}let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter(e=>Fxe.equals(e.sourceUri,t.documentUri))),n.push(...r),Yhe(n)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const n=ype(e),r=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:r,targetUri:n.uri,targetPath:r,segment:ede(t),local:!0}}}}class Vxe{constructor(e){if(this.map=new Map,e)for(const[t,n]of e)this.add(t,n)}get size(){return Khe.sum(Yhe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(void 0===t)return this.map.delete(e);{const n=this.map.get(e);if(n){const r=n.indexOf(t);if(r>=0)return 1===n.length?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){var t;return null!==(t=this.map.get(e))&&void 0!==t?t:[]}has(e,t){if(void 0===t)return this.map.has(e);{const n=this.map.get(e);return!!n&&n.indexOf(t)>=0}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,n)=>t.forEach(t=>e(t,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Yhe(this.map.entries()).flatMap(([e,t])=>t.map(t=>[e,t]))}keys(){return Yhe(this.map.keys())}values(){return Yhe(this.map.values()).flat()}entriesGroupedByKey(){return Yhe(this.map.entries())}}class Yxe{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return void 0!==t&&(this.map.delete(e),this.inverse.delete(t),!0)}}class Xxe{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=mxe.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,n=bpe,r=mxe.None){const i=[];this.exportNode(e,i,t);for(const a of n(e))await Sxe(r),this.exportNode(a,i,t);return i}exportNode(e,t,n){const r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async computeLocalScopes(e,t=mxe.None){const n=e.parseResult.value,r=new Vxe;for(const i of xpe(n))await Sxe(t),this.processNode(i,e,r);return r}processNode(e,t,n){const r=e.$container;if(r){const i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}}class Kxe{constructor(e,t,n){var r;this.elements=e,this.outerScope=t,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find(t=>t.name.toLowerCase()===e.toLowerCase()):this.elements.find(t=>t.name===e);return t||(this.outerScope?this.outerScope.getElement(e):void 0)}}class Qxe{constructor(e,t,n){var r;this.elements=new Map,this.caseInsensitive=null!==(r=null==n?void 0:n.caseInsensitive)&&void 0!==r&&r;for(const t of e){const e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.set(e,t)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return n||(this.outerScope?this.outerScope.getElement(e):void 0)}getAllElements(){let e=Yhe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Zxe{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Jxe extends Zxe{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const n=t();return this.cache.set(e,n),n}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class ewe extends Zxe{constructor(e){super(),this.cache=new Map,this.converter=null!=e?e:e=>e}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();const r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){const e=n();return r.set(t,e),e}}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}}class twe extends Jxe{constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{t.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class nwe{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new twe(e.shared)}getScope(e){const t=[],n=this.reflection.getReferenceType(e),r=ype(e.container).precomputedScopes;if(r){let i=e.container;do{const e=r.get(i);e.length>0&&t.push(Yhe(e).filter(e=>this.reflection.isSubtype(e.type,n))),i=i.$container}while(i)}let i=this.getGlobalScope(n,e);for(let e=t.length-1;e>=0;e--)i=this.createScope(t[e],i);return i}createScope(e,t,n){return new Kxe(Yhe(e),t,n)}createScopeForNodes(e,t,n){const r=Yhe(e).map(e=>{const t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)}).nonNullable();return new Kxe(r,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new Qxe(this.indexManager.allElements(e)))}}function rwe(e){return"object"==typeof e&&!!e&&("$ref"in e||"$error"in e)}class iwe{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const n=null!=t?t:{},r=null==t?void 0:t.replacer,i=(e,t)=>this.replacer(e,t,n),a=r?(e,t)=>r(e,t,i):i;try{return this.currentDocument=ype(e),JSON.stringify(e,a,null==t?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const n=null!=t?t:{},r=JSON.parse(e);return this.linkNode(r,r,n),r}replacer(e,t,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:o}){var s,l,c,u;if(!this.ignoreProperties.has(e)){if($he(t)){const e=t.ref,r=n?t.$refText:void 0;if(e){const n=ype(e);let i="";this.currentDocument&&this.currentDocument!==n&&(i=o?o(n.uri,t):n.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(e)}`,$refText:r}}return{$error:null!==(l=null===(s=t.error)||void 0===s?void 0:s.message)&&void 0!==l?l:"Could not resolve reference",$refText:r}}if(Phe(t)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),e&&!t.$document||!(null==n?void 0:n.$textRegion)||(n.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),r&&!e&&(null!=n||(n=Object.assign({},t)),n.$sourceText=null===(u=t.$cstNode)||void 0===u?void 0:u.text),a){null!=n||(n=Object.assign({},t));const e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,""))}return null!=n?n:t}return t}}addAstNodeRegionWithAssignmentsTo(e){const t=e=>({offset:e.offset,end:e.end,length:e.length,range:e.range});if(e.$cstNode){const n=(e.$textRegion=t(e.$cstNode)).assignments={};return Object.keys(e).filter(e=>!e.startsWith("$")).forEach(r=>{const i=function(e,t){return e&&t?Kpe(e,t,e.astNode,!0):[]}(e.$cstNode,r).map(t);0!==i.length&&(n[r]=i)}),e}}linkNode(e,t,n,r,i,a){for(const[r,i]of Object.entries(e))if(Array.isArray(i))for(let a=0;a{await this.handleException(()=>e.call(t,n,r,i),"An error occurred during validation",r,n)}}async handleException(e,t,n,r){try{await e()}catch(e){if(Cxe(e))throw e;console.error(`${t}:`,e),e instanceof Error&&e.stack&&console.error(e.stack);n("error",`${t}: ${e instanceof Error?e.message:String(e)}`,{node:r})}}addEntry(e,t){if("AstNode"!==e)for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,t);else this.entries.add("AstNode",t)}getChecks(e,t){let n=Yhe(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(n=n.filter(e=>t.includes(e.category))),n.map(e=>e.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,n){return async(r,i,a,o)=>{await this.handleException(()=>e.call(n,r,i,a,o),t,i,r)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class hwe{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},n=mxe.None){const r=e.parseResult,i=[];if(await Sxe(n),!t.categories||t.categories.includes("built-in")){if(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===lwe.LexingError}))return i;if(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===lwe.ParsingError}))return i;if(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.code)===lwe.LinkingError}))return i}try{i.push(...await this.validateAst(r.value,t,n))}catch(e){if(Cxe(e))throw e;console.error("An error occurred during validation:",e)}return await Sxe(n),i}processLexingErrors(e,t,n){var r,i,a;const o=[...e.lexerErrors,...null!==(i=null===(r=e.lexerReport)||void 0===r?void 0:r.diagnostics)&&void 0!==i?i:[]];for(const e of o){const n=null!==(a=e.severity)&&void 0!==a?a:"error",r={severity:pwe(n),range:{start:{line:e.line-1,character:e.column-1},end:{line:e.line-1,character:e.column+e.length-1}},message:e.message,data:fwe(n),source:this.getSource()};t.push(r)}}processParsingErrors(e,t,n){for(const n of e.parserErrors){let e;if(isNaN(n.token.startOffset)){if("previousToken"in n){const t=n.previousToken;if(isNaN(t.startOffset)){const t={line:0,character:0};e={start:t,end:t}}else{const n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=Jhe(n.token);if(e){const r={severity:pwe("error"),range:e,message:n.message,data:owe(lwe.ParsingError),source:this.getSource()};t.push(r)}}}processLinkingErrors(e,t,n){for(const n of e.references){const e=n.error;if(e){const n={node:e.container,property:e.property,index:e.index,data:{code:lwe.LinkingError,containerType:e.container.$type,property:e.property,refText:e.reference.$refText}};t.push(this.toDiagnostic("error",e.message,n))}}}async validateAst(e,t,n=mxe.None){const r=[],i=(e,t,n)=>{r.push(this.toDiagnostic(e,t,n))};return await this.validateAstBefore(e,t,i,n),await this.validateAstNodes(e,t,i,n),await this.validateAstAfter(e,t,i,n),r}async validateAstBefore(e,t,n,r=mxe.None){var i;const a=this.validationRegistry.checksBefore;for(const o of a)await Sxe(r),await o(e,n,null!==(i=t.categories)&&void 0!==i?i:[],r)}async validateAstNodes(e,t,n,r=mxe.None){await Promise.all(wpe(e).map(async e=>{await Sxe(r);const i=this.validationRegistry.getChecks(e.$type,t.categories);for(const t of i)await t(e,n,r)}))}async validateAstAfter(e,t,n,r=mxe.None){var i;const a=this.validationRegistry.checksAfter;for(const o of a)await Sxe(r),await o(e,n,null!==(i=t.categories)&&void 0!==i?i:[],r)}toDiagnostic(e,t,n){return{message:t,range:dwe(n),severity:pwe(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function dwe(e){if(e.range)return e.range;let t;return"string"==typeof e.property?t=Xpe(e.node.$cstNode,e.property,e.index):"string"==typeof e.keyword&&(t=Qpe(e.node.$cstNode,e.keyword,e.index)),null!=t||(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function pwe(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}function fwe(e){switch(e){case"error":return owe(lwe.LexingError);case"warning":return owe(lwe.LexingWarning);case"info":return owe(lwe.LexingInfo);case"hint":return owe(lwe.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}!function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"}(lwe||(lwe={}));class gwe{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n){const r=null!=n?n:ype(e);null!=t||(t=this.nameProvider.getName(e));const i=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${i} has no name.`);let a;const o=()=>{var t;return null!=a?a:a=ede(null!==(t=this.nameProvider.getNameNode(e))&&void 0!==t?t:e.$cstNode)};return{node:e,name:t,get nameSegment(){return o()},selectionSegment:ede(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}}class mwe{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=mxe.None){const n=[],r=e.parseResult.value;for(const e of wpe(r))await Sxe(t),kpe(e).filter(e=>!Bhe(e)).forEach(e=>{const t=this.createDescription(e);t&&n.push(t)});return n}createDescription(e){const t=e.reference.$nodeDescription,n=e.reference.$refNode;if(!t||!n)return;const r=ype(e.container).uri;return{sourceUri:r,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:ede(n),local:Fxe.equals(t.documentUri,r)}}}class ywe{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return void 0!==t?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((e,t)=>{if(!e||0===t.length)return e;const n=t.indexOf(this.indexSeparator);if(n>0){const r=t.substring(0,n),i=parseInt(t.substring(n+1)),a=e[r];return null==a?void 0:a[i]}return e[t]},e)}}class vwe{constructor(e){this._ready=new Axe,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new hxe,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,n;this.workspaceConfig=null!==(n=null===(t=e.capabilities.workspace)||void 0===t?void 0:t.configuration)&&void 0!==n&&n}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(e=>this.toSectionName(e.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(e=>({section:this.toSectionName(e.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(t);t.forEach((e,t)=>{this.updateSectionConfiguration(e.section,n[t])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(t=>{const n=e.settings[t];this.updateSectionConfiguration(t,n),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:n})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}!function(e){e.create=function(e){return{dispose:async()=>await e()}}}(cwe||(cwe={}));class bwe{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Vxe,this.documentPhaseListeners=new Vxe,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=zxe.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=mxe.None){var r,i;for(const n of e){const e=n.uri.toString();if(n.state===zxe.Validated){if("boolean"==typeof t.validation&&t.validation)n.state=zxe.IndexedReferences,n.diagnostics=void 0,this.buildState.delete(e);else if("object"==typeof t.validation){const a=this.buildState.get(e),o=null===(r=null==a?void 0:a.result)||void 0===r?void 0:r.validationChecks;if(o){const r=(null!==(i=t.validation.categories)&&void 0!==i?i:swe.all).filter(e=>!o.includes(e));r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:r})},result:a.result}),n.state=zxe.IndexedReferences)}}}else this.buildState.delete(e)}this.currentState=zxe.Changed,await this.emitUpdate(e.map(e=>e.uri),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=mxe.None){this.currentState=zxe.Changed;for(const e of t)this.langiumDocuments.deleteDocument(e),this.buildState.delete(e.toString()),this.indexManager.remove(e);for(const t of e){if(!this.langiumDocuments.invalidateDocument(t)){const e=this.langiumDocumentFactory.fromModel({$type:"INVALID"},t);e.state=zxe.Changed,this.langiumDocuments.addDocument(e)}this.buildState.delete(t.toString())}const r=Yhe(e).concat(t).map(e=>e.toString()).toSet();this.langiumDocuments.all.filter(e=>!r.has(e.uri.toString())&&this.shouldRelink(e,r)).forEach(e=>{this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e),e.state=Math.min(e.state,zxe.ComputedScopes),e.diagnostics=void 0}),await this.emitUpdate(e,t),await Sxe(n);const i=this.sortDocuments(this.langiumDocuments.all.filter(e=>{var t;return e.staten(e,t)))}sortDocuments(e){let t=0,n=e.length-1;for(;t=0&&!this.hasTextDocument(e[n]);)n--;tvoid 0!==e.error)||this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),cwe.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,zxe.Parsed,n,e=>this.langiumDocumentFactory.update(e,n)),await this.runCancelable(e,zxe.IndexedContent,n,e=>this.indexManager.updateContent(e,n)),await this.runCancelable(e,zxe.ComputedScopes,n,async e=>{const t=this.serviceRegistry.getServices(e.uri).references.ScopeComputation;e.precomputedScopes=await t.computeLocalScopes(e,n)}),await this.runCancelable(e,zxe.Linked,n,e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n)),await this.runCancelable(e,zxe.IndexedReferences,n,e=>this.indexManager.updateReferences(e,n));const r=e.filter(e=>this.shouldValidate(e));await this.runCancelable(r,zxe.Validated,n,e=>this.validate(e,n));for(const t of e){const e=this.buildState.get(t.uri.toString());e&&(e.completed=!0)}}prepareBuild(e,t){for(const n of e){const e=n.uri.toString(),r=this.buildState.get(e);r&&!r.completed||this.buildState.set(e,{completed:!1,options:t,result:null==r?void 0:r.result})}}async runCancelable(e,t,n,r){const i=e.filter(e=>e.statee.state===t);await this.notifyBuildPhase(a,t,n),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),cwe.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),cwe.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let r;if(t&&"path"in t?r=t:n=t,null!=n||(n=mxe.None),r){const t=this.langiumDocuments.getDocument(r);if(t&&t.state>e)return Promise.resolve(r)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(_xe):new Promise((t,i)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),o.dispose(),r){const e=this.langiumDocuments.getDocument(r);t(null==e?void 0:e.uri)}else t(void 0)}),o=n.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(_xe)})})}async notifyDocumentPhase(e,t,n){const r=this.documentPhaseListeners.get(t).slice();for(const t of r)try{await t(e,n)}catch(e){if(!Cxe(e))throw e}}async notifyBuildPhase(e,t,n){if(0===e.length)return;const r=this.buildPhaseListeners.get(t).slice();for(const t of r)await Sxe(n),await t(e,n)}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}async validate(e,t){var n,r;const i=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o="object"==typeof a?a:void 0,s=await i.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const l=this.buildState.get(e.uri.toString());if(l){null!==(n=l.result)&&void 0!==n||(l.result={});const e=null!==(r=null==o?void 0:o.categories)&&void 0!==r?r:swe.all;l.result.validationChecks?l.result.validationChecks.push(...e):l.result.validationChecks=[...e]}}getBuildOptions(e){var t,n;return null!==(n=null===(t=this.buildState.get(e.uri.toString()))||void 0===t?void 0:t.options)&&void 0!==n?n:{}}}class xwe{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new ewe,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const n=ype(e).uri,r=[];return this.referenceIndex.forEach(e=>{e.forEach(e=>{Fxe.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)})}),Yhe(r)}allElements(e,t){let n=Yhe(this.symbolIndex.keys());return t&&(n=n.filter(e=>!t||t.has(e))),n.map(t=>this.getFileDescriptions(t,e)).flat()}getFileDescriptions(e,t){var n;if(!t)return null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[];const r=this.symbolByTypeIndex.get(e,t,()=>{var n;return(null!==(n=this.symbolIndex.get(e))&&void 0!==n?n:[]).filter(e=>this.astReflection.isSubtype(e.type,t))});return r}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=mxe.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.references.ScopeComputation.computeExports(e,t),i=e.uri.toString();this.symbolIndex.set(i,r),this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=mxe.None){const n=this.serviceRegistry.getServices(e.uri),r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),r)}isAffected(e,t){const n=this.referenceIndex.get(e.uri.toString());return!!n&&n.some(e=>!e.local&&t.has(e.targetUri.toString()))}}class wwe{constructor(e){this.initialBuildOptions={},this._ready=new Axe,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var t;this.folders=null!==(t=e.workspaceFolders)&&void 0!==t?t:void 0}initialized(e){return this.mutex.write(e=>{var t;return this.initializeWorkspace(null!==(t=this.folders)&&void 0!==t?t:[],e)})}async initializeWorkspace(e,t=mxe.None){const n=await this.performStartup(e);await Sxe(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap(e=>e.LanguageMetaData.fileExtensions),n=[],r=e=>{n.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)};return await this.loadAdditionalDocuments(e,r),await Promise.all(e.map(e=>[e,this.getRootFolder(e)]).map(async e=>this.traverseFolder(...e,t,r))),this._ready.resolve(),n}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return $xe.parse(e.uri)}async traverseFolder(e,t,n,r){const i=await this.fileSystemProvider.readDirectory(t);await Promise.all(i.map(async t=>{if(this.includeEntry(e,t,n))if(t.isDirectory)await this.traverseFolder(e,t.uri,n,r);else if(t.isFile){const e=await this.langiumDocuments.getOrCreateDocument(t.uri);r(e)}}))}includeEntry(e,t,n){const r=Fxe.basename(t.uri);if(r.startsWith("."))return!1;if(t.isDirectory)return"node_modules"!==r&&"out"!==r;if(t.isFile){const e=Fxe.extname(t.uri);return n.includes(e)}return!1}}class Ewe{buildUnexpectedCharactersMessage(e,t,n,r,i){return wge.buildUnexpectedCharactersMessage(e,t,n,r,i)}buildUnableToPopLexerModeMessage(e){return wge.buildUnableToPopLexerModeMessage(e)}}const kwe={mode:"full"};class Twe{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const n=Cwe(t)?Object.values(t):t,r="production"===e.LanguageMetaData.mode;this.chevrotainLexer=new Tge(n,{positionTracking:"full",skipValidations:r,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=kwe){var n,r,i;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:null!==(n=a.groups.hidden)&&void 0!==n?n:[],report:null===(i=(r=this.tokenBuilder).flushLexingReport)||void 0===i?void 0:i.call(r,e)}}toTokenTypeDictionary(e){if(Cwe(e))return e;const t=_we(e)?Object.values(e.modes).flat():e,n={};return t.forEach(e=>n[e.name]=e),n}}function _we(e){return e&&"modes"in e&&"defaultMode"in e}function Cwe(e){return!function(e){return Array.isArray(e)&&(0===e.length||"name"in e[0])}(e)&&!_we(e)}function Swe(e,t,n){let r,i;"string"==typeof e?(i=t,r=n):(i=e.range.start,r=t),i||(i=ove.create(0,0));const a=function(e){var t,n,r;const i=[];let a=e.position.line,o=e.position.character;for(let s=0;s=u.length){if(i.length>0){const e=ove.create(a,o);i.push({type:"break",content:"",range:sve.create(e,e)})}}else{Nwe.lastIndex=h;const e=Nwe.exec(u);if(e){const t=e[0],n=e[1],r=ove.create(a,o+h),s=ove.create(a,o+h+t.length);i.push({type:"tag",content:n,range:sve.create(r,s)}),h+=t.length,h=Rwe(u,h)}if(h0&&"break"===i[i.length-1].type)return i.slice(0,-1);return i}({lines:Awe(e),position:i,options:jwe(r)});return function(e){var t,n,r,i;const a=ove.create(e.position.line,e.position.character);if(0===e.tokens.length)return new Uwe([],sve.create(a,a));const o=[];for(;e.index0&&i.push({type:"text",content:t.substring(a,e),range:sve.create(ove.create(n,a+r),ove.create(n,e+r))});let l=s.length+1;const c=o[1];if(i.push({type:"inline-tag",content:c,range:sve.create(ove.create(n,a+l+r),ove.create(n,a+l+c.length+r))}),l+=c.length,4===o.length){l+=o[2].length;const e=o[3];i.push({type:"text",content:e,range:sve.create(ove.create(n,a+l+r),ove.create(n,a+l+e.length+r))})}else i.push({type:"text",content:"",range:sve.create(ove.create(n,a+l+r),ove.create(n,a+l+r))});a=e+o[0].length}const o=t.substring(a);o.length>0&&i.push({type:"text",content:o,range:sve.create(ove.create(n,a+r),ove.create(n,a+r+o.length))})}return i}const Lwe=/\S/,Mwe=/\s*$/;function Rwe(e,t){const n=e.substring(t).match(Lwe);return n?t+n.index:e.length}function Dwe(e){const t=e.match(Mwe);if(t&&"number"==typeof t.index)return t.index}function Pwe(e,t){const n=e.tokens[e.index];return"tag"===n.type?Fwe(e,!1):"text"===n.type||"inline-tag"===n.type?$we(e):(function(e,t){if(t){const n=new Wwe("",e.range);"inlines"in t?t.inlines.push(n):t.content.inlines.push(n)}}(n,t),void e.index++)}function $we(e){let t=e.tokens[e.index];const n=t;let r=t;const i=[];for(;t&&"break"!==t.type&&"tag"!==t.type;)i.push(Bwe(e)),r=t,t=e.tokens[e.index];return new qwe(i,sve.create(n.range.start,r.range.end))}function Bwe(e){return"inline-tag"===e.tokens[e.index].type?Fwe(e,!0):zwe(e)}function Fwe(e,t){const n=e.tokens[e.index++],r=n.content.substring(1),i=e.tokens[e.index];if("text"===(null==i?void 0:i.type)){if(t){const i=zwe(e);return new Gwe(r,new qwe([i],i.range),t,sve.create(n.range.start,i.range.end))}{const i=$we(e);return new Gwe(r,i,t,sve.create(n.range.start,i.range.end))}}{const e=n.range;return new Gwe(r,new qwe([],e),t,e)}}function zwe(e){const t=e.tokens[e.index++];return new Wwe(t.content,t.range)}function jwe(e){if(!e)return jwe({start:"/**",end:"*/",line:"*"});const{start:t,end:n,line:r}=e;return{start:Hwe(t,!0),end:Hwe(n,!1),line:Hwe(r,!0)}}function Hwe(e,t){if("string"==typeof e||"object"==typeof e){const n="string"==typeof e?Gpe(e):e.source;return t?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}return e}class Uwe{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(0===e.length)e=t.toString();else{const n=t.toString();e+=Vwe(e)+n}return e.trim()}toMarkdown(e){let t="";for(const n of this.elements)if(0===t.length)t=n.toMarkdown(e);else{const r=n.toMarkdown(e);t+=Vwe(t)+r}return t.trim()}}class Gwe{constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`;const t=this.content.toString();return 1===this.content.inlines.length?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}\n${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.renderTag)||void 0===t?void 0:t.call(e,this))&&void 0!==n?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const n=function(e,t,n){var r,i;if("linkplain"===e||"linkcode"===e||"link"===e){const a=t.indexOf(" ");let o=t;if(a>0){const e=Rwe(t,a);o=t.substring(e),t=t.substring(0,a)}("linkcode"===e||"link"===e&&"code"===n.link)&&(o=`\`${o}\``);const s=null!==(i=null===(r=n.renderLink)||void 0===r?void 0:r.call(n,t,o))&&void 0!==i?i:function(e,t){try{return $xe.parse(e,!0),`[${t}](${e})`}catch(t){return e}}(t,o);return s}return}(this.name,t,null!=e?e:{});if("string"==typeof n)return n}let n="";"italic"===(null==e?void 0:e.tag)||void 0===(null==e?void 0:e.tag)?n="*":"bold"===(null==e?void 0:e.tag)?n="**":"bold-italic"===(null==e?void 0:e.tag)&&(n="***");let r=`${n}@${this.name}${n}`;return 1===this.content.inlines.length?r=`${r} — ${t}`:this.content.inlines.length>1&&(r=`${r}\n${t}`),this.inline?`{${r}}`:r}}class qwe{constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tn.range.start.line&&(e+="\n")}return e}toMarkdown(e){let t="";for(let n=0;nr.range.start.line&&(t+="\n")}return t}}class Wwe{constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}}function Vwe(e){return e.endsWith("\n")?"\n":"\n\n"}class Ywe{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&function(e,t){const n=jwe(t),r=Awe(e);if(0===r.length)return!1;const i=r[0],a=r[r.length-1],o=n.start,s=n.end;return Boolean(null==o?void 0:o.exec(i))&&Boolean(null==s?void 0:s.exec(a))}(t)){return Swe(t).toMarkdown({renderLink:(t,n)=>this.documentationLinkRenderer(e,t,n),renderTag:t=>this.documentationTagRenderer(e,t)})}}documentationLinkRenderer(e,t,n){var r;const i=null!==(r=this.findNameInPrecomputedScopes(e,t))&&void 0!==r?r:this.findNameInGlobalScope(e,t);if(i&&i.nameSegment){const e=i.nameSegment.range.start.line+1,t=i.nameSegment.range.start.character+1;return`[${n}](${i.documentUri.with({fragment:`L${e},${t}`}).toString()})`}}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const n=ype(e).precomputedScopes;if(!n)return;let r=e;do{const e=n.get(r).find(e=>e.name===t);if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){const n=this.indexManager.allElements().find(e=>e.name===t);return n}}class Xwe{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return function(e){return"string"==typeof e.$comment}(e)?e.$comment:null===(t=rde(e.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===t?void 0:t.text}}class Kwe{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}}class Qwe{constructor(){this.previousTokenSource=new yxe,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=(Txe=performance.now(),new yxe);return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n=mxe.None){const r=new Axe,i={action:t,deferred:r,cancellationToken:n};return e.push(i),this.performNextOperation(),r.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))return;e.push(...this.readQueue.splice(0,this.readQueue.length))}this.done=!1,await Promise.all(e.map(async({action:e,deferred:t,cancellationToken:n})=>{try{const r=await Promise.resolve().then(()=>e(n));t.resolve(r)}catch(e){Cxe(e)?t.resolve(void 0):t.reject(e)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Zwe{constructor(e){this.grammarElementIdMap=new Yxe,this.tokenTypeIdMap=new Yxe,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(e=>Object.assign(Object.assign({},e),{message:e.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,n=new Map;for(const n of wpe(e))t.set(n,{});if(e.$cstNode)for(const t of Zhe(e.$cstNode))n.set(t,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,void 0!==e.$cstNode&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[r,i]of Object.entries(e))if(!r.startsWith("$"))if(Array.isArray(i)){const e=[];n[r]=e;for(const n of i)Phe(n)?e.push(this.dehydrateAstNode(n,t)):$he(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else Phe(i)?n[r]=this.dehydrateAstNode(i,t):$he(i)?n[r]=this.dehydrateReference(i,t):void 0!==i&&(n[r]=i);return n}dehydrateReference(e,t){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){const n=t.cstNodes.get(e);return Hhe(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),zhe(e)?n.content=e.content.map(e=>this.dehydrateCstNode(e,t)):jhe(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const t=e.value,n=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){const t=new Map,n=new Map;for(const n of wpe(e))t.set(n,{});let r;if(e.$cstNode)for(const t of Zhe(e.$cstNode)){let e;"fullText"in t?(e=new Rbe(t.fullText),r=e):"content"in t?e=new Lbe:"tokenType"in t&&(e=this.hydrateCstLeafNode(t)),e&&(n.set(t,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(const[r,i]of Object.entries(e))if(!r.startsWith("$"))if(Array.isArray(i)){const e=[];n[r]=e;for(const a of i)Phe(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):$he(a)?e.push(this.hydrateReference(a,n,r,t)):e.push(a)}else Phe(i)?n[r]=this.setParent(this.hydrateAstNode(i,t),n):$he(i)?n[r]=this.hydrateReference(i,n,r,t):void 0!==i&&(n[r]=i);return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){const r=t.cstNodes.get(e);if("number"==typeof e.grammarSource&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),zhe(r))for(const i of e.content){const e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,a=e.startColumn,o=e.endLine,s=e.endColumn,l=e.hidden;return new Obe(n,r,{start:{line:i,character:a},end:{line:o,character:s}},t,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();return this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of wpe(this.grammar))pde(t)&&this.grammarElementIdMap.set(t,e++)}}function Jwe(e){return{documentation:{CommentProvider:e=>new Xwe(e),DocumentationProvider:e=>new Ywe(e)},parser:{AsyncParser:e=>new Kwe(e),GrammarConfig:e=>function(e){const t=[],n=e.Grammar;for(const e of n.rules)Bde(e)&&Ype(e)&&jpe(ife(e))&&t.push(e.name);return{multilineCommentRules:t,nameRegexp:nde}}(e),LangiumParser:e=>Jbe(e),CompletionParser:e=>function(e){const t=e.Grammar,n=e.parser.Lexer,r=new Hbe(e);return qbe(t,r,n.definition),r.finalize(),r}(e),ValueConverter:()=>new txe,TokenBuilder:()=>new exe,Lexer:e=>new Twe(e),ParserErrorMessageProvider:()=>new jbe,LexerErrorMessageProvider:()=>new Ewe},workspace:{AstNodeLocator:()=>new ywe,AstNodeDescriptionProvider:e=>new gwe(e),ReferenceDescriptionProvider:e=>new mwe(e)},references:{Linker:e=>new Gxe(e),NameProvider:()=>new qxe,ScopeProvider:e=>new nwe(e),ScopeComputation:e=>new Xxe(e),References:e=>new Wxe(e)},serializer:{Hydrator:e=>new Zwe(e),JsonSerializer:e=>new iwe(e)},validation:{DocumentValidator:e=>new hwe(e),ValidationRegistry:e=>new uwe(e)},shared:()=>e.shared}}function eEe(e){return{ServiceRegistry:e=>new awe(e),workspace:{LangiumDocuments:e=>new Hxe(e),LangiumDocumentFactory:e=>new jxe(e),DocumentBuilder:e=>new bwe(e),IndexManager:e=>new xwe(e),WorkspaceManager:e=>new wwe(e),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new Qwe,ConfigurationProvider:e=>new vwe(e)}}}var tEe;function nEe(e,t,n,r,i,a,o,s,l){return iEe([e,t,n,r,i,a,o,s,l].reduce(sEe,{}))}!function(e){e.merge=(e,t)=>sEe(sEe({},e),t)}(tEe||(tEe={}));const rEe=Symbol("isProxy");function iEe(e,t){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===rEe||oEe(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(oEe(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(t,n)=>n in e,ownKeys:()=>[...Object.getOwnPropertyNames(e)]});return n}const aEe=Symbol();function oEe(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:e[t]});if(e[t]===aEe)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}if(t in n){const i=n[t];e[t]=aEe;try{e[t]="function"==typeof i?i(r):iEe(i,r)}catch(n){throw e[t]=n instanceof Error?n:void 0,n}return e[t]}}function sEe(e,t){if(t)for(const[n,r]of Object.entries(t))if(void 0!==r){const t=e[n];e[n]=null!==t&&null!==r&&"object"==typeof t&&"object"==typeof r?sEe(t,r):r}return e}class lEe{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const cEe={fileSystemProvider:()=>new lEe},uEe={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},hEe={AstReflection:()=>new fpe};function dEe(e){var t;const n=function(){const e=nEe(eEe(cEe),hEe),t=nEe(Jwe({shared:e}),uEe);return e.ServiceRegistry.register(t),t}(),r=n.serializer.JsonSerializer.deserialize(e);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,$xe.parse(`memory://${null!==(t=r.name)&&void 0!==t?t:"grammar"}.langium`)),r}var pEe=Object.defineProperty,fEe=(e,t)=>pEe(e,"name",{value:t,configurable:!0}),gEe="Statement",mEe="Architecture";fEe(function(e){return WEe.isInstance(e,mEe)},"isArchitecture");var yEe="Axis",vEe="Branch";fEe(function(e){return WEe.isInstance(e,vEe)},"isBranch");var bEe="Checkout",xEe="CherryPicking",wEe="Commit";fEe(function(e){return WEe.isInstance(e,wEe)},"isCommit");var EEe="Common";fEe(function(e){return WEe.isInstance(e,EEe)},"isCommon");var kEe="Curve",TEe="Edge",_Ee="Entry",CEe="GitGraph";fEe(function(e){return WEe.isInstance(e,CEe)},"isGitGraph");var SEe="Group",AEe="Info";fEe(function(e){return WEe.isInstance(e,AEe)},"isInfo");var NEe="Junction",IEe="Merge";fEe(function(e){return WEe.isInstance(e,IEe)},"isMerge");var OEe="Option",LEe="Packet";fEe(function(e){return WEe.isInstance(e,LEe)},"isPacket");var MEe="PacketBlock";fEe(function(e){return WEe.isInstance(e,MEe)},"isPacketBlock");var REe="Pie";fEe(function(e){return WEe.isInstance(e,REe)},"isPie");var DEe="PieSection";fEe(function(e){return WEe.isInstance(e,DEe)},"isPieSection");var PEe,$Ee,BEe,FEe,zEe,jEe,HEe="Radar",UEe="Service",GEe="Direction",qEe=class extends Fhe{static{fEe(this,"MermaidAstReflection")}getAllTypes(){return[mEe,yEe,vEe,bEe,xEe,wEe,EEe,kEe,GEe,TEe,_Ee,CEe,SEe,AEe,NEe,IEe,OEe,LEe,MEe,REe,DEe,HEe,UEe,gEe]}computeIsSubtype(e,t){switch(e){case vEe:case bEe:case xEe:case wEe:case IEe:return this.isSubtype(gEe,t);case GEe:return this.isSubtype(CEe,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;if("Entry:axis"===t)return yEe;throw new Error(`${t} is not a valid reference id.`)}getTypeMetaData(e){switch(e){case mEe:return{name:mEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case yEe:return{name:yEe,properties:[{name:"label"},{name:"name"}]};case vEe:return{name:vEe,properties:[{name:"name"},{name:"order"}]};case bEe:return{name:bEe,properties:[{name:"branch"}]};case xEe:return{name:xEe,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case wEe:return{name:wEe,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case EEe:return{name:EEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case kEe:return{name:kEe,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case TEe:return{name:TEe,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case _Ee:return{name:_Ee,properties:[{name:"axis"},{name:"value"}]};case CEe:return{name:CEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case SEe:return{name:SEe,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case AEe:return{name:AEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case NEe:return{name:NEe,properties:[{name:"id"},{name:"in"}]};case IEe:return{name:IEe,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case OEe:return{name:OEe,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case LEe:return{name:LEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case MEe:return{name:MEe,properties:[{name:"end"},{name:"label"},{name:"start"}]};case REe:return{name:REe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case DEe:return{name:DEe,properties:[{name:"label"},{name:"value"}]};case HEe:return{name:HEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case UEe:return{name:UEe,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case GEe:return{name:GEe,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},WEe=new qEe,VEe=fEe(()=>PEe??(PEe=dEe('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"InfoGrammar"),YEe=fEe(()=>$Ee??($Ee=dEe('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PacketGrammar"),XEe=fEe(()=>BEe??(BEe=dEe('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PieGrammar"),KEe=fEe(()=>FEe??(FEe=dEe('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"ArchitectureGrammar"),QEe=fEe(()=>zEe??(zEe=dEe('{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}')),"GitGraphGrammar"),ZEe=fEe(()=>jEe??(jEe=dEe('{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}')),"RadarGrammar"),JEe={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},eke={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tke={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nke={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rke={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ike={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ake={AstReflection:fEe(()=>new qEe,"AstReflection")},oke={Grammar:fEe(()=>VEe(),"Grammar"),LanguageMetaData:fEe(()=>JEe,"LanguageMetaData"),parser:{}},ske={Grammar:fEe(()=>YEe(),"Grammar"),LanguageMetaData:fEe(()=>eke,"LanguageMetaData"),parser:{}},lke={Grammar:fEe(()=>XEe(),"Grammar"),LanguageMetaData:fEe(()=>tke,"LanguageMetaData"),parser:{}},cke={Grammar:fEe(()=>KEe(),"Grammar"),LanguageMetaData:fEe(()=>nke,"LanguageMetaData"),parser:{}},uke={Grammar:fEe(()=>QEe(),"Grammar"),LanguageMetaData:fEe(()=>rke,"LanguageMetaData"),parser:{}},hke={Grammar:fEe(()=>ZEe(),"Grammar"),LanguageMetaData:fEe(()=>ike,"LanguageMetaData"),parser:{}},dke={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},pke=class extends txe{static{fEe(this,"AbstractMermaidValueConverter")}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return void 0===r&&(r=this.runCustomConverter(e,t,n)),void 0===r?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){const r=dke[e.name];if(void 0===r)return;const i=r.exec(t);return null!==i?void 0!==i[1]?i[1].trim().replace(/[\t ]{2,}/gm," "):void 0!==i[2]?i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n"):void 0:void 0}},fke=class extends pke{static{fEe(this,"CommonValueConverter")}runCustomConverter(e,t,n){}},gke=class extends exe{static{fEe(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){const r=super.buildKeywordTokens(e,t,n);return r.forEach(e=>{this.keywords.has(e.name)&&void 0!==e.PATTERN&&(e.PATTERN=new RegExp(e.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),r}};(class extends gke{static{fEe(this,"CommonTokenBuilder")}});var mke=class extends gke{static{fEe(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},yke={parser:{TokenBuilder:fEe(()=>new mke,"TokenBuilder"),ValueConverter:fEe(()=>new fke,"ValueConverter")}};function vke(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),uke,yke);return t.ServiceRegistry.register(n),{shared:t,GitGraph:n}}fEe(vke,"createGitGraphServices");var bke=class extends gke{static{fEe(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},xke={parser:{TokenBuilder:fEe(()=>new bke,"TokenBuilder"),ValueConverter:fEe(()=>new fke,"ValueConverter")}};function wke(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),oke,xke);return t.ServiceRegistry.register(n),{shared:t,Info:n}}fEe(wke,"createInfoServices");var Eke=class extends gke{static{fEe(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},kke={parser:{TokenBuilder:fEe(()=>new Eke,"TokenBuilder"),ValueConverter:fEe(()=>new fke,"ValueConverter")}};function Tke(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),ske,kke);return t.ServiceRegistry.register(n),{shared:t,Packet:n}}fEe(Tke,"createPacketServices");var _ke=class extends gke{static{fEe(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Cke=class extends pke{static{fEe(this,"PieValueConverter")}runCustomConverter(e,t,n){if("PIE_SECTION_LABEL"===e.name)return t.replace(/"/g,"").trim()}},Ske={parser:{TokenBuilder:fEe(()=>new _ke,"TokenBuilder"),ValueConverter:fEe(()=>new Cke,"ValueConverter")}};function Ake(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),lke,Ske);return t.ServiceRegistry.register(n),{shared:t,Pie:n}}fEe(Ake,"createPieServices");var Nke=class extends gke{static{fEe(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Ike=class extends pke{static{fEe(this,"ArchitectureValueConverter")}runCustomConverter(e,t,n){return"ARCH_ICON"===e.name?t.replace(/[()]/g,"").trim():"ARCH_TEXT_ICON"===e.name?t.replace(/["()]/g,""):"ARCH_TITLE"===e.name?t.replace(/[[\]]/g,"").trim():void 0}},Oke={parser:{TokenBuilder:fEe(()=>new Nke,"TokenBuilder"),ValueConverter:fEe(()=>new Ike,"ValueConverter")}};function Lke(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),cke,Oke);return t.ServiceRegistry.register(n),{shared:t,Architecture:n}}fEe(Lke,"createArchitectureServices");var Mke=class extends gke{static{fEe(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Rke={parser:{TokenBuilder:fEe(()=>new Mke,"TokenBuilder"),ValueConverter:fEe(()=>new fke,"ValueConverter")}};function Dke(e=cEe){const t=nEe(eEe(e),ake),n=nEe(Jwe({shared:t}),hke,Rke);return t.ServiceRegistry.register(n),{shared:t,Radar:n}}fEe(Dke,"createRadarServices");var Pke={},$ke={info:fEe(async()=>{const{createInfoServices:e}=await Promise.resolve().then(function(){return DJe}),t=e().Info.parser.LangiumParser;Pke.info=t},"info"),packet:fEe(async()=>{const{createPacketServices:e}=await Promise.resolve().then(function(){return PJe}),t=e().Packet.parser.LangiumParser;Pke.packet=t},"packet"),pie:fEe(async()=>{const{createPieServices:e}=await Promise.resolve().then(function(){return $Je}),t=e().Pie.parser.LangiumParser;Pke.pie=t},"pie"),architecture:fEe(async()=>{const{createArchitectureServices:e}=await Promise.resolve().then(function(){return BJe}),t=e().Architecture.parser.LangiumParser;Pke.architecture=t},"architecture"),gitGraph:fEe(async()=>{const{createGitGraphServices:e}=await Promise.resolve().then(function(){return FJe}),t=e().GitGraph.parser.LangiumParser;Pke.gitGraph=t},"gitGraph"),radar:fEe(async()=>{const{createRadarServices:e}=await Promise.resolve().then(function(){return zJe}),t=e().Radar.parser.LangiumParser;Pke.radar=t},"radar")};async function Bke(e,t){const n=$ke[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);Pke[e]||await n();const r=Pke[e].parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new Fke(r);return r.value}fEe(Bke,"parse");var Fke=class extends Error{constructor(e){super(`Parsing failed: ${e.lexerErrors.map(e=>e.message).join("\n")} ${e.parserErrors.map(e=>e.message).join("\n")}`),this.result=e}static{fEe(this,"MermaidParseError")}},zke={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},jke=MU.gitGraph,Hke=JH(()=>$5({...jke,...WU().gitGraph}),"getConfig"),Uke=new Dhe(()=>{const e=Hke(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});function Gke(){return k5({length:7})}function qke(e,t){const n=Object.create(null);return e.reduce((e,r)=>{const i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}JH(Gke,"getID"),JH(qke,"uniqBy");var Wke=JH(function(e){Uke.records.direction=e},"setDirection"),Vke=JH(function(e){nU.debug("options str",e),e=e?.trim(),e=e||"{}";try{Uke.records.options=JSON.parse(e)}catch(e){nU.error("error while parsing gitGraph options",e.message)}},"setOptions"),Yke=JH(function(){return Uke.records.options},"getOptions"),Xke=JH(function(e){let t=e.msg,n=e.id;const r=e.type;let i=e.tags;nU.info("commit",t,n,r,i),nU.debug("Entering commit:",t,n,r,i);const a=Hke();n=_G.sanitizeText(n,a),t=_G.sanitizeText(t,a),i=i?.map(e=>_G.sanitizeText(e,a));const o={id:n||Uke.records.seq+"-"+Gke(),message:t,seq:Uke.records.seq++,type:r??zke.NORMAL,tags:i??[],parents:null==Uke.records.head?[]:[Uke.records.head.id],branch:Uke.records.currBranch};Uke.records.head=o,nU.info("main branch",a.mainBranchName),Uke.records.commits.set(o.id,o),Uke.records.branches.set(Uke.records.currBranch,o.id),nU.debug("in pushCommit "+o.id)},"commit"),Kke=JH(function(e){let t=e.name;const n=e.order;if(t=_G.sanitizeText(t,Hke()),Uke.records.branches.has(t))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 ${t}")`);Uke.records.branches.set(t,null!=Uke.records.head?Uke.records.head.id:null),Uke.records.branchConfig.set(t,{name:t,order:n}),Jke(t),nU.debug("in createBranch")},"branch"),Qke=JH(e=>{let t=e.branch,n=e.id;const r=e.type,i=e.tags,a=Hke();t=_G.sanitizeText(t,a),n&&(n=_G.sanitizeText(n,a));const o=Uke.records.branches.get(Uke.records.currBranch),s=Uke.records.branches.get(t),l=o?Uke.records.commits.get(o):void 0,c=s?Uke.records.commits.get(s):void 0;if(l&&c&&l.branch===t)throw new Error(`Cannot merge branch '${t}' into itself.`);if(Uke.records.currBranch===t){const e=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},e}if(void 0===l||!l){const e=new Error(`Incorrect usage of "merge". Current branch (${Uke.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]},e}if(!Uke.records.branches.has(t)){const e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(void 0===c||!c){const e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']},e}if(l===c){const e=new Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},e}if(n&&Uke.records.commits.has(n)){const e=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom Id");throw e.hash={text:`merge ${t} ${n} ${r} ${i?.join(" ")}`,token:`merge ${t} ${n} ${r} ${i?.join(" ")}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(" ")}`]},e}const u=s||"",h={id:n||`${Uke.records.seq}-${Gke()}`,message:`merged branch ${t} into ${Uke.records.currBranch}`,seq:Uke.records.seq++,parents:null==Uke.records.head?[]:[Uke.records.head.id,u],branch:Uke.records.currBranch,type:zke.MERGE,customType:r,customId:!!n,tags:i??[]};Uke.records.head=h,Uke.records.commits.set(h.id,h),Uke.records.branches.set(Uke.records.currBranch,h.id),nU.debug(Uke.records.branches),nU.debug("in mergeBranch")},"merge"),Zke=JH(function(e){let t=e.id,n=e.targetId,r=e.tags,i=e.parent;nU.debug("Entering cherryPick:",t,n,r);const a=Hke();if(t=_G.sanitizeText(t,a),n=_G.sanitizeText(n,a),r=r?.map(e=>_G.sanitizeText(e,a)),i=_G.sanitizeText(i,a),!t||!Uke.records.commits.has(t)){const e=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const o=Uke.records.commits.get(t);if(void 0===o||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&(!Array.isArray(o.parents)||!o.parents.includes(i))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const s=o.branch;if(o.type===zke.MERGE&&!i){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!n||!Uke.records.commits.has(n)){if(s===Uke.records.currBranch){const e=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const e=Uke.records.branches.get(Uke.records.currBranch);if(void 0===e||!e){const e=new Error(`Incorrect usage of "cherry-pick". Current branch (${Uke.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const a=Uke.records.commits.get(e);if(void 0===a||!a){const e=new Error(`Incorrect usage of "cherry-pick". Current branch (${Uke.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]},e}const l={id:Uke.records.seq+"-"+Gke(),message:`cherry-picked ${o?.message} into ${Uke.records.currBranch}`,seq:Uke.records.seq++,parents:null==Uke.records.head?[]:[Uke.records.head.id,o.id],branch:Uke.records.currBranch,type:zke.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${o.id}${o.type===zke.MERGE?`|parent:${i}`:""}`]};Uke.records.head=l,Uke.records.commits.set(l.id,l),Uke.records.branches.set(Uke.records.currBranch,l.id),nU.debug(Uke.records.branches),nU.debug("in cherryPick")}},"cherryPick"),Jke=JH(function(e){if(e=_G.sanitizeText(e,Hke()),!Uke.records.branches.has(e)){const t=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}{Uke.records.currBranch=e;const t=Uke.records.branches.get(Uke.records.currBranch);Uke.records.head=void 0!==t&&t?Uke.records.commits.get(t)??null:null}},"checkout");function eTe(e,t,n){const r=e.indexOf(t);-1===r?e.push(n):e.splice(r,1,n)}function tTe(e){const t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]);let n="";e.forEach(function(e){n+=e===t?"\t*":"\t|"});const r=[n,t.id,t.seq];for(const e in Uke.records.branches)Uke.records.branches.get(e)===t.id&&r.push(e);if(nU.debug(r.join(" ")),t.parents&&2==t.parents.length&&t.parents[0]&&t.parents[1]){const n=Uke.records.commits.get(t.parents[0]);eTe(e,t,n),t.parents[1]&&e.push(Uke.records.commits.get(t.parents[1]))}else{if(0==t.parents.length)return;if(t.parents[0]){const n=Uke.records.commits.get(t.parents[0]);eTe(e,t,n)}}tTe(e=qke(e,e=>e.id))}JH(eTe,"upsert"),JH(tTe,"prettyPrintCommitHistory");var nTe=JH(function(){nU.debug(Uke.records.commits);tTe([sTe()[0]])},"prettyPrint"),rTe=JH(function(){Uke.reset(),FG()},"clear"),iTe=JH(function(){const e=[...Uke.records.branchConfig.values()].map((e,t)=>null!==e.order&&void 0!==e.order?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}));return e},"getBranchesAsObjArray"),aTe=JH(function(){return Uke.records.branches},"getBranches"),oTe=JH(function(){return Uke.records.commits},"getCommits"),sTe=JH(function(){const e=[...Uke.records.commits.values()];return e.forEach(function(e){nU.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},"getCommitsArray"),lTe={commitType:zke,getConfig:Hke,setDirection:Wke,setOptions:Vke,getOptions:Yke,commit:Xke,branch:Kke,merge:Qke,cherryPick:Zke,checkout:Jke,prettyPrint:nTe,clear:rTe,getBranchesAsObjArray:iTe,getBranches:aTe,getCommits:oTe,getCommitsArray:sTe,getCurrentBranch:JH(function(){return Uke.records.currBranch},"getCurrentBranch"),getDirection:JH(function(){return Uke.records.direction},"getDirection"),getHead:JH(function(){return Uke.records.head},"getHead"),setAccTitle:zG,getAccTitle:jG,getAccDescription:UG,setAccDescription:HG,setDiagramTitle:GG,getDiagramTitle:qG},cTe=JH((e,t)=>{Rhe(e,t),e.dir&&t.setDirection(e.dir);for(const n of e.statements)uTe(n,t)},"populate"),uTe=JH((e,t)=>{const n={Commit:JH(e=>t.commit(hTe(e)),"Commit"),Branch:JH(e=>t.branch(dTe(e)),"Branch"),Merge:JH(e=>t.merge(pTe(e)),"Merge"),Checkout:JH(e=>t.checkout(fTe(e)),"Checkout"),CherryPicking:JH(e=>t.cherryPick(gTe(e)),"CherryPicking")}[e.$type];n?n(e):nU.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),hTe=JH(e=>({id:e.id,msg:e.message??"",type:void 0!==e.type?zke[e.type]:zke.NORMAL,tags:e.tags??void 0}),"parseCommit"),dTe=JH(e=>({name:e.name,order:e.order??0}),"parseBranch"),pTe=JH(e=>({branch:e.branch,id:e.id??"",type:void 0!==e.type?zke[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),fTe=JH(e=>e.branch,"parseCheckout"),gTe=JH(e=>({id:e.id,targetId:"",tags:0===e.tags?.length?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),mTe={parse:JH(async e=>{const t=await Bke("gitGraph",e);nU.debug(t),cTe(t,lTe)},"parse")},yTe=YG(),vTe=yTe?.gitGraph,bTe=10,xTe=40,wTe=new Map,ETe=new Map,kTe=new Map,TTe=[],_Te=0,CTe="LR",STe=JH(()=>{wTe.clear(),ETe.clear(),kTe.clear(),_Te=0,TTe=[],CTe="LR"},"clear"),ATe=JH(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof e?e.split(/\\n|\n|/gi):e).forEach(e=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}),t},"drawText"),NTe=JH(e=>{let t,n,r;return"BT"===CTe?(n=JH((e,t)=>e<=t,"comparisonFunc"),r=1/0):(n=JH((e,t)=>e>=t,"comparisonFunc"),r=0),e.forEach(e=>{const i="TB"===CTe||"BT"==CTe?ETe.get(e)?.y:ETe.get(e)?.x;void 0!==i&&n(i,r)&&(t=e,r=i)}),t},"findClosestParent"),ITe=JH(e=>{let t="",n=1/0;return e.forEach(e=>{const r=ETe.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},"findClosestParentBT"),OTe=JH((e,t,n)=>{let r=n,i=n;const a=[];e.forEach(e=>{const n=t.get(e);if(!n)throw new Error(`Commit not found for key ${e}`);n.parents.length?(r=MTe(n),i=Math.max(r,i)):a.push(n),RTe(n,r)}),r=i,a.forEach(e=>{DTe(e,r,n)}),e.forEach(e=>{const n=t.get(e);if(n?.parents.length){const e=ITe(n.parents);r=ETe.get(e).y-xTe,r<=i&&(i=r);const t=wTe.get(n.branch).pos,a=r-bTe;ETe.set(n.id,{x:t,y:a})}})},"setParallelBTPos"),LTe=JH(e=>{const t=NTe(e.parents.filter(e=>null!==e));if(!t)throw new Error(`Closest parent not found for commit ${e.id}`);const n=ETe.get(t)?.y;if(void 0===n)throw new Error(`Closest parent position not found for commit ${e.id}`);return n},"findClosestParentPos"),MTe=JH(e=>LTe(e)+xTe,"calculateCommitPosition"),RTe=JH((e,t)=>{const n=wTe.get(e.branch);if(!n)throw new Error(`Branch not found for commit ${e.id}`);const r=n.pos,i=t+bTe;return ETe.set(e.id,{x:r,y:i}),{x:r,y:i}},"setCommitPosition"),DTe=JH((e,t,n)=>{const r=wTe.get(e.branch);if(!r)throw new Error(`Branch not found for commit ${e.id}`);const i=t+n,a=r.pos;ETe.set(e.id,{x:a,y:i})},"setRootPosition"),PTe=JH((e,t,n,r,i,a)=>{if(a===zke.HIGHLIGHT)e.append("rect").attr("x",n.x-10).attr("y",n.y-10).attr("width",20).attr("height",20).attr("class",`commit ${t.id} commit-highlight${i%8} ${r}-outer`),e.append("rect").attr("x",n.x-6).attr("y",n.y-6).attr("width",12).attr("height",12).attr("class",`commit ${t.id} commit${i%8} ${r}-inner`);else if(a===zke.CHERRY_PICK)e.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",10).attr("class",`commit ${t.id} ${r}`),e.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${r}`),e.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${r}`),e.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${r}`),e.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${r}`);else{const o=e.append("circle");if(o.attr("cx",n.x),o.attr("cy",n.y),o.attr("r",t.type===zke.MERGE?9:10),o.attr("class",`commit ${t.id} commit${i%8}`),a===zke.MERGE){const a=e.append("circle");a.attr("cx",n.x),a.attr("cy",n.y),a.attr("r",6),a.attr("class",`commit ${r} ${t.id} commit${i%8}`)}if(a===zke.REVERSE){e.append("path").attr("d",`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr("class",`commit ${r} ${t.id} commit${i%8}`)}}},"drawCommitBullet"),$Te=JH((e,t,n,r)=>{if(t.type!==zke.CHERRY_PICK&&(t.customId&&t.type===zke.MERGE||t.type!==zke.MERGE)&&vTe?.showCommitLabel){const i=e.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),o=i.append("text").attr("x",r).attr("y",n.y+25).attr("class","commit-label").text(t.id),s=o.node()?.getBBox();if(s&&(a.attr("x",n.posWithOffset-s.width/2-2).attr("y",n.y+13.5).attr("width",s.width+4).attr("height",s.height+4),"TB"===CTe||"BT"===CTe?(a.attr("x",n.x-(s.width+16+5)).attr("y",n.y-12),o.attr("x",n.x-(s.width+16)).attr("y",n.y+s.height-12)):o.attr("x",n.posWithOffset-s.width/2),vTe.rotateCommitLabel))if("TB"===CTe||"BT"===CTe)o.attr("transform","rotate(-45, "+n.x+", "+n.y+")"),a.attr("transform","rotate(-45, "+n.x+", "+n.y+")");else{const e=-7.5-(s.width+10)/25*9.5,t=10+s.width/25*8.5;i.attr("transform","translate("+e+", "+t+") rotate(-45, "+r+", "+n.y+")")}}},"drawCommitLabel"),BTe=JH((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0;const s=[];for(const r of t.tags.reverse()){const t=e.insert("polygon"),l=e.append("circle"),c=e.append("text").attr("y",n.y-16-i).attr("class","tag-label").text(r),u=c.node()?.getBBox();if(!u)throw new Error("Tag bbox not found");a=Math.max(a,u.width),o=Math.max(o,u.height),c.attr("x",n.posWithOffset-u.width/2),s.push({tag:c,hole:l,rect:t,yOffset:i}),i+=20}for(const{tag:e,hole:t,rect:i,yOffset:l}of s){const s=o/2,c=n.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${r-a/2-2},${c+2} \n ${r-a/2-2},${c-2}\n ${n.posWithOffset-a/2-4},${c-s-2}\n ${n.posWithOffset+a/2+4},${c-s-2}\n ${n.posWithOffset+a/2+4},${c+s+2}\n ${n.posWithOffset-a/2-4},${c+s+2}`),t.attr("cy",c).attr("cx",r-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===CTe||"BT"===CTe){const o=r+l;i.attr("class","tag-label-bkg").attr("points",`\n ${n.x},${o+2}\n ${n.x},${o-2}\n ${n.x+bTe},${o-s-2}\n ${n.x+bTe+a+4},${o-s-2}\n ${n.x+bTe+a+4},${o+s+2}\n ${n.x+bTe},${o+s+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),t.attr("cx",n.x+2).attr("cy",o).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")"),e.attr("x",n.x+5).attr("y",o+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+r+")")}}}},"drawCommitTags"),FTe=JH(e=>{switch(e.customType??e.type){case zke.NORMAL:return"commit-normal";case zke.REVERSE:return"commit-reverse";case zke.HIGHLIGHT:return"commit-highlight";case zke.MERGE:return"commit-merge";case zke.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),zTe=JH((e,t,n,r)=>{const i={x:0,y:0};if(!(e.parents.length>0)){if("TB"===t)return 30;if("BT"===t){return(r.get(e.id)??i).y-xTe}return 0}{const n=NTe(e.parents);if(n){const a=r.get(n)??i;if("TB"===t)return a.y+xTe;if("BT"===t){return(r.get(e.id)??i).y-xTe}return a.x+xTe}}return 0},"calculatePosition"),jTe=JH((e,t,n)=>{const r="BT"===CTe&&n?t:t+bTe,i="TB"===CTe||"BT"===CTe?r:wTe.get(e.branch)?.pos,a="TB"===CTe||"BT"===CTe?wTe.get(e.branch)?.pos:r;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${e.id}`);return{x:a,y:i,posWithOffset:r}},"getCommitPosition"),HTe=JH((e,t,n)=>{if(!vTe)throw new Error("GitGraph config not found");const r=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let a="TB"===CTe||"BT"===CTe?30:0;const o=[...t.keys()],s=vTe?.parallelCommits??!1,l=JH((e,n)=>{const r=t.get(e)?.seq,i=t.get(n)?.seq;return void 0!==r&&void 0!==i?r-i:0},"sortKeys");let c=o.sort(l);"BT"===CTe&&(s&&OTe(c,t,a),c=c.reverse()),c.forEach(e=>{const o=t.get(e);if(!o)throw new Error(`Commit not found for key ${e}`);s&&(a=zTe(o,CTe,a,ETe));const l=jTe(o,a,s);if(n){const e=FTe(o),t=o.customType??o.type,n=wTe.get(o.branch)?.index??0;PTe(r,o,l,e,n,t),$Te(i,o,l,a),BTe(i,o,l,a)}"TB"===CTe||"BT"===CTe?ETe.set(o.id,{x:l.x,y:l.posWithOffset}):ETe.set(o.id,{x:l.posWithOffset,y:l.y}),a="BT"===CTe&&s?a+xTe:a+xTe+bTe,a>_Te&&(_Te=a)})},"drawCommits"),UTe=JH((e,t,n,r,i)=>{const a=("TB"===CTe||"BT"===CTe?n.xe.branch===a,"isOnBranchToGetCurve"),s=JH(n=>n.seq>e.seq&&n.seqs(e)&&o(e))},"shouldRerouteArrow"),GTe=JH((e,t,n=0)=>{const r=e+Math.abs(e-t)/2;if(n>5)return r;if(TTe.every(e=>Math.abs(e-r)>=10))return TTe.push(r),r;const i=Math.abs(e-t);return GTe(e,t-i/5,n+1)},"findLane"),qTe=JH((e,t,n,r)=>{const i=ETe.get(t.id),a=ETe.get(n.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${t.id} and ${n.id}`);const o=UTe(t,n,i,a,r);let s,l="",c="",u=0,h=0,d=wTe.get(n.branch)?.index;if(n.type===zke.MERGE&&t.id!==n.parents[0]&&(d=wTe.get(t.branch)?.index),o){l="A 10 10, 0, 0, 0,",c="A 10 10, 0, 0, 1,",u=10,h=10;const e=i.ya.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",u=20,h=20,s=n.type===zke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-u} ${c} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+u} ${i.y} ${l} ${a.x} ${i.y+h} L ${a.x} ${a.y}`),i.x===a.x&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):"BT"===CTe?(i.xa.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",u=20,h=20,s=n.type===zke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${l} ${i.x-h} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y-h} L ${a.x} ${a.y}`),i.x===a.x&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.ya.y&&(s=n.type===zke.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-u} ${i.y} ${l} ${a.x} ${i.y-h} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+u} ${c} ${i.x+h} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(s=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(void 0===s)throw new Error("Line definition not found");e.append("path").attr("d",s).attr("class","arrow arrow"+d%8)},"drawArrow"),WTe=JH((e,t)=>{const n=e.append("g").attr("class","commit-arrows");[...t.keys()].forEach(e=>{const r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{qTe(n,t.get(e),r,t)})})},"drawArrows"),VTe=JH((e,t)=>{const n=e.append("g");t.forEach((e,t)=>{const r=t%8,i=wTe.get(e.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${e.name}`);const a=n.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",_Te),a.attr("y2",i),a.attr("class","branch branch"+r),"TB"===CTe?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",_Te),a.attr("x2",i)):"BT"===CTe&&(a.attr("y1",_Te),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),TTe.push(i);const o=e.name,s=ATe(o),l=n.insert("rect"),c=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);c.node().appendChild(s);const u=s.getBBox();l.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-u.width-4-(!0===vTe?.rotateCommitLabel?30:0)).attr("y",-u.height/2+8).attr("width",u.width+18).attr("height",u.height+4),c.attr("transform","translate("+(-u.width-14-(!0===vTe?.rotateCommitLabel?30:0))+", "+(i-u.height/2-1)+")"),"TB"===CTe?(l.attr("x",i-u.width/2-10).attr("y",0),c.attr("transform","translate("+(i-u.width/2-5)+", 0)")):"BT"===CTe?(l.attr("x",i-u.width/2-10).attr("y",_Te),c.attr("transform","translate("+(i-u.width/2-5)+", "+_Te+")")):l.attr("transform","translate(-19, "+(i-u.height/2)+")")})},"drawBranches"),YTe=JH(function(e,t,n,r,i){return wTe.set(e,{pos:t,index:n}),t+=50+(i?40:0)+("TB"===CTe||"BT"===CTe?r.width/2:0)},"setBranchPosition"),XTe=JH(function(e,t,n,r){if(STe(),nU.debug("in gitgraph renderer",e+"\n","id:",t,n),!vTe)throw new Error("GitGraph config not found");const i=vTe.rotateCommitLabel??!1,a=r.db;kTe=a.getCommits();const o=a.getBranchesAsObjArray();CTe=a.getDirection();const s=TK(`[id="${t}"]`);let l=0;o.forEach((e,t)=>{const n=ATe(e.name),r=s.append("g"),a=r.insert("g").attr("class","branchLabel"),o=a.insert("g").attr("class","label branch-label");o.node()?.appendChild(n);const c=n.getBBox();l=YTe(e.name,l,t,c,i),o.remove(),a.remove(),r.remove()}),HTe(s,kTe,!1),vTe.showBranches&&VTe(s,o),WTe(s,kTe),HTe(s,kTe,!0),B5.insertTitle(s,"gitTitleText",vTe.titleTopMargin??0,a.getDiagramTitle()),ZG(void 0,s,vTe.diagramPadding,vTe.useMaxWidth)},"draw"),KTe={draw:XTe},QTe=JH(e=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map(t=>`\n .branch-label${t} { fill: ${e["gitBranchLabel"+t]}; }\n .commit${t} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; }\n .commit-highlight${t} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; }\n .label${t} { fill: ${e["git"+t]}; }\n .arrow${t} { stroke: ${e["git"+t]}; }\n `).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${e.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelColor};}\n .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}\n .tag-label-bkg { fill: ${e.tagLabelBackground}; stroke: ${e.tagLabelBorder}; }\n .tag-hole { fill: ${e.textColor}; }\n\n .commit-merge {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n }\n .commit-reverse {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${e.primaryColor};\n fill: ${e.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`,"getStyles"),ZTe={parser:mTe,db:lTe,renderer:KTe,styles:QTe},JTe=Object.freeze({__proto__:null,diagram:ZTe}),e_e={exports:{}};e_e.exports=function(){var e="day";return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s=i(this),l=(n=this.isoWeekYear(),o=4-(a=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,e));return s.diff(l,"week")+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(e,t)}}}();var t_e=Zt(e_e.exports),n_e=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],l=[1,32],c=[1,33],u=[1,34],h=[1,9],d=[1,10],p=[1,11],f=[1,12],g=[1,13],m=[1,14],y=[1,15],v=[1,16],b=[1,19],x=[1,20],w=[1,21],E=[1,22],k=[1,23],T=[1,25],_=[1,35],C={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$="task";break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+" "+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+" "+a[s-1]+" "+a[s];break;case 44:case 46:this.$=a[s-3]+" "+a[s-2]+" "+a[s-1]+" "+a[s]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:c,21:u,22:h,23:d,24:p,25:f,26:g,27:m,28:y,29:v,30:b,31:x,33:w,35:E,36:k,37:24,38:T,40:_},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:c,21:u,22:h,23:d,24:p,25:f,26:g,27:m,28:y,29:v,30:b,31:x,33:w,35:E,36:k,37:24,38:T,40:_},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},S=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){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:case 15:case 18:case 21:case 24:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:case 9:case 10:case 12:case 13:break;case 11:return 10;case 14:this.begin("href");break;case 16:return 43;case 17:this.begin("callbackname");break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 22:return 42;case 23:this.begin("click");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 e}();function A(){this.yy={}}return C.lexer=S,JH(A,"Parser"),A.prototype=C,C.Parser=A,new A}();n_e.parser=n_e;var r_e=n_e;Rm.extend(t_e),Rm.extend(Bm),Rm.extend(Pm);var i_e,a_e,o_e={friday:5,saturday:6},s_e="",l_e="",c_e=void 0,u_e="",h_e=[],d_e=[],p_e=new Map,f_e=[],g_e=[],m_e="",y_e="",v_e=["active","done","crit","milestone"],b_e=[],x_e=!1,w_e=!1,E_e="sunday",k_e="saturday",T_e=0,__e=JH(function(){f_e=[],g_e=[],m_e="",b_e=[],rCe=0,i_e=void 0,a_e=void 0,sCe=[],s_e="",l_e="",y_e="",c_e=void 0,u_e="",h_e=[],d_e=[],x_e=!1,w_e=!1,T_e=0,p_e=new Map,FG(),E_e="sunday",k_e="saturday"},"clear"),C_e=JH(function(e){l_e=e},"setAxisFormat"),S_e=JH(function(){return l_e},"getAxisFormat"),A_e=JH(function(e){c_e=e},"setTickInterval"),N_e=JH(function(){return c_e},"getTickInterval"),I_e=JH(function(e){u_e=e},"setTodayMarker"),O_e=JH(function(){return u_e},"getTodayMarker"),L_e=JH(function(e){s_e=e},"setDateFormat"),M_e=JH(function(){x_e=!0},"enableInclusiveEndDates"),R_e=JH(function(){return x_e},"endDatesAreInclusive"),D_e=JH(function(){w_e=!0},"enableTopAxis"),P_e=JH(function(){return w_e},"topAxisEnabled"),$_e=JH(function(e){y_e=e},"setDisplayMode"),B_e=JH(function(){return y_e},"getDisplayMode"),F_e=JH(function(){return s_e},"getDateFormat"),z_e=JH(function(e){h_e=e.toLowerCase().split(/[\s,]+/)},"setIncludes"),j_e=JH(function(){return h_e},"getIncludes"),H_e=JH(function(e){d_e=e.toLowerCase().split(/[\s,]+/)},"setExcludes"),U_e=JH(function(){return d_e},"getExcludes"),G_e=JH(function(){return p_e},"getLinks"),q_e=JH(function(e){m_e=e,f_e.push(e)},"addSection"),W_e=JH(function(){return f_e},"getSections"),V_e=JH(function(){let e=dCe();let t=0;for(;!e&&t<10;)e=dCe(),t++;return g_e=sCe},"getTasks"),Y_e=JH(function(e,t,n,r){return!r.includes(e.format(t.trim()))&&(!(!n.includes("weekends")||e.isoWeekday()!==o_e[k_e]&&e.isoWeekday()!==o_e[k_e]+1)||(!!n.includes(e.format("dddd").toLowerCase())||n.includes(e.format(t.trim()))))},"isInvalidDate"),X_e=JH(function(e){E_e=e},"setWeekday"),K_e=JH(function(){return E_e},"getWeekday"),Q_e=JH(function(e){k_e=e},"setWeekend"),Z_e=JH(function(e,t,n,r){if(!n.length||e.manualEndTime)return;let i,a;i=e.startTime instanceof Date?Rm(e.startTime):Rm(e.startTime,t,!0),i=i.add(1,"d"),a=e.endTime instanceof Date?Rm(e.endTime):Rm(e.endTime,t,!0);const[o,s]=J_e(i,a,t,n,r);e.endTime=o.toDate(),e.renderEndTime=s},"checkTaskDates"),J_e=JH(function(e,t,n,r,i){let a=!1,o=null;for(;e<=t;)a||(o=t.toDate()),a=Y_e(e,n,r,i),a&&(t=t.add(1,"d")),e=e.add(1,"d");return[t,o]},"fixTaskDates"),eCe=JH(function(e,t,n){n=n.trim();const r=/^after\s+(?[\d\w- ]+)/.exec(n);if(null!==r){let e=null;for(const t of r.groups.ids.split(" ")){let n=uCe(t);void 0!==n&&(!e||n.endTime>e.endTime)&&(e=n)}if(e)return e.endTime;const t=new Date;return t.setHours(0,0,0,0),t}let i=Rm(n,t.trim(),!0);if(i.isValid())return i.toDate();{nU.debug("Invalid date:"+n),nU.debug("With date format:"+t.trim());const e=new Date(n);if(void 0===e||isNaN(e.getTime())||e.getFullYear()<-1e4||e.getFullYear()>1e4)throw new Error("Invalid date:"+n);return e}},"getStartDate"),tCe=JH(function(e){const t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return null!==t?[Number.parseFloat(t[1]),t[2]]:[NaN,"ms"]},"parseDuration"),nCe=JH(function(e,t,n,r=!1){n=n.trim();const i=/^until\s+(?[\d\w- ]+)/.exec(n);if(null!==i){let e=null;for(const t of i.groups.ids.split(" ")){let n=uCe(t);void 0!==n&&(!e||n.startTime{window.open(n,"_self")}),p_e.set(e,n))}),fCe(e,"clickable")},"setLink"),fCe=JH(function(e,t){e.split(",").forEach(function(e){let n=uCe(e);void 0!==n&&n.classes.push(t)})},"setClass"),gCe=JH(function(e,t,n){if("loose"!==YG().securityLevel)return;if(void 0===t)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{B5.runFunc(t,...r)})},"setClickFun"),mCe=JH(function(e,t){b_e.push(function(){const n=document.querySelector(`[id="${e}"]`);null!==n&&n.addEventListener("click",function(){t()})},function(){const n=document.querySelector(`[id="${e}-text"]`);null!==n&&n.addEventListener("click",function(){t()})})},"pushFun"),yCe=JH(function(e,t,n){e.split(",").forEach(function(e){gCe(e,t,n)}),fCe(e,"clickable")},"setClickEvent"),vCe=JH(function(e){b_e.forEach(function(t){t(e)})},"bindFunctions"),bCe={getConfig:JH(()=>YG().gantt,"getConfig"),clear:__e,setDateFormat:L_e,getDateFormat:F_e,enableInclusiveEndDates:M_e,endDatesAreInclusive:R_e,enableTopAxis:D_e,topAxisEnabled:P_e,setAxisFormat:C_e,getAxisFormat:S_e,setTickInterval:A_e,getTickInterval:N_e,setTodayMarker:I_e,getTodayMarker:O_e,setAccTitle:zG,getAccTitle:jG,setDiagramTitle:GG,getDiagramTitle:qG,setDisplayMode:$_e,getDisplayMode:B_e,setAccDescription:HG,getAccDescription:UG,addSection:q_e,getSections:W_e,getTasks:V_e,addTask:cCe,findTaskById:uCe,addTaskOrg:hCe,setIncludes:z_e,getIncludes:j_e,setExcludes:H_e,getExcludes:U_e,setClickEvent:yCe,setLink:pCe,getLinks:G_e,bindFunctions:vCe,parseDuration:tCe,isInvalidDate:Y_e,setWeekday:X_e,getWeekday:K_e,setWeekend:Q_e};function xCe(e,t,n){let r=!0;for(;r;)r=!1,n.forEach(function(n){const i=new RegExp("^\\s*"+n+"\\s*$");e[0].match(i)&&(t[n]=!0,e.shift(1),r=!0)})}JH(xCe,"getTaskTags");var wCe,ECe=JH(function(){nU.debug("Something is calling, setConf, remove the call")},"setConf"),kCe={monday:GJ,tuesday:qJ,wednesday:WJ,thursday:VJ,friday:YJ,saturday:XJ,sunday:UJ},TCe=JH((e,t)=>{let n=[...e].map(()=>-1/0),r=[...e].sort((e,t)=>e.startTime-t.startTime||e.order-t.order),i=0;for(const e of r)for(let r=0;r=n[r]){n[r]=e.endTime,e.order=r+t,r>i&&(i=r);break}return i},"getMaxIntersections"),_Ce=JH(function(e,t,n,r){const i=YG().gantt,a=YG().securityLevel;let o;"sandbox"===a&&(o=TK("#i"+t));const s=TK("sandbox"===a?o.nodes()[0].contentDocument.body:"body"),l="sandbox"===a?o.nodes()[0].contentDocument:document,c=l.getElementById(t);void 0===(wCe=c.parentElement.offsetWidth)&&(wCe=1200),void 0!==i.useWidth&&(wCe=i.useWidth);const u=r.db.getTasks();let h=[];for(const e of u)h.push(e.type);h=k(h);const d={};let p=2*i.topPadding;if("compact"===r.db.getDisplayMode()||"compact"===i.displayMode){const e={};for(const t of u)void 0===e[t.section]?e[t.section]=[t]:e[t.section].push(t);let t=0;for(const n of Object.keys(e)){const r=TCe(e[n],t)+1;t+=r,p+=r*(i.barHeight+i.barGap),d[n]=r}}else{p+=u.length*(i.barHeight+i.barGap);for(const e of h)d[e]=u.filter(t=>t.type===e).length}c.setAttribute("viewBox","0 0 "+wCe+" "+p);const f=s.select(`[id="${t}"]`),g=D1().domain([ZY(u,function(e){return e.startTime}),QY(u,function(e){return e.endTime})]).rangeRound([0,wCe-i.leftPadding-i.rightPadding]);function m(e,t){const n=e.startTime,r=t.startTime;let i=0;return n>r?i=1:ne.order))].map(t=>e.find(e=>e.order===t));f.append("g").selectAll("rect").data(u).enter().append("rect").attr("x",0).attr("y",function(e,t){return e.order*n+a-2}).attr("width",function(){return c-i.rightPadding/2}).attr("height",n).attr("class",function(e){for(const[t,n]of h.entries())if(e.type===n)return"section section"+t%i.numberSectionStyles;return"section section0"});const d=f.append("g").selectAll("rect").data(e).enter(),p=r.db.getLinks();d.append("rect").attr("id",function(e){return e.id}).attr("rx",3).attr("ry",3).attr("x",function(e){return e.milestone?g(e.startTime)+o+.5*(g(e.endTime)-g(e.startTime))-.5*s:g(e.startTime)+o}).attr("y",function(e,t){return e.order*n+a}).attr("width",function(e){return e.milestone?s:g(e.renderEndTime||e.endTime)-g(e.startTime)}).attr("height",s).attr("transform-origin",function(e,t){return t=e.order,(g(e.startTime)+o+.5*(g(e.endTime)-g(e.startTime))).toString()+"px "+(t*n+a+.5*s).toString()+"px"}).attr("class",function(e){let t="";e.classes.length>0&&(t=e.classes.join(" "));let n=0;for(const[t,r]of h.entries())e.type===r&&(n=t%i.numberSectionStyles);let r="";return e.active?e.crit?r+=" activeCrit":r=" active":e.done?r=e.crit?" doneCrit":" done":e.crit&&(r+=" crit"),0===r.length&&(r=" task"),e.milestone&&(r=" milestone "+r),r+=n,r+=" "+t,"task"+r}),d.append("text").attr("id",function(e){return e.id+"-text"}).text(function(e){return e.task}).attr("font-size",i.fontSize).attr("x",function(e){let t=g(e.startTime),n=g(e.renderEndTime||e.endTime);e.milestone&&(t+=.5*(g(e.endTime)-g(e.startTime))-.5*s),e.milestone&&(n=t+s);const r=this.getBBox().width;return r>n-t?n+r+1.5*i.leftPadding>c?t+o-5:n+o+5:(n-t)/2+t+o}).attr("y",function(e,t){return e.order*n+i.barHeight/2+(i.fontSize/2-2)+a}).attr("text-height",s).attr("class",function(e){const t=g(e.startTime);let n=g(e.endTime);e.milestone&&(n=t+s);const r=this.getBBox().width;let a="";e.classes.length>0&&(a=e.classes.join(" "));let o=0;for(const[t,n]of h.entries())e.type===n&&(o=t%i.numberSectionStyles);let l="";return e.active&&(l=e.crit?"activeCritText"+o:"activeText"+o),e.done?l=e.crit?l+" doneCritText"+o:l+" doneText"+o:e.crit&&(l=l+" critText"+o),e.milestone&&(l+=" milestoneText"),r>n-t?n+r+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+o+" "+l:a+" taskTextOutsideRight taskTextOutside"+o+" "+l+" width-"+r:a+" taskText taskText"+o+" "+l+" width-"+r});if("sandbox"===YG().securityLevel){let e;e=TK("#i"+t);const n=e.nodes()[0].contentDocument;d.filter(function(e){return p.has(e.id)}).each(function(e){var t=n.querySelector("#"+e.id),r=n.querySelector("#"+e.id+"-text");const i=t.parentNode;var a=n.createElement("a");a.setAttribute("xlink:href",p.get(e.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(t),a.appendChild(r)})}}function b(e,t,n,a,o,s,l,c){if(0===l.length&&0===c.length)return;let u,h;for(const{startTime:e,endTime:t}of s)(void 0===u||eh)&&(h=t);if(!u||!h)return;if(Rm(h).diff(Rm(u),"year")>5)return void nU.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");const d=r.db.getDateFormat(),p=[];let m=null,y=Rm(u);for(;y.valueOf()<=h;)r.db.isInvalidDate(y,d,l,c)?m?m.end=y:m={start:y,end:y}:m&&(p.push(m),m=null),y=y.add(1,"d");f.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",function(e){return"exclude-"+e.start.format("YYYY-MM-DD")}).attr("x",function(e){return g(e.start)+n}).attr("y",i.gridLineStartPadding).attr("width",function(e){const t=e.end.add(1,"day");return g(t)-g(e.start)}).attr("height",o-t-i.gridLineStartPadding).attr("transform-origin",function(t,r){return(g(t.start)+n+.5*(g(t.end)-g(t.start))).toString()+"px "+(r*e+.5*o).toString()+"px"}).attr("class","exclude-range")}function x(e,t,n,a){let o=function(e){return oX(3,e)}(g).tickSize(-a+t+i.gridLineStartPadding).tickFormat(f0(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const s=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(null!==s){const e=s[1],t=s[2],n=r.db.getWeekday()||i.weekday;switch(t){case"millisecond":o.ticks(CJ.every(e));break;case"second":o.ticks(RJ.every(e));break;case"minute":o.ticks(DJ.every(e));break;case"hour":o.ticks($J.every(e));break;case"day":o.ticks(FJ.every(e));break;case"week":o.ticks(kCe[n].every(e));break;case"month":o.ticks(i0.every(e))}}if(f.append("g").attr("class","grid").attr("transform","translate("+e+", "+(a-50)+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let n=function(e){return oX(1,e)}(g).tickSize(-a+t+i.gridLineStartPadding).tickFormat(f0(r.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==s){const e=s[1],t=s[2],a=r.db.getWeekday()||i.weekday;switch(t){case"millisecond":n.ticks(CJ.every(e));break;case"second":n.ticks(RJ.every(e));break;case"minute":n.ticks(DJ.every(e));break;case"hour":n.ticks($J.every(e));break;case"day":n.ticks(FJ.every(e));break;case"week":n.ticks(kCe[a].every(e));break;case"month":n.ticks(i0.every(e))}}f.append("g").attr("class","grid").attr("transform","translate("+e+", "+t+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function w(e,t){let n=0;const r=Object.keys(d).map(e=>[e,d[e]]);f.append("g").selectAll("text").data(r).enter().append(function(e){const t=e[0].split(_G.lineBreakRegex),n=-(t.length-1)/2,r=l.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("dy",n+"em");for(const[e,n]of t.entries()){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttribute("alignment-baseline","central"),t.setAttribute("x","10"),e>0&&t.setAttribute("dy","1em"),t.textContent=n,r.appendChild(t)}return r}).attr("x",10).attr("y",function(i,a){if(!(a>0))return i[1]*e/2+t;for(let o=0;o`\n .mermaid-main-font {\n font-family: ${e.fontFamily};\n }\n\n .exclude-range {\n fill: ${e.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${e.sectionBkgColor};\n }\n\n .section2 {\n fill: ${e.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${e.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${e.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: ${e.fontFamily};\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${e.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${e.fontFamily};\n fill: ${e.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${e.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: ${e.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${e.taskTextDarkColor};\n text-anchor: start;\n font-family: ${e.fontFamily};\n }\n\n .taskTextOutsideLeft {\n fill: ${e.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${e.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${e.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${e.taskBkgColor};\n stroke: ${e.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${e.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${e.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${e.activeTaskBkgColor};\n stroke: ${e.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${e.doneTaskBorderColor};\n fill: ${e.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${e.critBorderColor};\n fill: ${e.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${e.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.titleColor||e.textColor};\n font-family: ${e.fontFamily};\n }\n`,"getStyles")},SCe=Object.freeze({__proto__:null,diagram:CCe}),ACe={parse:JH(async e=>{const t=await Bke("info",e);nU.debug(t)},"parse")},NCe={version:Nte},ICe={getVersion:JH(()=>NCe.version,"getVersion")},OCe=JH((e,t,n)=>{nU.debug("rendering info diagram\n"+e);const r=Ite(t);AG(r,100,400,!0);r.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"),LCe={parser:ACe,db:ICe,renderer:{draw:OCe}},MCe=Object.freeze({__proto__:null,diagram:LCe}),RCe=MU.pie,DCe={sections:new Map,showData:!1},PCe=DCe.sections,$Ce=DCe.showData,BCe=structuredClone(RCe),FCe=JH(()=>structuredClone(BCe),"getConfig"),zCe=JH(()=>{PCe=new Map,$Ce=DCe.showData,FG()},"clear"),jCe=JH(({label:e,value:t})=>{PCe.has(e)||(PCe.set(e,t),nU.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),HCe={getConfig:FCe,clear:zCe,setDiagramTitle:GG,getDiagramTitle:qG,setAccTitle:zG,getAccTitle:jG,setAccDescription:HG,getAccDescription:UG,addSection:jCe,getSections:JH(()=>PCe,"getSections"),setShowData:JH(e=>{$Ce=e},"setShowData"),getShowData:JH(()=>$Ce,"getShowData")},UCe=JH((e,t)=>{Rhe(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),GCe={parse:JH(async e=>{const t=await Bke("pie",e);nU.debug(t),UCe(t,HCe)},"parse")},qCe=JH(e=>`\n .pieCircle{\n stroke: ${e.pieStrokeColor};\n stroke-width : ${e.pieStrokeWidth};\n opacity : ${e.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${e.pieOuterStrokeColor};\n stroke-width: ${e.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${e.pieTitleTextSize};\n fill: ${e.pieTitleTextColor};\n font-family: ${e.fontFamily};\n }\n .slice {\n font-family: ${e.fontFamily};\n fill: ${e.pieSectionTextColor};\n font-size:${e.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${e.pieLegendTextColor};\n font-family: ${e.fontFamily};\n font-size: ${e.pieLegendTextSize};\n }\n`,"getStyles"),WCe=JH(e=>{const t=[...e.entries()].map(e=>({label:e[0],value:e[1]})).sort((e,t)=>t.value-e.value),n=function(){var e=h2,t=u2,n=null,r=$1(0),i=$1(Y1),a=$1(0);function o(o){var s,l,c,u,h,d=(o=i2(o)).length,p=0,f=new Array(d),g=new Array(d),m=+r.apply(this,arguments),y=Math.min(Y1,Math.max(-Y1,i.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s0&&(p+=h);for(null!=t?f.sort(function(e,n){return t(g[e],g[n])}):null!=n&&f.sort(function(e,t){return n(o[e],o[t])}),s=0,c=p?(y-d*b)/p:0;s0?h*c:0)+b,g[l]={data:o[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:v};return g}return o.value=function(t){return arguments.length?(e="function"==typeof t?t:$1(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:$1(+e),o):r},o.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:$1(+e),o):i},o.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:$1(+e),o):a},o}().value(e=>e.value);return n(t)},"createPieArcs"),VCe=JH((e,t,n,r)=>{nU.debug("rendering pie chart\n"+e);const i=r.db,a=YG(),o=$5(i.getConfig(),a.pie),s=18,l=450,c=l,u=Ite(t),h=u.append("g");h.attr("transform","translate(225,225)");const{themeVariables:d}=a;let[p]=P5(d.pieOuterStrokeWidth);p??=2;const f=o.textPosition,g=Math.min(c,l)/2-40,m=r2().innerRadius(0).outerRadius(g),y=r2().innerRadius(g*f).outerRadius(g*f);h.append("circle").attr("cx",0).attr("cy",0).attr("r",g+p/2).attr("class","pieOuterCircle");const v=i.getSections(),b=WCe(v),x=cJ([d.pie1,d.pie2,d.pie3,d.pie4,d.pie5,d.pie6,d.pie7,d.pie8,d.pie9,d.pie10,d.pie11,d.pie12]);h.selectAll("mySlices").data(b).enter().append("path").attr("d",m).attr("fill",e=>x(e.data.label)).attr("class","pieCircle");let w=0;v.forEach(e=>{w+=e}),h.selectAll("mySlices").data(b).enter().append("text").text(e=>(e.data.value/w*100).toFixed(0)+"%").attr("transform",e=>"translate("+y.centroid(e)+")").style("text-anchor","middle").attr("class","slice"),h.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const E=h.selectAll(".legend").data(x.domain()).enter().append("g").attr("class","legend").attr("transform",(e,t)=>"translate(216,"+(22*t-22*x.domain().length/2)+")");E.append("rect").attr("width",s).attr("height",s).style("fill",x).style("stroke",x),E.data(b).append("text").attr("x",22).attr("y",14).text(e=>{const{label:t,value:n}=e.data;return i.getShowData()?`${t} [${n}]`:t});const k=Math.max(...E.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0)),T=512+k;u.attr("viewBox",`0 0 ${T} 450`),AG(u,l,T,o.useMaxWidth)},"draw"),YCe={parser:GCe,db:HCe,renderer:{draw:VCe},styles:qCe},XCe=Object.freeze({__proto__:null,diagram:YCe}),KCe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[1,7],o=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],s=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],c=[2,36],u=[1,37],h=[1,36],d=[1,38],p=[1,35],f=[1,43],g=[1,41],m=[1,14],y=[1,23],v=[1,18],b=[1,19],x=[1,20],w=[1,21],E=[1,22],k=[1,24],T=[1,25],_=[1,26],C=[1,27],S=[1,28],A=[1,29],N=[1,32],I=[1,33],O=[1,34],L=[1,39],M=[1,40],R=[1,42],D=[1,44],P=[1,62],$=[1,61],B=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],F=[1,65],z=[1,66],j=[1,67],H=[1,68],U=[1,69],G=[1,70],q=[1,71],W=[1,72],V=[1,73],Y=[1,74],X=[1,75],K=[1,76],Q=[4,5,6,7,8,9,10,11,12,13,14,15,18],Z=[1,90],J=[1,91],ee=[1,92],te=[1,99],ne=[1,93],re=[1,96],ie=[1,94],ae=[1,95],oe=[1,97],se=[1,98],le=[1,102],ce=[10,55,56,57],ue=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:JH(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],[59,1],[59,1],[59,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:case 68:this.$=a[s];break;case 24:case 69:this.$=a[s-1]+""+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],"",a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],"",a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=" ⟶ ",r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=" ⟶ ",r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:case 66:this.$={text:a[s],type:"text"};break;case 65:this.$={text:a[s-1].text+""+a[s],type:a[s-1].type};break;case 67:this.$={text:a[s],type:"markdown"}}},"anonymous"),table:[{18:t,26:1,27:2,28:n,55:r,56:i,57:a},{1:[3]},{18:t,26:8,27:2,28:n,55:r,56:i,57:a},{18:t,26:9,27:2,28:n,55:r,56:i,57:a},e(o,[2,33],{29:10}),e(s,[2,61]),e(s,[2,62]),e(s,[2,63]),{1:[2,30]},{1:[2,31]},e(l,c,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:h,10:d,12:p,13:f,14:g,18:m,25:y,35:v,37:b,39:x,41:w,42:E,48:k,50:T,51:_,52:C,53:S,54:A,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(o,[2,34]),{27:45,55:r,56:i,57:a},e(l,[2,37]),e(l,c,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:h,10:d,12:p,13:f,14:g,18:m,25:y,35:v,37:b,39:x,41:w,42:E,48:k,50:T,51:_,52:C,53:S,54:A,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},e(l,[2,45]),e(l,[2,46]),{18:[1,50]},{4:u,5:h,10:d,12:p,13:f,14:g,43:51,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:52,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:53,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:54,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:55,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,10:d,12:p,13:f,14:g,43:56,58:31,60:N,61:I,63:O,64:L,65:M,66:R,67:D},{4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,44:[1,57],47:[1,58],58:60,59:59,63:O,64:L,65:M,66:R,67:D},e(B,[2,64]),e(B,[2,66]),e(B,[2,67]),e(B,[2,70]),e(B,[2,71]),e(B,[2,72]),e(B,[2,73]),e(B,[2,74]),e(B,[2,75]),e(B,[2,76]),e(B,[2,77]),e(B,[2,78]),e(B,[2,79]),e(B,[2,80]),e(o,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:64,4:F,5:z,6:j,7:H,8:U,9:G,10:q,11:W,12:V,13:Y,14:X,15:K,21:63},e(l,[2,53],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,49:[1,77],63:O,64:L,65:M,66:R,67:D}),e(l,[2,56],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,49:[1,78],63:O,64:L,65:M,66:R,67:D}),e(l,[2,57],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,58],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,59],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,60],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),{45:[1,79]},{44:[1,80]},e(B,[2,65]),e(B,[2,81]),e(B,[2,82]),e(B,[2,83]),{3:82,4:F,5:z,6:j,7:H,8:U,9:G,10:q,11:W,12:V,13:Y,14:X,15:K,18:[1,81]},e(Q,[2,23]),e(Q,[2,1]),e(Q,[2,2]),e(Q,[2,3]),e(Q,[2,4]),e(Q,[2,5]),e(Q,[2,6]),e(Q,[2,7]),e(Q,[2,8]),e(Q,[2,9]),e(Q,[2,10]),e(Q,[2,11]),e(Q,[2,12]),e(l,[2,52],{58:31,43:83,4:u,5:h,10:d,12:p,13:f,14:g,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),e(l,[2,55],{58:31,43:84,4:u,5:h,10:d,12:p,13:f,14:g,60:N,61:I,63:O,64:L,65:M,66:R,67:D}),{46:[1,85]},{45:[1,86]},{4:Z,5:J,6:ee,8:te,11:ne,13:re,16:89,17:ie,18:ae,19:oe,20:se,22:88,23:87},e(Q,[2,24]),e(l,[2,51],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,54],{59:59,58:60,4:u,5:h,8:P,10:d,12:p,13:f,14:g,18:$,63:O,64:L,65:M,66:R,67:D}),e(l,[2,47],{22:88,16:89,23:100,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),{46:[1,101]},e(l,[2,29],{10:le}),e(ce,[2,27],{16:103,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),e(ue,[2,25]),e(ue,[2,13]),e(ue,[2,14]),e(ue,[2,15]),e(ue,[2,16]),e(ue,[2,17]),e(ue,[2,18]),e(ue,[2,19]),e(ue,[2,20]),e(ue,[2,21]),e(ue,[2,22]),e(l,[2,49],{10:le}),e(l,[2,48],{22:88,16:89,23:104,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se}),{4:Z,5:J,6:ee,8:te,11:ne,13:re,16:89,17:ie,18:ae,19:oe,20:se,22:105},e(ue,[2,26]),e(l,[2,50],{10:le}),e(ce,[2,28],{16:103,4:Z,5:J,6:ee,8:te,11:ne,13:re,17:ie,18:ae,19:oe,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},de=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:case 1:case 3:break;case 2:return 55;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:case 23:case 25:case 31: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 24:this.begin("string");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 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 11;case 37:return 64;case 38:return 10;case 39:case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51: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,/^(?::)/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],inclusive:!0}}};return e}();function pe(){this.yy={}}return he.lexer=de,JH(pe,"Parser"),pe.prototype=he,he.Parser=pe,new pe}();KCe.parser=KCe;var QCe=KCe,ZCe=TU(),JCe=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{JH(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:MU.quadrantChart?.chartWidth||500,chartWidth:MU.quadrantChart?.chartHeight||500,titlePadding:MU.quadrantChart?.titlePadding||10,titleFontSize:MU.quadrantChart?.titleFontSize||20,quadrantPadding:MU.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:MU.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:MU.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:MU.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:MU.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:MU.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:MU.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:MU.quadrantChart?.pointTextPadding||5,pointLabelFontSize:MU.quadrantChart?.pointLabelFontSize||12,pointRadius:MU.quadrantChart?.pointRadius||5,xAxisPosition:MU.quadrantChart?.xAxisPosition||"top",yAxisPosition:MU.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:MU.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:MU.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:ZCe.quadrant1Fill,quadrant2Fill:ZCe.quadrant2Fill,quadrant3Fill:ZCe.quadrant3Fill,quadrant4Fill:ZCe.quadrant4Fill,quadrant1TextFill:ZCe.quadrant1TextFill,quadrant2TextFill:ZCe.quadrant2TextFill,quadrant3TextFill:ZCe.quadrant3TextFill,quadrant4TextFill:ZCe.quadrant4TextFill,quadrantPointFill:ZCe.quadrantPointFill,quadrantPointTextFill:ZCe.quadrantPointTextFill,quadrantXAxisTextFill:ZCe.quadrantXAxisTextFill,quadrantYAxisTextFill:ZCe.quadrantYAxisTextFill,quadrantTitleFill:ZCe.quadrantTitleFill,quadrantInternalBorderStrokeFill:ZCe.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:ZCe.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,nU.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,t){this.classes.set(e,t)}setConfig(e){nU.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){nU.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,t,n,r){const i=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,a={top:"top"===e&&t?i:0,bottom:"bottom"===e&&t?i:0},o=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,s={left:"left"===this.config.yAxisPosition&&n?o:0,right:"right"===this.config.yAxisPosition&&n?o:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:r?l:0},u=this.config.quadrantPadding+s.left,h=this.config.quadrantPadding+a.top+c.top,d=this.config.chartWidth-2*this.config.quadrantPadding-s.left-s.right,p=this.config.chartHeight-2*this.config.quadrantPadding-a.top-a.bottom-c.top;return{xAxisSpace:a,yAxisSpace:s,titleSpace:c,quadrantSpace:{quadrantLeft:u,quadrantTop:h,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:p,quadrantHalfHeight:p/2}}}getAxisLabels(e,t,n,r){const{quadrantSpace:i,titleSpace:a}=r,{quadrantHalfHeight:o,quadrantHeight:s,quadrantLeft:l,quadrantHalfWidth:c,quadrantTop:u,quadrantWidth:h}=i,d=Boolean(this.data.xAxisRightText),p=Boolean(this.data.yAxisTopText),f=[];return this.data.xAxisLeftText&&t&&f.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(d?c/2:0),y:"top"===e?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+u+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&t&&f.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+c+(d?c/2:0),y:"top"===e?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+u+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&f.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:u+s-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&f.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:u+o-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),f}getQuadrants(e){const{quadrantSpace:t}=e,{quadrantHalfHeight:n,quadrantLeft:r,quadrantHalfWidth:i,quadrantTop:a}=t,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:a,width:i,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:a,width:i,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(const e of o)e.text.x=e.x+e.width/2,0===this.data.points.length?(e.text.y=e.y+e.height/2,e.text.horizontalPos="middle"):(e.text.y=e.y+this.config.quadrantTextTopPadding,e.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:t}=e,{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:a}=t,o=EJ().domain([0,1]).range([r,a+r]),s=EJ().domain([0,1]).range([n+i,i]),l=this.data.points.map(e=>{const t=this.classes.get(e.className);t&&(e={...t,...e});return{x:o(e.x),y:s(e.y),fill:e.color??this.themeConfig.quadrantPointFill,radius:e.radius??this.config.pointRadius,text:{text:e.text,fill:this.themeConfig.quadrantPointTextFill,x:o(e.x),y:s(e.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:e.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:e.strokeWidth??"0px"}});return l}getBorders(e){const t=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:s,quadrantWidth:l}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s,x2:a+l+t,y2:s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:s+t,x2:a+l,y2:s+i-t},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s+i,x2:a+l+t,y2:s+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:s+t,x2:a,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:s+t,x2:a+o,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+t,y1:s+r,x2:a+l-t,y2:s+r}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),t=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(r,e,t,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,e,t,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}},eSe=class extends Error{static{JH(this,"InvalidStyleError")}constructor(e,t,n){super(`value for ${e} ${t} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}};function tSe(e){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(e)}function nSe(e){return!/^\d+$/.test(e)}function rSe(e){return!/^\d+px$/.test(e)}JH(tSe,"validateHexCode"),JH(nSe,"validateNumber"),JH(rSe,"validateSizeInPixels");var iSe=YG();function aSe(e){return oG(e.trim(),iSe)}JH(aSe,"textSanitizer");var oSe=new JCe;function sSe(e){oSe.setData({quadrant1Text:aSe(e.text)})}function lSe(e){oSe.setData({quadrant2Text:aSe(e.text)})}function cSe(e){oSe.setData({quadrant3Text:aSe(e.text)})}function uSe(e){oSe.setData({quadrant4Text:aSe(e.text)})}function hSe(e){oSe.setData({xAxisLeftText:aSe(e.text)})}function dSe(e){oSe.setData({xAxisRightText:aSe(e.text)})}function pSe(e){oSe.setData({yAxisTopText:aSe(e.text)})}function fSe(e){oSe.setData({yAxisBottomText:aSe(e.text)})}function gSe(e){const t={};for(const n of e){const[e,r]=n.trim().split(/\s*:\s*/);if("radius"===e){if(nSe(r))throw new eSe(e,r,"number");t.radius=parseInt(r)}else if("color"===e){if(tSe(r))throw new eSe(e,r,"hex code");t.color=r}else if("stroke-color"===e){if(tSe(r))throw new eSe(e,r,"hex code");t.strokeColor=r}else{if("stroke-width"!==e)throw new Error(`style named ${e} is not supported.`);if(rSe(r))throw new eSe(e,r,"number of pixels (eg. 10px)");t.strokeWidth=r}}return t}function mSe(e,t,n,r,i){const a=gSe(i);oSe.addPoints([{x:n,y:r,text:aSe(e.text),className:t,...a}])}function ySe(e,t){oSe.addClass(e,gSe(t))}function vSe(e){oSe.setConfig({chartWidth:e})}function bSe(e){oSe.setConfig({chartHeight:e})}function xSe(){const e=YG(),{themeVariables:t,quadrantChart:n}=e;return n&&oSe.setConfig(n),oSe.setThemeConfig({quadrant1Fill:t.quadrant1Fill,quadrant2Fill:t.quadrant2Fill,quadrant3Fill:t.quadrant3Fill,quadrant4Fill:t.quadrant4Fill,quadrant1TextFill:t.quadrant1TextFill,quadrant2TextFill:t.quadrant2TextFill,quadrant3TextFill:t.quadrant3TextFill,quadrant4TextFill:t.quadrant4TextFill,quadrantPointFill:t.quadrantPointFill,quadrantPointTextFill:t.quadrantPointTextFill,quadrantXAxisTextFill:t.quadrantXAxisTextFill,quadrantYAxisTextFill:t.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:t.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:t.quadrantInternalBorderStrokeFill,quadrantTitleFill:t.quadrantTitleFill}),oSe.setData({titleText:qG()}),oSe.build()}JH(sSe,"setQuadrant1Text"),JH(lSe,"setQuadrant2Text"),JH(cSe,"setQuadrant3Text"),JH(uSe,"setQuadrant4Text"),JH(hSe,"setXAxisLeftText"),JH(dSe,"setXAxisRightText"),JH(pSe,"setYAxisTopText"),JH(fSe,"setYAxisBottomText"),JH(gSe,"parseStyles"),JH(mSe,"addPoint"),JH(ySe,"addClass"),JH(vSe,"setWidth"),JH(bSe,"setHeight"),JH(xSe,"getQuadrantData");var wSe={setWidth:vSe,setHeight:bSe,setQuadrant1Text:sSe,setQuadrant2Text:lSe,setQuadrant3Text:cSe,setQuadrant4Text:uSe,setXAxisLeftText:hSe,setXAxisRightText:dSe,setYAxisTopText:pSe,setYAxisBottomText:fSe,parseStyles:gSe,addPoint:mSe,addClass:ySe,getQuadrantData:xSe,clear:JH(function(){oSe.clear(),FG()},"clear"),setAccTitle:zG,getAccTitle:jG,setDiagramTitle:GG,getDiagramTitle:qG,getAccDescription:UG,setAccDescription:HG},ESe=JH((e,t,n,r)=>{function i(e){return"top"===e?"hanging":"middle"}function a(e){return"left"===e?"start":"middle"}function o(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}JH(i,"getDominantBaseLine"),JH(a,"getTextAnchor"),JH(o,"getTransformation");const s=YG();nU.debug("Rendering quadrant chart\n"+e);const l=s.securityLevel;let c;"sandbox"===l&&(c=TK("#i"+t));const u=TK("sandbox"===l?c.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`),h=u.append("g").attr("class","main"),d=s.quadrantChart?.chartWidth??500,p=s.quadrantChart?.chartHeight??500;AG(u,p,d,s.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+d+" "+p),r.db.setHeight(p),r.db.setWidth(d);const f=r.db.getQuadrantData(),g=h.append("g").attr("class","quadrants"),m=h.append("g").attr("class","border"),y=h.append("g").attr("class","data-points"),v=h.append("g").attr("class","labels"),b=h.append("g").attr("class","title");f.title&&b.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",i(f.title.horizontalPos)).attr("text-anchor",a(f.title.verticalPos)).attr("transform",o(f.title)).text(f.title.text),f.borderLines&&m.selectAll("line").data(f.borderLines).enter().append("line").attr("x1",e=>e.x1).attr("y1",e=>e.y1).attr("x2",e=>e.x2).attr("y2",e=>e.y2).style("stroke",e=>e.strokeFill).style("stroke-width",e=>e.strokeWidth);const x=g.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");x.append("rect").attr("x",e=>e.x).attr("y",e=>e.y).attr("width",e=>e.width).attr("height",e=>e.height).attr("fill",e=>e.fill),x.append("text").attr("x",0).attr("y",0).attr("fill",e=>e.text.fill).attr("font-size",e=>e.text.fontSize).attr("dominant-baseline",e=>i(e.text.horizontalPos)).attr("text-anchor",e=>a(e.text.verticalPos)).attr("transform",e=>o(e.text)).text(e=>e.text.text);v.selectAll("g.label").data(f.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(e=>e.text).attr("fill",e=>e.fill).attr("font-size",e=>e.fontSize).attr("dominant-baseline",e=>i(e.horizontalPos)).attr("text-anchor",e=>a(e.verticalPos)).attr("transform",e=>o(e));const w=y.selectAll("g.data-point").data(f.points).enter().append("g").attr("class","data-point");w.append("circle").attr("cx",e=>e.x).attr("cy",e=>e.y).attr("r",e=>e.radius).attr("fill",e=>e.fill).attr("stroke",e=>e.strokeColor).attr("stroke-width",e=>e.strokeWidth),w.append("text").attr("x",0).attr("y",0).text(e=>e.text.text).attr("fill",e=>e.text.fill).attr("font-size",e=>e.text.fontSize).attr("dominant-baseline",e=>i(e.text.horizontalPos)).attr("text-anchor",e=>a(e.text.verticalPos)).attr("transform",e=>o(e.text))},"draw"),kSe={parser:QCe,db:wSe,renderer:{draw:ESe},styles:JH(()=>"","styles")},TSe=Object.freeze({__proto__:null,diagram:kSe}),_Se=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],s=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],c=[1,26],u=[1,28],h=[1,29],d=[1,30],p=[1,31],f=[1,32],g=[1,33],m=[1,34],y=[1,35],v=[1,36],b=[1,37],x=[1,43],w=[1,42],E=[1,47],k=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],S=[1,64],A={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:"",type:"text"},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:"",type:"text"},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:case 27:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:"text",text:""});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:"text",text:""});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:case 38:this.$={text:a[s],type:"text"};break;case 39:this.$={text:a[s],type:"markdown"};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+""+a[s]}},"anonymous"),table:[e(t,n,{3:1,4:2,7:4,5:r,34:i,35:a,36:o}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,34:i,35:a,36:o}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],34:i,35:a,36:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(s,[2,34]),e(s,[2,35]),e(s,[2,36]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,34:i,35:a,36:o}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,34:i,35:a,36:o}),{11:23,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:39,13:38,24:x,27:w,29:40,30:41,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:45,15:44,27:E,33:46,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:49,17:48,24:k,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{11:52,17:51,24:k,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(_,[2,37],{40:55,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b}),e(_,[2,38]),e(_,[2,39]),e(C,[2,40]),e(C,[2,42]),e(C,[2,43]),e(C,[2,44]),e(C,[2,45]),e(C,[2,46]),e(C,[2,47]),e(C,[2,48]),e(C,[2,49]),e(C,[2,50]),e(C,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:w}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:E}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:k},{25:63,27:S},e(T,[2,14]),{17:65,24:k},e(T,[2,16]),e(T,[2,17]),e(C,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:c,40:27,41:u,42:h,43:d,44:p,45:f,46:g,47:m,48:y,49:v,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:S},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},N=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return e}();function I(){this.yy={}}return A.lexer=N,JH(I,"Parser"),I.prototype=A,A.Parser=I,new I}();_Se.parser=_Se;var CSe=_Se;function SSe(e){return"bar"===e.type}function ASe(e){return"band"===e.type}function NSe(e){return"linear"===e.type}JH(SSe,"isBarPlot"),JH(ASe,"isBandAxisData"),JH(NSe,"isLinearAxisData");var ISe=class{constructor(e){this.parentGroup=e}static{JH(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};const n={width:0,height:0},r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",t);for(const i of e){const e=p7(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},OSe=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}static{JH(this,"BaseAxis")}setRange(e){this.range=e,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*e.width;this.outerPadding=Math.min(n.width/2,r);const i=n.height+2*this.axisConfig.labelPadding;this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+2*this.axisConfig.titlePadding;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),r=.2*e.height;this.outerPadding=Math.min(n.height/2,r);const i=n.width+2*this.axisConfig.labelPadding;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+2*this.axisConfig.titlePadding;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const t=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},LSe=class extends OSe{static{JH(this,"BandAxis")}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=uJ().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=uJ().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),nU.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},MSe=class extends OSe{static{JH(this,"LinearAxis")}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=EJ().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];"left"===this.axisPosition&&e.reverse(),this.scale=EJ().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function RSe(e,t,n,r){const i=new ISe(r);return ASe(e)?new LSe(t,n,e.categories,e.title,i):new MSe(t,n,[e.min,e.max],e.title,i)}JH(RSe,"getAxis");var DSe=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{JH(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function PSe(e,t,n,r){const i=new ISe(r);return new DSe(i,e,t,n)}JH(PSe,"getChartTitleComponent");var $Se=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{JH(this,"LinePlot")}getDrawableElement(){const e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let t;return t="horizontal"===this.orientation?c2().y(e=>e[0]).x(e=>e[1])(e):c2().x(e=>e[0]).y(e=>e[1])(e),t?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},BSe=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{JH(this,"BarPlot")}getDrawableElement(){const e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),n=t/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},FSe=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{JH(this,"BasePlot")}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const e=[];for(const[t,n]of this.chartData.plots.entries())switch(n.type){case"line":{const r=new $Se(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case"bar":{const r=new BSe(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}};function zSe(e,t,n){return new FSe(e,t,n)}JH(zSe,"getPlotComponent");var jSe,HSe=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:PSe(e,t,n,r),plot:zSe(e,t,n),xAxis:RSe(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:RSe(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{JH(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>SSe(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition("left"),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition("top"),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>SSe(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},USe=class{static{JH(this,"XYChartBuilder")}static build(e,t,n,r){return new HSe(e,t,n,r).getDrawableElement()}},GSe=0,qSe=ZSe(),WSe=QSe(),VSe=JSe(),YSe=WSe.plotColorPalette.split(",").map(e=>e.trim()),XSe=!1,KSe=!1;function QSe(){const e=TU(),t=WU();return $5(e.xyChart,t.themeVariables.xyChart)}function ZSe(){const e=WU();return $5(MU.xyChart,e.xyChart)}function JSe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function eAe(e){const t=WU();return oG(e.trim(),t)}function tAe(e){jSe=e}function nAe(e){qSe.chartOrientation="horizontal"===e?"horizontal":"vertical"}function rAe(e){VSe.xAxis.title=eAe(e.text)}function iAe(e,t){VSe.xAxis={type:"linear",title:VSe.xAxis.title,min:e,max:t},XSe=!0}function aAe(e){VSe.xAxis={type:"band",title:VSe.xAxis.title,categories:e.map(e=>eAe(e.text))},XSe=!0}function oAe(e){VSe.yAxis.title=eAe(e.text)}function sAe(e,t){VSe.yAxis={type:"linear",title:VSe.yAxis.title,min:e,max:t},KSe=!0}function lAe(e){const t=Math.min(...e),n=Math.max(...e),r=NSe(VSe.yAxis)?VSe.yAxis.min:1/0,i=NSe(VSe.yAxis)?VSe.yAxis.max:-1/0;VSe.yAxis={type:"linear",title:VSe.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}function cAe(e){let t=[];if(0===e.length)return t;if(!XSe){const t=NSe(VSe.xAxis)?VSe.xAxis.min:1/0,n=NSe(VSe.xAxis)?VSe.xAxis.max:-1/0;iAe(Math.min(t,1),Math.max(n,e.length))}if(KSe||lAe(e),ASe(VSe.xAxis)&&(t=VSe.xAxis.categories.map((t,n)=>[t,e[n]])),NSe(VSe.xAxis)){const n=VSe.xAxis.min,r=VSe.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}function uAe(e){return YSe[0===e?0:e%YSe.length]}function hAe(e,t){const n=cAe(t);VSe.plots.push({type:"line",strokeFill:uAe(GSe),strokeWidth:2,data:n}),GSe++}function dAe(e,t){const n=cAe(t);VSe.plots.push({type:"bar",fill:uAe(GSe),data:n}),GSe++}function pAe(){if(0===VSe.plots.length)throw Error("No Plot to render, please provide a plot with some data");return VSe.title=qG(),USe.build(qSe,VSe,WSe,jSe)}function fAe(){return WSe}function gAe(){return qSe}JH(QSe,"getChartDefaultThemeConfig"),JH(ZSe,"getChartDefaultConfig"),JH(JSe,"getChartDefaultData"),JH(eAe,"textSanitizer"),JH(tAe,"setTmpSVGG"),JH(nAe,"setOrientation"),JH(rAe,"setXAxisTitle"),JH(iAe,"setXAxisRangeData"),JH(aAe,"setXAxisBand"),JH(oAe,"setYAxisTitle"),JH(sAe,"setYAxisRangeData"),JH(lAe,"setYAxisRangeFromPlotData"),JH(cAe,"transformDataWithoutCategory"),JH(uAe,"getPlotColorFromPalette"),JH(hAe,"setLineData"),JH(dAe,"setBarData"),JH(pAe,"getDrawableElem"),JH(fAe,"getChartThemeConfig"),JH(gAe,"getChartConfig");var mAe=JH(function(){FG(),GSe=0,qSe=ZSe(),VSe={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},WSe=QSe(),YSe=WSe.plotColorPalette.split(",").map(e=>e.trim()),XSe=!1,KSe=!1},"clear"),yAe={getDrawableElem:pAe,clear:mAe,setAccTitle:zG,getAccTitle:jG,setDiagramTitle:GG,getDiagramTitle:qG,getAccDescription:UG,setAccDescription:HG,setOrientation:nAe,setXAxisTitle:rAe,setXAxisRangeData:iAe,setXAxisBand:aAe,setYAxisTitle:oAe,setYAxisRangeData:sAe,setLineData:hAe,setBarData:dAe,setTmpSVGG:tAe,getChartThemeConfig:fAe,getChartConfig:gAe},vAe=JH((e,t,n,r)=>{const i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig();function s(e){return"top"===e?"text-before-edge":"middle"}function l(e){return"left"===e?"start":"right"===e?"end":"middle"}function c(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}JH(s,"getDominantBaseLine"),JH(l,"getTextAnchor"),JH(c,"getTextTransformation"),nU.debug("Rendering xychart chart\n"+e);const u=Ite(t),h=u.append("g").attr("class","main"),d=h.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");AG(u,o.height,o.width,!0),u.attr("viewBox",`0 0 ${o.width} ${o.height}`),d.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=i.getDrawableElem(),f={};function g(e){let t=h,n="";for(const[r]of e.entries()){let i=h;r>0&&f[n]&&(i=f[n]),n+=e[r],t=f[n],t||(t=f[n]=i.append("g").attr("class",e[r]))}return t}JH(g,"getGroup");for(const e of p){if(0===e.data.length)continue;const t=g(e.groupTexts);switch(e.type){case"rect":t.selectAll("rect").data(e.data).enter().append("rect").attr("x",e=>e.x).attr("y",e=>e.y).attr("width",e=>e.width).attr("height",e=>e.height).attr("fill",e=>e.fill).attr("stroke",e=>e.strokeFill).attr("stroke-width",e=>e.strokeWidth);break;case"text":t.selectAll("text").data(e.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",e=>e.fill).attr("font-size",e=>e.fontSize).attr("dominant-baseline",e=>s(e.verticalPos)).attr("text-anchor",e=>l(e.horizontalPos)).attr("transform",e=>c(e)).text(e=>e.text);break;case"path":t.selectAll("path").data(e.data).enter().append("path").attr("d",e=>e.path).attr("fill",e=>e.fill?e.fill:"none").attr("stroke",e=>e.strokeFill).attr("stroke-width",e=>e.strokeWidth)}}},"draw"),bAe={parser:CSe,db:yAe,renderer:{draw:vAe}},xAe=Object.freeze({__proto__:null,diagram:bAe}),wAe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],o=[1,22],s=[2,7],l=[1,26],c=[1,27],u=[1,28],h=[1,29],d=[1,33],p=[1,34],f=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,24],b=[1,31],x=[1,32],w=[1,30],E=[1,39],k=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],C=[89,90],S=[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],A=[27,29],N=[1,70],I=[1,71],O=[1,72],L=[1,73],M=[1,74],R=[1,75],D=[1,76],P=[1,83],$=[1,80],B=[1,84],F=[1,85],z=[1,86],j=[1,87],H=[1,88],U=[1,89],G=[1,90],q=[1,91],W=[1,92],V=[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],X=[1,101],K=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Q=[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],Z=[1,110],J=[1,106],ee=[1,107],te=[1,108],ne=[1,109],re=[1,111],ie=[1,116],ae=[1,117],oe=[1,114],se=[1,115],le={trace:JH(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:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection("TB");break;case 18:r.setDirection("BT");break;case 19:r.setDirection("RL");break;case 20:r.setDirection("LR");break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:case 65:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},"anonymous"),table:[{3:1,4:2,6:t,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:t,9:n,11:r,13:i},{1:[2,2]},{4:17,5:o,7:13,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:o,7:42,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:43,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:44,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:45,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:46,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:47,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:48,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:49,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{4:17,5:o,7:50,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:c,23:u,24:h,25:23,33:25,41:d,42:p,43:f,44:g,45:m,46:y,54:v,72:b,74:x,77:w,89:E,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:_,89:E,90:k},{30:63,33:62,75:_,89:E,90:k},{30:64,33:62,75:_,89:E,90:k},e(C,[2,29]),e(C,[2,30]),e(C,[2,31]),e(C,[2,32]),e(C,[2,33]),e(C,[2,34]),e(S,[2,81]),e(S,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(A,[2,79]),e(A,[2,80]),{27:[1,67],29:[1,68]},e(A,[2,85]),e(A,[2,86]),{62:69,65:N,66:I,67:O,68:L,69:M,70:R,71:D},{62:77,65:N,66:I,67:O,68:L,69:M,70:R,71:D},{30:78,33:62,75:_,89:E,90:k},{73:79,75:P,76:$,78:81,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},e(V,[2,60]),e(V,[2,62]),{73:93,75:P,76:$,78:81,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},{30:94,33:62,75:_,76:$,89:E,90:k},{5:[1,95]},{30:96,33:62,75:_,89:E,90:k},{5:[1,97]},{30:98,33:62,75:_,89:E,90:k},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(T,[2,59],{76:$}),e(T,[2,64],{76:X}),{33:103,75:[1,102],89:E,90:k},e(K,[2,65],{79:104,75:P,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W}),e(Q,[2,67]),e(Q,[2,69]),e(Q,[2,70]),e(Q,[2,71]),e(Q,[2,72]),e(Q,[2,73]),e(Q,[2,74]),e(Q,[2,75]),e(Q,[2,76]),e(Q,[2,77]),e(Q,[2,78]),e(T,[2,57],{76:X}),e(T,[2,58],{76:$}),{5:Z,28:105,31:J,34:ee,36:te,38:ne,40:re},{27:[1,112],76:$},{5:ie,40:ae,56:113,57:oe,59:se},{27:[1,118],76:$},{33:119,89:E,90:k},{33:120,89:E,90:k},{75:P,78:121,79:82,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W},e(V,[2,61]),e(V,[2,63]),e(Q,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:J,34:ee,36:te,38:ne,40:re},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:ie,40:ae,56:130,57:oe,59:se},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(K,[2,66],{79:104,75:P,80:B,81:F,82:z,83:j,84:H,85:U,86:G,87:q,88:W}),{33:132,89:E,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:Z,28:145,31:J,34:ee,36:te,38:ne,40:re},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:ie,40:ae,56:152,57:oe,59:se},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:Z,28:159,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:160,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:161,31:J,34:ee,36:te,38:ne,40:re},{5:Z,28:162,31:J,34:ee,36:te,38:ne,40:re},{5:ie,40:ae,56:163,57:oe,59:se},{5:ie,40:ae,56:164,57:oe,59:se},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ce=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){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:case 58:case 65: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:case 14:case 15:case 56: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:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");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 66:return"qString";case 67:return t.yytext=t.yytext.trim(),89;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 e}();function ue(){this.yy={}}return le.lexer=ce,JH(ue,"Parser"),ue.prototype=le,le.Parser=ue,new ue}();wAe.parser=wAe;var EAe=wAe,kAe=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:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=zG,this.getAccTitle=jG,this.setAccDescription=HG,this.getAccDescription=UG,this.setDiagramTitle=GG,this.getDiagramTitle=qG,this.getConfig=JH(()=>YG().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{JH(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,t){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=e)}setNewReqText(e){void 0!==this.latestRequirement&&(this.latestRequirement.text=e)}setNewReqRisk(e){void 0!==this.latestRequirement&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),nU.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){void 0!==this.latestElement&&(this.latestElement.type=e)}setNewElementDocRef(e){void 0!==this.latestElement&&(this.latestElement.docRef=e)}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,FG()}setCssStyle(e,t){for(const n of e){const e=this.requirements.get(n)??this.elements.get(n);if(!t||!e)return;for(const n of t)n.includes(",")?e.cssStyles.push(...n.split(",")):e.cssStyles.push(n)}}setClass(e,t){for(const n of e){const e=this.requirements.get(n)??this.elements.get(n);if(e)for(const n of t){e.classes.push(n);const t=this.classes.get(n)?.styles;t&&e.cssStyles.push(...t)}}}defineClass(e,t){for(const n of e){let e=this.classes.get(n);void 0===e&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t&&t.forEach(function(t){if(/color/.exec(t)){const n=t.replace("fill","bgFill");e.textStyles.push(n)}e.styles.push(t)}),this.requirements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))}),this.elements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))})}}getClasses(){return this.classes}getData(){const e=YG(),t=[],n=[];for(const n of this.requirements.values()){const r=n;r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(" "),r.shape="requirementBox",r.look=e.look,t.push(r)}for(const n of this.elements.values()){const r=n;r.shape="requirementBox",r.look=e.look,r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(" "),t.push(r)}for(const t of this.relations){let r=0;const i=t.type===this.Relationships.CONTAINS,a={id:`${t.src}-${t.dst}-${r}`,start:this.requirements.get(t.src)?.name??this.elements.get(t.src)?.name,end:this.requirements.get(t.dst)?.name??this.elements.get(t.dst)?.name,label:`<<${t.type}>>`,classes:"relationshipLine",style:["fill:none",i?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:i?"normal":"dashed",arrowTypeStart:i?"requirement_contains":"",arrowTypeEnd:i?"":"requirement_arrow",look:e.look};n.push(a),r++}return{nodes:t,edges:n,other:{},config:e,direction:this.getDirection()}}},TAe=JH(e=>`\n\n marker {\n fill: ${e.relationColor};\n stroke: ${e.relationColor};\n }\n\n marker.cross {\n stroke: ${e.lineColor};\n }\n\n svg {\n font-family: ${e.fontFamily};\n font-size: ${e.fontSize};\n }\n\n .reqBox {\n fill: ${e.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${e.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${e.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${e.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${e.relationLabelColor};\n }\n .divider {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n`,"getStyles"),_Ae={};eU(_Ae,{draw:()=>CAe});var CAe=JH(async function(e,t,n,r){nU.info("REF0:"),nU.info("Drawing requirement diagram (unified)",t);const{securityLevel:i,state:a,layout:o}=YG(),s=r.db.getData(),l=che(t,i);s.type=r.type,s.layoutAlgorithm=Ate(o),s.nodeSpacing=a?.nodeSpacing??50,s.rankSpacing=a?.rankSpacing??50,s.markers=["requirement_contains","requirement_arrow"],s.diagramId=t,await Ste(s,l);B5.insertTitle(l,"requirementDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),uhe(l,8,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),SAe={parser:EAe,get db(){return new kAe},renderer:_Ae,styles:TAe},AAe=Object.freeze({__proto__:null,diagram:SAe}),NAe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,13],l=[1,14],c=[1,16],u=[1,17],h=[1,18],d=[1,24],p=[1,25],f=[1,26],g=[1,27],m=[1,28],y=[1,29],v=[1,30],b=[1,31],x=[1,32],w=[1,33],E=[1,34],k=[1,35],T=[1,36],_=[1,37],C=[1,38],S=[1,39],A=[1,41],N=[1,42],I=[1,43],O=[1,44],L=[1,45],M=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],D=[4,5,16,50,52,53],P=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],z=[68,69,70],j=[1,122],H={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",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",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,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],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 11:case 12:case 62:this.$=a[s];break;case 15:a[s].type="createParticipant",this.$=a[s];break;case 16:a[s-1].unshift({type:"boxStart",boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:"boxEnd",boxText:a[s-2]}),this.$=a[s-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 29:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 30:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:a[s-1].unshift({type:"loopStart",loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 35:a[s-1].unshift({type:"rectStart",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:"rectEnd",color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:"optStart",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:"altStart",altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:"parStart",parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:"parStart",parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:"criticalStart",criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:"breakStart",breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:"breakEnd",optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 43:this.$=a[s-3].concat([{type:"option",optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 45:this.$=a[s-3].concat([{type:"and",parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 47:this.$=a[s-3].concat([{type:"else",altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 48:a[s-3].draw="participant",a[s-3].type="addParticipant",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 49:a[s-1].draw="participant",a[s-1].type="addParticipant",this.$=a[s-1];break;case 50:a[s-3].draw="actor",a[s-3].type="addParticipant",a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 51:a[s-1].draw="actor",a[s-1].type="addParticipant",this.$=a[s-1];break;case 52:a[s-1].type="destroyParticipant",this.$=a[s-1];break;case 53:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 54:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 55:this.$=[a[s-1],{type:"addLinks",actor:a[s-1].actor,text:a[s]}];break;case 56:this.$=[a[s-1],{type:"addALink",actor:a[s-1].actor,text:a[s]}];break;case 57:this.$=[a[s-1],{type:"addProperties",actor:a[s-1].actor,text:a[s]}];break;case 58:this.$=[a[s-1],{type:"addDetails",actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-2],a[s]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 66:this.$=[a[s-4],a[s-1],{type:"addMessage",from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 67:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 68:this.$={type:"addParticipant",actor:a[s]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(a[s].trim().substring(1))}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,12:12,13:s,14:l,17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},e(R,[2,5]),{9:47,12:12,13:s,14:l,17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},e(R,[2,7]),e(R,[2,8]),e(R,[2,14]),{12:48,50:_,52:C,53:S},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:M},{22:55,70:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(R,[2,29]),e(R,[2,30]),{32:[1,61]},{34:[1,62]},e(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:M},{22:72,70:M},{22:73,70:M},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:M},{22:90,70:M},{22:91,70:M},{22:92,70:M},e([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),e(R,[2,6]),e(R,[2,15]),e(D,[2,9],{10:93}),e(R,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},e(R,[2,21]),{5:[1,97]},{5:[1,98]},e(R,[2,24]),e(R,[2,25]),e(R,[2,26]),e(R,[2,27]),e(R,[2,28]),e(R,[2,31]),e(R,[2,32]),e(P,i,{7:99}),e(P,i,{7:100}),e(P,i,{7:101}),e($,i,{40:102,7:103}),e(B,i,{42:104,7:105}),e(B,i,{7:105,42:106}),e(F,i,{45:107,7:108}),e(P,i,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:M},e(z,[2,69]),e(z,[2,70]),e(z,[2,71]),e(z,[2,72]),e(z,[2,73]),e(z,[2,74]),e(z,[2,75]),e(z,[2,76]),e(z,[2,77]),e(z,[2,78]),{22:118,70:M},{22:120,58:119,70:M},{70:[2,63]},{70:[2,64]},{56:121,81:j},{56:123,81:j},{56:124,81:j},{56:125,81:j},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:_,52:C,53:S},{5:[1,131]},e(R,[2,19]),e(R,[2,20]),e(R,[2,22]),e(R,[2,23]),{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,132],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,133],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,134],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,135]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,46],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,49:[1,136],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,137]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,44],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,48:[1,138],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{16:[1,139]},{16:[1,140]},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[2,42],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,47:[1,141],50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{4:a,5:o,8:8,9:10,12:12,13:s,14:l,16:[1,142],17:15,18:c,21:u,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:d,30:p,31:f,33:g,35:m,36:y,37:v,38:b,39:x,41:w,43:E,44:k,46:T,50:_,52:C,53:S,54:A,59:N,60:I,61:O,62:L,70:M},{15:[1,143]},e(R,[2,49]),{15:[1,144]},e(R,[2,51]),e(R,[2,52]),{22:145,70:M},{22:146,70:M},{56:147,81:j},{56:148,81:j},{56:149,81:j},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},e(R,[2,16]),e(D,[2,10]),{12:151,50:_,52:C,53:S},e(D,[2,12]),e(D,[2,13]),e(R,[2,18]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{15:[1,152]},e(R,[2,38]),{15:[1,153]},e(R,[2,39]),e(R,[2,40]),{15:[1,154]},e(R,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:j},{56:158,81:j},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:M},e(D,[2,11]),e($,i,{7:103,40:160}),e(B,i,{7:105,42:161}),e(F,i,{7:108,45:162}),e(R,[2,48]),e(R,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},U=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return t.yytext=t.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return t.yytext=t.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/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,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return e}();function G(){this.yy={}}return H.lexer=U,JH(G,"Parser"),G.prototype=H,H.Parser=G,new G}();NAe.parser=NAe;var IAe=NAe,OAe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},LAe={FILLED:0,OPEN:1},MAe={LEFTOF:0,RIGHTOF:1,OVER:2},RAe=class{constructor(){this.state=new Dhe(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=zG,this.setAccDescription=HG,this.setDiagramTitle=GG,this.getAccTitle=jG,this.getAccDescription=UG,this.getDiagramTitle=qG,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(YG().wrap),this.LINETYPE=OAe,this.ARROWTYPE=LAe,this.PLACEMENT=MAe}static{JH(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r){let i=this.state.records.currentBox;const a=this.state.records.actors.get(e);if(a){if(this.state.records.currentBox&&a.box&&this.state.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:this.state.records.currentBox,a.box=i,a&&t===a.name&&null==n)return}if(null==n?.text&&(n={text:t,type:r}),null!=r&&null!=n.text||(n={text:t,type:r}),this.state.records.actors.set(e,{box:i,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},t}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??"",wrap:n?.wrap??this.autoWrap(),type:r,activate:i}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.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(e){return this.state.records.actors.get(e)}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(e){this.state.records.wrapEnabled=e}extractWrap(e){if(void 0===e)return{};e=e.trim();const t=null!==/^:?wrap:/.exec(e)||null===/^:?nowrap:/.exec(e)&&void 0;return{cleanedText:(void 0===t?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:YG().sequence?.wrap??!1}clear(){this.state.reset(),FG()}parseMessage(e){const t=e.trim(),{wrap:n,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:n};return nU.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",n)||(n="transparent",r=e.trim());else{const t=(new Option).style;t.color=n,t.color!==n&&(n="transparent",r=e.trim())}const{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?oG(a,YG()):void 0,color:n,wrap:i}}addNote(e,t,n){const r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const n=this.getActor(e);try{let e=oG(t.text,YG());e=e.replace(/=/g,"="),e=e.replace(/&/g,"&");const r=JSON.parse(e);this.insertLinks(n,r)}catch(e){nU.error("error while parsing actor link text",e)}}addALink(e,t){const n=this.getActor(e);try{const e={};let r=oG(t.text,YG());const i=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const a=r.slice(0,i-1).trim(),o=r.slice(i+1).trim();e[a]=o,this.insertLinks(n,e)}catch(e){nU.error("error while parsing actor link text",e)}}insertLinks(e,t){if(null==e.links)e.links=t;else for(const n in t)e.links[n]=t[n]}addProperties(e,t){const n=this.getActor(e);try{const e=oG(t.text,YG()),r=JSON.parse(e);this.insertProperties(n,r)}catch(e){nU.error("error while parsing actor properties text",e)}}insertProperties(e,t){if(null==e.properties)e.properties=t;else for(const n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const n=this.getActor(e),r=document.getElementById(t.text);try{const e=r.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(n,t.properties),t.links&&this.insertLinks(n,t.links)}catch(e){nU.error("error while parsing actor details text",e)}}getActorProperty(e,t){if(void 0!==e?.properties)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"setAccTitle":zG(e.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType)}}getConfig(){return YG().sequence}},DAe=JH(e=>`.actor {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${e.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${e.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${e.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${e.signalColor};\n }\n\n #arrowhead path {\n fill: ${e.signalColor};\n stroke: ${e.signalColor};\n }\n\n .sequenceNumber {\n fill: ${e.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${e.signalColor};\n }\n\n #crosshead path {\n fill: ${e.signalColor};\n stroke: ${e.signalColor};\n }\n\n .messageText {\n fill: ${e.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${e.labelBoxBorderColor};\n fill: ${e.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${e.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${e.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${e.labelBoxBorderColor};\n fill: ${e.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${e.noteBorderColor};\n fill: ${e.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${e.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .activation1 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .activation2 {\n fill: ${e.activationBkgColor};\n stroke: ${e.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${e.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${e.actorBorder};\n fill: ${e.actorBkg};\n stroke-width: 2px;\n }\n`,"getStyles"),PAe="actor-top",$Ae="actor-bottom",BAe="actor-man",FAe=JH(function(e,t){return Ice(e,t)},"drawRect"),zAe=JH(function(e,t,n,r,i){if(void 0===t.links||null===t.links||0===Object.keys(t.links).length)return{height:0,width:0};const a=t.links,o=t.actorCnt,s=t.rectData;var l="none";i&&(l="block !important");const c=e.append("g");c.attr("id","actor"+o+"_popup"),c.attr("class","actorPopupMenu"),c.attr("display",l);var u="";void 0!==s.class&&(u=" "+s.class);let h=s.width>n?s.width:n;const d=c.append("rect");if(d.attr("class","actorPopupMenuPanel"+u),d.attr("x",s.x),d.attr("y",s.height),d.attr("fill",s.fill),d.attr("stroke",s.stroke),d.attr("width",h),d.attr("height",s.height),d.attr("rx",s.rx),d.attr("ry",s.ry),null!=a){var p=20;for(let e in a){var f=c.append("a"),g=MY(a[e]);f.attr("xlink:href",g),f.attr("target","_blank"),hNe(r)(e,f,s.x+10,s.height+p,h,20,{class:"actor"},r),p+=30}}return d.attr("height",p),{height:s.height+p,width:h}},"drawPopup"),jAe=JH(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),HAe=JH(async function(e,t,n=null){let r=e.append("foreignObject");const i=await TG(t.text,WU()),a=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(a.height)).attr("width",Math.round(a.width)),"noteText"===t.class){const n=e.node().firstChild;n.setAttribute("height",a.height+2*t.textMargin);const i=n.getBBox();r.attr("x",Math.round(i.x+i.width/2-a.width/2)).attr("y",Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:e,stopx:i,starty:o}=n;if(e>i){const t=e;e=i,i=t}r.attr("x",Math.round(e+Math.abs(e-i)/2-a.width/2)),"loopText"===t.class?r.attr("y",Math.round(o)):r.attr("y",Math.round(o-a.height))}return[r]},"drawKatex"),UAe=JH(function(e,t){let n=0,r=0;const i=t.text.split(_G.lineBreakRegex),[a,o]=P5(t.fontSize);let s=[],l=0,c=JH(()=>t.y,"yfunc");if(void 0!==t.valign&&void 0!==t.textMargin&&t.textMargin>0)switch(t.valign){case"top":case"start":c=JH(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":c=JH(()=>Math.round(t.y+(n+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":c=JH(()=>Math.round(t.y+(n+r+2*t.textMargin)-t.textMargin),"yfunc")}if(void 0!==t.anchor&&void 0!==t.textMargin&&void 0!==t.width)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"}for(let[u,h]of i.entries()){void 0!==t.textMargin&&0===t.textMargin&&void 0!==a&&(l=u*a);const i=e.append("text");i.attr("x",t.x),i.attr("y",c()),void 0!==t.anchor&&i.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),void 0!==t.fontFamily&&i.style("font-family",t.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==t.fontWeight&&i.style("font-weight",t.fontWeight),void 0!==t.fill&&i.attr("fill",t.fill),void 0!==t.class&&i.attr("class",t.class),void 0!==t.dy?i.attr("dy",t.dy):0!==l&&i.attr("dy",l);const d=h||"​";if(t.tspan){const e=i.append("tspan");e.attr("x",t.x),void 0!==t.fill&&e.attr("fill",t.fill),e.text(d)}else i.text(d);void 0!==t.valign&&void 0!==t.textMargin&&t.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),s.push(i)}return s},"drawText"),GAe=JH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}JH(n,"genPoints");const r=e.append("polygon");return r.attr("points",n(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,UAe(e,t),r},"drawLabel"),qAe=-1,WAe=JH((e,t,n,r)=>{e.select&&n.forEach(n=>{const i=t.get(n),a=e.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):r.mirrorActors&&a.attr("y2",i.stopy)})},"fixLifeLineHeights"),VAe=JH(function(e,t,n,r){const i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height,s=e.append("g").lower();var l=s;r||(qAe++,Object.keys(t.links||{}).length&&!n.forceMenus&&l.attr("onclick",jAe(`actor${qAe}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+qAe).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=s.append("g"),t.actorCnt=qAe,null!=t.links&&l.attr("id","root-"+qAe));const c=Dce();var u="actor";t.properties?.class?u=t.properties.class:c.fill="#eaeaea",u+=r?` ${$Ae}`:` ${PAe}`,c.x=t.x,c.y=i,c.width=t.width,c.height=t.height,c.class=u,c.rx=3,c.ry=3,c.name=t.name;const h=FAe(l,c);if(t.rectData=c,t.properties?.icon){const e=t.properties.icon.trim();"@"===e.charAt(0)?Rce(l,c.x+c.width-20,c.y+10,e.substr(1)):Mce(l,c.x+c.width-20,c.y+10,e)}uNe(n,EG(t.description))(t.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},n);let d=t.height;if(h.node){const e=h.node().getBBox();t.height=e.height,d=e.height}return d},"drawActorTypeParticipant"),YAe=JH(function(e,t,n,r){const i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+80,s=e.append("g").lower();r||(qAe++,s.append("line").attr("id","actor"+qAe).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=qAe);const l=e.append("g");let c=BAe;c+=r?` ${$Ae}`:` ${PAe}`,l.attr("class",c),l.attr("name",t.name);const u=Dce();u.x=t.x,u.y=i,u.fill="#eaeaea",u.width=t.width,u.height=t.height,u.class="actor",u.rx=3,u.ry=3,l.append("line").attr("id","actor-man-torso"+qAe).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+qAe).attr("x1",a-18).attr("y1",i+33).attr("x2",a+18).attr("y2",i+33),l.append("line").attr("x1",a-18).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+18-2).attr("y2",i+60);const h=l.append("circle");h.attr("cx",t.x+t.width/2),h.attr("cy",i+10),h.attr("r",15),h.attr("width",t.width),h.attr("height",t.height);const d=l.node().getBBox();return t.height=d.height,uNe(n,EG(t.description))(t.description,l,u.x,u.y+35,u.width,u.height,{class:`actor ${BAe}`},n),t.height},"drawActorTypeActor"),XAe=JH(async function(e,t,n,r){switch(t.type){case"actor":return await YAe(e,t,n,r);case"participant":return await VAe(e,t,n,r)}},"drawActor"),KAe=JH(function(e,t,n){const r=e.append("g");eNe(r,t),t.name&&uNe(n)(t.name,r,t.x,t.y+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},n),r.lower()},"drawBox"),QAe=JH(function(e){return e.append("g")},"anchorElement"),ZAe=JH(function(e,t,n,r,i){const a=Dce(),o=t.anchored;a.x=t.startx,a.y=t.starty,a.class="activation"+i%3,a.width=t.stopx-t.startx,a.height=n-t.starty,FAe(o,a)},"drawActivation"),JAe=JH(async function(e,t,n,r){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:s,messageFontFamily:l,messageFontSize:c,messageFontWeight:u}=r,h=e.append("g"),d=JH(function(e,t,n,r){return h.append("line").attr("x1",e).attr("y1",t).attr("x2",n).attr("y2",r).attr("class","loopLine")},"drawLoopLine");d(t.startx,t.starty,t.stopx,t.starty),d(t.stopx,t.starty,t.stopx,t.stopy),d(t.startx,t.stopy,t.stopx,t.stopy),d(t.startx,t.starty,t.startx,t.stopy),void 0!==t.sections&&t.sections.forEach(function(e){d(t.startx,e.y,t.stopx,e.y).style("stroke-dasharray","3, 3")});let p=Pce();p.text=n,p.x=t.startx,p.y=t.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=s||50,p.height=o||20,p.textMargin=a,p.class="labelText",GAe(h,p),p=lNe(),p.text=t.title,p.x=t.startx+s/2+(t.stopx-t.startx)/2,p.y=t.starty+i+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.wrap=!0;let f=EG(p.text)?await HAe(h,p,t):UAe(h,p);if(void 0!==t.sectionTitles)for(const[e,n]of Object.entries(t.sectionTitles))if(n.message){p.text=n.message,p.x=t.startx+(t.stopx-t.startx)/2,p.y=t.sections[e].y+i+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=u,p.wrap=t.wrap,EG(p.text)?(t.starty=t.sections[e].y,await HAe(h,p,t)):UAe(h,p);let r=Math.round(f.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));t.sections[e].height+=r-(i+a)}return t.height=Math.round(t.stopy-t.starty),h},"drawLoop"),eNe=JH(function(e,t){Oce(e,t)},"drawBackgroundRect"),tNe=JH(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),nNe=JH(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),rNe=JH(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),iNe=JH(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),aNe=JH(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),oNe=JH(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),sNe=JH(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),lNe=JH(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),cNe=JH(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),uNe=function(){function e(e,t,n,r,a,o,s){i(t.append("text").attr("x",n+a/2).attr("y",r+o/2+5).style("text-anchor","middle").text(e),s)}function t(e,t,n,r,a,o,s,l){const{actorFontSize:c,actorFontFamily:u,actorFontWeight:h}=l,[d,p]=P5(c),f=e.split(_G.lineBreakRegex);for(let e=0;ee.height||0))+(0===this.loops.length?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(0===this.messages.length?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(0===this.notes.length?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:JH(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:JH(function(e){this.boxes.push(e)},"addBox"),addActor:JH(function(e){this.actors.push(e)},"addActor"),addLoop:JH(function(e){this.loops.push(e)},"addLoop"),addMessage:JH(function(e){this.messages.push(e)},"addMessage"),addNote:JH(function(e){this.notes.push(e)},"addNote"),lastActor:JH(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:JH(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:JH(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:JH(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:JH(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,TNe(YG())},"init"),updateVal:JH(function(e,t,n,r){void 0===e[t]?e[t]=n:e[t]=r(n,e[t])},"updateVal"),updateBounds:JH(function(e,t,n,r){const i=this;let a=0;function o(o){return JH(function(s){a++;const l=i.sequenceItems.length-a+1;i.updateVal(s,"starty",t-l*pNe.boxMargin,Math.min),i.updateVal(s,"stopy",r+l*pNe.boxMargin,Math.max),i.updateVal(fNe.data,"startx",e-l*pNe.boxMargin,Math.min),i.updateVal(fNe.data,"stopx",n+l*pNe.boxMargin,Math.max),"activation"!==o&&(i.updateVal(s,"startx",e-l*pNe.boxMargin,Math.min),i.updateVal(s,"stopx",n+l*pNe.boxMargin,Math.max),i.updateVal(fNe.data,"starty",t-l*pNe.boxMargin,Math.min),i.updateVal(fNe.data,"stopy",r+l*pNe.boxMargin,Math.max))},"updateItemBounds")}JH(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:JH(function(e,t,n,r){const i=_G.getMin(e,n),a=_G.getMax(e,n),o=_G.getMin(t,r),s=_G.getMax(t,r);this.updateVal(fNe.data,"startx",i,Math.min),this.updateVal(fNe.data,"starty",o,Math.min),this.updateVal(fNe.data,"stopx",a,Math.max),this.updateVal(fNe.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),newActivation:JH(function(e,t,n){const r=n.get(e.from),i=_Ne(e.from).length||0,a=r.x+r.width/2+(i-1)*pNe.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+pNe.activationWidth,stopy:void 0,actor:e.from,anchored:dNe.anchorElement(t)})},"newActivation"),endActivation:JH(function(e){const t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:JH(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:JH(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:JH(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:JH(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:JH(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:fNe.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:JH(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:JH(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:JH(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=_G.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:JH(function(){return this.verticalPos},"getVerticalPos"),getBounds:JH(function(){return{bounds:this.data,models:this.models}},"getBounds")},gNe=JH(async function(e,t){fNe.bumpVerticalPos(pNe.boxMargin),t.height=pNe.boxMargin,t.starty=fNe.getVerticalPos();const n=Dce();n.x=t.startx,n.y=t.starty,n.width=t.width||pNe.width,n.class="note";const r=e.append("g"),i=dNe.drawRect(r,n),a=Pce();a.x=t.startx,a.y=t.starty,a.width=n.width,a.dy="1em",a.text=t.message,a.class="noteText",a.fontFamily=pNe.noteFontFamily,a.fontSize=pNe.noteFontSize,a.fontWeight=pNe.noteFontWeight,a.anchor=pNe.noteAlign,a.textMargin=pNe.noteMargin,a.valign="center";const o=EG(a.text)?await HAe(r,a):UAe(r,a),s=Math.round(o.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));i.attr("height",s+2*pNe.noteMargin),t.height+=s+2*pNe.noteMargin,fNe.bumpVerticalPos(s+2*pNe.noteMargin),t.stopy=t.starty+s+2*pNe.noteMargin,t.stopx=t.startx+n.width,fNe.insert(t.startx,t.starty,t.stopx,t.stopy),fNe.models.addNote(t)},"drawNote"),mNe=JH(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),yNe=JH(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),vNe=JH(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function bNe(e,t){fNe.bumpVerticalPos(10);const{startx:n,stopx:r,message:i}=t,a=_G.splitBreaks(i).length,o=EG(i),s=o?await kG(i,YG()):B5.calculateTextDimensions(i,mNe(pNe));if(!o){const e=s.height/a;t.height+=e,fNe.bumpVerticalPos(e)}let l,c=s.height-10;const u=s.width;if(n===r){l=fNe.getVerticalPos()+c,pNe.rightAngles||(c+=pNe.boxMargin,l=fNe.getVerticalPos()+c),c+=30;const e=_G.getMax(u/2,pNe.width/2);fNe.insert(n-e,fNe.getVerticalPos()-10+c,r+e,fNe.getVerticalPos()+30+c)}else c+=pNe.boxMargin,l=fNe.getVerticalPos()+c,fNe.insert(n,l-10,r,l);return fNe.bumpVerticalPos(c),t.height+=c,t.stopy=t.starty+t.height,fNe.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}JH(bNe,"boundMessage");var xNe=JH(async function(e,t,n,r){const{startx:i,stopx:a,starty:o,message:s,type:l,sequenceIndex:c,sequenceVisible:u}=t,h=B5.calculateTextDimensions(s,mNe(pNe)),d=Pce();d.x=i,d.y=o+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=s,d.fontFamily=pNe.messageFontFamily,d.fontSize=pNe.messageFontSize,d.fontWeight=pNe.messageFontWeight,d.anchor=pNe.messageAlign,d.valign="center",d.textMargin=pNe.wrapPadding,d.tspan=!1,EG(d.text)?await HAe(e,d,{startx:i,stopx:a,starty:n}):UAe(e,d);const p=h.width;let f;i===a?f=pNe.rightAngles?e.append("path").attr("d",`M ${i},${n} H ${i+_G.getMax(pNe.width/2,p/2)} V ${n+25} H ${i}`):e.append("path").attr("d","M "+i+","+n+" C "+(i+60)+","+(n-10)+" "+(i+60)+","+(n+30)+" "+i+","+(n+20)):(f=e.append("line"),f.attr("x1",i),f.attr("y1",n),f.attr("x2",a),f.attr("y2",n)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0");let g="";pNe.arrowMarkerAbsolute&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),f.attr("stroke-width",2),f.attr("stroke","none"),f.style("fill","none"),l!==r.db.LINETYPE.SOLID&&l!==r.db.LINETYPE.DOTTED||f.attr("marker-end","url("+g+"#arrowhead)"),l!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(f.attr("marker-start","url("+g+"#arrowhead)"),f.attr("marker-end","url("+g+"#arrowhead)")),l!==r.db.LINETYPE.SOLID_POINT&&l!==r.db.LINETYPE.DOTTED_POINT||f.attr("marker-end","url("+g+"#filled-head)"),l!==r.db.LINETYPE.SOLID_CROSS&&l!==r.db.LINETYPE.DOTTED_CROSS||f.attr("marker-end","url("+g+"#crosshead)"),(u||pNe.showSequenceNumbers)&&(f.attr("marker-start","url("+g+"#sequencenumber)"),e.append("text").attr("x",i).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))},"drawMessage"),wNe=JH(function(e,t,n,r,i,a,o){let s,l=0,c=0,u=0;for(const e of r){const r=t.get(e),a=r.box;s&&s!=a&&(o||fNe.models.addBox(s),c+=pNe.boxMargin+s.margin),a&&a!=s&&(o||(a.x=l+c,a.y=i),c+=a.margin),r.width=r.width||pNe.width,r.height=_G.getMax(r.height||pNe.height,pNe.height),r.margin=r.margin||pNe.actorMargin,u=_G.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=l+c,r.starty=fNe.getVerticalPos(),fNe.insert(r.x,i,r.x+r.width,r.height),l+=r.width+c,r.box&&(r.box.width=l+a.margin-r.box.x),c=r.margin,s=r.box,fNe.models.addActor(r)}s&&!o&&fNe.models.addBox(s),fNe.bumpVerticalPos(u)},"addActorRenderingData"),ENe=JH(async function(e,t,n,r){if(r){let r=0;fNe.bumpVerticalPos(2*pNe.boxMargin);for(const i of n){const n=t.get(i);n.stopy||(n.stopy=fNe.getVerticalPos());const a=await dNe.drawActor(e,n,pNe,!0);r=_G.getMax(r,a)}fNe.bumpVerticalPos(r+pNe.boxMargin)}else for(const r of n){const n=t.get(r);await dNe.drawActor(e,n,pNe,!1)}},"drawActors"),kNe=JH(function(e,t,n,r){let i=0,a=0;for(const o of n){const n=t.get(o),s=ONe(n),l=dNe.drawPopup(e,n,s,pNe,pNe.forceMenus,r);l.height>i&&(i=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),TNe=JH(function(e){gU(pNe,e),e.fontFamily&&(pNe.actorFontFamily=pNe.noteFontFamily=pNe.messageFontFamily=e.fontFamily),e.fontSize&&(pNe.actorFontSize=pNe.noteFontSize=pNe.messageFontSize=e.fontSize),e.fontWeight&&(pNe.actorFontWeight=pNe.noteFontWeight=pNe.messageFontWeight=e.fontWeight)},"setConf"),_Ne=JH(function(e){return fNe.activations.filter(function(t){return t.actor===e})},"actorActivations"),CNe=JH(function(e,t){const n=t.get(e),r=_Ne(e);return[r.reduce(function(e,t){return _G.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return _G.getMax(e,t.stopx)},n.x+n.width/2+1)]},"activationBounds");function SNe(e,t,n,r,i){fNe.bumpVerticalPos(n);let a=r;if(t.id&&t.message&&e[t.id]){const n=e[t.id].width,i=mNe(pNe);t.message=B5.wrapLabel(`[${t.message}]`,n-2*pNe.wrapPadding,i),t.width=n,t.wrap=!0;const o=B5.calculateTextDimensions(t.message,i),s=_G.getMax(o.height,pNe.labelBoxHeight);a=r+s,nU.debug(`${s} - ${t.message}`)}i(t),fNe.bumpVerticalPos(a)}function ANe(e,t,n,r,i,a,o){function s(n,r){n.x{e.add(t.from),e.add(t.to)}),f=f.filter(t=>e.has(t))}wNe(c,u,h,f,0,g,!1);const x=await DNe(g,u,b,r);function w(e,t){const n=fNe.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),dNe.drawActivation(c,n,t,pNe,_Ne(e.from).length),fNe.insert(n.startx,t-10,n.stopx,t)}dNe.insertArrowHead(c),dNe.insertArrowCrossHead(c),dNe.insertArrowFilledHead(c),dNe.insertSequenceNumber(c),JH(w,"activeEnd");let E=1,k=1;const T=[],_=[];let C=0;for(const e of g){let t,n,i;switch(e.type){case r.db.LINETYPE.NOTE:fNe.resetVerticalPos(),n=e.noteModel,await gNe(c,n);break;case r.db.LINETYPE.ACTIVE_START:fNe.newActivation(e,c,u);break;case r.db.LINETYPE.ACTIVE_END:w(e,fNe.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e));break;case r.db.LINETYPE.LOOP_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"loop",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin,e=>fNe.newLoop(void 0,e.message));break;case r.db.LINETYPE.RECT_END:t=fNe.endLoop(),_.push(t),fNe.models.addLoop(t),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos());break;case r.db.LINETYPE.OPT_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e));break;case r.db.LINETYPE.OPT_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"opt",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e));break;case r.db.LINETYPE.ALT_ELSE:SNe(x,e,pNe.boxMargin+pNe.boxTextMargin,pNe.boxMargin,e=>fNe.addSectionToLoop(e));break;case r.db.LINETYPE.ALT_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"alt",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e)),fNe.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:SNe(x,e,pNe.boxMargin+pNe.boxTextMargin,pNe.boxMargin,e=>fNe.addSectionToLoop(e));break;case r.db.LINETYPE.PAR_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"par",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:E=e.message.start||E,k=e.message.step||k,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e));break;case r.db.LINETYPE.CRITICAL_OPTION:SNe(x,e,pNe.boxMargin+pNe.boxTextMargin,pNe.boxMargin,e=>fNe.addSectionToLoop(e));break;case r.db.LINETYPE.CRITICAL_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"critical",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:SNe(x,e,pNe.boxMargin,pNe.boxMargin+pNe.boxTextMargin,e=>fNe.newLoop(e));break;case r.db.LINETYPE.BREAK_END:t=fNe.endLoop(),await dNe.drawLoop(c,t,"break",pNe),fNe.bumpVerticalPos(t.stopy-fNe.getVerticalPos()),fNe.models.addLoop(t);break;default:try{i=e.msgModel,i.starty=fNe.getVerticalPos(),i.sequenceIndex=E,i.sequenceVisible=r.db.showSequenceNumbers();const t=await bNe(0,i);ANe(e,i,t,C,u,h,d),T.push({messageModel:i,lineStartY:t}),fNe.models.addMessage(i)}catch(e){nU.error("error while drawing message",e)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(E+=k),C++}nU.debug("createdActors",h),nU.debug("destroyedActors",d),await ENe(c,u,f,!1);for(const e of T)await xNe(c,e.messageModel,e.lineStartY,r);pNe.mirrorActors&&await ENe(c,u,f,!0),_.forEach(e=>dNe.drawBackgroundRect(c,e)),WAe(c,u,f,pNe);for(const e of fNe.models.boxes)e.height=fNe.getVerticalPos()-e.y,fNe.insert(e.x,e.y,e.x+e.width,e.height),e.startx=e.x,e.starty=e.y,e.stopx=e.startx+e.width,e.stopy=e.starty+e.height,e.stroke="rgb(0,0,0, 0.5)",dNe.drawBox(c,e,pNe);y&&fNe.bumpVerticalPos(pNe.boxMargin);const S=kNe(c,u,f,l),{bounds:A}=fNe.getBounds();void 0===A.startx&&(A.startx=0),void 0===A.starty&&(A.starty=0),void 0===A.stopx&&(A.stopx=0),void 0===A.stopy&&(A.stopy=0);let N=A.stopy-A.starty;N{const n=mNe(pNe);let r=t.actorKeys.reduce((t,n)=>t+(e.get(n).width+(e.get(n).margin||0)),0);r-=2*pNe.boxTextMargin,t.wrap&&(t.name=B5.wrapLabel(t.name,r-2*pNe.wrapPadding,n));const a=B5.calculateTextDimensions(t.name,n);i=_G.getMax(a.height,i);const o=_G.getMax(r,a.width+2*pNe.wrapPadding);if(t.margin=pNe.boxTextMargin,re.textMaxHeight=i),_G.getMax(r,pNe.height)}JH(LNe,"calculateActorMargins");var MNe=JH(async function(e,t,n){const r=t.get(e.from),i=t.get(e.to),a=r.x,o=i.x,s=e.wrap&&e.message;let l=EG(e.message)?await kG(e.message,YG()):B5.calculateTextDimensions(s?B5.wrapLabel(e.message,pNe.width,yNe(pNe)):e.message,yNe(pNe));const c={width:s?pNe.width:_G.getMax(pNe.width,l.width+2*pNe.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===n.db.PLACEMENT.RIGHTOF?(c.width=s?_G.getMax(pNe.width,l.width):_G.getMax(r.width/2+i.width/2,l.width+2*pNe.noteMargin),c.startx=a+(r.width+pNe.actorMargin)/2):e.placement===n.db.PLACEMENT.LEFTOF?(c.width=s?_G.getMax(pNe.width,l.width+2*pNe.noteMargin):_G.getMax(r.width/2+i.width/2,l.width+2*pNe.noteMargin),c.startx=a-c.width+(r.width-pNe.actorMargin)/2):e.to===e.from?(l=B5.calculateTextDimensions(s?B5.wrapLabel(e.message,_G.getMax(pNe.width,r.width),yNe(pNe)):e.message,yNe(pNe)),c.width=s?_G.getMax(pNe.width,r.width):_G.getMax(r.width,pNe.width,l.width+2*pNe.noteMargin),c.startx=a+(r.width-c.width)/2):(c.width=Math.abs(a+r.width/2-(o+i.width/2))+pNe.actorMargin,c.startx=a2,h=JH(e=>s?-e:e,"adjustValue");e.from===e.to?c=l:(e.activate&&!u&&(c+=h(pNe.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(c+=h(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(l-=h(3)));const d=[r,i,a,o],p=Math.abs(l-c);e.wrap&&e.message&&(e.message=B5.wrapLabel(e.message,_G.getMax(p+2*pNe.wrapPadding,pNe.width),mNe(pNe)));const f=B5.calculateTextDimensions(e.message,mNe(pNe));return{width:_G.getMax(e.wrap?0:f.width+2*pNe.wrapPadding,p+2*pNe.wrapPadding,pNe.width),height:0,startx:l,stopx:c,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,d),toBounds:Math.max.apply(null,d)}},"buildMessageModel"),DNe=JH(async function(e,t,n,r){const i={},a=[];let o,s,l;for(const n of e){switch(n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(o=a.pop(),i[o.id]=o,i[n.id]=o,a.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=a.pop(),i[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{const e=t.get(n.from?n.from:n.to.actor),r=_Ne(n.from?n.from:n.to.actor).length,i=e.x+e.width/2+(r-1)*pNe.activationWidth/2,a={startx:i,stopx:i+pNe.activationWidth,actor:n.from,enabled:!0};fNe.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{const e=fNe.activations.map(e=>e.actor).lastIndexOf(n.from);fNe.activations.splice(e,1).splice(0,1)}}void 0!==n.placement?(s=await MNe(n,t,r),n.noteModel=s,a.forEach(e=>{o=e,o.from=_G.getMin(o.from,s.startx),o.to=_G.getMax(o.to,s.startx+s.width),o.width=_G.getMax(o.width,Math.abs(o.from-o.to))-pNe.labelBoxWidth})):(l=RNe(n,t,r),n.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(e=>{if(o=e,l.startx===l.stopx){const e=t.get(n.from),r=t.get(n.to);o.from=_G.getMin(e.x-l.width/2,e.x-e.width/2,o.from),o.to=_G.getMax(r.x+l.width/2,r.x+e.width/2,o.to),o.width=_G.getMax(o.width,Math.abs(o.to-o.from))-pNe.labelBoxWidth}else o.from=_G.getMin(l.startx,o.from),o.to=_G.getMax(l.stopx,o.to),o.width=_G.getMax(o.width,l.width)-pNe.labelBoxWidth}))}return fNe.activations=[],nU.debug("Loop type widths:",i),i},"calculateLoopBounds"),PNe={bounds:fNe,drawActors:ENe,drawActorsPopup:kNe,setConf:TNe,draw:NNe},$Ne={parser:IAe,get db(){return new RAe},renderer:PNe,styles:DAe,init:JH(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,XG({sequence:{wrap:e.wrap}}))},"init")},BNe=Object.freeze({__proto__:null,diagram:$Ne}),FNe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,18],n=[1,19],r=[1,20],i=[1,41],a=[1,42],o=[1,26],s=[1,24],l=[1,25],c=[1,32],u=[1,33],h=[1,34],d=[1,45],p=[1,35],f=[1,36],g=[1,37],m=[1,38],y=[1,27],v=[1,28],b=[1,29],x=[1,30],w=[1,31],E=[1,44],k=[1,46],T=[1,43],_=[1,47],C=[1,9],S=[1,8,9],A=[1,58],N=[1,59],I=[1,60],O=[1,61],L=[1,62],M=[1,63],R=[1,64],D=[1,8,9,41],P=[1,76],$=[1,8,9,12,13,22,39,41,44,66,67,68,69,70,71,72,77,79],B=[1,8,9,12,13,17,20,22,39,41,44,48,58,66,67,68,69,70,71,72,77,79,84,99,101,102],F=[13,58,84,99,101,102],z=[13,58,71,72,84,99,101,102],j=[13,58,66,67,68,69,70,84,99,101,102],H=[1,98],U=[1,115],G=[1,107],q=[1,113],W=[1,108],V=[1,109],Y=[1,110],X=[1,111],K=[1,112],Q=[1,114],Z=[22,58,59,80,84,85,86,87,88,89],J=[1,8,9,39,41,44],ee=[1,8,9,22],te=[1,143],ne=[1,8,9,59],re=[1,8,9,22,58,59,80,84,85,86,87,88,89],ie={trace:JH(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,DOT:17,className:18,classLiteralName: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,CLASS:46,ANNOTATION_START:47,ANNOTATION_END:48,MEMBER:49,SEPARATOR:50,relation:51,NOTE_FOR:52,noteText:53,NOTE:54,CLASSDEF:55,classList:56,stylesOpt:57,ALPHA:58,COMMA:59,direction_tb:60,direction_bt:61,direction_rl:62,direction_lr:63,relationType:64,lineType:65,AGGREGATION:66,EXTENSION:67,COMPOSITION:68,DEPENDENCY:69,LOLLIPOP:70,LINE:71,DOTTED_LINE:72,CALLBACK:73,LINK:74,LINK_TARGET:75,CLICK:76,CALLBACK_NAME:77,CALLBACK_ARGS:78,HREF:79,STYLE:80,CSSCLASS:81,style:82,styleComponent:83,NUM:84,COLON:85,UNIT:86,SPACE:87,BRKT:88,PCT:89,commentToken:90,textToken:91,graphCodeTokens:92,textNoTagsToken:93,TAGSTART:94,TAGEND:95,"==":96,"--":97,DEFAULT:98,MINUS:99,keywords:100,UNICODE_TEXT:101,BQUOTE_STR:102,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",17:"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:"CLASS",47:"ANNOTATION_START",48:"ANNOTATION_END",49:"MEMBER",50:"SEPARATOR",52:"NOTE_FOR",54:"NOTE",55:"CLASSDEF",58:"ALPHA",59:"COMMA",60:"direction_tb",61:"direction_bt",62:"direction_rl",63:"direction_lr",66:"AGGREGATION",67:"EXTENSION",68:"COMPOSITION",69:"DEPENDENCY",70:"LOLLIPOP",71:"LINE",72:"DOTTED_LINE",73:"CALLBACK",74:"LINK",75:"LINK_TARGET",76:"CLICK",77:"CALLBACK_NAME",78:"CALLBACK_ARGS",79:"HREF",80:"STYLE",81:"CSSCLASS",84:"NUM",85:"COLON",86:"UNIT",87:"SPACE",88:"BRKT",89:"PCT",92:"graphCodeTokens",94:"TAGSTART",95:"TAGEND",96:"==",97:"--",98:"DEFAULT",99:"MINUS",100:"keywords",101:"UNICODE_TEXT",102:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,3],[15,2],[18,1],[18,3],[18,1],[18,2],[18,2],[18,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],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,6],[43,2],[43,3],[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],[56,1],[56,3],[32,1],[32,1],[32,1],[32,1],[51,3],[51,2],[51,2],[51,1],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,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],[57,1],[57,3],[82,1],[82,2],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[93,1],[93,1],[93,1],[93,1],[16,1],[16,1],[16,1],[16,1],[19,1],[53,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 12:case 14:this.$=a[s];break;case 10:case 13:this.$=a[s-2]+"."+a[s];break;case 11:case 15:case 95:this.$=a[s-1]+a[s];break;case 16:case 17:this.$=a[s-1]+"~"+a[s]+"~";break;case 18:r.addRelation(a[s]);break;case 19:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 30:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 31:case 32:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 33:r.addClassesToNamespace(a[s-3],a[s-1]);break;case 34:r.addClassesToNamespace(a[s-4],a[s-1]);break;case 35:this.$=a[s],r.addNamespace(a[s]);break;case 36:case 46:case 59:case 92:this.$=[a[s]];break;case 37:this.$=[a[s-1]];break;case 38:a[s].unshift(a[s-2]),this.$=a[s];break;case 40:r.setCssClass(a[s-2],a[s]);break;case 41:r.addMembers(a[s-3],a[s-1]);break;case 42:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 43:this.$=a[s],r.addClass(a[s]);break;case 44:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 45:r.addAnnotation(a[s],a[s-2]);break;case 47:a[s].push(a[s-1]),this.$=a[s];break;case 48:case 50:case 51:break;case 49:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 52:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 53:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 54:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 55:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 56:r.addNote(a[s],a[s-1]);break;case 57:r.addNote(a[s]);break;case 58:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 60:this.$=a[s-2].concat([a[s]]);break;case 61:r.setDirection("TB");break;case 62:r.setDirection("BT");break;case 63:r.setDirection("RL");break;case 64:r.setDirection("LR");break;case 65:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 66:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 67:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 68:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 69:this.$=r.relationType.AGGREGATION;break;case 70:this.$=r.relationType.EXTENSION;break;case 71:this.$=r.relationType.COMPOSITION;break;case 72:this.$=r.relationType.DEPENDENCY;break;case 73:this.$=r.relationType.LOLLIPOP;break;case 74:this.$=r.lineType.LINE;break;case 75:this.$=r.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 77:case 83:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 78:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 79:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 80:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 81:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 84:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 85:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 86:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 87:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 88:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 89:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 90:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 91:r.setCssClass(a[s-1],a[s]);break;case 93:a[s-2].push(a[s]),this.$=a[s-2]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(C,[2,5],{8:[1,48]}),{8:[1,49]},e(S,[2,18],{22:[1,50]}),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(S,[2,23]),e(S,[2,24]),e(S,[2,25]),e(S,[2,26]),e(S,[2,27]),e(S,[2,28]),e(S,[2,29]),{34:[1,51]},{36:[1,52]},e(S,[2,32]),e(S,[2,48],{51:53,64:56,65:57,13:[1,54],22:[1,55],66:A,67:N,68:I,69:O,70:L,71:M,72:R}),{39:[1,65]},e(D,[2,39],{39:[1,67],44:[1,66]}),e(S,[2,50]),e(S,[2,51]),{16:68,58:d,84:E,99:k,101:T},{16:39,18:69,19:40,58:d,84:E,99:k,101:T,102:_},{16:39,18:70,19:40,58:d,84:E,99:k,101:T,102:_},{16:39,18:71,19:40,58:d,84:E,99:k,101:T,102:_},{58:[1,72]},{13:[1,73]},{16:39,18:74,19:40,58:d,84:E,99:k,101:T,102:_},{13:P,53:75},{56:77,58:[1,78]},e(S,[2,61]),e(S,[2,62]),e(S,[2,63]),e(S,[2,64]),e($,[2,12],{16:39,19:40,18:80,17:[1,79],20:[1,81],58:d,84:E,99:k,101:T,102:_}),e($,[2,14],{20:[1,82]}),{15:83,16:84,58:d,84:E,99:k,101:T},{16:39,18:85,19:40,58:d,84:E,99:k,101:T,102:_},e(B,[2,118]),e(B,[2,119]),e(B,[2,120]),e(B,[2,121]),e([1,8,9,12,13,20,22,39,41,44,66,67,68,69,70,71,72,77,79],[2,122]),e(C,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,18:21,38:22,43:23,16:39,19:40,5:86,33:t,35:n,37:r,42:i,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_}),{5:87,10:5,16:39,18:21,19:40,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,47:o,49:s,50:l,52:c,54:u,55:h,58:d,60:p,61:f,62:g,63:m,73:y,74:v,76:b,80:x,81:w,84:E,99:k,101:T,102:_},e(S,[2,19]),e(S,[2,30]),e(S,[2,31]),{13:[1,89],16:39,18:88,19:40,58:d,84:E,99:k,101:T,102:_},{51:90,64:56,65:57,66:A,67:N,68:I,69:O,70:L,71:M,72:R},e(S,[2,49]),{65:91,71:M,72:R},e(F,[2,68],{64:92,66:A,67:N,68:I,69:O,70:L}),e(z,[2,69]),e(z,[2,70]),e(z,[2,71]),e(z,[2,72]),e(z,[2,73]),e(j,[2,74]),e(j,[2,75]),{8:[1,94],24:95,40:93,43:23,46:a},{16:96,58:d,84:E,99:k,101:T},{45:97,49:H},{48:[1,99]},{13:[1,100]},{13:[1,101]},{77:[1,102],79:[1,103]},{22:U,57:104,58:G,80:q,82:105,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},{58:[1,116]},{13:P,53:117},e(S,[2,57]),e(S,[2,123]),{22:U,57:118,58:G,59:[1,119],80:q,82:105,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},e(Z,[2,59]),{16:39,18:120,19:40,58:d,84:E,99:k,101:T,102:_},e($,[2,15]),e($,[2,16]),e($,[2,17]),{39:[2,35]},{15:122,16:84,17:[1,121],39:[2,9],58:d,84:E,99:k,101:T},e(J,[2,43],{11:123,12:[1,124]}),e(C,[2,7]),{9:[1,125]},e(ee,[2,52]),{16:39,18:126,19:40,58:d,84:E,99:k,101:T,102:_},{13:[1,128],16:39,18:127,19:40,58:d,84:E,99:k,101:T,102:_},e(F,[2,67],{64:129,66:A,67:N,68:I,69:O,70:L}),e(F,[2,66]),{41:[1,130]},{24:95,40:131,43:23,46:a},{8:[1,132],41:[2,36]},e(D,[2,40],{39:[1,133]}),{41:[1,134]},{41:[2,46],45:135,49:H},{16:39,18:136,19:40,58:d,84:E,99:k,101:T,102:_},e(S,[2,76],{13:[1,137]}),e(S,[2,78],{13:[1,139],75:[1,138]}),e(S,[2,82],{13:[1,140],78:[1,141]}),{13:[1,142]},e(S,[2,90],{59:te}),e(ne,[2,92],{83:144,22:U,58:G,80:q,84:W,85:V,86:Y,87:X,88:K,89:Q}),e(re,[2,94]),e(re,[2,96]),e(re,[2,97]),e(re,[2,98]),e(re,[2,99]),e(re,[2,100]),e(re,[2,101]),e(re,[2,102]),e(re,[2,103]),e(re,[2,104]),e(S,[2,91]),e(S,[2,56]),e(S,[2,58],{59:te}),{58:[1,145]},e($,[2,13]),{15:146,16:84,58:d,84:E,99:k,101:T},{39:[2,11]},e(J,[2,44]),{13:[1,147]},{1:[2,4]},e(ee,[2,54]),e(ee,[2,53]),{16:39,18:148,19:40,58:d,84:E,99:k,101:T,102:_},e(F,[2,65]),e(S,[2,33]),{41:[1,149]},{24:95,40:150,41:[2,37],43:23,46:a},{45:151,49:H},e(D,[2,41]),{41:[2,47]},e(S,[2,45]),e(S,[2,77]),e(S,[2,79]),e(S,[2,80],{75:[1,152]}),e(S,[2,83]),e(S,[2,84],{13:[1,153]}),e(S,[2,86],{13:[1,155],75:[1,154]}),{22:U,58:G,80:q,82:156,83:106,84:W,85:V,86:Y,87:X,88:K,89:Q},e(re,[2,95]),e(Z,[2,60]),{39:[2,10]},{14:[1,157]},e(ee,[2,55]),e(S,[2,34]),{41:[2,38]},{41:[1,158]},e(S,[2,81]),e(S,[2,85]),e(S,[2,87]),e(S,[2,88],{75:[1,159]}),e(ne,[2,93],{83:144,22:U,58:G,80:q,84:W,85:V,86:Y,87:X,88:K,89:Q}),e(J,[2,8]),e(D,[2,42]),e(S,[2,89])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,35],122:[2,11],125:[2,4],135:[2,47],146:[2,10],150:[2,38]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},ae=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:JH(function(e,t,n,r){switch(n){case 0:return 60;case 1:return 61;case 2:return 62;case 3:return 63;case 4:case 5:case 14:case 31:case 36:case 40:case 47: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:case 19:case 22:case 24:case 58:case 61:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:case 35:return 8;case 15:case 16:return 7;case 17:case 37:case 45:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 77;case 23:return 78;case 25:return"STR";case 26:this.begin("string");break;case 27:return 80;case 28:return 55;case 29:return this.begin("namespace"),42;case 30:case 39:return this.popState(),8;case 32:return this.begin("namespace-body"),39;case 33:case 43:return this.popState(),41;case 34:case 44:return"EOF_IN_STRUCT";case 38:return this.begin("class"),46;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 46:return"OPEN_IN_STRUCT";case 48:return"MEMBER";case 49:return 81;case 50:return 73;case 51:return 74;case 52:return 76;case 53:return 52;case 54:return 54;case 55:return 47;case 56:return 48;case 57:return 79;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:case 65:case 66:case 67:return 75;case 68:case 69:return 67;case 70:case 71:return 69;case 72:return 68;case 73:return 66;case 74:return 70;case 75:return 71;case 76:return 72;case 77:return 22;case 78:return 44;case 79:return 99;case 80:return 17;case 81:return"PLUS";case 82:return 85;case 83:return 59;case 84:case 85:return 88;case 86:return 89;case 87:case 88:return"EQUALS";case 89:return 58;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 84;case 94:return 101;case 95:case 96:return 87;case 97: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]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return e}();function oe(){this.yy={}}return ie.lexer=ae,JH(oe,"Parser"),oe.prototype=ie,ie.Parser=oe,new oe}();FNe.parser=FNe;var zNe=FNe,jNe=["#","+","~","-",""],HNe=class{static{JH(this,"ClassMember")}constructor(e,t){this.memberType=t,this.visibility="",this.classifier="",this.text="";const n=oG(e,YG());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+mG(this.id);"method"===this.memberType&&(e+=`(${mG(this.parameters.trim())})`,this.returnType&&(e+=" : "+mG(this.returnType))),e=e.trim();return{displayText:e,cssStyle:this.parseClassifier()}}parseMember(e){let t="";if("method"===this.memberType){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){const e=n[1]?n[1].trim():"";if(jNe.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():"",t=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",""===t){const e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=e.length,r=e.substring(0,1),i=e.substring(n-1);jNe.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(""===this.visibility?0:1,""===t?n:n-1)}this.classifier=t,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${mG(this.id)}${"method"===this.memberType?`(${mG(this.parameters)})${this.returnType?" : "+mG(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},UNe="classId-",GNe=0,qNe=JH(e=>_G.sanitizeText(e,YG()),"sanitizeText"),WNe=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=JH(e=>{let t=TK(".mermaidTooltip");null===(t._groups||t)[0][0]&&(t=TK("body").append("div").attr("class","mermaidTooltip").style("opacity",0));TK(e).select("svg").selectAll("g.node").on("mouseover",e=>{const n=TK(e.currentTarget);if(null===n.attr("title"))return;const r=this.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.text(n.attr("title")).style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.top-14+document.body.scrollTop+"px"),t.html(t.html().replace(/<br\/>/g,"
    ")),n.classed("hover",!0)}).on("mouseout",e=>{t.transition().duration(500).style("opacity",0);TK(e.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=zG,this.getAccTitle=jG,this.setAccDescription=HG,this.getAccDescription=UG,this.setDiagramTitle=GG,this.getDiagramTitle=qG,this.getConfig=JH(()=>YG().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{JH(this,"ClassDB")}splitClassNameAndType(e){const t=_G.sanitizeText(e,YG());let n="",r=t;if(t.indexOf("~")>0){const e=t.split("~");r=qNe(e[0]),n=qNe(e[1])}return{className:r,type:n}}setClassLabel(e,t){const n=_G.sanitizeText(e,YG());t&&(t=qNe(t));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(e){const t=_G.sanitizeText(e,YG()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;const i=_G.sanitizeText(n,YG());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:UNe+i+"-"+GNe}),GNe++}addInterface(e,t){const n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}lookUpDomId(e){const t=_G.sanitizeText(e,YG());if(this.classes.has(t))return this.classes.get(t).domId;throw new Error("Class not found: "+t)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",FG()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(e){nU.debug("Adding relation: "+JSON.stringify(e));const t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1!==this.relationType.LOLLIPOP||t.includes(e.relation.type2)?e.relation.type2!==this.relationType.LOLLIPOP||t.includes(e.relation.type1)?(this.addClass(e.id1),this.addClass(e.id2)):(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2="interface"+(this.interfaces.length-1)):(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1="interface"+(this.interfaces.length-1)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=_G.sanitizeText(e.relationTitle1.trim(),YG()),e.relationTitle2=_G.sanitizeText(e.relationTitle2.trim(),YG()),this.relations.push(e)}addAnnotation(e,t){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);const n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if("string"==typeof t){const e=t.trim();e.startsWith("<<")&&e.endsWith(">>")?r.annotations.push(qNe(e.substring(2,e.length-2))):e.indexOf(")")>0?r.methods.push(new HNe(e,"method")):e&&r.members.push(new HNe(e,"attribute"))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){const n={id:`note${this.notes.length}`,class:t,text:e};this.notes.push(n)}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),qNe(e.trim())}setCssClass(e,t){e.split(",").forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=UNe+n);const r=this.classes.get(n);r&&(r.cssClasses+=" "+t)})}defineClass(e,t){for(const n of e){let e=this.styleClasses.get(n);void 0===e&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){const n=t.replace("fill","bgFill");e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(",")))})}}setTooltip(e,t){e.split(",").forEach(e=>{void 0!==t&&(this.classes.get(e).tooltip=qNe(t))})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){const r=YG();e.split(",").forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=UNe+i);const a=this.classes.get(i);a&&(a.link=B5.formatUrl(t,r),"sandbox"===r.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof n?qNe(n):"_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,t,n){e.split(",").forEach(e=>{this.setClickFunc(e,t,n),this.classes.get(e).haveCallback=!0}),this.setCssClass(e,"clickable")}setClickFunc(e,t,n){const r=_G.sanitizeText(e,YG());if("loose"!==YG().securityLevel)return;if(void 0===t)return;const i=r;if(this.classes.has(i)){const e=this.lookUpDomId(i);let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{const n=document.querySelector(`[id="${e}"]`);null!==n&&n.addEventListener("click",()=>{B5.runFunc(t,...r)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}getDirection(){return this.direction}setDirection(e){this.direction=e}addNamespace(e){this.namespaces.has(e)||(this.namespaces.set(e,{id:e,classes:new Map,children:{},domId:UNe+e+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t){if(this.namespaces.has(e))for(const n of t){const{className:t}=this.splitClassNameAndType(n);this.classes.get(t).parent=e,this.namespaces.get(e).classes.set(t,this.classes.get(t))}}setCssStyle(e,t){const n=this.classes.get(e);if(t&&n)for(const e of t)e.includes(",")?n.styles.push(...e.split(",")):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}getData(){const e=[],t=[],n=YG();for(const t of this.namespaces.keys()){const r=this.namespaces.get(t);if(r){const t={id:r.id,label:r.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:n.look};e.push(t)}}for(const t of this.classes.keys()){const r=this.classes.get(t);if(r){const t=r;t.parentId=r.parent,t.look=n.look,e.push(t)}}let r=0;for(const i of this.notes){r++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look};e.push(a);const o=this.classes.get(i.class)?.id??"";if(o){const e={id:`edgeNote${r}`,start:i.id,end:o,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};t.push(e)}}for(const t of this.interfaces){const r={id:t.id,label:t.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(r)}r=0;for(const e of this.relations){r++;const i={id:j5(e.id1,e.id2,{prefix:"id",counter:r}),start:e.id1,end:e.id2,type:"normal",label:e.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:"none"===e.relationTitle1?"":e.relationTitle1,endLabelLeft:"none"===e.relationTitle2?"":e.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:e.style||"",pattern:1==e.relation.lineType?"dashed":"solid",look:n.look};t.push(i)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},VNe=JH(e=>`g.classGroup text {\n fill: ${e.nodeBorder||e.classText};\n stroke: none;\n font-family: ${e.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${e.classText};\n}\n.edgeLabel .label rect {\n fill: ${e.mainBkg};\n}\n.label text {\n fill: ${e.classText};\n}\n\n.labelBkg {\n background: ${e.mainBkg};\n}\n.edgeLabel .label span {\n background: ${e.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${e.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${e.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${e.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: transparent !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n line-height: initial;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n}\n`,"getStyles"),YNe=JH((e,t="TB")=>{if(!e.doc)return t;let n=t;for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir"),XNe=JH(function(e,t){return t.db.getClasses()},"getClasses"),KNe=JH(async function(e,t,n,r){nU.info("REF0:"),nU.info("Drawing class diagram (v3)",t);const{securityLevel:i,state:a,layout:o}=YG(),s=r.db.getData(),l=che(t,i);s.type=r.type,s.layoutAlgorithm=Ate(o),s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["aggregation","extension","composition","dependency","lollipop"],s.diagramId=t,await Ste(s,l);B5.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),uhe(l,8,"classDiagram",a?.useMaxWidth??!0)},"draw"),QNe={getClasses:XNe,draw:KNe,getDir:YNe},ZNe={parser:zNe,get db(){return new WNe},renderer:QNe,styles:VNe,init:JH(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},JNe=Object.freeze({__proto__:null,diagram:ZNe}),eIe={parser:zNe,get db(){return new WNe},renderer:QNe,styles:VNe,init:JH(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},tIe=Object.freeze({__proto__:null,diagram:eIe}),nIe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,16],l=[1,17],c=[1,18],u=[1,19],h=[1,32],d=[1,20],p=[1,21],f=[1,22],g=[1,23],m=[1,24],y=[1,26],v=[1,27],b=[1,28],x=[1,29],w=[1,30],E=[1,31],k=[1,34],T=[1,35],_=[1,36],C=[1,37],S=[1,33],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],N=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],O={trace:JH(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,"--\x3e":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,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",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:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"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],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:"nl"!=a[s]&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:case 12:this.$=a[s];break;case 8:this.$="nl";break;case 13:const e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:"relation",state1:a[s-2],state2:a[s]};break;case 15:const t=r.trimColon(a[s]);this.$={stmt:"relation",state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:"state",id:a[s-3],type:"default",description:"",doc:a[s-1]};break;case 20:var l=a[s],c=a[s-2].trim();if(a[s].match(":")){var u=a[s].split(":");l=u[0],c=[c,u[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:a[s-3],type:"default",description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:"state",id:a[s],type:"fork"};break;case 23:this.$={stmt:"state",id:a[s],type:"join"};break;case 24:this.$={stmt:"state",id:a[s],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[s-1].trim(),classes:a[s].trim()};break;case 34:this.$={stmt:"style",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 35:this.$={stmt:"applyClass",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 36:r.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[s].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:a[s-2].trim(),classes:[a[s].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:s,17:l,19:c,22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,39],15:[1,40]}),e(A,[2,16]),{18:[1,41]},e(A,[2,18],{20:[1,42]}),{23:[1,43]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},e(A,[2,28]),{34:[1,48]},{36:[1,49]},e(A,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},e(N,[2,42],{55:[1,54]}),e(N,[2,43],{55:[1,55]}),e(A,[2,36]),e(A,[2,37]),e(A,[2,38]),e(A,[2,39]),e(A,[2,6]),e(A,[2,13]),{13:56,24:h,54:S},e(A,[2,17]),e(I,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},e(A,[2,29]),e(A,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},e(A,[2,14],{14:[1,67]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,21:[1,68],22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},e(A,[2,32]),e(A,[2,33]),e(A,[2,34]),e(A,[2,35]),e(N,[2,44]),e(N,[2,45]),e(A,[2,15]),e(A,[2,19]),e(I,i,{7:72}),e(A,[2,26]),e(A,[2,27]),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:c,21:[1,73],22:u,24:h,25:d,26:p,27:f,28:g,29:m,32:25,33:y,35:v,37:b,38:x,42:w,45:E,48:k,49:T,50:_,51:C,54:S},e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},L=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),t.yytext=t.yytext.substr(2).trim(),31;case 67:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return t.yytext=t.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}},"anonymous"),rules:[/^(?: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,/^(?:[^\}]%%[^\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,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return e}();function M(){this.yy={}}return O.lexer=L,JH(M,"Parser"),M.prototype=O,O.Parser=M,new M}();nIe.parser=nIe;var rIe=nIe,iIe="state",aIe="relation",oIe="default",sIe="divider",lIe="fill:none",cIe="fill: #333",uIe="text",hIe="normal",dIe="rect",pIe="rectWithTitle",fIe="divider",gIe="roundedWithTitle",mIe="statediagram",yIe=`${mIe}-state`,vIe="transition",bIe=`${vIe} note-edge`,xIe=`${mIe}-note`,wIe=`${mIe}-cluster`,EIe=`${mIe}-cluster-alt`,kIe="parent",TIe="note",_Ie="----",CIe=`${_Ie}${TIe}`,SIe=`${_Ie}${kIe}`,AIe=JH((e,t="TB")=>{if(!e.doc)return t;let n=t;for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir"),NIe=JH(function(e,t){return t.db.getClasses()},"getClasses"),IIe=JH(async function(e,t,n,r){nU.info("REF0:"),nU.info("Drawing state diagram (v2)",t);const{securityLevel:i,state:a,layout:o}=YG();r.db.extract(r.db.getRootDocV2());const s=r.db.getData(),l=che(t,i);s.type=r.type,s.layoutAlgorithm=o,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["barb"],s.diagramId=t,await Ste(s,l);B5.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),uhe(l,8,mIe,a?.useMaxWidth??!0)},"draw"),OIe={getClasses:NIe,draw:IIe,getDir:AIe},LIe=new Map,MIe=0;function RIe(e="",t=0,n="",r=_Ie){return`state-${e}${null!==n&&n.length>0?`${r}${n}`:""}-${t}`}JH(RIe,"stateDomId");var DIe=JH((e,t,n,r,i,a,o,s)=>{nU.trace("items",t),t.forEach(t=>{switch(t.stmt){case iIe:case oIe:zIe(e,t,n,r,i,a,o,s);break;case aIe:{zIe(e,t.state1,n,r,i,a,o,s),zIe(e,t.state2,n,r,i,a,o,s);const l={id:"edge"+MIe,start:t.state1.id,end:t.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:lIe,labelStyle:"",label:_G.sanitizeText(t.description,YG()),arrowheadStyle:cIe,labelpos:"c",labelType:uIe,thickness:hIe,classes:vIe,look:o};i.push(l),MIe++}}})},"setupDoc"),PIe=JH((e,t="TB")=>{let n=t;if(e.doc)for(const t of e.doc)"dir"===t.stmt&&(n=t.value);return n},"getDir");function $Ie(e,t,n){if(!t.id||""===t.id||""===t.id)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(" ").forEach(e=>{if(n.get(e)){const r=n.get(e);t.cssCompiledStyles=[...t.cssCompiledStyles,...r.styles]}}));const r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}function BIe(e){return e?.classes?.join(" ")??""}function FIe(e){return e?.styles??[]}JH($Ie,"insertOrUpdateNode"),JH(BIe,"getClassesFromDbInfo"),JH(FIe,"getStylesFromDbInfo");var zIe=JH((e,t,n,r,i,a,o,s)=>{const l=t.id,c=n.get(l),u=BIe(c),h=FIe(c);if(nU.info("dataFetcher parsedItem",t,c,h),"root"!==l){let n=dIe;!0===t.start?n="stateStart":!1===t.start&&(n="stateEnd"),t.type!==oIe&&(n=t.type),LIe.get(l)||LIe.set(l,{id:l,shape:n,description:_G.sanitizeText(l,YG()),cssClasses:`${u} ${yIe}`,cssStyles:h});const c=LIe.get(l);t.description&&(Array.isArray(c.description)?(c.shape=pIe,c.description.push(t.description)):c.description?.length>0?(c.shape=pIe,c.description===l?c.description=[t.description]:c.description=[c.description,t.description]):(c.shape=dIe,c.description=t.description),c.description=_G.sanitizeTextOrArray(c.description,YG())),1===c.description?.length&&c.shape===pIe&&("group"===c.type?c.shape=gIe:c.shape=dIe),!c.type&&t.doc&&(nU.info("Setting cluster for XCX",l,PIe(t)),c.type="group",c.isGroup=!0,c.dir=PIe(t),c.shape=t.type===sIe?fIe:gIe,c.cssClasses=`${c.cssClasses} ${wIe} ${a?EIe:""}`);const d={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:RIe(l,MIe),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:o};if(d.shape===fIe&&(d.label=""),e&&"root"!==e.id&&(nU.trace("Setting node ",l," to be child of its parent ",e.id),d.parentId=e.id),d.centerLabel=!0,t.note){const e={labelStyle:"",shape:"note",label:t.note.text,cssClasses:xIe,cssStyles:[],cssCompilesStyles:[],id:l+CIe+"-"+MIe,domId:RIe(l,MIe,TIe),type:c.type,isGroup:"group"===c.type,padding:YG().flowchart.padding,look:o,position:t.note.position},n=l+SIe,a={labelStyle:"",shape:"noteGroup",label:t.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+SIe,domId:RIe(l,MIe,kIe),type:"group",isGroup:!0,padding:16,look:o,position:t.note.position};MIe++,a.id=n,e.parentId=n,$Ie(r,a,s),$Ie(r,e,s),$Ie(r,d,s);let u=l,h=e.id;"left of"===t.note.position&&(u=e.id,h=l),i.push({id:u+"-"+h,start:u,end:h,arrowhead:"none",arrowTypeEnd:"",style:lIe,labelStyle:"",classes:bIe,arrowheadStyle:cIe,labelpos:"c",labelType:uIe,thickness:hIe,look:o})}else $Ie(r,d,s)}t.doc&&(nU.trace("Adding nodes children "),DIe(t,t.doc,n,r,i,!a,o,s))},"dataFetcher"),jIe=JH(()=>{LIe.clear(),MIe=0},"reset"),HIe="[*]",UIe="start",GIe=HIe,qIe="color",WIe="fill";function VIe(){return new Map}JH(VIe,"newClassesList");var YIe,XIe=JH(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),KIe=JH(e=>JSON.parse(JSON.stringify(e)),"clone"),QIe=class{static{JH(this,"StateDB")}constructor(e){this.clear(),this.version=e,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=VIe();documents={root:XIe()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(e){nU.info("Setting root doc",e),this.rootDoc=e,1===this.version?this.extract(e):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(e,t,n){if(t.stmt===aIe)this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);else if(t.stmt===iIe&&("[*]"===t.id?(t.id=n?e.id+"_start":e.id+"_end",t.start=n):t.id=t.id.trim()),t.doc){const e=[];let n,r=[];for(n=0;n0&&r.length>0){const n={stmt:iIe,id:w5(),type:"divider",doc:KIe(r)};e.push(KIe(n)),t.doc=e}t.doc.forEach(e=>this.docTranslator(t,e,!0))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(e){let t;t=e.doc?e.doc:e,nU.info(t),this.clear(!0),nU.info("Extract initial document:",t),t.forEach(e=>{switch(nU.warn("Statement",e.stmt),e.stmt){case iIe:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles);break;case aIe:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":{const t=e.id.trim().split(","),n=e.styleClass.split(",");t.forEach(e=>{let t=this.getState(e);if(void 0===t){const n=e.trim();this.addState(n),t=this.getState(n)}t.styles=n.map(e=>e.replace(/;/g,"")?.trim())})}break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass)}});const n=this.getStates(),r=YG().look;jIe(),zIe(void 0,this.getRootDocV2(),n,this.nodes,this.edges,!0,r,this.classes),this.nodes.forEach(e=>{if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+e.id+"]");e.label=e.label[0]}})}addState(e,t=oIe,n=null,r=null,i=null,a=null,o=null,s=null){const l=e?.trim();if(this.currentDocument.states.has(l)?(this.currentDocument.states.get(l).doc||(this.currentDocument.states.get(l).doc=n),this.currentDocument.states.get(l).type||(this.currentDocument.states.get(l).type=t)):(nU.info("Adding state ",l,r),this.currentDocument.states.set(l,{id:l,descriptions:[],type:t,doc:n,note:i,classes:[],styles:[],textStyles:[]})),r&&(nU.info("Setting state description",l,r),"string"==typeof r&&this.addDescription(l,r.trim()),"object"==typeof r&&r.forEach(e=>this.addDescription(l,e.trim()))),i){const e=this.currentDocument.states.get(l);e.note=i,e.note.text=_G.sanitizeText(e.note.text,YG())}if(a){nU.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach(e=>this.setCssClass(l,e.trim()))}if(o){nU.info("Setting state styles",l,o);("string"==typeof o?[o]:o).forEach(e=>this.setStyle(l,e.trim()))}if(s){nU.info("Setting state styles",l,o);("string"==typeof s?[s]:s).forEach(e=>this.setTextStyle(l,e.trim()))}}clear(e){this.nodes=[],this.edges=[],this.documents={root:XIe()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=VIe(),e||FG()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){nU.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(e=""){let t=e;return e===HIe&&(this.startEndCount++,t=`${UIe}${this.startEndCount}`),t}startTypeIfNeeded(e="",t=oIe){return e===HIe?UIe:t}endIdIfNeeded(e=""){let t=e;return e===GIe&&(this.startEndCount++,t=`end${this.startEndCount}`),t}endTypeIfNeeded(e="",t=oIe){return e===GIe?"end":t}addRelationObjs(e,t,n){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:_G.sanitizeText(n,YG())})}addRelation(e,t,n){if("object"==typeof e)this.addRelationObjs(e,t,n);else{const r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,title:_G.sanitizeText(n,YG())})}}addDescription(e,t){const n=this.currentDocument.states.get(e),r=t.startsWith(":")?t.replace(":","").trim():t;n.descriptions.push(_G.sanitizeText(r,YG()))}cleanupLabel(e){return":"===e.substring(0,1)?e.substr(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(e,t=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(qIe).exec(e)){const e=t.replace(WIe,"bgFill").replace(qIe,WIe);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setCssClass(e,t){e.split(",").forEach(e=>{let n=this.getState(e);if(void 0===n){const t=e.trim();this.addState(t),n=this.getState(t)}n.classes.push(t)})}setStyle(e,t){const n=this.getState(e);void 0!==n&&n.styles.push(t)}setTextStyle(e,t){const n=this.getState(e);void 0!==n&&n.textStyles.push(t)}getDirectionStatement(){return this.rootDoc.find(e=>"dir"===e.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(e){const t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:"dir",value:e})}trimColon(e){return e&&":"===e[0]?e.substr(1).trim():e.trim()}getData(){const e=YG();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:AIe(this.getRootDocV2())}}getConfig(){return YG().state}getAccTitle=jG;setAccTitle=zG;getAccDescription=UG;setAccDescription=HG;setDiagramTitle=GG;getDiagramTitle=qG},ZIe=JH(e=>`\ndefs #statediagram-barbEnd {\n fill: ${e.transitionColor};\n stroke: ${e.transitionColor};\n }\ng.stateGroup text {\n fill: ${e.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${e.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${e.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${e.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${e.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${e.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${e.noteBorderColor};\n fill: ${e.noteBkgColor};\n\n text {\n fill: ${e.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${e.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${e.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${e.transitionLabelColor||e.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${e.transitionLabelColor||e.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${e.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${e.specialStateColor};\n stroke: ${e.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${e.specialStateColor};\n stroke: ${e.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${e.innerEndBackground};\n stroke: ${e.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${e.compositeBackground||e.background};\n // stroke: ${e.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${e.stateBkg||e.mainBkg};\n stroke: ${e.stateBorder||e.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${e.mainBkg};\n stroke: ${e.stateBorder||e.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${e.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${e.compositeTitleBackground};\n stroke: ${e.stateBorder||e.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${e.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${e.stateBorder||e.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${e.compositeBackground||e.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${e.altBackground?e.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${e.altBackground?e.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${e.noteBkgColor};\n stroke: ${e.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${e.noteBkgColor};\n stroke: ${e.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${e.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${e.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${e.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${e.lineColor};\n stroke: ${e.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n}\n`,"getStyles"),JIe={},eOe=JH((e,t)=>{JIe[e]=t},"set"),tOe=JH(e=>JIe[e],"get"),nOe=JH(()=>Object.keys(JIe),"keys"),rOe=JH(()=>nOe().length,"size"),iOe={get:tOe,set:eOe,keys:nOe,size:rOe},aOe=JH(e=>e.append("circle").attr("class","start-state").attr("r",YG().state.sizeUnit).attr("cx",YG().state.padding+YG().state.sizeUnit).attr("cy",YG().state.padding+YG().state.sizeUnit),"drawStartState"),oOe=JH(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",YG().state.textHeight).attr("class","divider").attr("x2",2*YG().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),sOe=JH((e,t)=>{const n=e.append("text").attr("x",2*YG().state.padding).attr("y",YG().state.textHeight+2*YG().state.padding).attr("font-size",YG().state.fontSize).attr("class","state-title").text(t.id),r=n.node().getBBox();return e.insert("rect",":first-child").attr("x",YG().state.padding).attr("y",YG().state.padding).attr("width",r.width+2*YG().state.padding).attr("height",r.height+2*YG().state.padding).attr("rx",YG().state.radius),n},"drawSimpleState"),lOe=JH((e,t)=>{const n=JH(function(e,t,n){const r=e.append("tspan").attr("x",2*YG().state.padding).text(t);n||r.attr("dy",YG().state.textHeight)},"addTspan"),r=e.append("text").attr("x",2*YG().state.padding).attr("y",YG().state.textHeight+1.3*YG().state.padding).attr("font-size",YG().state.fontSize).attr("class","state-title").text(t.descriptions[0]).node().getBBox(),i=r.height,a=e.append("text").attr("x",YG().state.padding).attr("y",i+.4*YG().state.padding+YG().state.dividerMargin+YG().state.textHeight).attr("class","state-description");let o=!0,s=!0;t.descriptions.forEach(function(e){o||(n(a,e,s),s=!1),o=!1});const l=e.append("line").attr("x1",YG().state.padding).attr("y1",YG().state.padding+i+YG().state.dividerMargin/2).attr("y2",YG().state.padding+i+YG().state.dividerMargin/2).attr("class","descr-divider"),c=a.node().getBBox(),u=Math.max(c.width,r.width);return l.attr("x2",u+3*YG().state.padding),e.insert("rect",":first-child").attr("x",YG().state.padding).attr("y",YG().state.padding).attr("width",u+2*YG().state.padding).attr("height",c.height+i+2*YG().state.padding).attr("rx",YG().state.radius),e},"drawDescrState"),cOe=JH((e,t,n)=>{const r=YG().state.padding,i=2*YG().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append("text").attr("x",0).attr("y",YG().state.titleShift).attr("font-size",YG().state.fontSize).attr("class","state-title").text(t.id),c=l.node().getBBox().width+i;let u,h=Math.max(c,o);h===o&&(h+=i);const d=e.node().getBBox();t.doc,u=s-r,c>o&&(u=(o-h)/2+r),Math.abs(s-d.x)o&&(u=s-(c-o)/2);const p=1-YG().state.textHeight;return e.insert("rect",":first-child").attr("x",u).attr("y",p).attr("class",n?"alt-composit":"composit").attr("width",h).attr("height",d.height+YG().state.textHeight+YG().state.titleShift+1).attr("rx","0"),l.attr("x",u+r),c<=o&&l.attr("x",s+(h-i)/2-c/2+r),e.insert("rect",":first-child").attr("x",u).attr("y",YG().state.titleShift-YG().state.textHeight-YG().state.padding).attr("width",h).attr("height",3*YG().state.textHeight).attr("rx",YG().state.radius),e.insert("rect",":first-child").attr("x",u).attr("y",YG().state.titleShift-YG().state.textHeight-YG().state.padding).attr("width",h).attr("height",d.height+3+2*YG().state.textHeight).attr("rx",YG().state.radius),e},"addTitleAndBox"),uOe=JH(e=>(e.append("circle").attr("class","end-state-outer").attr("r",YG().state.sizeUnit+YG().state.miniPadding).attr("cx",YG().state.padding+YG().state.sizeUnit+YG().state.miniPadding).attr("cy",YG().state.padding+YG().state.sizeUnit+YG().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",YG().state.sizeUnit).attr("cx",YG().state.padding+YG().state.sizeUnit+2).attr("cy",YG().state.padding+YG().state.sizeUnit+2)),"drawEndState"),hOe=JH((e,t)=>{let n=YG().state.forkWidth,r=YG().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",YG().state.padding).attr("y",YG().state.padding)},"drawForkJoinState"),dOe=JH((e,t,n,r)=>{let i=0;const a=r.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let o=e.replace(/\r\n/g,"
    ");o=o.replace(/\n/g,"
    ");const s=o.split(_G.lineBreakRegex);let l=1.25*YG().state.noteMargin;for(const e of s){const r=e.trim();if(r.length>0){const e=a.append("tspan");if(e.text(r),0===l){l+=e.node().getBBox().height}i+=l,e.attr("x",t+YG().state.noteMargin),e.attr("y",n+i+1.25*YG().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),pOe=JH((e,t)=>{t.attr("class","state-note");const n=t.append("rect").attr("x",0).attr("y",YG().state.padding),r=t.append("g"),{textWidth:i,textHeight:a}=dOe(e,0,0,r);return n.attr("height",a+2*YG().state.noteMargin),n.attr("width",i+2*YG().state.noteMargin),n},"drawNote"),fOe=JH(function(e,t){const n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append("g").attr("id",n).attr("class","stateGroup");"start"===t.type&&aOe(i),"end"===t.type&&uOe(i),"fork"!==t.type&&"join"!==t.type||hOe(i,t),"note"===t.type&&pOe(t.note.text,i),"divider"===t.type&&oOe(i),"default"===t.type&&0===t.descriptions.length&&sOe(i,t),"default"===t.type&&t.descriptions.length>0&&lOe(i,t);const a=i.node().getBBox();return r.width=a.width+2*YG().state.padding,r.height=a.height+2*YG().state.padding,iOe.set(n,r),r},"drawState"),gOe=0,mOe=JH(function(e,t,n){const r=JH(function(e){switch(e){case QIe.relationType.AGGREGATION:return"aggregation";case QIe.relationType.EXTENSION:return"extension";case QIe.relationType.COMPOSITION:return"composition";case QIe.relationType.DEPENDENCY:return"dependency"}},"getRelationType");t.points=t.points.filter(e=>!Number.isNaN(e.y));const i=t.points,a=c2().x(function(e){return e.x}).y(function(e){return e.y}).curve(v2),o=e.append("path").attr("d",a(i)).attr("id","edge"+gOe).attr("class","transition");let s="";if(YG().state.arrowMarkerAbsolute&&(s=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,s=s.replace(/\(/g,"\\("),s=s.replace(/\)/g,"\\)")),o.attr("marker-end","url("+s+"#"+r(QIe.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const r=e.append("g").attr("class","stateLabel"),{x:i,y:a}=B5.calcLabelPosition(t.points),o=_G.getRows(n.title);let s=0;const l=[];let c=0,u=0;for(let e=0;e<=o.length;e++){const t=r.append("text").attr("text-anchor","middle").text(o[e]).attr("x",i).attr("y",a+s),n=t.node().getBBox();if(c=Math.max(c,n.width),u=Math.min(u,n.x),nU.info(n.x,i,a+s),0===s){const e=t.node().getBBox();s=e.height,nU.info("Title height",s,a)}l.push(t)}let h=s*o.length;if(o.length>1){const e=(o.length-1)*s*.5;l.forEach((t,n)=>t.attr("y",a+n*s-e)),h=s*o.length}const d=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-YG().state.padding/2).attr("y",a-h/2-YG().state.padding/2-3.5).attr("width",c+YG().state.padding).attr("height",h+YG().state.padding),nU.info(d)}gOe++},"drawEdge"),yOe={},vOe=JH(function(){},"setConf"),bOe=JH(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),xOe=JH(function(e,t,n,r){YIe=YG().state;const i=YG().securityLevel;let a;"sandbox"===i&&(a=TK("#i"+t));const o=TK("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),s="sandbox"===i?a.nodes()[0].contentDocument:document;nU.debug("Rendering diagram "+e);const l=o.select(`[id='${t}']`);bOe(l);const c=r.db.getRootDoc();EOe(c,l,void 0,!1,o,s,r);const u=YIe.padding,h=l.node().getBBox(),d=h.width+2*u,p=h.height+2*u;AG(l,p,1.75*d,YIe.useMaxWidth),l.attr("viewBox",`${h.x-YIe.padding} ${h.y-YIe.padding} `+d+" "+p)},"draw"),wOe=JH(e=>e?e.length*YIe.fontSizeFactor:1,"getLabelWidth"),EOe=JH((e,t,n,r,i,a,o)=>{const s=new Bse({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l{const t=e.parentElement;let n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute("data-x-shift"),10),Number.isNaN(r)&&(r=0)),e.setAttribute("x1",0-r+8),e.setAttribute("x2",n-r-8)})}else nU.debug("No Node "+e+": "+JSON.stringify(s.node(e)))});let g=f.getBBox();s.edges().forEach(function(e){void 0!==e&&void 0!==s.edge(e)&&(nU.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(s.edge(e))),mOe(t,s.edge(e),s.edge(e).relation))}),g=f.getBBox();const m={id:n||"root",label:n||"root",width:0,height:0};return m.width=g.width+2*YIe.padding,m.height=g.height+2*YIe.padding,nU.debug("Doc rendered",m,s),m},"renderDoc"),kOe={setConf:vOe,draw:xOe},TOe={parser:rIe,get db(){return new QIe(1)},renderer:kOe,styles:ZIe,init:JH(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},_Oe=Object.freeze({__proto__:null,diagram:TOe}),COe={parser:rIe,get db(){return new QIe(2)},renderer:OIe,styles:ZIe,init:JH(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")},SOe=Object.freeze({__proto__:null,diagram:COe}),AOe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,14],l={trace:JH(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:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,16]},{15:[1,17]},e(t,[2,11]),e(t,[2,12]),{19:[1,18]},e(t,[2,4]),e(t,[2,9]),e(t,[2,10]),e(t,[2,13])],defaultActions:{},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},c=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 e}();function u(){this.yy={}}return l.lexer=c,JH(u,"Parser"),u.prototype=l,l.Parser=u,new u}();AOe.parser=AOe;var NOe=AOe,IOe="",OOe=[],LOe=[],MOe=[],ROe=JH(function(){OOe.length=0,LOe.length=0,IOe="",MOe.length=0,FG()},"clear"),DOe=JH(function(e){IOe=e,OOe.push(e)},"addSection"),POe=JH(function(){return OOe},"getSections"),$Oe=JH(function(){let e=jOe();let t=0;for(;!e&&t<100;)e=jOe(),t++;return LOe.push(...MOe),LOe},"getTasks"),BOe=JH(function(){const e=[];LOe.forEach(t=>{t.people&&e.push(...t.people)});return[...new Set(e)].sort()},"updateActors"),FOe=JH(function(e,t){const n=t.substr(1).split(":");let r=0,i=[];1===n.length?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(","));const a=i.map(e=>e.trim()),o={section:IOe,type:IOe,people:a,task:e,score:r};MOe.push(o)},"addTask"),zOe=JH(function(e){const t={section:IOe,type:IOe,description:e,task:e,classes:[]};LOe.push(t)},"addTaskOrg"),jOe=JH(function(){const e=JH(function(e){return MOe[e].processed},"compileTask");let t=!0;for(const[n,r]of MOe.entries())e(n),t=t&&r.processed;return t},"compileTasks"),HOe=JH(function(){return BOe()},"getActors"),UOe={getConfig:JH(()=>YG().journey,"getConfig"),clear:ROe,setDiagramTitle:GG,getDiagramTitle:qG,setAccTitle:zG,getAccTitle:jG,setAccDescription:HG,getAccDescription:UG,addSection:DOe,getSections:POe,getTasks:$Oe,addTask:FOe,addTaskOrg:zOe,getActors:HOe},GOe=JH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n`,"getStyles"),qOe=JH(function(e,t){return Ice(e,t)},"drawRect"),WOe=JH(function(e,t){const n=15,r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");function a(e){const r=r2().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function o(e){const r=r2().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function s(e){e.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",t.cx-5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),JH(a,"smile"),JH(o,"sad"),JH(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),r},"drawFace"),VOe=JH(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),void 0!==n.class&&n.attr("class",n.class),void 0!==t.title&&n.append("title").text(t.title),n},"drawCircle"),YOe=JH(function(e,t){return Lce(e,t)},"drawText"),XOe=JH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}JH(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7)),r.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,YOe(e,t)},"drawLabel"),KOe=JH(function(e,t,n){const r=e.append("g"),i=Dce();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,qOe(r,i),eLe(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),QOe=-1,ZOe=JH(function(e,t,n){const r=t.x+n.width/2,i=e.append("g");QOe++;i.append("line").attr("id","task"+QOe).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),WOe(i,{cx:r,cy:300+30*(5-t.score),score:t.score});const a=Dce();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,qOe(i,a);let o=t.x+14;t.people.forEach(e=>{const n=t.actors[e].color,r={cx:o,cy:t.y,r:7,fill:n,stroke:"#000",title:e,pos:t.actors[e].position};VOe(i,r),o+=10}),eLe(n)(t.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),JOe=JH(function(e,t){Oce(e,t)},"drawBackgroundRect"),eLe=function(){function e(e,t,n,i,a,o,s,l){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("font-color",l).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l,c){const{taskFontSize:u,taskFontFamily:h}=l,d=e.split(//gi);for(let e=0;e{const i=rLe[r].color,a={cx:20,cy:n,r:7,fill:i,stroke:"#000",pos:rLe[r].position};tLe.drawCircle(e,a);const o={x:40,y:n+7,fill:"#666",text:r,textMargin:5|t.boxTextMargin};tLe.drawText(e,o),n+=20})}JH(iLe,"drawActorLegend");var aLe=YG().journey,oLe=aLe.leftMargin,sLe=JH(function(e,t,n,r){const i=YG().journey,a=YG().securityLevel;let o;"sandbox"===a&&(o=TK("#i"+t));const s=TK("sandbox"===a?o.nodes()[0].contentDocument.body:"body");lLe.init();const l=s.select("#"+t);tLe.initGraphics(l);const c=r.db.getTasks(),u=r.db.getDiagramTitle(),h=r.db.getActors();for(const e in rLe)delete rLe[e];let d=0;h.forEach(e=>{rLe[e]={color:i.actorColours[d%i.actorColours.length],position:d},d++}),iLe(l),lLe.insert(0,0,oLe,50*Object.keys(rLe).length),hLe(l,c,0);const p=lLe.getBounds();u&&l.append("text").text(u).attr("x",oLe).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const f=p.stopy-p.starty+2*i.diagramMarginY,g=oLe+p.stopx+2*i.diagramMarginX;AG(l,f,g,i.useMaxWidth),l.append("line").attr("x1",oLe).attr("y1",4*i.height).attr("x2",g-oLe-4).attr("y2",4*i.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=u?70:0;l.attr("viewBox",`${p.startx} -25 ${g} ${f+m}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",f+m+25)},"draw"),lLe={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:JH(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:JH(function(e,t,n,r){void 0===e[t]?e[t]=n:e[t]=r(n,e[t])},"updateVal"),updateBounds:JH(function(e,t,n,r){const i=YG().journey,a=this;let o=0;function s(s){return JH(function(l){o++;const c=a.sequenceItems.length-o+1;a.updateVal(l,"starty",t-c*i.boxMargin,Math.min),a.updateVal(l,"stopy",r+c*i.boxMargin,Math.max),a.updateVal(lLe.data,"startx",e-c*i.boxMargin,Math.min),a.updateVal(lLe.data,"stopx",n+c*i.boxMargin,Math.max),"activation"!==s&&(a.updateVal(l,"startx",e-c*i.boxMargin,Math.min),a.updateVal(l,"stopx",n+c*i.boxMargin,Math.max),a.updateVal(lLe.data,"starty",t-c*i.boxMargin,Math.min),a.updateVal(lLe.data,"stopy",r+c*i.boxMargin,Math.max))},"updateItemBounds")}JH(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:JH(function(e,t,n,r){const i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(lLe.data,"startx",i,Math.min),this.updateVal(lLe.data,"starty",o,Math.min),this.updateVal(lLe.data,"stopx",a,Math.max),this.updateVal(lLe.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:JH(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:JH(function(){return this.verticalPos},"getVerticalPos"),getBounds:JH(function(){return this.data},"getBounds")},cLe=aLe.sectionFills,uLe=aLe.sectionColours,hLe=JH(function(e,t,n){const r=YG().journey;let i="";const a=n+(2*r.height+r.diagramMarginY);let o=0,s="#CCC",l="black",c=0;for(const[n,u]of t.entries()){if(i!==u.section){s=cLe[o%cLe.length],c=o%cLe.length,l=uLe[o%uLe.length];let a=0;const h=u.section;for(let e=n;e(rLe[t]&&(e[t]=rLe[t]),e),{});u.x=n*r.taskMargin+n*r.width+oLe,u.y=a,u.width=r.diagramMarginX,u.height=r.diagramMarginY,u.colour=l,u.fill=s,u.num=c,u.actors=h,tLe.drawTask(e,u,r),lLe.insert(u.x,u.y,u.x+u.width+r.taskMargin,450)}},"drawTasks"),dLe={setConf:nLe,draw:sLe},pLe={parser:NOe,db:UOe,renderer:dLe,styles:GOe,init:JH(e=>{dLe.setConf(e.journey),UOe.clear()},"init")},fLe=Object.freeze({__proto__:null,diagram:pLe}),gLe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[6,8,10,11,12,14,16,17,20,21],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,16],l=[1,17],c={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline: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,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",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",20:"period",21:"event"},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,1],[9,1],[18,1],[19,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:case 6:case 7:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 8:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 15:r.addTask(a[s],0,""),this.$=a[s];break;case 16:r.addEvent(a[s].substr(2)),this.$=a[s]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:s,21:l},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:18,11:n,12:r,14:i,16:a,17:o,18:14,19:15,20:s,21:l},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,19]},{15:[1,20]},e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,4]),e(t,[2,9]),e(t,[2,10])],defaultActions:{},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},u=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\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,/^(?::\s[^:\n]+)/i,/^(?:[^#:\n]+)/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],inclusive:!0}}};return e}();function h(){this.yy={}}return c.lexer=u,JH(h,"Parser"),h.prototype=c,c.Parser=h,new h}();gLe.parser=gLe;var mLe=gLe,yLe={};eU(yLe,{addEvent:()=>NLe,addSection:()=>_Le,addTask:()=>ALe,addTaskOrg:()=>ILe,clear:()=>TLe,default:()=>LLe,getCommonDb:()=>kLe,getSections:()=>CLe,getTasks:()=>SLe});var vLe="",bLe=0,xLe=[],wLe=[],ELe=[],kLe=JH(()=>RG,"getCommonDb"),TLe=JH(function(){xLe.length=0,wLe.length=0,vLe="",ELe.length=0,FG()},"clear"),_Le=JH(function(e){vLe=e,xLe.push(e)},"addSection"),CLe=JH(function(){return xLe},"getSections"),SLe=JH(function(){let e=OLe();let t=0;for(;!e&&t<100;)e=OLe(),t++;return wLe.push(...ELe),wLe},"getTasks"),ALe=JH(function(e,t,n){const r={id:bLe++,section:vLe,type:vLe,task:e,score:t||0,events:n?[n]:[]};ELe.push(r)},"addTask"),NLe=JH(function(e){ELe.find(e=>e.id===bLe-1).events.push(e)},"addEvent"),ILe=JH(function(e){const t={section:vLe,type:vLe,description:e,task:e,classes:[]};wLe.push(t)},"addTaskOrg"),OLe=JH(function(){const e=JH(function(e){return ELe[e].processed},"compileTask");let t=!0;for(const[n,r]of ELe.entries())e(n),t=t&&r.processed;return t},"compileTasks"),LLe={clear:TLe,getCommonDb:kLe,addSection:_Le,getSections:CLe,getTasks:SLe,addTask:ALe,addTaskOrg:ILe,addEvent:NLe},MLe=JH(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),void 0!==t.class&&n.attr("class",t.class),n},"drawRect"),RLe=JH(function(e,t){const n=15,r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");function a(e){const r=r2().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function o(e){const r=r2().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);e.append("path").attr("class","mouth").attr("d",r).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function s(e){e.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",t.cx-5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+5).attr("cy",t.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),JH(a,"smile"),JH(o,"sad"),JH(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),r},"drawFace"),DLe=JH(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),void 0!==n.class&&n.attr("class",n.class),void 0!==t.title&&n.append("title").text(t.title),n},"drawCircle"),PLe=JH(function(e,t){const n=t.text.replace(//gi," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),void 0!==t.class&&r.attr("class",t.class);const i=r.append("tspan");return i.attr("x",t.x+2*t.textMargin),i.text(n),r},"drawText"),$Le=JH(function(e,t){function n(e,t,n,r,i){return e+","+t+" "+(e+n)+","+t+" "+(e+n)+","+(t+r-i)+" "+(e+n-1.2*i)+","+(t+r)+" "+e+","+(t+r)}JH(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7)),r.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,PLe(e,t)},"drawLabel"),BLe=JH(function(e,t,n){const r=e.append("g"),i=ULe();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,MLe(r,i),GLe(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),FLe=-1,zLe=JH(function(e,t,n){const r=t.x+n.width/2,i=e.append("g");FLe++;i.append("line").attr("id","task"+FLe).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),RLe(i,{cx:r,cy:300+30*(5-t.score),score:t.score});const a=ULe();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,MLe(i,a),GLe(n)(t.task,i,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jLe=JH(function(e,t){MLe(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),HLe=JH(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),ULe=JH(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),GLe=function(){function e(e,t,n,i,a,o,s,l){r(t.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("font-color",l).style("text-anchor","middle").text(e),s)}function t(e,t,n,i,a,o,s,l,c){const{taskFontSize:u,taskFontFamily:h}=l,d=e.split(//gi);for(let e=0;e)/).reverse(),i=[],a=n.attr("y"),o=parseFloat(n.attr("dy")),s=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",o+"em");for(let o=0;ot||"
    "===e)&&(i.pop(),s.text(i.join(" ").trim()),i="
    "===e?[""]:[e],s=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(e))})}JH(WLe,"wrap");var VLe=JH(function(e,t,n,r){const i=n%12-1,a=e.append("g");t.section=i,a.attr("class",(t.class?t.class+" ":"")+"timeline-node section-"+i);const o=a.append("g"),s=a.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(WLe,t.width).node().getBBox(),c=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return t.height=l.height+1.1*c*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),XLe(o,t,i,r),t},"drawNode"),YLe=JH(function(e,t,n){const r=e.append("g"),i=r.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(WLe,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return r.remove(),i.height+1.1*a*.5+t.padding},"getVirtualNodeHeight"),XLe=JH(function(e,t,n){e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${10-t.height} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),KLe={drawRect:MLe,drawCircle:DLe,drawSection:BLe,drawText:PLe,drawLabel:$Le,drawTask:zLe,drawBackgroundRect:jLe,getTextObj:HLe,getNoteRect:ULe,initGraphics:qLe,drawNode:VLe,getVirtualNodeHeight:YLe},QLe=JH(function(e,t,n,r){const i=YG(),a=i.leftMargin??50;nU.debug("timeline",r.db);const o=i.securityLevel;let s;"sandbox"===o&&(s=TK("#i"+t));const l=TK("sandbox"===o?s.nodes()[0].contentDocument.body:"body").select("#"+t);l.append("g");const c=r.db.getTasks(),u=r.db.getCommonDb().getDiagramTitle();nU.debug("task",c),KLe.initGraphics(l);const h=r.db.getSections();nU.debug("sections",h);let d=0,p=0,f=0,g=0,m=50+a,y=50;g=50;let v=0,b=!0;h.forEach(function(e){const t={number:v,descr:e,section:v,width:150,padding:20,maxHeight:d},n=KLe.getVirtualNodeHeight(l,t,i);nU.debug("sectionHeight before draw",n),d=Math.max(d,n+20)});let x=0,w=0;nU.debug("tasks.length",c.length);for(const[e,t]of c.entries()){const n={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:p},r=KLe.getVirtualNodeHeight(l,n,i);nU.debug("taskHeight before draw",r),p=Math.max(p,r+20),x=Math.max(x,t.events.length);let a=0;for(const e of t.events){const n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=KLe.getVirtualNodeHeight(l,n,i)}w=Math.max(w,a)}nU.debug("maxSectionHeight before draw",d),nU.debug("maxTaskHeight before draw",p),h&&h.length>0?h.forEach(e=>{const t=c.filter(t=>t.section===e),n={number:v,descr:e,section:v,width:200*Math.max(t.length,1)-50,padding:20,maxHeight:d};nU.debug("sectionNode",n);const r=l.append("g"),a=KLe.drawNode(r,n,v,i);nU.debug("sectionNode output",a),r.attr("transform",`translate(${m}, 50)`),y+=d+50,t.length>0&&ZLe(l,t,v,m,y,p,i,x,w,d,!1),m+=200*Math.max(t.length,1),y=50,v++}):(b=!1,ZLe(l,c,v,m,y,p,i,x,w,d,!0));const E=l.node().getBBox();nU.debug("bounds",E),u&&l.append("text").text(u).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),f=b?d+p+150:p+100;l.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",f).attr("x2",E.width+3*a).attr("y2",f).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),NG(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),ZLe=JH(function(e,t,n,r,i,a,o,s,l,c,u){for(const s of t){const t={descr:s.task,section:n,number:n,width:150,padding:20,maxHeight:a};nU.debug("taskNode",t);const h=e.append("g").attr("class","taskWrapper"),d=KLe.drawNode(h,t,n,o).height;if(nU.debug("taskHeight after draw",d),h.attr("transform",`translate(${r}, ${i})`),a=Math.max(a,d),s.events){const t=e.append("g").attr("class","lineWrapper");let h=a;i+=100,h+=JLe(e,s.events,n,r,i,o),i-=100,t.append("line").attr("x1",r+95).attr("y1",i+a).attr("x2",r+95).attr("y2",i+a+(u?a:c)+l+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}r+=200,u&&!o.timeline?.disableMulticolor&&n++}i-=10},"drawTasks"),JLe=JH(function(e,t,n,r,i,a){let o=0;const s=i;i+=100;for(const s of t){const t={descr:s,section:n,number:n,width:150,padding:20,maxHeight:50};nU.debug("eventNode",t);const l=e.append("g").attr("class","eventWrapper"),c=KLe.drawNode(l,t,n,a).height;o+=c,l.attr("transform",`translate(${r}, ${i})`),i=i+10+c}return i=s,o},"drawEvents"),eMe={setConf:JH(()=>{},"setConf"),draw:QLe},tMe=JH(e=>{let t="";for(let t=0;t`\n .edge {\n stroke-width: 3;\n }\n ${tMe(e)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`,"getStyles")},rMe=Object.freeze({__proto__:null,diagram:nMe});function iMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function lMe(e,t,n){return(t=hMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cMe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||pMe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uMe(e){return function(e){if(Array.isArray(e))return iMe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pMe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hMe(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function dMe(e){return dMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dMe(e)}function pMe(e,t){if(e){if("string"==typeof e)return iMe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iMe(e,t):void 0}}var fMe="undefined"==typeof window?null:window,gMe=fMe?fMe.navigator:null;fMe&&fMe.document;var mMe,yMe,vMe,bMe,xMe,wMe,EMe,kMe,TMe,_Me,CMe,SMe,AMe,NMe,IMe,OMe,LMe,MMe,RMe,DMe,PMe,$Me,BMe,FMe,zMe,jMe,HMe,UMe,GMe=dMe(""),qMe=dMe({}),WMe=dMe(function(){}),VMe="undefined"==typeof HTMLElement?"undefined":dMe(HTMLElement),YMe=function(e){return e&&e.instanceString&&KMe(e.instanceString)?e.instanceString():null},XMe=function(e){return null!=e&&dMe(e)==GMe},KMe=function(e){return null!=e&&dMe(e)===WMe},QMe=function(e){return!tRe(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},ZMe=function(e){return null!=e&&dMe(e)===qMe&&!QMe(e)&&e.constructor===Object},JMe=function(e){return null!=e&&dMe(e)===dMe(1)&&!isNaN(e)},eRe=function(e){return"undefined"===VMe?void 0:null!=e&&e instanceof HTMLElement},tRe=function(e){return nRe(e)||rRe(e)},nRe=function(e){return"collection"===YMe(e)&&e._private.single},rRe=function(e){return"collection"===YMe(e)&&!e._private.single},iRe=function(e){return"core"===YMe(e)},aRe=function(e){return"stylesheet"===YMe(e)},oRe=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},sRe=function(e){return function(e){return null!=e&&dMe(e)===qMe}(e)&&KMe(e.then)},lRe=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},xRe=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,a,o,s,l;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=new RegExp("^"+yRe+"$").exec(e);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(a=u[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*c(d,h,n+1/3)),s=Math.round(255*c(d,h,n)),l=Math.round(255*c(d,h,n-1/3))}t=[o,s,l,a]}return t}(e)},ERe={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},kRe=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i=o||t<0||m&&e-f>=u}function x(){var e=t();if(b(e))return w(e);d=setTimeout(x,function(e){var t=o-(e-p);return m?i(t,u-(e-f)):t}(e))}function w(e){return d=void 0,y&&l?v(e):(l=c=void 0,h)}function E(){var e=t(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===d)return function(e){return f=e,d=setTimeout(x,o),g?v(e):h}(p);if(m)return clearTimeout(d),d=setTimeout(x,o),v(p)}return void 0===d&&(d=setTimeout(x,o)),h}return o=n(o)||0,e(s)&&(g=!!s.leading,u=(m="maxWait"in s)?r(n(s.maxWait)||0,o):u,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=p=c=d=void 0},E.flush=function(){return void 0===d?h:w(t())},E},HMe}(),RRe=CRe(MRe),DRe=fMe?fMe.performance:null,PRe=DRe&&DRe.now?function(){return DRe.now()}:function(){return Date.now()},$Re=function(){if(fMe){if(fMe.requestAnimationFrame)return function(e){fMe.requestAnimationFrame(e)};if(fMe.mozRequestAnimationFrame)return function(e){fMe.mozRequestAnimationFrame(e)};if(fMe.webkitRequestAnimationFrame)return function(e){fMe.webkitRequestAnimationFrame(e)};if(fMe.msRequestAnimationFrame)return function(e){fMe.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(PRe())},1e3/60)}}(),BRe=function(e){return $Re(e)},FRe=PRe,zRe=9261,jRe=5381,HRe=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zRe;!(t=e.next()).done;)n=65599*n+t.value|0;return n},URe=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:zRe)+e|0},GRe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jRe;return(t<<5)+t+e|0},qRe=function(e){return 2097152*e[0]+e[1]},WRe=function(e,t){return[URe(e[0],t[0]),GRe(e[1],t[1])]},VRe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return HRe({next:function(){return r=0;r--)e[r]===t&&e.splice(r,1)},gDe=function(e){e.splice(0,e.length)},mDe=function(e,t,n){return n&&(t=hRe(n,t)),e[t]},yDe=function(e,t,n,r){n&&(t=hRe(n,t)),e[t]=r},vDe="undefined"!=typeof Map?Map:function(){return oMe(function e(){aMe(this,e),this._obj={}},[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}])}(),bDe=function(){return oMe(function e(t){if(aMe(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&iRe(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new xDe,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];QMe(t.classes)?l=t.classes:XMe(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,u=l.length;ct?1:0},c=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=e.length);in;0<=n?t++:t--)c.push(t);return c}.apply(this).reverse()).length;ag;0<=g?++d:--d)m.push(a(e,r));return m},f=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t&&i(a,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=a},g=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;i0;){var w=y.pop(),E=g(w),k=w.id();if(h[k]=E,E!==1/0)for(var T=w.neighborhood().intersect(p),_=0;_0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},RDe={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t0;){if(x(),E++,c===h){for(var k=[],T=i,_=h,C=v[_];k.unshift(T),null!=C&&k.unshift(C),null!=(T=y[_]);)C=v[_=T.id()];return{found:!0,distance:d[c],path:this.spawn(k),steps:E}}f[c]=!0;for(var S=l._private.edges,A=0;AC&&(p[_]=C,y[_]=T,v[_]=x),!i){var S=T*c+k;!i&&p[S]>C&&(p[S]=C,y[S]=k,v[S]=x)}}}for(var A=0;A1&&void 0!==arguments[1]?arguments[1]:a,r=[],i=v(e);;){if(null==i)return t.spawn();var o=y(i),l=o.edge,c=o.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=c}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},jDe=Math.sqrt(2),HDe=function(e,t,n){0===n.length&&oDe("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,c=l.length-1;c>=0;c--){var u=l[c],h=u[1],d=u[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&l.splice(c,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=HDe(i,e,t),n--}return t},GDe={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/jDe);if(!(i<2)){for(var l=[],c=0;c0?1:e<0?-1:0},QDe=function(e,t){return Math.sqrt(ZDe(e,t))},ZDe=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},JDe=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},iPe=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},aPe=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},oPe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},sPe=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=cMe(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},lPe=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},cPe=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},uPe=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},hPe=function(e,t){return uPe(e,t.x,t.y)},dPe=function(e,t){return uPe(e,t.x1,t.y1)&&uPe(e,t.x2,t.y2)},pPe=null!==(IDe=Math.hypot)&&void 0!==IDe?IDe:function(e,t){return Math.sqrt(e*e+t*t)};function fPe(e,t,n,r,i,a){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=pPe(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),c=r(s,o),u=a(l,c);if(Math.abs(u)<1e-9)return n(e,i(l,.5));var h=a(r(o,e),c)/u;return n(e,i(l,h))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===c?RPe(i,a):c,h=i/2,d=a/2,p=(u=Math.min(u,h,d))!==h,f=u!==d;if(p){var g=r-d-o;if((s=SPe(e,t,n,r,n-h+u-o,g,n+h-u+o,g,!1)).length>0)return s}if(f){var m=n+h+o;if((s=SPe(e,t,n,r,m,r-d+u-o,m,r+d-u+o,!1)).length>0)return s}if(p){var y=r+d+o;if((s=SPe(e,t,n,r,n-h+u-o,y,n+h-u+o,y,!1)).length>0)return s}if(f){var v=n-h-o;if((s=SPe(e,t,n,r,v,r-d+u-o,v,r+d-u+o,!1)).length>0)return s}var b=n-h+u,x=r-d+u;if((l=_Pe(e,t,n,r,b,x,u+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+h-u,E=r-d+u;if((l=_Pe(e,t,n,r,w,E,u+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var k=n+h-u,T=r+d-u;if((l=_Pe(e,t,n,r,k,T,u+o)).length>0&&l[0]>=k&&l[1]>=T)return[l[0],l[1]];var _=n-h+u,C=r+d-u;return(l=_Pe(e,t,n,r,_,C,u+o)).length>0&&l[0]<=_&&l[1]>=C?[l[0],l[1]]:[]},mPe=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,a),h=Math.max(r,a);return l-s<=e&&e<=c+s&&u-s<=t&&t<=h+s},yPe=function(e,t,n,r,i,a,o,s,l){var c=Math.min(n,o,i)-l,u=Math.max(n,o,i)+l,h=Math.min(r,s,a)-l,d=Math.max(r,s,a)+l;return!(eu||td)},vPe=function(e,t,n,r,i,a,o,s){var l=[];!function(e,t,n,r,i){var a,o,s,l,c,u,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(c=(c=s+Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u=(u=s-Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+c+u,h+=(c+u)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-u+c)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(o),i[0]=-h+d*Math.cos(l/3),i[2]=-h+d*Math.cos((l+2*Math.PI)/3),i[4]=-h+d*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,l);for(var c=[],u=0;u<6;u+=2)Math.abs(l[u+1])<1e-7&&l[u]>=0&&l[u]<=1&&c.push(l[u]);c.push(1),c.push(0);for(var h,d,p,f=-1,g=0;g=0?pl?(e-i)*(e-i)+(t-a)*(t-a):c-h},xPe=function(e,t,n){for(var r,i,a,o,s=0,l=0;l=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},wPe=function(e,t,n,r,i,a,o,s,l){var c,u=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var h,d=Math.cos(-c),p=Math.sin(-c),f=0;f0){var g=kPe(u,-l);h=EPe(g)}else h=u;return xPe(e,t,h)},EPe=function(e){for(var t,n,r,i,a,o,s,l,c=new Array(e.length/2),u=0;u=0&&f<=1&&m.push(f),g>=0&&g<=1&&m.push(g),0===m.length)return[];var y=m[0]*s[0]+e,v=m[0]*s[1]+t;return m.length>1?m[0]==m[1]?[y,v]:[y,v,m[1]*s[0]+e,m[1]*s[1]+t]:[y,v]},CPe=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},SPe=function(e,t,n,r,i,a,o,s,l){var c=e-i,u=n-e,h=o-i,d=t-a,p=r-t,f=s-a,g=h*d-f*c,m=u*d-p*c,y=f*u-h*p;if(0!==y){var v=g/y,b=m/y,x=-.001;return x<=v&&v<=1.001&&x<=b&&b<=1.001||l?[e+v*u,t+v*p]:[]}return 0===g||0===m?CPe(e,n,o)===o?[o,s]:CPe(e,n,i)===i?[i,a]:CPe(i,o,n)===n?[n,r]:[]:[]},APe=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,l=t,c=n;a.push({x:l+o*e[0],y:c+s*e[1]});for(var u=1;u0){var v=kPe(g,-s);c=EPe(v)}else c=g}else c=n;for(var b=0;bc&&(c=t)},h=function(e){return l[e]},d=0;d0?b.edgesTo(v)[0]:v.edgesTo(b)[0];var w=r(x);v=v.id(),c[v]>c[g]+w&&(c[v]=c[g]+w,d.nodes.indexOf(v)<0?d.push(v):d.updateItem(v),l[v]=0,n[v]=[]),c[v]==c[g]+w&&(l[v]=l[v]+l[g],n[v].push(g))}else for(var E=0;E0;){for(var C=t.pop(),S=0;S0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(u,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:n$e,o=r,s=0;s=2?l$e(e,t,n,0,a$e,o$e):l$e(e,t,n,0,i$e)},squaredEuclidean:function(e,t,n){return l$e(e,t,n,0,a$e)},manhattan:function(e,t,n){return l$e(e,t,n,0,i$e)},max:function(e,t,n){return l$e(e,t,n,-1/0,s$e)}};function u$e(e,t,n,r,i,a){var o;return o=KMe(e)?e:c$e[e]||c$e.euclidean,0===t&&KMe(e)?o(i,a):o(t,n,r,i,a)}c$e["squared-euclidean"]=c$e.squaredEuclidean,c$e.squaredeuclidean=c$e.squaredEuclidean;var h$e=pDe({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),d$e=function(e){return h$e(e)},p$e=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return u$e(e,r.length,a,function(e){return r[e](t)},o,s)},f$e=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,l=0;ln)return!1}return!0},b$e=function(e,t,n){for(var r=0;ri&&(i=t[l][c],a=c);o[a].push(e[l])}for(var u=0;u=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[o],g=t[r[o]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var m=0;mn[g.key][y.key]&&(a=n[g.key][y.key])):"max"===i.linkage?(a=n[f.key][y.key],n[f.key][y.key]1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var a=0,o=e.length-1;o>=0;o--){var s=e[o];i?isFinite(s)||(e[o]=-1/0,a++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+a]:(e[c-1+a]+e[c+a])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;io&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var c=0;c=C?(S=C,C=N,A=I):N>S&&(S=N);for(var O=0;O0?1:0;k[E%c.minIterations*t+$]=B,P+=B}if(P>0&&(E>=c.minIterations-1||E==c.maxIterations-1)){for(var F=0,z=0;z0&&r.push(i);return r}(t,a,o),U=function(e,t,n){for(var r=$$e(e,t,n),i=0;il&&(s=c,l=u)}n[i]=a[s]}return $$e(e,t,n)}(t,r,H),G={},q=0;q1||o>1)&&(c=!0),u[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[t].push(e.id())})}else h[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?c=!0:r=t:n=t),u[t]=[],e.connectedEdges().forEach(function(e){return u[t].push(e.id())})):h[t]=[e.source().id(),e.target().id()]});var d={found:!1,trail:void 0};if(c)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,a=[e];u[i].length;)t=u[i].shift(),n=h[t][0],i!=(r=h[t][1])?(u[r]=u[r].filter(function(e){return e!=t}),i=r):s||i==n||(u[n]=u[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},f=[],g=[];for(g=p(i);1!=g.length;)0==u[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var m in f.unshift(l.getElementById(g.shift())),u)if(u[m].length)return d;return d.found=!0,d.trail=this.spawn(f,!0),d}},H$e=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(l,c,u){l===u&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var h,d,p,f,g=e.getElementById(c).connectedEdges().intersection(e);0===g.size()?i.push(e.spawn(e.getElementById(c))):g.forEach(function(n){h=n.source().id(),d=n.target().id(),(p=h===c?d:h)!==u&&(f=n.id(),o[f]||(o[f]=!0,a.push({x:c,y:p,edge:n})),p in t?t[c].low=Math.min(t[c].low,t[p].id):(s(l,p,c),t[c].low=Math.min(t[c].low,t[p].low),t[c].id<=t[p].low&&(t[c].cutVertex=!0,function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)}(c,p))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},U$e=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var c=i.pop();if(l.merge(e.getElementById(c)),t[c].low=t[s].index,t[c].explored=!0,c===s)break}var u=l.edgesWith(l),h=l.merge(u);r.push(h),a=a.difference(h)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},G$e={};[kDe,MDe,RDe,PDe,BDe,zDe,GDe,FPe,jPe,UPe,qPe,t$e,_$e,M$e,F$e,j$e,{hopcroftTarjanBiconnected:H$e,htbc:H$e,htb:H$e,hopcroftTarjanBiconnectedComponents:H$e},{tarjanStronglyConnected:U$e,tsc:U$e,tscc:U$e,tarjanStronglyConnectedComponents:U$e}].forEach(function(e){xRe(G$e,e)}); /*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */ -var U$e=function(e){if(!(this instanceof U$e))return new U$e(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};U$e.prototype={fulfill:function(e){return G$e(this,1,"fulfillValue",e)},reject:function(e){return G$e(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new U$e;return n.onFulfilled.push(V$e(e,r,"fulfill")),n.onRejected.push(V$e(t,r,"reject")),q$e(n),r.proxy}};var G$e=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,q$e(e)),e},q$e=function(e){1===e.state?W$e(e,"onFulfilled",e.fulfillValue):2===e.state&&W$e(e,"onRejected",e.rejectReason)},W$e=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1}}(),i=function(){if(UBe)return HBe;UBe=1;var e=BFe();return HBe=function(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this},HBe}();function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&t%1==0&&t0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){XMe(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],a=0,o=n.length;a0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};kze.className=kze.classNames=kze.classes;var Tze={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:dRe,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Tze.variable="(?:[\\w-.]|(?:\\\\"+Tze.metaChar+"))+",Tze.className="(?:[\\w-]|(?:\\\\"+Tze.metaChar+"))+",Tze.value=Tze.string+"|"+Tze.number,Tze.id=Tze.variable,function(){var e,t,n;for(e=Tze.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Tze.comparatorOp+="|\\!"+t)}();var _ze=0,Cze=1,Sze=2,Aze=3,Nze=4,Ize=5,Oze=6,Lze=7,Mze=8,Rze=9,Dze=10,Pze=11,$ze=12,Bze=13,Fze=14,zze=15,jze=16,Hze=17,Uze=18,Gze=19,qze=20,Wze=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return function(e,t){return-1*yRe(e,t)}(e.selector,t.selector)}),Vze=function(){for(var e,t={},n=0;n0&&c.edgeCount>0)return oDe("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return oDe("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&oDe("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return VMe(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case _ze:var l=e(s);return l.substring(0,l.length-1);case Aze:var c=r.field,u=r.operator;return"["+c+n(e(u))+t(s)+"]";case Ize:var h=r.operator,d=r.field;return"["+e(h)+d+"]";case Nze:return"["+r.field+"]";case Oze:var p=r.operator;return"[["+r.field+n(e(p))+t(s)+"]]";case Lze:return s;case Mze:return"#"+s;case Rze:return"."+s;case Hze:case zze:return i(r.parent,a)+n(">")+i(r.child,a);case Uze:case jze:return i(r.ancestor,a)+" "+i(r.descendant,a);case Gze:var f=i(r.left,a),g=i(r.subject,a),m=i(r.right,a);return f+(f.length>0?" ":"")+g+m;case qze:return""}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)},"")},a="",o=0;o1&&o=0&&(t=t.replace("!",""),u=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(o||l||c)&&(i=o||s?""+e:"",a=""+n),c&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":h=!0,r=e>n;break;case">=":h=!0,r=e>=n;break;case"<":h=!0,r=e0;){var c=i.shift();t(c),a.add(c.id()),o&&r(i,a,c)}return e}function pje(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],pje)},hje.forEachUp=function(e){return dje(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],fje)},hje.forEachUpAndDown=function(e){return dje(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],gje)},hje.ancestors=hje.parents,(lje=cje={data:wze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:wze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:wze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:wze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:wze.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:wze.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=lje.data,lje.removeAttr=lje.removeData;var mje,yje,vje=cje,bje={};function xje(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;ot}),minIndegree:wje("indegree",function(e,t){return et}),minOutdegree:wje("outdegree",function(e,t){return et})}),vRe(bje,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,u=c;c&&(l=l[0]);var h=u?l.position():{x:0,y:0};return i={x:s.x-h.x,y:s.y-h.y},void 0===e?i:i[e]}for(var d=0;d0,m=g;g&&(f=f[0]);var y=m?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}},mje.modelPosition=mje.point=mje.position,mje.modelPositions=mje.points=mje.positions,mje.renderedPoint=mje.renderedPosition,mje.relativePoint=mje.relativePosition;var Tje,_je,Cje=yje;Tje=_je={},_je.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},_je.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}}),this):this},_je.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;0!==a.w&&0!==a.h||((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(c=100*c/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var h=y(i.width.val-a.w,s,l),d=h.biasDiff,p=h.biasComplementDiff,f=y(i.height.val-a.h,c,u),g=f.biasDiff,m=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-d+a.x1+a.x2+p)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-g+a.y1+a.y2+m)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Nje=function(e,t){return null==t?e:Aje(e,t.x1,t.y1,t.x2,t.y2)},Ije=function(e,t,n){return fDe(e,t,n)},Oje=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-s,c.y1=i-s,c.x2=r+s,c.y2=i+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,iPe(c,1),Aje(e,c.x1,c.y1,c.x2,c.y2)}}},Lje=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o,s,l,c,u=t.pstyle("text-halign"),h=t.pstyle("text-valign"),d=Ije(a,"labelWidth",n),p=Ije(a,"labelHeight",n),f=Ije(a,"labelX",n),g=Ije(a,"labelY",n),m=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,v=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,k=p,T=d,_=T/2,C=k/2;if(v)o=f-_,s=f+_,l=g-C,c=g+C;else{switch(u.value){case"left":o=f-T,s=f;break;case"center":o=f-_,s=f+_;break;case"right":o=f,s=f+T}switch(h.value){case"top":l=g-k,c=g;break;case"center":l=g-C,c=g+C;break;case"bottom":l=g,c=g+k}}var S=m-Math.max(x,w)-E-2,A=m+Math.max(x,w)+E+2,N=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;o+=S,s+=A,l+=N,c+=I;var O=n||"main",L=i.labelBounds,M=L[O]=L[O]||{};M.x1=o,M.y1=l,M.x2=s,M.y2=c,M.w=s-o,M.h=c-l,M.leftPad=S,M.rightPad=A,M.topPad=N,M.botPad=I;var R=v&&"autorotate"===b.strValue,D=null!=b.pfValue&&0!==b.pfValue;if(R||D){var P=R?Ije(i.rstyle,"labelAngle",n):b.pfValue,$=Math.cos(P),B=Math.sin(P),F=(o+s)/2,z=(l+c)/2;if(!v){switch(u.value){case"left":F=s;break;case"right":F=o}switch(h.value){case"top":z=c;break;case"bottom":z=l}}var j=function(e,t){return{x:(e-=F)*$-(t-=z)*B+F,y:e*B+t*$+z}},H=j(o,l),U=j(o,c),G=j(s,l),q=j(s,c);o=Math.min(H.x,U.x,G.x,q.x),s=Math.max(H.x,U.x,G.x,q.x),l=Math.min(H.y,U.y,G.y,q.y),c=Math.max(H.y,U.y,G.y,q.y)}var W=O+"Rot",V=L[W]=L[W]||{};V.x1=o,V.y1=l,V.x2=s,V.y2=c,V.w=s-o,V.h=c-l,Aje(e,o,l,s,c),Aje(i.labelBounds.all,o,l,s,c)}return e}},Mje=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,r=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;Rje(e,t,n,r,"outside",r/2)}},Rje=function(e,t,n,r,i,a){if(!(0===n||r<=0||"inside"===i)){var o=t.cy(),s=t.pstyle("shape").value,l=o.renderer().nodeShapes[s],c=t.position(),u=c.x,h=c.y,d=t.width(),p=t.height();if(l.hasMiterBounds){"center"===i&&(r/=2);var f=l.miterBounds(u,h,d,p,r);Nje(e,f)}else null!=a&&a>0&&aPe(e,[a,a,a,a])}},Dje=function(e,t){var n,r,i,a,o,s,l,c=e._private.cy,u=c.styleEnabled(),h=c.headless(),d=tPe(),p=e._private,f=e.isNode(),g=e.isEdge(),m=p.rstyle,y=f&&u?e.pstyle("bounds-expansion").pfValue:[0],v=function(e){return"none"!==e.pstyle("display").value},b=!u||v(e)&&(!g||v(e.source())&&v(e.target()));if(b){var x=0;u&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;u&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var E=Math.max(x,w),k=0;if(u&&(k=e.pstyle("width").pfValue/2),f&&t.includeNodes){var T=e.position();o=T.x,s=T.y;var _=e.outerWidth()/2,C=e.outerHeight()/2;Aje(d,n=o-_,i=s-C,r=o+_,a=s+C),u&&Mje(d,e),u&&t.includeOutlines&&!h&&Mje(d,e),u&&function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,r=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Rje(e,t,n,r,i)}}(d,e)}else if(g&&t.includeEdges)if(u&&!h){var S=e.pstyle("curve-style").strValue;if(n=Math.min(m.srcX,m.midX,m.tgtX),r=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),a=Math.max(m.srcY,m.midY,m.tgtY),Aje(d,n-=k,i-=k,r+=k,a+=k),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var N=n;n=r,r=N}if(i>(a=A[1].y)){var I=i;i=a,a=I}Aje(d,n-k,i-k,r+k,a+k)}}else if("bezier"===S||"unbundled-bezier"===S||hRe(S,"segments")||hRe(S,"taxi")){var O;switch(S){case"bezier":case"unbundled-bezier":O=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=m.linePts}if(null!=O)for(var L=0;L(r=D.x)){var P=n;n=r,r=P}if((i=R.y)>(a=D.y)){var $=i;i=a,a=$}Aje(d,n-=k,i-=k,r+=k,a+=k)}if(u&&t.includeEdges&&g&&(Oje(d,e,"mid-source"),Oje(d,e,"mid-target"),Oje(d,e,"source"),Oje(d,e,"target")),u)if("yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;Aje(d,d.x1+B,d.y1+F,d.x2+B,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};oPe(z,d),aPe(z,y),iPe(z,1),u&&(n=d.x1,r=d.x2,i=d.y1,a=d.y2,Aje(d,n-E,i-E,r+E,a+E));var j=p.overlayBounds=p.overlayBounds||{};oPe(j,d),aPe(j,y),iPe(j,1);var H=p.labelBounds=p.labelBounds||{};null!=H.all?((l=H.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):H.all=tPe(),u&&t.includeLabels&&(t.includeMainLabels&&Lje(d,e,null),g&&(t.includeSourceLabels&&Lje(d,e,"source"),t.includeTargetLabels&&Lje(d,e,"target")))}return d.x1=Sje(d.x1),d.y1=Sje(d.y1),d.x2=Sje(d.x2),d.y2=Sje(d.y2),d.w=Sje(d.x2-d.x1),d.h=Sje(d.y2-d.y1),d.w>0&&d.h>0&&b&&(aPe(d,y),iPe(d,1)),d},Pje=function(e){var t=0,n=function(e){return(e?1:0)<0&&void 0!==arguments[0]?arguments[0]:nHe,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)o(s);return this},iHe.removeAllListeners=function(){return this.removeListener("*")},iHe.emit=iHe.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,XMe(t)||(t=[t]),sHe(this,function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(){var n=r[s];if(n.type===a.type&&(!n.namespace||n.namespace===a.namespace||".*"===n.namespace)&&e.eventMatches(e.context,n,a)){var i=[a];null!=t&&function(e,t){for(var n=0;n1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&VMe(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=o)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,a=0;a=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n));var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(KMe(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify("style")}else if(VMe(e)){if(void 0===t){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var a=0;a0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),LHe.neighbourhood=LHe.neighborhood,LHe.closedNeighbourhood=LHe.closedNeighborhood,LHe.openNeighbourhood=LHe.openNeighborhood,vRe(LHe,{source:uje(function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t},"source"),target:uje(function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t},"target"),sources:PHe({attr:"source"}),targets:PHe({attr:"target"})}),vRe(LHe,{edgesWith:uje($He(),"edgesWith"),edgesTo:uje($He({thisIsSrc:!0}),"edgesTo")}),vRe(LHe,{connectedEdges:uje(function(e){for(var t=[],n=0;n0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),LHe.componentsOf=LHe.components;var FHe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new mDe,a=!1;if(t){if(t.length>0&&KMe(t[0])&&!eRe(t[0])){a=!0;for(var o=[],s=new vDe,l=0,c=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,s=[],l=[],c=0,u=i.length;c0){for(var R=e.length===i.length?i:new FHe(a,e),D=0;D0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?k.emitAndNotify("remove"):t&&k.emit("remove"));for(var T=0;T=.001?function(t,r){for(var i=0;i<4;++i){var a=d(r,e,n);if(0===a)return r;r-=(h(r,e,n)-t)/a}return r}(t,o):0===l?o:function(t,r,i){var a,o,s=0;do{(a=h(o=r+(i-r)/2,e,n)-t)>0?i=o:r=o}while(Math.abs(a)>1e-7&&++s<10);return o}(t,r,r+i)}var f=!1;function g(){f=!0,e===t&&n===r||function(){for(var t=0;t<11;++t)s[t]=h(t*i,e,n)}()}var m=function(i){return f||g(),e===t&&n===r?i:0===i?0:1===i?1:h(p(i),t,r)};m.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var y="generateBezier("+[e,t,n,r]+")";return m.toString=function(){return y},m} -/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var UHe=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),c=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return function e(t,r,i){var a,o,s,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,h=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,o=(a=null!==i)?(u=e(t,r))/i*.016:.016;s=n(s||l,o),c.push(1+s.x),u+=16,Math.abs(s.x)>h&&Math.abs(s.v)>h;);return a?function(e){return c[e*(c.length-1)|0]}:u}}(),GHe=function(e,t,n,r){var i=HHe(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},qHe={linear:function(e,t,n){return e+(t-e)*n},ease:GHe(.25,.1,.25,1),"ease-in":GHe(.42,0,1,1),"ease-out":GHe(0,0,.58,1),"ease-in-out":GHe(.42,0,.58,1),"ease-in-sine":GHe(.47,0,.745,.715),"ease-out-sine":GHe(.39,.575,.565,1),"ease-in-out-sine":GHe(.445,.05,.55,.95),"ease-in-quad":GHe(.55,.085,.68,.53),"ease-out-quad":GHe(.25,.46,.45,.94),"ease-in-out-quad":GHe(.455,.03,.515,.955),"ease-in-cubic":GHe(.55,.055,.675,.19),"ease-out-cubic":GHe(.215,.61,.355,1),"ease-in-out-cubic":GHe(.645,.045,.355,1),"ease-in-quart":GHe(.895,.03,.685,.22),"ease-out-quart":GHe(.165,.84,.44,1),"ease-in-out-quart":GHe(.77,0,.175,1),"ease-in-quint":GHe(.755,.05,.855,.06),"ease-out-quint":GHe(.23,1,.32,1),"ease-in-out-quint":GHe(.86,0,.07,1),"ease-in-expo":GHe(.95,.05,.795,.035),"ease-out-expo":GHe(.19,1,.22,1),"ease-in-out-expo":GHe(1,0,0,1),"ease-in-circ":GHe(.6,.04,.98,.335),"ease-out-circ":GHe(.075,.82,.165,1),"ease-in-out-circ":GHe(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return qHe.linear;var r=UHe(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":GHe};function WHe(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function VHe(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function YHe(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=VHe(e,i),s=VHe(t,i);if(QMe(o)&&QMe(s))return WHe(a,o,s,n,r);if(XMe(o)&&XMe(s)){for(var l=[],c=0;c0?("spring"===h&&d.push(o.duration),o.easingImpl=qHe[h].apply(null,d)):o.easingImpl=qHe[h]}var p,f=o.easingImpl;if(p=0===o.duration?1:(n-l)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),null==o.delay){var g=o.startPosition,m=o.position;if(m&&i&&!e.locked()){var y={};KHe(g.x,m.x)&&(y.x=YHe(g.x,m.x,p,f)),KHe(g.y,m.y)&&(y.y=YHe(g.y,m.y,p,f)),e.position(y)}var v=o.startPan,b=o.pan,x=a.pan,w=null!=b&&r;w&&(KHe(v.x,b.x)&&(x.x=YHe(v.x,b.x,p,f)),KHe(v.y,b.y)&&(x.y=YHe(v.y,b.y,p,f)),e.emit("pan"));var E=o.startZoom,k=o.zoom,T=null!=k&&r;T&&(KHe(E,k)&&(a.zoom=ePe(a.minZoom,YHe(E,k,p,f),a.maxZoom)),e.emit("zoom")),(w||T)&&e.emit("viewport");var _=o.style;if(_&&_.length>0&&i){for(var C=0;C<_.length;C++){var S=_[C],A=S.name,N=S,I=o.startStyle[A],O=YHe(I,N,p,f,c.properties[I.name]);c.overrideBypass(e,A,O)}e.emit("style")}}return o.progress=p,p}function KHe(e,t){return null!=e&&null!=t&&(!(!QMe(e)||!QMe(t))||!(!e||!t))}function QHe(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function ZHe(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(0===a.length){var l=o.shift();l&&a.push(l)}for(var c=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},u=a.length-1;u>=0;u--){var h=a[u],d=h._private;d.stopped?(a.splice(u,1),d.hooked=!1,d.playing=!1,d.started=!1,c(d.frames)):(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||QHe(0,h,e),XHe(t,h,e,n),d.applying&&(d.applying=!1),c(d.frames),null!=d.step&&d.step(e),h.completed()&&(a.splice(u,1),d.hooked=!1,d.playing=!1,d.started=!1,c(d.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var JHe={animate:wze.animate(),animation:wze.animation(),animated:wze.animated(),clearQueue:wze.clearQueue(),delay:wze.delay(),delayAnimation:wze.delayAnimation(),stop:wze.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender(function(t,n){ZHe(n,e)},t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&PRe(function(n){ZHe(n,e),t()})}()}}},eUe={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&eRe(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},tUe=function(e){return VMe(e)?new aje(e):e},nUe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new rHe(eUe,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,tUe(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,tUe(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,tUe(t),n),this},once:function(e,t,n){return this.emitter().one(e,tUe(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};wze.eventAliasesOn(nUe);var rUe={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};rUe.jpeg=rUe.jpg;var iUe={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=VMe(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var a=new r(vRe({},e,{cy:t,eles:i}));return a}iDe("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else iDe("A `name` must be specified to make a layout");else iDe("Layout options must be specified to make a layout")}};iUe.createLayout=iUe.makeLayout=iUe.layout;var aUe={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};sUe.invalidateDimensions=sUe.resize;var lUe={collection:function(e,t){return VMe(e)?this.$(e):JMe(e)?e.collection():XMe(e)?(t||(t={}),new FHe(this,e,t.unique,t.removed)):new FHe(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};lUe.elements=lUe.filter=lUe.$;var cUe={},uUe="t";cUe.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(d||h&&p){var f=void 0;d&&p||d?f=c.properties:p&&(f=c.mappedProperties);for(var g=0;g1&&(m=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],k=i.valueMin[1],T=i.valueMax[1],_=i.valueMin[2],C=i.valueMax[2],S=null==i.valueMin[3]?1:i.valueMin[3],A=null==i.valueMax[3]?1:i.valueMax[3],N=[Math.round(w+(E-w)*m),Math.round(k+(T-k)*m),Math.round(_+(C-_)*m),Math.round(S+(A-S)*m)];n={bypass:i.bypass,name:i.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else{if(!s.number)return!1;var I=i.valueMin+(i.valueMax-i.valueMin)*m;n=this.parse(i.name,I,i.bypass,d)}if(!n)return g(),!1;n.mapping=i,i=n;break;case o.data:for(var O=i.field.split("."),L=h.data,M=0;M0&&a>0){for(var s={},l=!1,c=0;c0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},cUe.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);e.removed()||null!=s&&s(n,r,e)&&a(o)},cUe.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify("zorder",e)})},cUe.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},cUe.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},cUe.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},cUe.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var hUe={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;at.length?a.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(a.match(/^\s*$/))break;var l=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){oDe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}t=l[0];var c=l[1];if("core"!==c)if(new aje(c).invalid){oDe("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),o();continue}var u=l[2],h=!1;n=u;for(var d=[];;){if(n.match(/^\s*$/))break;var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){oDe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),h=!0;break}r=p[0];var f=p[1],g=p[2];if(this.properties[f])i.parse(f,g)?(d.push({name:f,val:g}),s()):(oDe("Skipping property: Invalid property definition in: "+r),s());else oDe("Skipping property: Invalid property name in: "+r),s()}if(h){o();break}i.selector(c);for(var m=0;m=7&&"d"===t[0]&&(c=new RegExp(s.data.regex).exec(t))){if(n)return!1;var d=s.data;return{name:e,value:c,strValue:""+t,mapped:d,field:c[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(u=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(h.multiple)return!1;var p=s.mapData;if(!h.color&&!h.number)return!1;var f=this.parse(e,u[4]);if(!f||f.mapped)return!1;var g=this.parse(e,u[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return oDe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(h.color){var m=f.value,y=g.value;if(!(m[0]!==y[0]||m[1]!==y[1]||m[2]!==y[2]||m[3]!==y[3]&&(null!=m[3]&&1!==m[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:u,strValue:""+t,mapped:p,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(h.multiple&&"multiple"!==r){var v;if(v=l?t.split(/\s+/):XMe(t)?t:[t],h.evenMultiple&&v.length%2!=0)return null;for(var b=[],x=[],w=[],E="",k=!1,T=0;T0?" ":"")+_.strValue}return h.validate&&!h.validate(b,x)?null:h.singleEnum&&k?1===b.length&&VMe(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var C,S,A=function(){for(var r=0;rh.max||h.strictMax&&t===h.max))return null;var M={name:e,value:t,strValue:""+t+(N||""),units:N,bypass:n};return h.unitless||"px"!==N&&"em"!==N?M.pfValue=t:M.pfValue="px"!==N&&N?this.getEmSizeInPixels()*t:t,"ms"!==N&&"s"!==N||(M.pfValue="ms"===N?t:1e3*t),"deg"!==N&&"rad"!==N||(M.pfValue="rad"===N?t:(C=t,Math.PI*C/180)),"%"===N&&(M.pfValue=t/100),M}if(h.propList){var R=[],D=""+t;if("none"===D);else{for(var P=D.split(/\s*,\s*|\s+/),$=0;$0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:o=(o=(o=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:o)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),QMe(e)?n=e:KMe(e)&&(n=e.level,null!=e.position?t=UDe(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;QMe(l.x)&&(t.pan.x=l.x,o=!1),QMe(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(VMe(e)){var n=e;e=this.mutableElements().filter(n)}else JMe(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var e=n.window().getComputedStyle(t),r=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-r("padding-left")-r("padding-right"),height:t.clientHeight-r("padding-top")-r("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};wUe.centre=wUe.center,wUe.autolockNodes=wUe.autolock,wUe.autoungrabifyNodes=wUe.autoungrabify;var EUe={data:wze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:wze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:wze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:wze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};EUe.attr=EUe.data,EUe.removeAttr=EUe.removeData;var kUe=function(e){var t=this,n=(e=vRe({},e)).container;n&&!ZMe(n)&&ZMe(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==dMe&&void 0!==n&&!e.headless,o=e;o.layout=vRe({name:a?"grid":"null"},o.layout),o.renderer=vRe({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:o,elements:new FHe(this),listeners:[],aniEles:new FHe(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:QMe(o.zoom)?o.zoom:1,pan:{x:KMe(o.pan)&&QMe(o.pan.x)?o.pan.x:0,y:KMe(o.pan)&&QMe(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});l.styleEnabled&&t.setStyle([]);var c=vRe({},o,o.renderer);t.initRenderer(c);!function(e,t){if(e.some(aRe))return X$e.all(e).then(t);t(e)}([o.style,o.elements],function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(KMe(e)||XMe(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var a=vRe({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()}(a,function(){t.startAnimationLoop(),l.ready=!0,YMe(o.ready)&&t.on("ready",o.ready);for(var e=0;e0,l=!!t.boundingBox,c=tPe(l?t.boundingBox:structuredClone(n.extent()));if(JMe(t.roots))e=t.roots;else if(XMe(t.roots)){for(var u=[],h=0;h0;){var N=A(),I=T(N,C);if(I)N.outgoers().filter(function(e){return e.isNode()&&r.has(e)}).forEach(S);else if(null===I){oDe("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var L=0;L0&&y[0].length<=3?a/2:0),s=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(o=1),{x:q+o*Math.cos(s),y:W+o*Math.sin(s)}}var u=y[r].length,h=Math.max(1===u?0:l?(c.w-2*t.padding-V.w)/((t.grid?X:u)-1):(c.w-2*t.padding-V.w)/((t.grid?X:u)+1),O);return{x:q+(i+1-(u+1)/2)*h,y:W+(r+1-(F+1)/2)*Y}}(e),c,K[t.direction])}),this};var IUe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function OUe(e){this.options=vRe({},IUe,e)}OUe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o,s=tPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,c=s.y1+s.h/2,u=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),h=0,d=0;d1&&t.avoidOverlap){h*=1.75;var m=Math.cos(u)-Math.cos(0),y=Math.sin(u)-Math.sin(0),v=Math.sqrt(h*h/(m*m+y*y));o=Math.max(v,o)}return r.nodes().layoutPositions(this,t,function(e,n){var r=t.startAngle+n*u*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:l+a,y:c+s}}),this};var LUe,MUe={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function RUe(e){this.options=vRe({},MUe,e)}RUe.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,a=i.nodes().not(":parent"),o=tPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=o.x1+o.w/2,l=o.y1+o.h/2,c=[],u=0,h=0;h0)Math.abs(v[0].value-x.value)>=m&&(v=[],y.push(v));v.push(x)}var w=u+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,k=(Math.min(o.w,o.h)/2-w)/(y.length+E?1:0);w=Math.min(w,k)}for(var T=0,_=0;_1&&t.avoidOverlap){var N=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(N*N+I*I));T=Math.max(O,T)}C.r=T,T+=w}if(t.equidistant){for(var L=0,M=0,R=0;R=e.numIter)&&(UUe(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature=e.animationThreshold&&a(),PRe(u)):(tGe(r,e),s())};u()}else{for(;c;)c=o(l),l++;tGe(r,e),s()}return this},PUe.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},PUe.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var $Ue=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=tPe(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},c=0;c0){o.graphSet.push(w);for(c=0;cr.count?0:r.graph},FUe=function(e,t,n,r){var i=r.graphSet[n];if(-10)var s=(c=r.nodeOverlap*o)*i/(g=Math.sqrt(i*i+a*a)),l=c*a/g;else{var c,u=YUe(e,i,a),h=YUe(t,-1*i,-1*a),d=h.x-u.x,p=h.y-u.y,f=d*d+p*p,g=Math.sqrt(f);s=(c=(e.nodeRepulsion+t.nodeRepulsion)/f)*d/g,l=c*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},VUe=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},YUe=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,c={};return 0===t&&0n?(c.x=r,c.y=i+a/2,c):0t&&-1*l<=s&&s<=l?(c.x=r-o/2,c.y=i-o*n/2/t,c):0=l)?(c.x=r+a*t/2/n,c.y=i+a/2,c):0>n&&(s<=-1*l||s>=l)?(c.x=r-a*t/2/n,c.y=i-a/2,c):c},XUe=function(e,t){for(var n=0;n1){var f=t.gravity*h/p,g=t.gravity*d/p;u.offsetX+=f,u.offsetY+=g}}}}},QUe=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},eGe=function(e,t){var n=e.parentId;if(null!=n){var r=t.layoutNodes[t.idToIndex[n]],i=!1;return(null==r.maxX||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(null==r.minX||e.minX-r.padLeftr.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(null==r.minY||e.minY-r.padTopf&&(h+=p+t.componentSpacing,u=0,d=0,p=0)}}},nGe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function rGe(e){this.options=vRe({},nGe,e)}rGe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var a=tPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,t,function(e){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),c=Math.round(a.w/a.h*s),u=function(e){if(null==e)return Math.min(l,c);Math.min(l,c)==l?l=e:c=e},h=function(e){if(null==e)return Math.max(l,c);Math.max(l,c)==l?l=e:c=e},d=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=p)l=d,c=p;else if(null!=d&&null==p)l=d,c=Math.ceil(o/l);else if(null==d&&null!=p)c=p,l=Math.ceil(o/c);else if(c*l>o){var f=u(),g=h();(f-1)*g>=o?u(f-1):(g-1)*f>=o&&h(g-1)}else for(;c*l=o?h(y+1):u(m+1)}var v=a.w/c,b=a.h/l;if(t.condense&&(v=0,b=0),t.avoidOverlap)for(var x=0;x=c&&(O=0,I++)},M={},R=0;R(r=yPe(e,t,x[w],x[w+1],x[w+2],x[w+3])))return m(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(x=a.allpts,w=0;w+5(r=mPe(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return m(n,r),!0;v=v||i.source,b=b||i.target;var E=o.getArrowWidth(l,u),k=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w0&&(y(v),y(b))}function b(e,t,n){return fDe(e,t,n)}function x(n,r){var i,a=n._private,o=f;i=r?r+"-":"",n.boundingBox();var s=a.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var c=b(a.rscratch,"labelX",r),u=b(a.rscratch,"labelY",r),h=b(a.rscratch,"labelAngle",r),d=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-o-d,y=s.x2+o-d,v=s.y1-o-p,x=s.y2+o-p;if(h){var w=Math.cos(h),E=Math.sin(h),k=function(e,t){return{x:(e-=c)*w-(t-=u)*E+c,y:e*E+t*w+u}},T=k(g,v),_=k(g,x),C=k(y,v),S=k(y,x),A=[T.x+d,T.y+p,C.x+d,C.y+p,S.x+d,S.y+p,_.x+d,_.y+p];if(vPe(e,t,A))return m(n),!0}else if(lPe(s,e,t))return m(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):v(E)||x(E)||x(E,"source")||x(E,"target")}return c},getAllInBox:function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),u=Math.max(t,r),h=tPe({x1:e=s,y1:t=c,x2:n=l,y2:r=u}),d=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[d[0],d[1]],[d[1],d[2]],[d[2],d[3]],[d[3],d[0]]];function f(e,t,n){return fDe(e,t,n)}function g(e,t){var n=e._private,r=a;e.boundingBox();var i=n.labelBounds.main;if(!i)return null;var o=f(n.rscratch,"labelX",t),s=f(n.rscratch,"labelY",t),l=f(n.rscratch,"labelAngle",t),c=e.pstyle("text-margin-x").pfValue,u=e.pstyle("text-margin-y").pfValue,h=i.x1-r-c,d=i.x2+r-c,p=i.y1-r-u,g=i.y2+r-u;if(l){var m=Math.cos(l),y=Math.sin(l),v=function(e,t){return{x:(e-=o)*m-(t-=s)*y+o,y:e*y+t*m+s}};return[v(h,p),v(d,p),v(d,g),v(h,g)]}return[{x:h,y:p},{x:d,y:p},{x:d,y:g},{x:h,y:g}]}function m(e,t,n,r){function i(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}for(var y=0;y0?-(Math.PI-a.ang):Math.PI+a.ang),PGe(t,n,DGe),bGe=RGe.nx*DGe.ny-RGe.ny*DGe.nx,xGe=RGe.nx*DGe.nx-RGe.ny*-DGe.ny,kGe=Math.asin(Math.max(-1,Math.min(1,bGe))),Math.abs(kGe)<1e-6)return yGe=t.x,vGe=t.y,void(_Ge=SGe=0);wGe=1,EGe=!1,xGe<0?kGe<0?kGe=Math.PI+kGe:(kGe=Math.PI-kGe,wGe=-1,EGe=!0):kGe>0&&(wGe=-1,EGe=!0),SGe=void 0!==t.radius?t.radius:r,TGe=kGe/2,AGe=Math.min(RGe.len/2,DGe.len/2),i?(CGe=Math.abs(Math.cos(TGe)*SGe/Math.sin(TGe)))>AGe?(CGe=AGe,_Ge=Math.abs(CGe*Math.sin(TGe)/Math.cos(TGe))):_Ge=SGe:(CGe=Math.min(AGe,SGe),_Ge=Math.abs(CGe*Math.sin(TGe)/Math.cos(TGe))),OGe=t.x+DGe.nx*CGe,LGe=t.y+DGe.ny*CGe,yGe=OGe-DGe.ny*_Ge*wGe,vGe=LGe+DGe.nx*_Ge*wGe,NGe=t.x+RGe.nx*CGe,IGe=t.y+RGe.ny*CGe,MGe=t};function BGe(e,t){0===t.radius?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function FGe(e,t,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:($Ge(e,t,n,r,i),{cx:yGe,cy:vGe,radius:_Ge,startX:NGe,startY:IGe,stopX:OGe,stopY:LGe,startAngle:RGe.ang+Math.PI/2*wGe,endAngle:DGe.ang-Math.PI/2*wGe,counterClockwise:EGe})}var zGe=.01,jGe=Math.sqrt(.02),HGe={};function UGe(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},S=C(T,E),A=C(_,k),N=!1;"auto"===m?g=Math.abs(S)>Math.abs(A)?i:r:m===l||m===s?(g=r,N=!0):m!==a&&m!==o||(g=i,N=!0);var I,O=g===r,L=O?A:S,M=O?_:T,R=YDe(M),D=!1;(N&&(v||x)||!(m===s&&M<0||m===l&&M>0||m===a&&M>0||m===o&&M<0)||(L=(R*=-1)*Math.abs(L),D=!0),v)?I=(b<0?1+b:b)*L:I=(b<0?L:0)+b*R;var P=function(e){return Math.abs(e)=Math.abs(L)},$=P(I),B=P(Math.abs(L)-Math.abs(I));if(($||B)&&!D)if(O){var F=Math.abs(M)<=h/2,z=Math.abs(T)<=d/2;if(F){var j=(c.x1+c.x2)/2,H=c.y1,U=c.y2;n.segpts=[j,H,j,U]}else if(z){var G=(c.y1+c.y2)/2,q=c.x1,W=c.x2;n.segpts=[q,G,W,G]}else n.segpts=[c.x1,c.y2]}else{var V=Math.abs(M)<=u/2,Y=Math.abs(_)<=p/2;if(V){var X=(c.y1+c.y2)/2,K=c.x1,Q=c.x2;n.segpts=[K,X,Q,X]}else if(Y){var Z=(c.x1+c.x2)/2,J=c.y1,ee=c.y2;n.segpts=[Z,J,Z,ee]}else n.segpts=[c.x2,c.y1]}else if(O){var te=c.y1+I+(f?h/2*R:0),ne=c.x1,re=c.x2;n.segpts=[ne,te,re,te]}else{var ie=c.x1+I+(f?u/2*R:0),ae=c.y1,oe=c.y2;n.segpts=[ie,ae,ie,oe]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},HGe.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,c=t.srcShape,u=t.tgtShape,h=t.srcCornerRadius,d=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!QMe(n.startX)||!QMe(n.startY),m=!QMe(n.arrowStartX)||!QMe(n.arrowStartY),y=!QMe(n.endX)||!QMe(n.endY),v=!QMe(n.arrowEndX)||!QMe(n.arrowEndY),b=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),x=XDe({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xg.poolIndex()){var m=f;f=g,g=m}var y=h.srcPos=f.position(),v=h.tgtPos=g.position(),b=h.srcW=f.outerWidth(),w=h.srcH=f.outerHeight(),E=h.tgtW=g.outerWidth(),k=h.tgtH=g.outerHeight(),T=h.srcShape=n.nodeShapes[t.getNodeShape(f)],_=h.tgtShape=n.nodeShapes[t.getNodeShape(g)],C=h.srcCornerRadius="auto"===f.pstyle("corner-radius").value?"auto":f.pstyle("corner-radius").pfValue,S=h.tgtCornerRadius="auto"===g.pstyle("corner-radius").value?"auto":g.pstyle("corner-radius").pfValue,A=h.tgtRs=g._private.rscratch,N=h.srcRs=f._private.rscratch;h.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var I=0;I=jGe||(G=Math.sqrt(Math.max(U*U,zGe)+Math.max(H*H,zGe)));var q=h.vector={x:U,y:H},W=h.vectorNorm={x:q.x/G,y:q.y/G},V={x:-W.y,y:W.x};h.nodesOverlap=!QMe(G)||_.checkPoint(P[0],P[1],0,E,k,v.x,v.y,S,A)||T.checkPoint(B[0],B[1],0,b,w,y.x,y.y,C,N),h.vectorNormInverse=V,e={nodesOverlap:h.nodesOverlap,dirCounts:h.dirCounts,calculatedIntersection:!0,hasBezier:h.hasBezier,hasUnbundled:h.hasUnbundled,eles:h.eles,srcPos:v,srcRs:A,tgtPos:y,tgtRs:N,srcW:E,srcH:k,tgtW:b,tgtH:w,srcIntn:F,tgtIntn:$,srcShape:_,tgtShape:T,posPts:{x1:j.x2,y1:j.y2,x2:j.x1,y2:j.y1},intersectionPts:{x1:z.x2,y1:z.y2,x2:z.x1,y2:z.y1},vector:{x:-q.x,y:-q.y},vectorNorm:{x:-W.x,y:-W.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var Y=D?e:h;L.nodesOverlap=Y.nodesOverlap,L.srcIntn=Y.srcIntn,L.tgtIntn=Y.tgtIntn,L.isRound=M.startsWith("round"),r&&(f.isParent()||f.isChild()||g.isParent()||g.isChild())&&(f.parents().anySame(g)||g.parents().anySame(f)||f.same(g)&&f.isParent())?t.findCompoundLoopPoints(O,Y,I,R):f===g?t.findLoopPoints(O,Y,I,R):M.endsWith("segments")?t.findSegmentsPoints(O,Y):M.endsWith("taxi")?t.findTaxiPoints(O,Y):"straight"===M||!R&&h.eles.length%2==1&&I===Math.floor(h.eles.length/2)?t.findStraightEdgePoints(O):t.findBezierPoints(O,Y,I,R,D),t.findEndpoints(O),t.tryToCorrectInvalidPoints(O,Y),t.checkForInvalidEdgeWarning(O),t.storeAllpts(O),t.storeEdgeProjections(O),t.calculateArrowAngles(O),t.recalculateEdgeLabelProjections(O),t.calculateLabelAngles(O)}},x=0;x0){var Z=p,J=KDe(Z,qDe(a)),ee=KDe(Z,qDe(Q)),te=J;if(ee2)KDe(Z,{x:Q[2],y:Q[3]})0){var fe=f,ge=KDe(fe,qDe(a)),me=KDe(fe,qDe(pe)),ye=ge;if(me2)KDe(fe,{x:pe[2],y:pe[3]})=c||v){u={cp:g,segment:y};break}}if(u)break}var b=u.cp,x=u.segment,w=(c-d)/x.length,E=x.t1-x.t0,k=s?x.t0+E*w:x.t1-E*w;k=ePe(0,k,1),t=JDe(b.p0,b.p1,b.p2,k),i=function(e,t,n,r){var i=ePe(0,r-.001,1),a=ePe(0,r+.001,1),o=JDe(e,t,n,i),s=JDe(e,t,n,a);return XGe(o,s)}(b.p0,b.p1,b.p2,k);break;case"straight":case"segments":case"haystack":for(var T,_,C,S,A=0,N=r.allpts.length,I=0;I+3=c));I+=2);var O=(c-_)/T;O=ePe(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,a=t.y-e.y,o=XDe(e,t),s=i/o,l=a/o;return n=null==n?0:n,r=null!=r?r:n*o,{x:e.x+s*r,y:e.y+l*r}}(C,S,O),i=XGe(C,S)}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,i)}};c("source"),c("target"),this.applyLabelDimensions(e)}},VGe.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},VGe.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=WRe(r,e._private.labelDimsKey);if(fDe(n.rscratch,"prefixedLabelDimsKey",t)!==i){gDe(n.rscratch,"prefixedLabelDimsKey",t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,s=e.pstyle("text-wrap").strValue,l=fDe(n.rscratch,"labelWrapCachedLines",t)||[],c="wrap"!==s?1:Math.max(l.length,1),u=a.height/c,h=u*o,d=a.width,p=a.height+(c-1)*(o-1)*u;gDe(n.rstyle,"labelWidth",t,d),gDe(n.rscratch,"labelWidth",t,d),gDe(n.rstyle,"labelHeight",t,p),gDe(n.rscratch,"labelHeight",t,p),gDe(n.rscratch,"labelLineHeight",t,h)}},VGe.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(gDe(n.rscratch,e,t,r),r):fDe(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=o("labelKey");if(null!=l&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var c=i.split("\n"),u=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],p=/[\s\u200b]+|$/g,f=0;fu){var v,b="",x=0,w=aMe(g.matchAll(p));try{for(w.s();!(v=w.n()).done;){var E=v.value,k=E[0],T=g.substring(x,E.index);x=E.index+k.length;var _=0===b.length?T:b+T+k;this.calculateLabelDimensions(e,_).width<=u?b+=T+k:(b&&d.push(b),b=T+k)}}catch(e){w.e(e)}finally{w.f()}b.match(/^[\s\u200b]+$/)||d.push(b)}else d.push(g)}o("labelWrapCachedLines",d),i=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",l)}else if("ellipsis"===s){var C=e.pstyle("text-max-width").pfValue,S="",A=!1;if(this.calculateLabelDimensions(e,i).widthC)break;S+=i[N],N===i.length-1&&(A=!0)}return A||(S+="…"),S}return i},VGe.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},VGe.calculateLabelDimensions=function(e,t){var n=this.cy.window().document,r=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue,a=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=this.labelCalcCanvas,l=this.labelCalcCanvasContext;if(!s){s=this.labelCalcCanvas=n.createElement("canvas"),l=this.labelCalcCanvasContext=s.getContext("2d");var c=s.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}l.font="".concat(r," ").concat(o," ").concat(i,"px ").concat(a);for(var u=0,h=0,d=t.split("\n"),p=0;p1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var C=i(t);m&&(e.hoverData.tapholdCancelled=!0);n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:u[0],y:u[1]});var S=function(e){return{originalEvent:t,type:e,position:{x:u[0],y:u[1]}}},A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||o.emit(S("boxstart")),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(m){var N=S("cxtdrag");b?b.emit(N):o.emit(N),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(S("cxtdragout")),e.hoverData.cxtOver=g,g&&g.emit(S("cxtdragover")))}}else if(e.hoverData.dragging){if(n=!0,o.panningEnabled()&&o.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(u[0]-O[0])*s,y:(u[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};o.panBy(I),o.emit(S("dragpan")),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:u[0],y:u[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:u[0],y:u[1]}),e.hoverData.last=g),b)if(m){if(o.boxSelectionEnabled()&&C)b&&b.grabbed()&&(h(w),b.emit(S("freeon")),w.emit(S("free")),e.dragData.didDrag&&(b.emit(S("dragfreeon")),w.emit(S("dragfree")))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var L=!e.dragData.didDrag;L&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||c(w,{inDragLayer:!0});var M={x:0,y:0};if(QMe(x[0])&&QMe(x[1])&&(M.x+=x[0],M.y+=x[1],L)){var R=e.hoverData.dragDelta;R&&QMe(R[0])&&QMe(R[1])&&(M.x+=R[0],M.y+=R[1])}e.hoverData.draggingEles=!0,w.silentShift(M).emit(S("position")).emit(S("drag")),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else if(m){if(e.hoverData.dragging||!o.boxSelectionEnabled()||!C&&o.panningEnabled()&&o.userPanningEnabled()){if(!e.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()){a(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=qDe(d),e.redrawHint("select",!0),e.redraw())}}else A();b&&b.pannable()&&b.active()&&b.unactivate()}return f[2]=u[0],f[3]=u[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}},!1),e.registerBinding(t,"mouseup",function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var a=e.cy,o=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(o[0],o[1],!0,!1),c=e.dragData.possibleDragElements,u=e.hoverData.down,d=i(t);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,u&&u.unactivate();var p=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(3===e.hoverData.which){var f=p("cxttapend");if(u?u.emit(f):a.emit(f),!e.hoverData.cxtDragged){var g=p("cxttap");u?u.emit(g):a.emit(g)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:o[0],y:o[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(u,["click","tap","vclick"],t,{x:o[0],y:o[1]}),x=!1,t.timeStamp-w<=a.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(u,["dblclick","dbltap","vdblclick"],t,{x:o[0],y:o[1]})):(b=setTimeout(function(){x||r(u,["oneclick","onetap","voneclick"],t,{x:o[0],y:o[1]})},a.multiClickDebounceTime()),w=t.timeStamp)),null!=u||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(a.$(n).unselect(["tapunselect"]),c.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=c=a.collection()),l!=u||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===a.selectionType()||d?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):d||(a.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var m=a.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),m.length>0&&e.redrawHint("eles",!0),a.emit(p("boxend"));var y=function(e){return e.selectable()&&!e.selected()};"additive"===a.selectionType()||d||a.$(n).unmerge(m).unselect(),m.emit(p("box")).stdFilter(y).select().emit(p("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=u&&u.grabbed();h(c),v&&(u.emit(p("freeon")),c.emit(p("free")),e.dragData.didDrag&&(u.emit(p("dragfreeon")),c.emit(p("dragfree"))))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}},!1);var k,T,_,C,S,A,N,I,O,L,M,R,D,P,$=[],B=1e5,F=function(t){var n=!1,r=t.deltaY;if(null==r&&(null!=t.wheelDeltaY?r=t.wheelDeltaY/4:null!=t.wheelDelta&&(r=t.wheelDelta/4)),0!==r){if(null==k)if($.length>=4){var i=$;if(k=function(e,t){for(var n=0;n5}if(k)for(var o=0;o5&&(r=5*YDe(r)),d=r/-250,k&&(d/=B,d*=3),d*=e.wheelSensitivity,1===t.deltaMode&&(d*=33);var p=s.zoom()*Math.pow(10,d);"gesturechange"===t.type&&(p=e.gestureStartZoom*t.scale),s.zoom({level:p,renderedPosition:{x:h[0],y:h[1]}}),s.emit({type:"gesturechange"===t.type?"pinchzoom":"scrollzoom",originalEvent:t,position:{x:u[0],y:u[1]}})}}}};e.registerBinding(e.container,"wheel",F,!0),e.registerBinding(t,"scroll",function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(t){e.hasTouchStarted||F(t)},!0),e.registerBinding(e.container,"mouseout",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,"mouseover",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})},!1);var z,j,H,U,G,q,W,V=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},Y=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",z=function(t){if(e.hasTouchStarted=!0,v(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(t.touches[1]){o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(t.touches[2]){o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=o[0],i[5]=o[1]}var l=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};if(t.touches[1]){e.touchData.singleTouchMoved=!0,h(e.dragData.touchDragEles);var d=e.findContainerClientCoords();L=d[0],M=d[1],R=d[2],D=d[3],T=t.touches[0].clientX-L,_=t.touches[0].clientY-M,C=t.touches[1].clientX-L,S=t.touches[1].clientY-M,P=0<=T&&T<=R&&0<=C&&C<=R&&0<=_&&_<=D&&0<=S&&S<=D;var f=n.pan(),g=n.zoom();A=V(T,_,C,S),N=Y(T,_,C,S),O=[((I=[(T+C)/2,(_+S)/2])[0]-f.x)/g,(I[1]-f.y)/g];if(N<4e4&&!t.touches[2]){var m=e.findNearestElement(i[0],i[1],!0,!0),y=e.findNearestElement(i[2],i[3],!0,!0);return m&&m.isNode()?(m.activate().emit(l("cxttapstart")),e.touchData.start=m):y&&y.isNode()?(y.activate().emit(l("cxttapstart")),e.touchData.start=y):n.emit(l("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var b=e.findNearestElements(i[0],i[1],!0,!0),x=b[0];if(null!=x&&(x.activate(),e.touchData.start=x,e.touchData.starts=b,e.nodeIsGrabbable(x))){var w=e.dragData.touchDragEles=n.collection(),E=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),x.selected()?(E=n.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),c(E,{addToList:w})):u(x,{addToList:w}),s(x),x.emit(l("grabon")),E?E.forEach(function(e){e.emit(l("grab"))}):x.emit(l("grab"))}r(x,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==x&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})},e.tapholdDuration)}if(t.touches.length>=1){for(var k=e.touchData.startPosition=[null,null,null,null,null,null],$=0;$=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var E=t.touches[0].clientX-L,k=t.touches[0].clientY-M,I=t.touches[1].clientX-L,R=t.touches[1].clientY-M,D=Y(E,k,I,R);if(D/N>=2.25||D>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var $=f("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit($),e.touchData.start=null):o.emit($)}}if(n&&e.touchData.cxt){$=f("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit($):o.emit($),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit(f("cxtdragout")),e.touchData.cxtOver=B,B&&B.emit(f("cxtdragover")))}else if(n&&t.touches[2]&&o.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||o.emit(f("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&o.zoomingEnabled()&&o.panningEnabled()&&o.userZoomingEnabled()&&o.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",H=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",U=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o=e.cy,s=o.zoom(),l=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);l[0]=u[0],l[1]=u[1]}if(t.touches[1]){u=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);l[2]=u[0],l[3]=u[1]}if(t.touches[2]){u=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);l[4]=u[0],l[5]=u[1]}var d,p=function(e){return{originalEvent:t,type:e,position:{x:l[0],y:l[1]}}};if(i&&i.unactivate(),e.touchData.cxt){if(d=p("cxttapend"),i?i.emit(d):o.emit(d),!e.touchData.cxtDragged){var f=p("cxttap");i?i.emit(f):o.emit(f)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&o.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var g=o.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint("select",!0),o.emit(p("boxend"));g.emit(p("box")).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(p("boxselect")),g.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var m=e.dragData.touchDragEles;if(null!=i){var y=i._private.grabbed;h(m),e.redrawHint("drag",!0),e.redrawHint("eles",!0),y&&(i.emit(p("freeon")),m.emit(p("free")),e.dragData.didDrag&&(i.emit(p("dragfreeon")),m.emit(p("dragfree")))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:l[0],y:l[1]}),i.unactivate(),e.touchData.start=null}else{var v=e.findNearestElement(l[0],l[1],!0,!0);r(v,["touchend","tapend","vmouseup","tapdragout"],t,{x:l[0],y:l[1]})}var b=e.touchData.startPosition[0]-l[0],x=b*b,w=e.touchData.startPosition[1]-l[1],E=(x+w*w)*s*s;e.touchData.singleTouchMoved||(i||o.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:l[0],y:l[1]}),G=!1,t.timeStamp-W<=o.multiClickDebounceTime()?(q&&clearTimeout(q),G=!0,W=null,r(i,["dbltap","vdblclick"],t,{x:l[0],y:l[1]})):(q=setTimeout(function(){G||r(i,["onetap","voneclick"],t,{x:l[0],y:l[1]})},o.multiClickDebounceTime()),W=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&E2){for(var p=[u[0],u[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return m[0]}return null},p=Object.keys(h),f=0;f0?c:pPe(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){var l=2*(s="auto"===s?LPe(r,i):s);if(bPe(e,t,this.points,a,o,r,i-l,[0,-1],n))return!0;if(bPe(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,u=i/2+2*n;return!!vPe(e,t,[a-c,o-u,a-c,o,a+c,o,a+c,o-u])||(!!EPe(e,t,l,l,a+r/2-s,o+i/2-s,n)||!!EPe(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},rqe.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",NPe(3,0)),this.generateRoundPolygon("round-triangle",NPe(3,0)),this.generatePolygon("rectangle",NPe(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",NPe(5,0)),this.generateRoundPolygon("round-pentagon",NPe(5,0)),this.generatePolygon("hexagon",NPe(6,0)),this.generateRoundPolygon("round-hexagon",NPe(6,0)),this.generatePolygon("heptagon",NPe(7,0)),this.generateRoundPolygon("round-heptagon",NPe(7,0)),this.generatePolygon("octagon",NPe(8,0)),this.generateRoundPolygon("round-octagon",NPe(8,0));var r=new Array(20),i=OPe(5,0),a=OPe(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*lqe)break;var m=e.deq(t,h,u);if(!(m.length>0))break;for(var y=0;y0&&(e.onDeqd(t,c),!i&&e.shouldRedraw(t,c,h,u)&&r())},i(t))}}},uqe=function(){return iMe(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tDe;rMe(this,e),this.idsByKey=new mDe,this.keyForId=new mDe,this.cachesByLvl=new mDe,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n},[{key:"getIdsFor",value:function(e){null==e&&iDe("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new vDe,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new mDe,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}])}(),hqe=7.99,dqe={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},pqe=hDe({getKey:null,doesEleInvalidateKey:tDe,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:eDe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),fqe=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=pqe(t);vRe(n,r),n.lookup=new uqe(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},gqe=fqe.prototype;gqe.reasons=dqe,gqe.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},gqe.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},gqe.getElementQueue=function(){var e=this.eleCacheQueue=this.eleCacheQueue||new NDe(function(e,t){return t.reqs-e.reqs});return e},gqe.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},gqe.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(VDe(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var c=Math.pow(2,r),u=t.h*c,h=t.w*c,d=o.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,d))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||h>1024)return null;var g=a.getTextureQueue(p),m=g[g.length-2],y=function(){return a.recycleTexture(p,h)||a.addTexture(p,h)};m||(m=g[g.length-1]),m||(m=y()),m.width-m.usedWidthr;S--)_=a.getElement(e,t,n,S,dqe.downscale);C()}else{var A;if(!x&&!w&&!E)for(var N=r-1;N>=-4;N--){var I=l.get(e,N);if(I){A=I;break}}if(b(A))return a.queueElement(e,r),A;m.context.translate(m.usedWidth,0),m.context.scale(c,c),this.drawElement(m.context,e,t,d,!1),m.context.scale(1/c,1/c),m.context.translate(-m.usedWidth,0)}return f={x:m.usedWidth,texture:m,level:r,scale:c,width:h,height:u,scaledLabelShown:d},m.usedWidth+=Math.ceil(h+8),m.eleCaches.push(f),l.set(e,r,f),a.checkTextureFullness(m),f},gqe.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},gqe.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?dDe(t,e):e.fullnessChecks++},gqe.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;dDe(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,pDe(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),dDe(r,a),n.push(a),a}},gqe.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},gqe.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o<1&&n.size()>0;o++){var s=n.pop(),l=s.key,c=s.eles[0],u=a.hasCache(c,s.level);if(r[l]=null,!u){i.push(s);var h=t.getBoundingBox(c);t.getElement(c,h,e,s.level,dqe.dequeue)}}return i},gqe.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=JRe,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},gqe.onDequeue=function(e){this.onDequeues.push(e)},gqe.offDequeue=function(e){dDe(this.onDequeues,e)},gqe.setupDequeueing=cqe({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var o,s,l=r.layersByLevel,c=Math.pow(2,n),u=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return u;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var a=u.length-1;a>=0;a--){var o=u[a];o.invalid&&dDe(u,o)}}();var h=function(t){var i=(t=t||{}).after;!function(){if(!o){o=tPe();for(var t=0;t32767||s>32767)return null;if(a*s>16e6)return null;var l=r.makeLayer(o,n);if(null!=i){var h=u.indexOf(i)+1;u.splice(h,0,l)}else(void 0===t.insert||t.insert)&&u.unshift(l);return l};if(r.skipping&&!a)return null;for(var d=null,p=e.length/1,f=!a,g=0;g=p||!uPe(d.bb,m.boundingBox()))&&!(d=h({insert:!0,after:d})))return null;s||f?r.queueLayer(d,m):r.drawEleInLayer(d,m,n,t),d.eles.push(m),v[n]=d}}return s||(f?null:u)},yqe.getEleLevelForLayerLevel=function(e,t){return e},yqe.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,true),i.setImgSmoothing(a,!0))},yqe.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===t.length},yqe.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},yqe.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=$Re(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},yqe.invalidateLayer=function(e){if(this.lastInvalidationTime=$Re(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];dDe(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,s=t._private.rscratch;if((!a||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var c=a?t.pstyle("opacity").value:1,u=a?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,m=t.pstyle("line-outline-color").value,y=c*u,v=c*u,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===h?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;o.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,k=t.pstyle("ghost-opacity").value,T=y*k;e.translate(w,E),b(T),x(T),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(o.colorStrokeStyle(e,m[0],m[1],m[2],n),"straight-triangle"===h?o.drawEdgeTrianglePath(t,e,s.allpts):(o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")):e.lineCap="butt"}();i&&o.drawEdgeUnderlay(e,t),b(),x(),i&&o.drawEdgeOverlay(e,t),o.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},Dqe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==o.edgeType||a?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,o.allpts,"solid")}}}};Rqe.drawEdgeOverlay=Dqe("overlay"),Rqe.drawEdgeUnderlay=Dqe("underlay"),Rqe.drawEdgePath=function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,l=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");a.pathCacheKey&&a.pathCacheKey===h?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=h,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(c),o.lineDashOffset=u;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+35&&void 0!==arguments[5]?arguments[5]:5,o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}$qe.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(VDe(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],o=this;if(null==r){if(a&&!o.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,u=t.pstyle("label"),h=t.pstyle("source-label"),d=t.pstyle("target-label");if(c||(!u||!u.value)&&(!h||!h.value)&&(!d||!d.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(o.drawText(e,t,null,f,a),t.isEdge()&&(o.drawText(e,t,"source",f,a),o.drawText(e,t,"target",f,a))):o.drawText(e,t,i,f,a),n&&e.translate(p.x1,p.y1)},$qe.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,c=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],s),this.colorStrokeStyle(e,u[0],u[1],u[2],l)},$qe.getTextAngle=function(e,t){var n,r=e._private.rscratch,i=t?t+"-":"",a=e.pstyle(i+"text-rotation");if("autorotate"===a.strValue){var o=fDe(r,"labelAngle",t);n=e.isEdge()?o:0}else n="none"===a.strValue?0:a.pfValue;return n},$qe.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||0!==o&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,c=fDe(a,"labelX",n),u=fDe(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(e,t,i);var d,p=n?n+"-":"",f=fDe(a,"labelWidth",n),g=fDe(a,"labelHeight",n),m=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,v=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(v&&(b="center",x="center"),c+=m,u+=y,0!==(d=r?this.getTextAngle(t,n):0)&&(s=c,l=u,e.translate(s,l),e.rotate(d),c=0,u=0),x){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,T=t.pstyle("text-background-padding").pfValue,_=t.pstyle("text-background-shape").strValue,C="round-rectangle"===_||"roundrectangle"===_,S="circle"===_;if(w>0||k>0&&E>0){var A=e.fillStyle,N=e.strokeStyle,I=e.lineWidth,O=t.pstyle("text-background-color").value,L=t.pstyle("text-border-color").value,M=t.pstyle("text-border-style").value,R=w>0,D=k>0&&E>0,P=c-T;switch(b){case"left":P-=f;break;case"center":P-=f/2}var $=u-g-T,B=f+2*T,F=g+2*T;if(R&&(e.fillStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(w*o,")")),D&&(e.strokeStyle="rgba(".concat(L[0],",").concat(L[1],",").concat(L[2],",").concat(E*o,")"),e.lineWidth=k,e.setLineDash))switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;default:e.setLineDash([])}if(C?(e.beginPath(),Bqe(e,P,$,B,F,2)):S?(e.beginPath(),function(e,t,n,r,i){var a=Math.min(r,i)/2,o=t+r/2,s=n+i/2;e.beginPath(),e.arc(o,s,a,0,2*Math.PI),e.closePath()}(e,P,$,B,F)):(e.beginPath(),e.rect(P,$,B,F)),R&&e.fill(),D&&e.stroke(),D&&"double"===M){var z=k/2;e.beginPath(),C?Bqe(e,P+z,$+z,B-2*z,F-2*z,2):e.rect(P+z,$+z,B-2*z,F-2*z),e.stroke()}e.fillStyle=A,e.strokeStyle=N,e.lineWidth=I,e.setLineDash&&e.setLineDash([])}var j=2*t.pstyle("text-outline-width").pfValue;if(j>0&&(e.lineWidth=j),"wrap"===t.pstyle("text-wrap").value){var H=fDe(a,"labelWrapCachedLines",n),U=fDe(a,"labelLineHeight",n),G=f/2,q=this.getLabelJustification(t);switch("auto"===q||("left"===b?"left"===q?c+=-f:"center"===q&&(c+=-G):"center"===b?"left"===q?c+=-G:"right"===q&&(c+=G):"right"===b&&("center"===q?c+=G:"right"===q&&(c+=f))),x){case"top":case"center":case"bottom":u-=(H.length-1)*U}for(var W=0;W0&&e.strokeText(H[W],c,u),e.fillText(H[W],c,u),u+=U}else j>0&&e.strokeText(h,c,u),e.fillText(h,c,u);0!==d&&(e.rotate(-d),e.translate(-s,-l))}}};var Fqe={drawNode:function(e,t,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,c=t._private,u=c.rscratch,h=t.position();if(QMe(h.x)&&QMe(h.y)&&(!s||t.visible())){var d,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),m=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var v=t.pstyle("background-image").value,b=new Array(v.length),x=new Array(v.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:S;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;l.colorStrokeStyle(e,A[0],A[1],A[2],t)},G=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F;l.colorStrokeStyle(e,$[0],$[1],$[2],t)},q=function(e,t,n,r){var i,a=l.nodePathCache=l.nodePathCache||[],o=VRe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+j),s=a[o],c=!1;return null!=s?(i=s,c=!0,u.pathCache=i):(i=new Path2D,a[o]=u.pathCache=i),{path:i,cacheHit:c}},W=t.pstyle("shape").strValue,V=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(h.x,h.y);var Y=q(r,i,W,V);d=Y.path,m=Y.cacheHit}var X=function(){if(!m){var n=h;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(d||e,n.x,n.y,r,i,j,u)}g?e.fill(d):e.fill()},K=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=c.backgrounding,a=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,a),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u)))},Z=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasStripe(t)&&(e.save(),g?e.clip(u.pathCache):(l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u),e.clip()),l.drawStripe(e,t,a),e.restore(),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u)))},J=function(){var t=(_>0?_:-_)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=_>0?0:255;0!==_&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(d):e.fill())},ee=function(){if(C>0){if(e.lineWidth=C,e.lineCap=O,e.lineJoin=I,e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(M),e.lineDashOffset=R;break;case"solid":case"double":e.setLineDash([])}if("center"!==L){if(e.save(),e.lineWidth*=2,"inside"===L)g?e.clip(d):e.clip();else{var t=new Path2D;t.rect(-r/2-C,-i/2-C,r+2*C,i+2*C),t.addPath(d),e.clip(t,"evenodd")}g?e.stroke(d):e.stroke(),e.restore()}else g?e.stroke(d):e.stroke();if("double"===N){e.lineWidth=C/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(d):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(P>0){if(e.lineWidth=P,e.lineCap="butt",e.setLineDash)switch(B){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=h;g&&(n={x:0,y:0});var a=l.getNodeShape(t),o=C;"inside"===L&&(o=0),"outside"===L&&(o*=2);var s,c=(r+o+(P+z))/r,u=(i+o+(P+z))/i,d=r*c,p=i*u,f=l.nodeShapes[a].points;if(g)s=q(d,p,a,f).path;if("ellipse"===a)l.drawEllipsePath(s||e,n.x,n.y,d,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var m=0,y=0,v=0;"round-diamond"===a?m=1.4*(o+z+P):"round-heptagon"===a?(m=1.075*(o+z+P),v=-(o/2+z+P)/35):"round-hexagon"===a?m=1.12*(o+z+P):"round-pentagon"===a?(m=1.13*(o+z+P),v=-(o/2+z+P)/15):"round-tag"===a?(m=1.12*(o+z+P),y=.07*(o/2+P+z)):"round-triangle"===a&&(m=(o+z+P)*(Math.PI/2),v=-(o+z/2+P)/Math.PI),0!==m&&(d=r*(c=(r+m)/r),["round-hexagon","round-tag"].includes(a)||(p=i*(u=(i+m)/i)));for(var b=d/2,x=p/2,w=(j="auto"===j?MPe(d,p):j)+(o+P+z)/2,E=new Array(f.length/2),k=new Array(f.length/2),T=0;T0){if(r=r||n.position(),null==i||null==a){var h=n.padding();i=n.width()+2*h,a=n.height()+2*h}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[c].draw(t,r.x,r.y,i+2*o,a+2*o,u),t.fill()}}}};Fqe.drawNodeOverlay=zqe("overlay"),Fqe.drawNodeUnderlay=zqe("underlay"),Fqe.hasPie=function(e){return(e=e[0])._private.hasPie},Fqe.hasStripe=function(e){return(e=e[0])._private.hasStripe},Fqe.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i,a=t.cy().style(),o=t.pstyle("pie-size"),s=t.pstyle("pie-hole"),l=t.pstyle("pie-start-angle").pfValue,c=r.x,u=r.y,h=t.width(),d=t.height(),p=Math.min(h,d)/2,f=0;if(this.usePaths()&&(c=0,u=0),"%"===o.units?p*=o.pfValue:void 0!==o.pfValue&&(p=o.pfValue/2),"%"===s.units?i=p*s.pfValue:void 0!==s.pfValue&&(i=s.pfValue/2),!(i>=p))for(var g=1;g<=a.pieBackgroundN;g++){var m=t.pstyle("pie-"+g+"-background-size").value,y=t.pstyle("pie-"+g+"-background-color").value,v=t.pstyle("pie-"+g+"-background-opacity").value*n,b=m/100;b+f>1&&(b=1-f);var x=1.5*Math.PI+2*Math.PI*f,w=(x+=l)+2*Math.PI*b;0===m||f>=1||f+b>1||(0===i?(e.beginPath(),e.moveTo(c,u),e.arc(c,u,p,x,w),e.closePath()):(e.beginPath(),e.arc(c,u,p,x,w),e.arc(c,u,i,w,x,!0),e.closePath()),this.colorFillStyle(e,y[0],y[1],y[2],v),e.fill(),f+=b)}},Fqe.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=r.x,o=r.y,s=t.width(),l=t.height(),c=0,u=this.usePaths();e.save();var h=t.pstyle("stripe-direction").value,d=t.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":e.rotate(-Math.PI/2)}var p=s,f=l;"%"===d.units?(p*=d.pfValue,f*=d.pfValue):void 0!==d.pfValue&&(p=d.pfValue,f=d.pfValue),u&&(a=0,o=0),o-=p/2,a-=f/2;for(var g=1;g<=i.stripeBackgroundN;g++){var m=t.pstyle("stripe-"+g+"-background-size").value,y=t.pstyle("stripe-"+g+"-background-color").value,v=t.pstyle("stripe-"+g+"-background-opacity").value*n,b=m/100;b+c>1&&(b=1-c),0===m||c>=1||c+b>1||(e.beginPath(),e.rect(a,o+f*c,p,f*b),e.closePath(),this.colorFillStyle(e,y[0],y[1],y[2],v),e.fill(),c+=b)}e.restore()};var jqe,Hqe={};function Uqe(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(r));return r}function Gqe(e,t,n){void 0===n&&(n=t);var r=e.makeOffscreenCanvas(t,n),i=r.context=r.getContext("2d");return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function qqe(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function Wqe(e){return"solid"===e.pstyle("background-fill").value&&("none"===e.pstyle("background-image").strValue&&(0===e.pstyle("border-width").value||(0===e.pstyle("border-opacity").value||"solid"===e.pstyle("border-style").value)))}function Vqe(e,t){if(e.length!==t.length)return!1;for(var n=0;n>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function Kqe(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function Qqe(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function Zqe(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function Jqe(e,t,n,r,i,a){switch(t){case e.FLOAT:return new Float32Array(n.buffer,a*r,i);case e.INT:return new Int32Array(n.buffer,a*r,i)}}function eWe(e,t,n,r){var i=sMe(Qqe(e,n),3),a=i[0],o=i[1],s=i[2],l=Zqe(e,o,t*a),c=a*s,u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,t*c,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,a,o,!1,c,0):o===e.INT&&e.vertexAttribIPointer(r,a,o,c,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var h=new Array(t),d=0;dt.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!h&&(u[t.NODE]=!0,u[t.SELECT_BOX]=!0);var v=n.style(),b=n.zoom(),x=void 0!==o?o:b,w=n.pan(),E={x:w.x,y:w.y},k={zoom:b,pan:{x:w.x,y:w.y}},T=t.prevViewport;void 0===T||k.zoom!==T.zoom||k.pan.x!==T.pan.x||k.pan.y!==T.pan.y||g&&!f||(t.motionBlurPxRatio=1),s&&(E=s),x*=l,E.x*=l,E.y*=l;var _=t.getCachedZSortedEles();function C(e,n,r,i,a){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",t.colorFillStyle(e,255,255,255,t.motionBlurTransparency),e.fillRect(n,r,i,a),e.globalCompositeOperation=o}function S(e,n){var a,l,u,h;t.clearingMotionBlur||e!==c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]&&e!==c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]?(a=E,l=x,u=t.canvasWidth,h=t.canvasHeight):(a={x:w.x*p,y:w.y*p},l=b*p,u=t.canvasWidth*p,h=t.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===n?C(e,0,0,u,h):r||void 0!==n&&!n||e.clearRect(0,0,u,h),i||(e.translate(a.x,a.y),e.scale(l,l)),s&&e.translate(s.x,s.y),o&&e.scale(o,o)}if(h||(t.textureDrawLastFrame=!1),h){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var A=t.data.bufferContexts[t.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:l*t.textureMult}),(k=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight}).mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}u[t.DRAG]=!1,u[t.NODE]=!1;var N=c.contexts[t.NODE],I=t.textureCache.texture;k=t.textureCache.viewport;N.setTransform(1,0,0,1,0,0),d?C(N,0,0,k.width,k.height):N.clearRect(0,0,k.width,k.height);var O=v.core("outside-texture-bg-color").value,L=v.core("outside-texture-bg-opacity").value;t.colorFillStyle(N,O[0],O[1],O[2],L),N.fillRect(0,0,k.width,k.height);b=n.zoom();S(N,!1),N.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),N.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else t.textureOnViewport&&!r&&(t.textureCache=null);var M=n.extent(),R=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),D=t.hideEdgesOnViewport&&R,P=[];if(P[t.NODE]=!u[t.NODE]&&d&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,P[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),P[t.DRAG]=!u[t.DRAG]&&d&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,P[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),u[t.NODE]||i||a||P[t.NODE]){var $=d&&!P[t.NODE]&&1!==p;S(N=r||($?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),d&&!$?"motionBlur":void 0),D?t.drawCachedNodes(N,_.nondrag,l,M):t.drawLayeredElements(N,_.nondrag,l,M),t.debug&&t.drawDebugPoints(N,_.nondrag),i||d||(u[t.NODE]=!1)}if(!a&&(u[t.DRAG]||i||P[t.DRAG])){$=d&&!P[t.DRAG]&&1!==p;S(N=r||($?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]),d&&!$?"motionBlur":void 0),D?t.drawCachedNodes(N,_.drag,l,M):t.drawCachedElements(N,_.drag,l,M),t.debug&&t.drawDebugPoints(N,_.drag),i||d||(u[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,S),d&&1!==p){var B=c.contexts[t.NODE],F=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],z=c.contexts[t.DRAG],j=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],H=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!y?e.clearRect(0,0,t.canvasWidth,t.canvasHeight):C(e,0,0,t.canvasWidth,t.canvasHeight);var i=p;e.drawImage(n,0,0,t.canvasWidth*i,t.canvasHeight*i,0,0,t.canvasWidth,t.canvasHeight)};(u[t.NODE]||P[t.NODE])&&(H(B,F,P[t.NODE]),u[t.NODE]=!1),(u[t.DRAG]||P[t.DRAG])&&(H(z,j,P[t.DRAG]),u[t.DRAG]=!1)}t.prevViewport=k,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),d&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!h,t.mbFrames=0,u[t.NODE]=!0,u[t.DRAG]=!0,t.redraw()},100)),r||n.emit("render")},Hqe.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,i=n.data,a=r.style(),o=e.drawOnlyNodeLayer,s=e.drawAllLayers,l=i.canvasNeedsRedraw,c=e.forcedContext;if(n.showFps||!o&&l[n.SELECT_BOX]&&!s){var u=c||i.contexts[n.SELECT_BOX];if(t(u),1==n.selection[4]&&(n.hoverData.selecting||n.touchData.selecting)){var h=n.cy.zoom(),d=a.core("selection-box-border-width").value/h;u.lineWidth=d,u.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",u.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),d>0&&(u.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",u.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){h=n.cy.zoom();var p=i.bgActivePosistion;u.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",u.beginPath(),u.arc(p.x,p.y,a.core("active-bg-size").pfValue/h,0,2*Math.PI),u.fill()}var f=n.lastRedrawTime;if(n.showFps&&f){f=Math.round(f);var g=Math.round(1e3/f),m="1 frame = "+f+" ms = "+g+" fps";if(u.setTransform(1,0,0,1,0,0),u.fillStyle="rgba(255, 0, 0, 0.75)",u.strokeStyle="rgba(255, 0, 0, 0.75)",u.font="30px Arial",!jqe){var y=u.measureText(m);jqe=y.actualBoundingBoxAscent}u.fillText(m,0,jqe);u.strokeRect(0,jqe+10,250,20),u.fillRect(0,jqe+10,250*Math.min(g/60,1),20)}s||(l[n.SELECT_BOX]=!1)}};var tWe="undefined"!=typeof Float32Array?Float32Array:Array;function nWe(){var e=new tWe(9);return tWe!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function rWe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function iWe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=d*r+p*o+c,e[7]=d*i+p*s+u,e[8]=d*a+p*l+h,e}function aWe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(n),p=Math.cos(n);return e[0]=p*r+d*o,e[1]=p*i+d*s,e[2]=p*a+d*l,e[3]=p*o-d*r,e[4]=p*s-d*i,e[5]=p*l-d*a,e[6]=c,e[7]=u,e[8]=h,e}function oWe(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var sWe=function(){return iMe(function e(t,n,r,i){rMe(this,e),this.debugID=Math.floor(1e4*Math.random()),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(t,n,n),this.scratch=i(t,n,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(e){var t=e.w,n=e.h,r=this.texHeight,i=this.texSize,a=r/n,o=t*a,s=n*a;return o>i&&(o=t*(a=i/t),s=n*a),{scale:a,texW:o,texH:s}}},{key:"draw",value:function(e,t,n){var r=this;if(this.locked)throw new Error("can't draw, atlas is locked");var i=this.texSize,a=this.texRows,o=this.texHeight,s=this.getScale(t),l=s.scale,c=s.texW,u=s.texH,h=function(e,r){if(n&&r){var i=r.context,a=e.x,s=e.row,c=a,u=o*s;i.save(),i.translate(c,u),i.scale(l,l),n(i,t),i.restore()}},d=[null,null],p=function(){h(r.freePointer,r.canvas),d[0]={x:r.freePointer.x,y:r.freePointer.row*o,w:c,h:u},d[1]={x:r.freePointer.x+c,y:r.freePointer.row*o,w:0,h:u},r.freePointer.x+=c,r.freePointer.x==i&&(r.freePointer.x=0,r.freePointer.row++)},f=function(){r.freePointer.x=0,r.freePointer.row++};if(this.freePointer.x+c<=i)p();else{if(this.freePointer.row>=a-1)return!1;this.freePointer.x===i?(f(),p()):this.enableWrapping?function(){var e=r.scratch,t=r.canvas;e.clear(),h({x:0,row:0},e);var n=i-r.freePointer.x,a=c-n,s=o,l=r.freePointer.x,p=r.freePointer.row*o,f=n;t.context.drawImage(e,0,0,f,s,l,p,f,s),d[0]={x:l,y:p,w:f,h:u};var g=n,m=(r.freePointer.row+1)*o,y=a;t&&t.context.drawImage(e,g,0,y,s,0,m,y,s),d[1]={x:0,y:m,w:y,h:u},r.freePointer.x=a,r.freePointer.row++}():(f(),p())}return this.keyToLocation.set(e,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(e){return this.keyToLocation.get(e)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(e){if(this.locked)return!1;var t=this.texSize,n=this.texRows,r=this.getScale(e).texW;return!(this.freePointer.x+r>t)||this.freePointer.row1&&void 0!==arguments[1]?arguments[1]:{},i=r.forceRedraw,a=void 0!==i&&i,o=r.filterEle,s=void 0===o?function(){return!0}:o,l=r.filterType,c=void 0===l?function(){return!0}:l,u=!1,h=!1,d=aMe(e);try{for(d.s();!(t=d.n()).done;){var p=t.value;if(s(p)){var f,g=aMe(this.renderTypes.values());try{var m=function(){var e=f.value,t=e.type;if(c(t)){var r=n.collections.get(e.collection),i=e.getKey(p),o=Array.isArray(i)?i:[i];if(a)o.forEach(function(e){return r.markKeyForGC(e)}),h=!0;else{var s=e.getID?e.getID(p):p.id(),l=n._key(t,s),d=n.typeAndIdToKey.get(l);void 0===d||Vqe(o,d)||(u=!0,n.typeAndIdToKey.delete(l),d.forEach(function(e){return r.markKeyForGC(e)}))}}};for(g.s();!(f=g.n()).done;)m()}catch(e){g.e(e)}finally{g.f()}}}}catch(e){d.e(e)}finally{d.f()}return h&&(this.gc(),u=!1),u}},{key:"gc",value:function(){var e,t=aMe(this.collections.values());try{for(t.s();!(e=t.n()).done;){e.value.gc()}}catch(e){t.e(e)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(e,t,n,r){var i=this.renderTypes.get(t),a=this.collections.get(i.collection),o=!1,s=a.draw(r,n,function(t){i.drawClipped?(t.save(),t.beginPath(),t.rect(0,0,n.w,n.h),t.clip(),i.drawElement(t,e,n,!0,!0),t.restore()):i.drawElement(t,e,n,!0,!0),o=!0});if(o){var l=i.getID?i.getID(e):e.id(),c=this._key(t,l);this.typeAndIdToKey.has(c)?this.typeAndIdToKey.get(c).push(r):this.typeAndIdToKey.set(c,[r])}return s}},{key:"getAtlasInfo",value:function(e,t){var n=this,r=this.renderTypes.get(t),i=r.getKey(e);return(Array.isArray(i)?i:[i]).map(function(i){var a=r.getBoundingBox(e,i),o=n.getOrCreateAtlas(e,t,a,i),s=sMe(o.getOffsets(i),2),l=s[0];return{atlas:o,tex:l,tex1:l,tex2:s[1],bb:a}})}},{key:"getDebugInfo",value:function(){var e,t=[],n=aMe(this.collections);try{for(n.s();!(e=n.n()).done;){var r=sMe(e.value,2),i=r[0],a=r[1].getCounts(),o=a.keyCount,s=a.atlasCount;t.push({type:i,keyCount:o,atlasCount:s})}}catch(e){n.e(e)}finally{n.f()}return t}}])}(),uWe=function(){return iMe(function e(t){rMe(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]},[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(e,t){return t})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(e){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(e)}},{key:"getAtlasIndexForBatch",value:function(e){var t=this.batchAtlases.indexOf(e);if(t<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(e),t=this.batchAtlases.length-1}return t}}])}(),hWe={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},dWe=1,pWe=2,fWe=function(){return iMe(function e(t,n,r){rMe(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=Gqe,this.atlasManager=new cWe(t,r),this.batchManager=new uWe(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(hWe.SCREEN),this.pickingProgram=this._createShaderProgram(hWe.PICKING),this.vao=this._createVAO()},[{key:"addAtlasCollection",value:function(e,t){this.atlasManager.addAtlasCollection(e,t)}},{key:"addTextureAtlasRenderType",value:function(e,t){this.atlasManager.addRenderType(e,t)}},{key:"addSimpleShapeRenderType",value:function(e,t){this.simpleShapeOptions.set(e,t)}},{key:"invalidate",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type,n=this.atlasManager;return t?n.invalidate(e,{filterType:function(e){return e===t},forceRedraw:!0}):n.invalidate(e)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(e){var t=this.gl,n="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),r=this.batchManager.getIndexArray(),i="#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(r.map(function(e){return"uniform sampler2D uTexture".concat(e,";")}).join("\n\t"),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(r.map(function(e){return"if(vAtlasId == ".concat(e,") outColor = texture(uTexture").concat(e,", vTexCoord);")}).join("\n\telse "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(e.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "),a=function(e,t,n){var r=Uqe(e,e.VERTEX_SHADER,t),i=Uqe(e,e.FRAGMENT_SHADER,n),a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error("Could not initialize shaders");return a}(t,n,i);a.aPosition=t.getAttribLocation(a,"aPosition"),a.aIndex=t.getAttribLocation(a,"aIndex"),a.aVertType=t.getAttribLocation(a,"aVertType"),a.aTransform=t.getAttribLocation(a,"aTransform"),a.aAtlasId=t.getAttribLocation(a,"aAtlasId"),a.aTex=t.getAttribLocation(a,"aTex"),a.aPointAPointB=t.getAttribLocation(a,"aPointAPointB"),a.aPointCPointD=t.getAttribLocation(a,"aPointCPointD"),a.aLineWidth=t.getAttribLocation(a,"aLineWidth"),a.aColor=t.getAttribLocation(a,"aColor"),a.aCornerRadius=t.getAttribLocation(a,"aCornerRadius"),a.aBorderColor=t.getAttribLocation(a,"aBorderColor"),a.uPanZoomMatrix=t.getUniformLocation(a,"uPanZoomMatrix"),a.uAtlasSize=t.getUniformLocation(a,"uAtlasSize"),a.uBGColor=t.getUniformLocation(a,"uBGColor"),a.uZoom=t.getUniformLocation(a,"uZoom"),a.uTextures=[];for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:hWe.SCREEN;this.panZoomMatrix=e,this.renderTarget=t,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(e,t){return!!e.visible()&&(!t||!t.isVisible||t.isVisible(e))}},{key:"drawTexture",value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&(!e.isEdge()||this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(o===dWe)return;if(o==pWe)return void this.drawPickingRectangle(e,t,n)}var s,l=aMe(r.getAtlasInfo(e,n));try{for(l.s();!(s=l.n()).done;){var c=s.value,u=c.atlas,h=c.tex1,d=c.tex2;i.canAddToCurrentBatch(u)||this.endBatch();for(var p=i.getAtlasIndexForBatch(u),f=0,g=[[h,!0],[d,!1]];f=this.maxInstances&&this.endBatch()}}}}catch(e){l.e(e)}finally{l.f()}}}},{key:"setTransformMatrix",value:function(e,t,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var o=r.bb,s=r.tex1,l=r.tex2,c=s.w/(s.w+l.w);i||(c=1-c);var u=this._getAdjustedBB(o,a,i,c);this._applyTransformMatrix(t,u,n,e)}else{var h=n.getBoundingBox(e),d=this._getAdjustedBB(h,a,!0,1);this._applyTransformMatrix(t,d,n,e)}}},{key:"_applyTransformMatrix",value:function(e,t,n,r){var i,a;rWe(e);var o=n.getRotation?n.getRotation(r):0;if(0!==o){var s=n.getRotationPoint(r);iWe(e,e,[s.x,s.y]),aWe(e,e,o);var l=n.getRotationOffset(r);i=l.x+(t.xOffset||0),a=l.y+(t.yOffset||0)}else i=t.x1,a=t.y1;iWe(e,e,[i,a]),oWe(e,e,[t.w,t.h])}},{key:"_getAdjustedBB",value:function(e,t,n,r){var i=e.x1,a=e.y1,o=e.w,s=e.h;t&&(i-=t,a-=t,o+=2*t,s+=2*t);var l=0,c=o*r;return n&&r<1?o=c:!n&&r<1&&(i+=l=o-c,o=c),{x1:i,y1:a,w:o,h:s,xOffset:l,yOffset:e.yOffset}}},{key:"drawPickingRectangle",value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=4,Xqe(t,this.indexBuffer.getView(i)),Yqe([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(void 0===a||r.isSimple&&!r.isSimple(e))this.drawTexture(e,t,n);else{var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,5===a||6===a){var s=r.getBoundingBox(e),l=this._getCornerRadius(e,i.radius,s),c=this.cornerRadiusBuffer.getView(o);c[0]=l,c[1]=l,c[2]=l,c[3]=l,6===a&&(c[0]=0,c[2]=0)}Xqe(t,this.indexBuffer.getView(o)),Yqe(e.pstyle(i.color).value,e.pstyle(i.opacity).value,this.colorBuffer.getView(o));var u=this.lineWidthBuffer.getView(o);if(u[0]=0,u[1]=0,i.border){var h=e.pstyle("border-width").value;if(h>0){Yqe(e.pstyle("border-color").value,e.pstyle("border-opacity").value,this.borderColorBuffer.getView(o));var d=e.pstyle("border-position").value;if("inside"===d)u[0]=0,u[1]=-h;else if("outside"===d)u[0]=h,u[1]=0;else{var p=h/2;u[0]=p,u[1]=-p}}}var f=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,f,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"_getVertTypeForShape",value:function(e,t){switch(e.pstyle(t).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(e,t,n){var r=n.w,i=n.h;if("auto"===e.pstyle(t).value)return LPe(r,i);var a=e.pstyle(t).pfValue,o=r/2,s=i/2;return Math.min(a,s,o)}},{key:"drawEdgeArrow",value:function(e,t,n){if(e.visible()){var r,i,a,o=e._private.rscratch;if("source"===n?(r=o.arrowStartX,i=o.arrowStartY,a=o.srcArrowAngle):(r=o.arrowEndX,i=o.arrowEndY,a=o.tgtArrowAngle),!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a)||null==a))if("none"!==e.pstyle(n+"-arrow-shape").value){var s=e.pstyle(n+"-arrow-color").value,l=e.pstyle("opacity").value*e.pstyle("line-opacity").value,c=e.pstyle("width").pfValue,u=e.pstyle("arrow-scale").value,h=this.r.getArrowWidth(c,u),d=this.instanceCount,p=this.transformBuffer.getMatrixView(d);rWe(p),iWe(p,p,[r,i]),oWe(p,p,[h,h]),aWe(p,p,a),this.vertTypeBuffer.getView(d)[0]=3,Xqe(t,this.indexBuffer.getView(d)),Yqe(s,l,this.colorBuffer.getView(d)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle("opacity").value,i=e.pstyle("line-opacity").value,a=e.pstyle("width").pfValue,o=e.pstyle("line-color").value,s=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==n.length){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=1,Xqe(t,this.indexBuffer.getView(l)),Yqe(o,s,this.colorBuffer.getView(l)),this.lineWidthBuffer.getView(l)[0]=a;var c=this.pointAPointBBuffer.getView(l);c[0]=n[0],c[1]=n[1],c[2]=n[2],c[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var u=0;u=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(e){var t=e._private.rscratch;return!t.badLine&&null!=t.allpts&&!isNaN(t.allpts[0])}},{key:"_getEdgePoints",value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(4==n.length)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:"_getNumSegments",value:function(e){return Math.min(Math.max(15,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(e,t){if(4==e.length)return e;for(var n=Array(2*(t+1)),r=0;r<=t;r++)if(0==r)n[0]=e[0],n[1]=e[1];else if(r==t)n[2*r]=e[e.length-2],n[2*r+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,2*r)}return n}},{key:"_setCurvePoint",value:function(e,t,n,r){if(!(e.length<=2)){for(var i=Array(e.length-2),a=0;a0}},s=function(e){return"yes"===e.pstyle("text-events").strValue?pWe:dWe},l=function(e){var t=e.position(),n=t.x,r=t.y,i=e.outerWidth(),a=e.outerHeight();return{w:i,h:a,x1:n-i/2,y1:r-a/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Wqe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:yWe(t.getLabelKey,null),getBoundingBox:vWe(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:a("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:yWe(t.getSourceLabelKey,"source"),getBoundingBox:vWe(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:i("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:a("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:yWe(t.getTargetLabelKey,"target"),getBoundingBox:vWe(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:i("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:a("target-label")});var c=LRe(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(e,t){var r=!1;t&&t.length>0&&(r|=n.drawing.invalidate(t)),r&&c()}),function(e){var t=e.render;e.render=function(n){n=n||{};var r=e.cy;e.webgl&&(r.zoom()>hqe?(!function(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}(e),t.call(e,n)):(!function(e){var t=function(t){t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.canvasWidth,e.canvasHeight),t.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}(e),wWe(e,n,hWe.SCREEN)))};var n=e.matchCanvasSize;e.matchCanvasSize=function(t){n.call(e,t),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0},e.findNearestElements=function(t,n,r,i){return function(e,t,n){var r,i,a,o=function(e,t,n){var r,i,a,o,s=qqe(e),l=s.pan,c=s.zoom,u=function(e,t,n,r,i){var a=r*n+t.x,o=i*n+t.y;return[a,o=Math.round(e.canvasHeight-o)]}(e,l,c,t,n),h=sMe(u,2),d=h[0],p=h[1],f=6;if(r=d-f/2,i=p-f/2,a=f,o=f,0===a||0===o)return[];var g=e.data.contexts[e.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),wWe(e,null,hWe.PICKING),e.pickingFrameBuffer.needsDraw=!1);var m=a*o,y=new Uint8Array(4*m);g.readPixels(r,i,a,o,g.RGBA,g.UNSIGNED_BYTE,y),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var v=new Set,b=0;b=0&&v.add(x)}return v}(e,t,n),s=e.getCachedZSortedEles(),l=aMe(o);try{for(l.s();!(a=l.n()).done;){var c=s[a.value];if(!r&&c.isNode()&&(r=c),!i&&c.isEdge()&&(i=c),r&&i)break}}catch(e){l.e(e)}finally{l.f()}return[r,i].filter(Boolean)}(e,t,n)};var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0};var i=e.notify;e.notify=function(t,n){i.call(e,t,n),"viewport"===t||"bounds"===t?e.pickingFrameBuffer.needsDraw=!0:"background"===t&&e.drawing.invalidate(n,{type:"node-body"})}}(n)};var yWe=function(e,t){return function(n){var r=e(n),i=mWe(n,t);return i.length>1?i.map(function(e,t){return"".concat(r,"_").concat(t)}):r}},vWe=function(e,t){return function(n,r){var i=e(n);if("string"==typeof r){var a=r.indexOf("_");if(a>0){var o=Number(r.substring(a+1)),s=mWe(n,t),l=i.h/s.length,c=l*o,u=i.y1+c;return{x1:i.x1,w:i.w,y1:u,h:l,yOffset:c}}}return i}};function bWe(e,t){var n=e.canvasWidth,r=e.canvasHeight,i=qqe(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(a.x,a.y),t.scale(o,o)}function xWe(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function wWe(e,t,n){var r;e.webglDebug&&(r=performance.now());var i=e.drawing,a=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&function(e,t){e.drawSelectionRectangle(t,function(t){return bWe(e,t)})}(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var o=e.data.contexts[e.WEBGL];n.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=function(e){var t=e.canvasWidth,n=e.canvasHeight,r=qqe(e),i=r.pan,a=r.zoom,o=nWe();iWe(o,o,[i.x,i.y]),oWe(o,o,[a,a]);var s=nWe();!function(e,t,n){e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1}(s,t,n);var l=nWe();return function(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];e[0]=d*r+p*o+f*c,e[1]=d*i+p*s+f*u,e[2]=d*a+p*l+f*h,e[3]=g*r+m*o+y*c,e[4]=g*i+m*s+y*u,e[5]=g*a+m*l+y*h,e[6]=v*r+b*o+x*c,e[7]=v*i+b*s+x*u,e[8]=v*a+b*l+x*h}(l,s,o),l}(e),l=e.getCachedZSortedEles();if(a=l.length,i.startFrame(s,n),n.screen){for(var c=0;c0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),d.translate(g.x,g.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-g.x,-g.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,a),d.fill())}return h},NWe.png=function(e){return OWe(e,this.bufferCanvasImage(e),"image/png")},NWe.jpg=function(e){return OWe(e,this.bufferCanvasImage(e),"image/jpeg")};var LWe={nodeShapeImpl:function(e,t,n,r,i,a,o,s){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a,s);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}}},MWe=DWe,RWe=DWe.prototype;function DWe(e){var t=this,n=t.cy.window().document;e.webgl&&(RWe.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(RWe.CANVAS_LAYERS),contexts:new Array(RWe.CANVAS_LAYERS),canvasNeedsRedraw:new Array(RWe.CANVAS_LAYERS),bufferCanvases:new Array(RWe.BUFFER_COUNT),bufferContexts:new Array(RWe.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};pMe&&pMe.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;lt&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=c},function(e,t,n){function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),c=n(13),u=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(c,1),a.target!=a.source&&a.target.edges.splice(u,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l(e=c.getTop())&&(r=e),a>(t=c.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),u>(r=g.getTop())&&(u=r),h<(a=g.getBottom())&&(h=a)}var m=new c(s,u,l-s,h-u);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-o,this.right=m.x+m.width+o,this.top=m.y-o,this.bottom=m.y+m.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,u=-i.MAX_VALUE,h=e.length,d=0;d(t=p.getLeft())&&(o=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),u<(a=p.getBottom())&&(u=a)}return new c(o,l,s-o,u-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(ia)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(ra?(n[0]=u,n[1]=h,k=!0):(n[0]=c,n[1]=l,k=!0):_===S&&(r>a?(n[0]=s,n[1]=l,k=!0):(n[0]=d,n[1]=h,k=!0)),-C===S?a>r?(n[2]=v,n[3]=b,T=!0):(n[2]=y,n[3]=m,T=!0):C===S&&(a>r?(n[2]=g,n[3]=m,T=!0):(n[2]=x,n[3]=b,T=!0)),k&&T)return!1;if(r>a?i>o?(A=this.getCardinalDirection(_,S,4),N=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-_,S,3),N=this.getCardinalDirection(-C,S,1)):i>o?(A=this.getCardinalDirection(-_,S,1),N=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(_,S,2),N=this.getCardinalDirection(C,S,4)),!k)switch(A){case 1:O=l,I=r+-f/S,n[0]=I,n[1]=O;break;case 2:I=d,O=i+p*S,n[0]=I,n[1]=O;break;case 3:O=h,I=r+f/S,n[0]=I,n[1]=O;break;case 4:I=u,O=i+-p*S,n[0]=I,n[1]=O}if(!T)switch(N){case 1:M=m,L=a+-E/S,n[2]=L,n[3]=M;break;case 2:L=x,M=o+w*S,n[2]=L,n[3]=M;break;case 3:M=b,L=a+E/S,n[2]=L,n[3]=M;break;case 4:L=v,M=o+-w*S,n[2]=L,n[3]=M}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,c,u,h,d=e.x,p=e.y,f=t.x,g=t.y,m=n.x,y=n.y,v=i.x,b=i.y;return 0===(h=(a=g-p)*(l=m-v)-(o=b-y)*(s=d-f))?null:new r((s*(u=v*y-m*b)-l*(c=f*p-d*g))/h,(o*c-a*u)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(c[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);var h=u.getEdges();for(a=0;a-1&&c.splice(g,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(h,1),u.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}})}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){var r=n(15),i=n(7),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in l.prototype=Object.create(r.prototype),r)l[c]=r[c];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||c>=s[0].length))for(var u=0;ue}}]),e}();e.exports=a},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n0&&(o=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(o,h,n))}},h.prototype.stop=function(){return this.stopped=!0,this};var p=function(e){e("layout","cose-bilkent",h)};"undefined"!=typeof cytoscape&&p(cytoscape),e.exports=p}])},QWe.exports=KWe(function(){return XWe?ZWe.exports:(XWe=1,e=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(u.WORLD_CENTER_X-o.x/2,u.WORLD_CENTER_Y-o.y/2))},v.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var y=m[0];m.splice(0,1);var b=u.indexOf(y);b>=0&&u.splice(b,1),f--,h--}d=null!=t?(u.indexOf(m[0])+1)%f:0;for(var x=Math.abs(r-n)/h,w=d;p!=h;w=++w%f){var E=u[w].getOtherEnd(e);if(E!=t){var k=(n+p*x)%360,T=(k+x)%360;v.branchRadialLayout(E,e,k,T,i+a,a),p++}}},v.maxDiagonalInTree=function(e){for(var t=f.MIN_VALUE,n=0;nt&&(t=r)}return t},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},v.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},v.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},v.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rl&&(l=u.rect.height)}n+=l+e.verticalPadding}},v.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},v.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:e.rect.width*e.rect.height0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},v.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},v.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a,o,s=0;return e.rowHeight[r]0&&(s=n+e.verticalPadding-e.rowHeight[r]),a=e.width-i>=t+e.horizontalPadding?(e.height+s)/(i+t+e.horizontalPadding):(e.height+s)/e.width,s=n+e.verticalPadding,(o=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var u=i;u<=a;u++)l[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a0)for(u=o;u<=s;u++)l[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var h,d,p=f.MAX_VALUE,g=0;g2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},v=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:return e.getLogger().trace("Found comment",t.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return e.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace("end icon"),this.popState();break;case 10:return e.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return e.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16: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 24:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 27:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return e.getLogger().trace("Long description:",t.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 e}();function b(){this.yy={}}return y.lexer=v,QH(b,"Parser"),b.prototype=y,y.Parser=b,new b}();nVe.parser=nVe;var rVe=nVe,iVe=[],aVe=0,oVe={},sVe=QH(()=>{iVe=[],aVe=0,oVe={}},"clear"),lVe=QH(function(e){for(let t=iVe.length-1;t>=0;t--)if(iVe[t].leveliVe.length>0?iVe[0]:null,"getMindmap"),uVe=QH((e,t,n,r)=>{eU.info("addNode",e,t,n,r);const i=WG();let a=i.mindmap?.padding??OU.mindmap.padding;switch(r){case hVe.ROUNDED_RECT:case hVe.RECT:case hVe.HEXAGON:a*=2}const o={id:aVe++,nodeId:iG(t,i),level:e,descr:iG(n,i),type:r,children:[],width:i.mindmap?.maxNodeWidth??OU.mindmap.maxNodeWidth,padding:a},s=lVe(e);if(s)s.children.push(o),iVe.push(o);else{if(0!==iVe.length)throw new Error('There can be only one root. No parent could be found for ("'+o.descr+'")');iVe.push(o)}},"addNode"),hVe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},dVe=QH((e,t)=>{switch(eU.debug("In get type",e,t),e){case"[":return hVe.RECT;case"(":return")"===t?hVe.ROUNDED_RECT:hVe.CLOUD;case"((":return hVe.CIRCLE;case")":return hVe.CLOUD;case"))":return hVe.BANG;case"{{":return hVe.HEXAGON;default:return hVe.DEFAULT}},"getType"),pVe=QH((e,t)=>{oVe[e]=t},"setElementForId"),fVe=QH(e=>{if(!e)return;const t=WG(),n=iVe[iVe.length-1];e.icon&&(n.icon=iG(e.icon,t)),e.class&&(n.class=iG(e.class,t))},"decorateNode"),gVe=QH(e=>{switch(e){case hVe.DEFAULT:return"no-border";case hVe.RECT:return"rect";case hVe.ROUNDED_RECT:return"rounded-rect";case hVe.CIRCLE:return"circle";case hVe.CLOUD:return"cloud";case hVe.BANG:return"bang";case hVe.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),mVe=QH(()=>eU,"getLogger"),yVe=QH(e=>oVe[e],"getElementById"),vVe={clear:sVe,addNode:uVe,getMindmap:cVe,nodeType:hVe,getType:dVe,setElementForId:pVe,decorateNode:fVe,type2Str:gVe,getLogger:mVe,getElementById:yVe},bVe=QH(function(e,t,n,r){t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 ${n.height-5} v${10-n.height} q0,-5 5,-5 h${n.width-10} q5,0 5,5 v${n.height-5} H0 Z`),t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",n.height).attr("x2",n.width).attr("y2",n.height)},"defaultBkg"),xVe=QH(function(e,t,n){t.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("height",n.height).attr("width",n.width)},"rectBkg"),wVe=QH(function(e,t,n){const r=n.width,i=n.height,a=.15*r,o=.25*r,s=.35*r,l=.2*r;t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*r},${-1*r*.1}\n a${s},${s} 1 0,1 ${.4*r},${-1*r*.1}\n a${o},${o} 1 0,1 ${.35*r},${1*r*.2}\n\n a${a},${a} 1 0,1 ${.15*r},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*r*.15},${1*i*.65}\n\n a${o},${a} 1 0,1 ${-1*r*.25},${.15*r}\n a${s},${s} 1 0,1 ${-1*r*.5},0\n a${a},${a} 1 0,1 ${-1*r*.25},${-1*r*.15}\n\n a${a},${a} 1 0,1 ${-1*r*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*r},${-1*i*.65}\n\n H0 V0 Z`)},"cloudBkg"),EVe=QH(function(e,t,n){const r=n.width,i=n.height,a=.15*r;t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*r},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*r},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*r*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*r*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*r*.1},${-1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${-1*i*.34}\n a${a},${a} 1 0,0 ${.1*r},${-1*i*.33}\n\n H0 V0 Z`)},"bangBkg"),kVe=QH(function(e,t,n){t.append("circle").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("r",n.width/2)},"circleBkg");function TVe(e,t,n,r,i){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+(i.width-t)/2+", "+n+")")}QH(TVe,"insertPolygonShape");var _Ve=QH(function(e,t,n){const r=n.height,i=r/4,a=n.width-n.padding+2*i;TVe(t,a,r,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-r/2},{x:a-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],n)},"hexagonBkg"),CVe=QH(function(e,t,n){t.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("height",n.height).attr("rx",n.padding).attr("ry",n.padding).attr("width",n.width)},"roundedRectBkg"),SVe=QH(async function(e,t,n,r,i){const a=i.htmlLabels,o=r%11,s=t.append("g");n.section=o;let l="section-"+o;o<0&&(l+=" section-root"),s.attr("class",(n.class?n.class+" ":"")+"mindmap-node "+l);const c=s.append("g"),u=s.append("g"),h=n.descr.replace(/()/g,"\n");await g7(u,h,{useHtmlLabels:a,width:n.width,classes:"mindmap-node-label"},i),a||u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=u.node().getBBox(),[p]=R5(i.fontSize);if(n.height=d.height+1.1*p*.5+n.padding,n.width=d.width+2*n.padding,n.icon)if(n.type===e.nodeType.CIRCLE){n.height+=50,n.width+=50;s.append("foreignObject").attr("height","50px").attr("width",n.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+o+" "+n.icon),u.attr("transform","translate("+n.width/2+", "+(n.height/2-1.5*n.padding)+")")}else{n.width+=50;const e=n.height;n.height=Math.max(e,60);const t=Math.abs(n.height-e);s.append("foreignObject").attr("width","60px").attr("height",n.height).attr("style","text-align: center;margin-top:"+t/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+o+" "+n.icon),u.attr("transform","translate("+(25+n.width/2)+", "+(t/2+n.padding/2)+")")}else if(a){const e=(n.width-d.width)/2,t=(n.height-d.height)/2;u.attr("transform","translate("+e+", "+t+")")}else{const e=n.width/2,t=n.padding/2;u.attr("transform","translate("+e+", "+t+")")}switch(n.type){case e.nodeType.DEFAULT:bVe(e,c,n,o);break;case e.nodeType.ROUNDED_RECT:CVe(e,c,n,o);break;case e.nodeType.RECT:xVe(e,c,n,o);break;case e.nodeType.CIRCLE:c.attr("transform","translate("+n.width/2+", "+ +n.height/2+")"),kVe(e,c,n,o);break;case e.nodeType.CLOUD:wVe(e,c,n,o);break;case e.nodeType.BANG:EVe(e,c,n,o);break;case e.nodeType.HEXAGON:_Ve(e,c,n,o)}return e.setElementForId(n.id,s),n.height},"drawNode"),AVe=QH(function(e,t){const n=e.getElementById(t.id),r=t.x||0,i=t.y||0;n.attr("transform","translate("+r+","+i+")")},"positionNode");async function NVe(e,t,n,r,i){await SVe(e,t,n,r,i),n.children&&await Promise.all(n.children.map((n,a)=>NVe(e,t,n,r<0?a:r,i)))}function IVe(e,t){t.edges().map((t,n)=>{const r=t.data();if(t[0]._private.bodyBounds){const i=t[0]._private.rscratch;eU.trace("Edge: ",n,r),e.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}})}function OVe(e,t,n,r){t.add({group:"nodes",data:{id:e.id.toString(),labelText:e.descr,height:e.height,width:e.width,level:r,nodeId:e.id,padding:e.padding,type:e.type},position:{x:e.x,y:e.y}}),e.children&&e.children.forEach(i=>{OVe(i,t,n,r+1),t.add({group:"edges",data:{id:`${e.id}_${i.id}`,source:e.id,target:i.id,depth:r,section:i.section}})})}function LVe(e,t){return new Promise(n=>{const r=EK("body").append("div").attr("id","cy").attr("style","display:none"),i=VWe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),OVe(e,i,t,0),i.nodes().forEach(function(e){e.layoutDimensions=()=>{const t=e.data();return{w:t.width,h:t.height}}}),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready(e=>{eU.info("Ready",e),n(i)})})}function MVe(e,t){t.nodes().map((t,n)=>{const r=t.data();r.x=t.position().x,r.y=t.position().y,AVe(e,r);const i=e.getElementById(r.nodeId);eU.info("Id:",n,"Position: (",t.position().x,", ",t.position().y,")",r),i.attr("transform",`translate(${t.position().x-r.width/2}, ${t.position().y-r.height/2})`),i.attr("attr",`apa-${n})`)})}VWe.use(tVe),QH(NVe,"drawNodes"),QH(IVe,"drawEdges"),QH(OVe,"addNodes"),QH(LVe,"layoutMindmap"),QH(MVe,"positionNodes");var RVe=QH(async(e,t,n,r)=>{eU.debug("Rendering mindmap diagram\n"+e);const i=r.db,a=i.getMindmap();if(!a)return;const o=WG();o.htmlLabels=!1;const s=Ate(t),l=s.append("g");l.attr("class","mindmap-edges");const c=s.append("g");c.attr("class","mindmap-nodes"),await NVe(i,c,a,-1,o);const u=await LVe(a,o);IVe(l,u),MVe(i,u),SG(void 0,s,o.mindmap?.padding??OU.mindmap.padding,o.mindmap?.useMaxWidth??OU.mindmap.useMaxWidth)},"draw"),DVe={draw:RVe},PVe=QH(e=>{let t="";for(let t=0;t`\n .edge {\n stroke-width: 3;\n }\n ${PVe(e)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`,"getStyles")},BVe=Object.freeze({__proto__:null,diagram:$Ve}),FVe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],c=[1,26],u=[1,24],h=[1,25],d=[6,7,11],p=[1,31],f=[6,7,11,24],g=[1,6,13,16,17,20,23],m=[1,35],y=[1,36],v=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:QH(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:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info("Node: ",a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace("Icon: ",a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace("Node: ",a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace("node found ..",a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace("node found ..",a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:c,7:u,10:23,11:h},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:s}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(f,[2,25]),e(f,[2,26]),e(f,[2,28],{20:[1,32]}),{21:[1,33]},{6:c,7:u,10:34,11:h},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(g,[2,14],{7:m,11:y}),e(v,[2,8]),e(v,[2,9]),e(v,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:b}),e(f,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:m,11:y}),e(v,[2,11]),e(v,[2,12]),e(d,[2,15],{24:b}),e(f,[2,30]),{22:[1,41]},e(f,[2,27]),e(f,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},w=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:return this.pushState("shapeData"),t.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return t.yytext=t.yytext.replace(n,"
    "),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return e.getLogger().trace("Found comment",t.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return e.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace("end icon"),this.popState();break;case 16:return e.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return e.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 33:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return e.getLogger().trace("Long description:",t.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 e}();function E(){this.yy={}}return x.lexer=w,QH(E,"Parser"),E.prototype=x,x.Parser=E,new E}();FVe.parser=FVe;var zVe=FVe,jVe=[],HVe=[],UVe=0,GVe={},qVe=QH(()=>{jVe=[],HVe=[],UVe=0,GVe={}},"clear"),WVe=QH(e=>{if(0===jVe.length)return null;const t=jVe[0].level;let n=null;for(let e=jVe.length-1;e>=0;e--)if(jVe[e].level!==t||n||(n=jVe[e]),jVe[e].levele.parentId===r.id);for(const t of i){const i={id:t.id,parentId:r.id,label:iG(t.label??"",n),isGroup:!1,ticket:t?.ticket,priority:t?.priority,assigned:t?.assigned,icon:t?.icon,shape:"kanbanItem",level:t.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(i)}}return{nodes:e,edges:[],other:{},config:WG()}},"getData"),XVe=QH((e,t,n,r,i)=>{const a=WG();let o=a.mindmap?.padding??OU.mindmap.padding;switch(r){case KVe.ROUNDED_RECT:case KVe.RECT:case KVe.HEXAGON:o*=2}const s={id:iG(t,a)||"kbn"+UVe++,level:e,label:iG(n,a),width:a.mindmap?.maxNodeWidth??OU.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(void 0!==i){let e;e=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const t=tY(e,{schema:eY});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes("_")))throw new Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&"kanbanItem"===t.shape&&(s.shape=t?.shape),t?.label&&(s.label=t?.label),t?.icon&&(s.icon=t?.icon.toString()),t?.assigned&&(s.assigned=t?.assigned.toString()),t?.ticket&&(s.ticket=t?.ticket.toString()),t?.priority&&(s.priority=t?.priority)}const l=WVe(e);l?s.parentId=l.id||"kbn"+UVe++:HVe.push(s),jVe.push(s)},"addNode"),KVe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},QVe=QH((e,t)=>{switch(eU.debug("In get type",e,t),e){case"[":return KVe.RECT;case"(":return")"===t?KVe.ROUNDED_RECT:KVe.CLOUD;case"((":return KVe.CIRCLE;case")":return KVe.CLOUD;case"))":return KVe.BANG;case"{{":return KVe.HEXAGON;default:return KVe.DEFAULT}},"getType"),ZVe=QH((e,t)=>{GVe[e]=t},"setElementForId"),JVe=QH(e=>{if(!e)return;const t=WG(),n=jVe[jVe.length-1];e.icon&&(n.icon=iG(e.icon,t)),e.class&&(n.cssClasses=iG(e.class,t))},"decorateNode"),eYe=QH(e=>{switch(e){case KVe.DEFAULT:return"no-border";case KVe.RECT:return"rect";case KVe.ROUNDED_RECT:return"rounded-rect";case KVe.CIRCLE:return"circle";case KVe.CLOUD:return"cloud";case KVe.BANG:return"bang";case KVe.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),tYe=QH(()=>eU,"getLogger"),nYe=QH(e=>GVe[e],"getElementById"),rYe={clear:qVe,addNode:XVe,getSections:VVe,getData:YVe,nodeType:KVe,getType:QVe,setElementForId:ZVe,decorateNode:JVe,type2Str:eYe,getLogger:tYe,getElementById:nYe},iYe=QH(async(e,t,n,r)=>{eU.debug("Rendering kanban diagram\n"+e);const i=r.db.getData(),a=WG();a.htmlLabels=!1;const o=Ate(t),s=o.append("g");s.attr("class","sections");const l=o.append("g");l.attr("class","items");const c=i.nodes.filter(e=>e.isGroup);let u=0;const h=[];let d=25;for(const e of c){const t=a?.kanban?.sectionWidth||200;u+=1,e.x=t*u+10*(u-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+u;const n=await G8(s,e);d=Math.max(d,n?.labelBBox?.height),h.push(n)}let p=0;for(const e of c){const t=h[p];p+=1;const n=a?.kanban?.sectionWidth||200,r=3*-n/2+d;let o=r;const s=i.nodes.filter(t=>t.parentId===e.id);for(const t of s){if(t.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");t.x=e.x,t.width=n-15;const r=(await $ee(l,t,{config:a})).node().getBBox();t.y=o+r.height/2,await zee(t),o=t.y+r.height/2+5}const c=t.cluster.select("rect"),u=Math.max(o-r+30,50)+(d-25);c.attr("height",u)}SG(void 0,o,a.mindmap?.padding??OU.kanban.padding,a.mindmap?.useMaxWidth??OU.kanban.useMaxWidth)},"draw"),aYe={draw:iYe},oYe=QH(e=>{let t="";for(let t=0;te.darkMode?jj(t,n):zj(t,n),"adjuster");for(let r=0;r`\n .edge {\n stroke-width: 3;\n }\n ${oYe(e)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${e.textColor};\n fill: ${e.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`,"getStyles")},lYe=Object.freeze({__proto__:null,diagram:sYe});function cYe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function uYe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function hYe(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function dYe(e){return e.target.depth}function pYe(e,t){return e.sourceLinks.length?e.depth:t-1}function fYe(e){return function(){return e}}function gYe(e,t){return yYe(e.source,t.source)||e.index-t.index}function mYe(e,t){return yYe(e.target,t.target)||e.index-t.index}function yYe(e,t){return e.y0-t.y0}function vYe(e){return e.value}function bYe(e){return e.index}function xYe(e){return e.nodes}function wYe(e){return e.links}function EYe(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function kYe({nodes:e}){for(const t of e){let e=t.y0,n=e;for(const n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(const e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function TYe(){let e,t,n,r=0,i=0,a=1,o=1,s=24,l=8,c=bYe,u=pYe,h=xYe,d=wYe,p=6;function f(){const f={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];const r=new Map(e.map((t,n)=>[c(t,n,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:i}=n;"object"!=typeof t&&(t=n.source=EYe(r,t)),"object"!=typeof i&&(i=n.target=EYe(r,i)),t.sourceLinks.push(n),i.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}(f),function({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(hYe(t.sourceLinks,vYe),hYe(t.targetLinks,vYe)):t.fixedValue}(f),function({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.depth=i;for(const{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}(f),function({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.height=i;for(const{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}(f),function(n){const c=function({nodes:e}){const n=cYe(e,e=>e.depth)+1,i=(a-r-s)/(n-1),o=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(u.call(null,t,n))));t.layer=e,t.x0=r+e*i,t.x1=t.x0+s,o[e]?o[e].push(t):o[e]=[t]}if(t)for(const e of o)e.sort(t);return o}(n);e=Math.min(l,(o-i)/(cYe(c,e=>e.length)-1)),function(t){const n=uYe(t,t=>(o-i-(t.length-1)*e)/hYe(t,vYe));for(const r of t){let t=i;for(const i of r){i.y0=t,i.y1=t+i.value*n,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*n}t=(o-t+e)/(r.length+1);for(let e=0;e0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,x(e)}void 0===t&&a.sort(yYe),y(a,r)}}function m(e,n,r){for(let i=e.length-2;i>=0;--i){const a=e[i];for(const e of a){let t=0,r=0;for(const{target:n,value:i}of e.sourceLinks){let a=i*(n.layer-e.layer);t+=k(e,n)*a,r+=a}if(!(r>0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,x(e)}void 0===t&&a.sort(yYe),y(a,r)}}function y(t,n){const r=t.length>>1,a=t[r];b(t,a.y0-e,r-1,n),v(t,a.y1+e,r+1,n),b(t,o,t.length-1,n),v(t,i,0,n)}function v(t,n,r,i){for(;r1e-6&&(a.y0+=o,a.y1+=o),n=a.y1+e}}function b(t,n,r,i){for(;r>=0;--r){const a=t[r],o=(a.y1-n)*i;o>1e-6&&(a.y0-=o,a.y1-=o),n=a.y0-e}}function x({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort(mYe);for(const{target:{targetLinks:t}}of e)t.sort(gYe)}}function w(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(mYe),n.sort(gYe)}function E(t,n){let r=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:a}of t.sourceLinks){if(i===n)break;r+=a+e}for(const{source:e,width:i}of n.targetLinks){if(e===t)break;r-=i}return r}function k(t,n){let r=n.y0-(n.targetLinks.length-1)*e/2;for(const{source:i,width:a}of n.targetLinks){if(i===t)break;r+=a+e}for(const{target:e,width:i}of t.sourceLinks){if(e===n)break;r-=i}return r}return f.update=function(e){return kYe(e),e},f.nodeId=function(e){return arguments.length?(c="function"==typeof e?e:fYe(e),f):c},f.nodeAlign=function(e){return arguments.length?(u="function"==typeof e?e:fYe(e),f):u},f.nodeSort=function(e){return arguments.length?(t=e,f):t},f.nodeWidth=function(e){return arguments.length?(s=+e,f):s},f.nodePadding=function(t){return arguments.length?(l=e=+t,f):l},f.nodes=function(e){return arguments.length?(h="function"==typeof e?e:fYe(e),f):h},f.links=function(e){return arguments.length?(d="function"==typeof e?e:fYe(e),f):d},f.linkSort=function(e){return arguments.length?(n=e,f):n},f.size=function(e){return arguments.length?(r=i=0,a=+e[0],o=+e[1],f):[a-r,o-i]},f.extent=function(e){return arguments.length?(r=+e[0][0],a=+e[1][0],i=+e[0][1],o=+e[1][1],f):[[r,i],[a,o]]},f.iterations=function(e){return arguments.length?(p=+e,f):p},f}var _Ye=Math.PI,CYe=2*_Ye,SYe=1e-6,AYe=CYe-SYe;function NYe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function IYe(){return new NYe}function OYe(e){return function(){return e}}function LYe(e){return e[0]}function MYe(e){return e[1]}NYe.prototype=IYe.prototype={constructor:NYe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,c=a-e,u=o-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>SYe)if(Math.abs(u*s-l*c)>SYe&&i){var d=n-a,p=r-o,f=s*s+l*l,g=d*d+p*p,m=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((_Ye-Math.acos((f+h-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>SYe&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*p)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,a){e=+e,t=+t,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+o,c=t+s,u=1^a,h=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>SYe||Math.abs(this._y1-c)>SYe)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%CYe+CYe),h>AYe?this._+="A"+n+","+n+",0,1,"+u+","+(e-o)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>SYe&&(this._+="A"+n+","+n+",0,"+ +(h>=_Ye)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var RYe=Array.prototype.slice;function DYe(e){return e.source}function PYe(e){return e.target}function $Ye(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function BYe(){return function(e){var t=DYe,n=PYe,r=LYe,i=MYe,a=null;function o(){var o,s=RYe.call(arguments),l=t.apply(this,s),c=n.apply(this,s);if(a||(a=o=IYe()),e(a,+r.apply(this,(s[0]=l,s)),+i.apply(this,s),+r.apply(this,(s[0]=c,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r="function"==typeof e?e:OYe(+e),o):r},o.y=function(e){return arguments.length?(i="function"==typeof e?e:OYe(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}($Ye)}function FYe(e){return[e.source.x1,e.y0]}function zYe(e){return[e.target.x0,e.y1]}var jYe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,9],n=[1,10],r=[1,5,10,12],i={trace:QH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:const e=r.findOrCreateNode(a[s-4].trim().replaceAll('""','"')),t=r.findOrCreateNode(a[s-2].trim().replaceAll('""','"')),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:t,20:n},{1:[2,6],7:11,10:[1,12]},e(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(r,[2,8]),e(r,[2,9]),{19:[1,16]},e(r,[2,11]),{1:[2,1]},{1:[2,5]},e(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:n},{15:18,16:7,17:8,18:t,20:n},{18:[1,19]},e(n,[2,3]),{12:[1,20]},e(r,[2,10]),{15:21,16:7,17:8,18:t,20:n},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},a=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:QH(function(e,t,n,r){switch(n){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},"anonymous"),rules:[/^(?:sankey-beta\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:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return e}();function o(){this.yy={}}return i.lexer=a,QH(o,"Parser"),o.prototype=i,i.Parser=o,new o}();jYe.parser=jYe;var HYe=jYe,UYe=[],GYe=[],qYe=new Map,WYe=QH(()=>{UYe=[],GYe=[],qYe=new Map,$G()},"clear"),VYe=class{constructor(e,t,n=0){this.source=e,this.target=t,this.value=n}static{QH(this,"SankeyLink")}},YYe=QH((e,t,n)=>{UYe.push(new VYe(e,t,n))},"addLink"),XYe=class{constructor(e){this.ID=e}static{QH(this,"SankeyNode")}},KYe=QH(e=>{e=kG.sanitizeText(e,WG());let t=qYe.get(e);return void 0===t&&(t=new XYe(e),qYe.set(e,t),GYe.push(t)),t},"findOrCreateNode"),QYe=QH(()=>GYe,"getNodes"),ZYe=QH(()=>UYe,"getLinks"),JYe=QH(()=>({nodes:GYe.map(e=>({id:e.ID})),links:UYe.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),"getGraph"),eXe={nodesMap:qYe,getConfig:QH(()=>WG().sankey,"getConfig"),getNodes:QYe,getLinks:ZYe,getGraph:JYe,addLink:YYe,findOrCreateNode:KYe,getAccTitle:FG,setAccTitle:BG,getAccDescription:jG,setAccDescription:zG,getDiagramTitle:UG,setDiagramTitle:HG,clear:WYe},tXe=class e{static{QH(this,"Uid")}static{this.count=0}static next(t){return new e(t+ ++e.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},nXe={left:function(e){return e.depth},right:function(e,t){return t-1-e.height},center:function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?uYe(e.sourceLinks,dYe)-1:0},justify:pYe},rXe=QH(function(e,t,n,r){const{securityLevel:i,sankey:a}=WG(),o=YG.sankey;let s;"sandbox"===i&&(s=EK("#i"+t));const l=EK("sandbox"===i?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${t}"]`):EK(`[id="${t}"]`),u=a?.width??o.width,h=a?.height??o.width,d=a?.useMaxWidth??o.useMaxWidth,p=a?.nodeAlignment??o.nodeAlignment,f=a?.prefix??o.prefix,g=a?.suffix??o.suffix,m=a?.showValues??o.showValues,y=r.db.getGraph(),v=nXe[p],b=TYe().nodeId(e=>e.id).nodeWidth(10).nodePadding(10+(m?15:0)).nodeAlign(v).extent([[0,0],[u,h]]);b(y);const x=sJ(R1);c.append("g").attr("class","nodes").selectAll(".node").data(y.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=tXe.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=>x(e.id));const w=QH(({id:e,value:t})=>m?`${e}\n${f}${Math.round(100*t)/100}${g}`:e,"getText");c.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(y.nodes).join("text").attr("x",e=>e.x0(e.y1+e.y0)/2).attr("dy",(m?"0":"0.35")+"em").attr("text-anchor",e=>e.x0(e.uid=tXe.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",e=>e.source.x1).attr("x2",e=>e.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",e=>x(e.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",e=>x(e.target.id))}let T;switch(k){case"gradient":T=QH(e=>e.uid,"coloring");break;case"source":T=QH(e=>x(e.source.id),"coloring");break;case"target":T=QH(e=>x(e.target.id),"coloring");break;default:T=k}E.append("path").attr("d",BYe().source(FYe).target(zYe)).attr("stroke",T).attr("stroke-width",e=>Math.max(1,e.width)),SG(void 0,c,0,d)},"draw"),iXe={draw:rXe},aXe=QH(e=>e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),oXe=QH(e=>`.label {\n font-family: ${e.fontFamily};\n }`,"getStyles"),sXe=HYe.parse.bind(HYe);HYe.parse=e=>sXe(aXe(e));var lXe={styles:oXe,parser:HYe,db:eXe,renderer:iXe},cXe=Object.freeze({__proto__:null,diagram:lXe}),uXe={packet:[]},hXe=structuredClone(uXe),dXe=OU.packet,pXe=QH(()=>{const e=D5({...dXe,...GU().packet});return e.showBits&&(e.paddingY+=10),e},"getConfig"),fXe=QH(()=>hXe.packet,"getPacket"),gXe={pushWord:QH(e=>{e.length>0&&hXe.packet.push(e)},"pushWord"),getPacket:fXe,getConfig:pXe,clear:QH(()=>{$G(),hXe=structuredClone(uXe)},"clear"),setAccTitle:BG,getAccTitle:FG,setDiagramTitle:HG,getDiagramTitle:UG,getAccDescription:jG,setAccDescription:zG},mXe=QH(e=>{Lhe(e,gXe);let t=-1,n=[],r=1;const{bitsPerRow:i}=gXe.getConfig();for(let{start:a,end:o,label:s}of e.blocks){if(o&&o{if(void 0===e.end&&(e.end=e.start),e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);return e.end+1<=t*n?[e,void 0]:[{start:e.start,end:t*n-1,label:e.label},{start:t*n,end:e.end,label:e.label}]},"getNextFittingBlock"),vXe={parse:QH(async e=>{const t=await Pke("packet",e);eU.debug(t),mXe(t)},"parse")},bXe=QH((e,t,n,r)=>{const i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:c}=a,u=i.getPacket(),h=i.getDiagramTitle(),d=o+s,p=d*(u.length+1)-(h?0:o),f=l*c+2,g=Ate(t);g.attr("viewbox",`0 0 ${f} ${p}`),CG(g,p,f,a.useMaxWidth);for(const[e,t]of u.entries())xXe(g,t,e,a);g.append("text").text(h).attr("x",f/2).attr("y",p-d/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),xXe=QH((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{const c=e.append("g"),u=n*(r+a)+a;for(const e of t){const t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(c.append("rect").attr("x",t).attr("y",u).attr("width",n).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",t+n/2).attr("y",u+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(e.label),!l)continue;const a=e.end===e.start,h=u-2;c.append("text").attr("x",t+(a?n/2:0)).attr("y",h).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(e.start),a||c.append("text").attr("x",t+n).attr("y",h).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(e.end)}},"drawWord"),wXe={draw:bXe},EXe={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},kXe=QH(({packet:e}={})=>{const t=D5(EXe,e);return`\n\t.packetByte {\n\t\tfont-size: ${t.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${t.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${t.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${t.labelColor};\n\t\tfont-size: ${t.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${t.titleColor};\n\t\tfont-size: ${t.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${t.blockStrokeColor};\n\t\tstroke-width: ${t.blockStrokeWidth};\n\t\tfill: ${t.blockFillColor};\n\t}\n\t`},"styles"),TXe={parser:vXe,db:gXe,renderer:wXe,styles:kXe},_Xe=Object.freeze({__proto__:null,diagram:TXe}),CXe={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},SXe={axes:[],curves:[],options:CXe},AXe=structuredClone(SXe),NXe=OU.radar,IXe=QH(()=>D5({...NXe,...GU().radar}),"getConfig"),OXe=QH(()=>AXe.axes,"getAxes"),LXe=QH(()=>AXe.curves,"getCurves"),MXe=QH(()=>AXe.options,"getOptions"),RXe=QH(e=>{AXe.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),DXe=QH(e=>{AXe.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:PXe(e.entries)}))},"setCurves"),PXe=QH(e=>{if(null==e[0].axis)return e.map(e=>e.value);const t=OXe();if(0===t.length)throw new Error("Axes must be populated before curves for reference entries");return t.map(t=>{const n=e.find(e=>e.axis?.$refText===t.name);if(void 0===n)throw new Error("Missing entry for axis "+t.label);return n.value})},"computeCurveEntries"),$Xe=QH(e=>{const t=e.reduce((e,t)=>(e[t.name]=t,e),{});AXe.options={showLegend:t.showLegend?.value??CXe.showLegend,ticks:t.ticks?.value??CXe.ticks,max:t.max?.value??CXe.max,min:t.min?.value??CXe.min,graticule:t.graticule?.value??CXe.graticule}},"setOptions"),BXe={getAxes:OXe,getCurves:LXe,getOptions:MXe,setAxes:RXe,setCurves:DXe,setOptions:$Xe,getConfig:IXe,clear:QH(()=>{$G(),AXe=structuredClone(SXe)},"clear"),setAccTitle:BG,getAccTitle:FG,setDiagramTitle:HG,getDiagramTitle:UG,getAccDescription:jG,setAccDescription:zG},FXe=QH(e=>{Lhe(e,BXe);const{axes:t,curves:n,options:r}=e;BXe.setAxes(t),BXe.setCurves(n),BXe.setOptions(r)},"populate"),zXe={parse:QH(async e=>{const t=await Pke("radar",e);eU.debug(t),FXe(t)},"parse")},jXe=QH((e,t,n,r)=>{const i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),c=i.getDiagramTitle(),u=Ate(t),h=HXe(u,l),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),p=s.min,f=Math.min(l.width,l.height)/2;UXe(h,a,f,s.ticks,s.graticule),GXe(h,a,f,l),qXe(h,a,o,p,d,s.graticule,l),YXe(h,o,s.showLegend,l),h.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),HXe=QH((e,t)=>{const n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i=t.marginLeft+t.width/2,a=t.marginTop+t.height/2;return e.attr("viewbox",`0 0 ${n} ${r}`).attr("width",n).attr("height",r),e.append("g").attr("transform",`translate(${i}, ${a})`)},"drawFrame"),UXe=QH((e,t,n,r,i)=>{if("circle"===i)for(let t=0;t{const n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(" ");e.append("polygon").attr("points",s).attr("class","radarGraticule")}}},"drawGraticule"),GXe=QH((e,t,n,r)=>{const i=t.length;for(let a=0;a{if(t.entries.length!==s)return;const c=t.entries.map((e,t)=>{const n=2*Math.PI*t/s-Math.PI/2,a=WXe(e,r,i,l);return{x:a*Math.cos(n),y:a*Math.sin(n)}});"circle"===a?e.append("path").attr("d",VXe(c,o.curveTension)).attr("class",`radarCurve-${n}`):"polygon"===a&&e.append("polygon").attr("points",c.map(e=>`${e.x},${e.y}`).join(" ")).attr("class",`radarCurve-${n}`)})}function WXe(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}function VXe(e,t){const n=e.length;let r=`M${e[0].x},${e[0].y}`;for(let i=0;i{const r=e.append("g").attr("transform",`translate(${i}, ${a+20*n})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${n}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(t.label)})}QH(qXe,"drawCurves"),QH(WXe,"relativeRadius"),QH(VXe,"closedRoundCurve"),QH(YXe,"drawLegend");var XXe={draw:jXe},KXe=QH((e,t)=>{let n="";for(let r=0;r{const t=D5(EU(),GU().themeVariables);return{themeVariables:t,radarOptions:D5(t.radar,e)}},"buildRadarStyleOptions"),ZXe=QH(({radar:e}={})=>{const{themeVariables:t,radarOptions:n}=QXe(e);return`\n\t.radarTitle {\n\t\tfont-size: ${t.fontSize};\n\t\tcolor: ${t.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${n.axisColor};\n\t\tstroke-width: ${n.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${n.axisLabelFontSize}px;\n\t\tcolor: ${n.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${n.graticuleColor};\n\t\tfill-opacity: ${n.graticuleOpacity};\n\t\tstroke: ${n.graticuleColor};\n\t\tstroke-width: ${n.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${n.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${KXe(t,n)}\n\t`},"styles"),JXe={parser:zXe,db:BXe,renderer:XXe,styles:ZXe},eKe=Object.freeze({__proto__:null,diagram:JXe}),tKe=function(){var e=QH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,7],n=[1,13],r=[1,14],i=[1,15],a=[1,19],o=[1,16],s=[1,17],l=[1,18],c=[8,30],u=[8,21,28,29,30,31,32,40,44,47],h=[1,23],d=[1,24],p=[8,15,16,21,28,29,30,31,32,40,44,47],f=[8,15,16,21,27,28,29,30,31,32,40,44,47],g=[1,49],m={trace:QH(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,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList: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:49,$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:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"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],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:QH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug("Rule: separator (NL) ");break;case 5:r.getLogger().debug("Rule: separator (Space) ");break;case 6:r.getLogger().debug("Rule: separator (EOF) ");break;case 7:r.getLogger().debug("Rule: hierarchy: ",a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug("Stop NL ");break;case 9:r.getLogger().debug("Stop EOF ");break;case 10:r.getLogger().debug("Stop NL2 ");break;case 11:r.getLogger().debug("Stop EOF2 ");break;case 12:r.getLogger().debug("Rule: statement: ",a[s]),"number"==typeof a[s].length?this.$=a[s]:this.$=[a[s]];break;case 13:r.getLogger().debug("Rule: statement #2: ",a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug("Rule: link: ",a[s],e),this.$={edgeTypeStr:a[s],label:""};break;case 15:r.getLogger().debug("Rule: LABEL link: ",a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:const t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:"space",label:"",width:t,children:[]};break;case 23:r.getLogger().debug("Rule: (nodeStatement link node) ",a[s-2],a[s-1],a[s]," typestr: ",a[s-1].edgeTypeStr);const i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+"-"+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:"edge",directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:"arrow_open"},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug("Rule: nodeStatement (node) ",a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug("APA123",this?this:"na"),r.getLogger().debug("COLUMNS: ",a[s]),this.$={type:"column-setting",columns:"auto"===a[s]?-1:parseInt(a[s])};break;case 27:r.getLogger().debug("Rule: id-block statement : ",a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:"composite",children:a[s-1]};break;case 28:r.getLogger().debug("Rule: blockStatement : ",a[s-2],a[s-1],a[s]);const o=r.generateId();this.$={id:o,type:"composite",label:"",children:a[s-1]};break;case 29:r.getLogger().debug("Rule: node (NODE_ID separator): ",a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug("Rule: dirList: ",a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug("Rule: dirList: ",a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug("Rule: nodeShapeNLabel: ",a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",a[s-3],a[s-2]," #3:",a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:"classDef",id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:"applyClass",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:"applyStyles",id:a[s-1].trim(),stylesStr:a[s].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{8:[1,20]},e(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:t,28:n,29:r,31:i,32:a,40:o,44:s,47:l}),e(u,[2,16],{14:22,15:h,16:d}),e(u,[2,17]),e(u,[2,18]),e(u,[2,19]),e(u,[2,20]),e(u,[2,21]),e(u,[2,22]),e(p,[2,25],{27:[1,25]}),e(u,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(f,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(c,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},e(p,[2,24]),{11:37,13:4,14:22,15:h,16:d,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(f,[2,30]),{18:[1,43]},{18:[1,44]},e(p,[2,23]),{18:[1,45]},{30:[1,46]},e(u,[2,28]),e(u,[2,35]),e(u,[2,36]),e(u,[2,37]),e(u,[2,38]),{37:[1,47]},{34:48,35:g},{15:[1,50]},e(u,[2,27]),e(f,[2,33]),{39:[1,51]},{34:52,35:g,39:[2,31]},{32:[2,15]},e(f,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:QH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:QH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,QH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),QH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},y=function(){var e={EOF:1,parseError:QH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:QH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:QH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:QH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:QH(function(){return this._more=!0,this},"more"),reject:QH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:QH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:QH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:QH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:QH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:QH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:QH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:QH(function(){var e=this.next();return e||this.lex()},"lex"),begin:QH(function(e){this.conditionStack.push(e)},"begin"),popState:QH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:QH(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:QH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:QH(function(e){this.begin(e)},"pushState"),stateStackSize:QH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:QH(function(e,t,n,r){switch(n){case 0:return 10;case 1:return e.getLogger().debug("Found space-block"),31;case 2:return e.getLogger().debug("Found nl-block"),31;case 3:return e.getLogger().debug("Found space-block"),29;case 4:e.getLogger().debug(".",t.yytext);break;case 5:e.getLogger().debug("_",t.yytext);break;case 6:return 5;case 7:return t.yytext=-1,28;case 8:return t.yytext=t.yytext.replace(/columns\s+/,""),e.getLogger().debug("COLUMNS (LEX)",t.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:e.getLogger().debug("LEX: POPPING STR:",t.yytext),this.popState();break;case 14:return e.getLogger().debug("LEX: STR end:",t.yytext),"STR";case 15:return t.yytext=t.yytext.replace(/space\:/,""),e.getLogger().debug("SPACE NUM (LEX)",t.yytext),21;case 16:return t.yytext="1",e.getLogger().debug("COLUMNS (LEX)",t.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),e.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),e.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),e.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),e.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),e.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),e.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),e.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),e.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),e.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),e.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),e.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),e.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return e.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return e.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return e.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return e.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return e.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return e.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return e.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return e.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),e.getLogger().debug("LEX ARR START"),38;case 75:return e.getLogger().debug("Lex: NODE_ID",t.yytext),32;case 76:return e.getLogger().debug("Lex: EOF",t.yytext),8;case 79:return"NODE_DESCR";case 81:e.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:e.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return e.getLogger().debug("LEX: NODE_DESCR:",t.yytext),"NODE_DESCR";case 84:e.getLogger().debug("LEX POPPING"),this.popState();break;case 85:e.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (right): dir:",t.yytext),"DIR";case 87:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (left):",t.yytext),"DIR";case 88:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (x):",t.yytext),"DIR";case 89:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (y):",t.yytext),"DIR";case 90:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (up):",t.yytext),"DIR";case 91:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (down):",t.yytext),"DIR";case 92:return t.yytext="]>",e.getLogger().debug("Lex (ARROW_DIR end):",t.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 94:case 95:case 96:return e.getLogger().debug("Lex: LINK",t.yytext),15;case 97:case 98:case 99:return e.getLogger().debug("Lex: START_LINK",t.yytext),this.pushState("LLABEL"),16;case 101:return e.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 103:case 104:return this.popState(),e.getLogger().debug("Lex: LINK",t.yytext),15;case 105:return e.getLogger().debug("Lex: COLON",t.yytext),t.yytext=t.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return e}();function v(){this.yy={}}return m.lexer=y,QH(v,"Parser"),v.prototype=m,m.Parser=v,new v}();tKe.parser=tKe;var nKe=tKe,rKe=new Map,iKe=[],aKe=new Map,oKe="color",sKe="fill",lKe=WG(),cKe=new Map,uKe=QH(e=>kG.sanitizeText(e,lKe),"sanitizeText"),hKe=QH(function(e,t=""){let n=cKe.get(e);n||(n={id:e,styles:[],textStyles:[]},cKe.set(e,n)),null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(oKe).exec(e)){const e=t.replace(sKe,"bgFill").replace(oKe,sKe);n.textStyles.push(e)}n.styles.push(t)})},"addStyleClass"),dKe=QH(function(e,t=""){const n=rKe.get(e);null!=t&&(n.styles=t.split(","))},"addStyle2Node"),pKe=QH(function(e,t){e.split(",").forEach(function(e){let n=rKe.get(e);if(void 0===n){const t=e.trim();n={id:t,type:"na",children:[]},rKe.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},"setCssClass"),fKe=QH((e,t)=>{const n=e.flat(),r=[];for(const e of n)if(e.label&&(e.label=uKe(e.label)),"classDef"!==e.type)if("applyClass"!==e.type)if("applyStyles"!==e.type)if("column-setting"===e.type)t.columns=e.columns??-1;else if("edge"===e.type){const t=(aKe.get(e.id)??0)+1;aKe.set(e.id,t),e.id=t+"-"+e.id,iKe.push(e)}else{e.label||("composite"===e.type?e.label="":e.label=e.id);const t=rKe.get(e.id);if(void 0===t?rKe.set(e.id,e):("na"!==e.type&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&fKe(e.children,e),"space"===e.type){const t=e.width??1;for(let n=0;n{eU.debug("Clear called"),$G(),mKe={id:"root",type:"composite",children:[],columns:-1},rKe=new Map([["root",mKe]]),gKe=[],cKe=new Map,iKe=[],aKe=new Map},"clear");function vKe(e){switch(eU.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return eU.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function bKe(e){return eU.debug("typeStr2Type",e),"=="===e?"thick":"normal"}function xKe(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}QH(vKe,"typeStr2Type"),QH(bKe,"edgeTypeStr2Type"),QH(xKe,"edgeStrToEdgeData");var wKe=0,EKe=QH(()=>(wKe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+wKe),"generateId"),kKe=QH(e=>{mKe.children=e,fKe(e,mKe),gKe=mKe.children},"setHierarchy"),TKe=QH(e=>{const t=rKe.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),_Ke=QH(()=>[...rKe.values()],"getBlocksFlat"),CKe=QH(()=>gKe||[],"getBlocks"),SKe=QH(()=>iKe,"getEdges"),AKe=QH(e=>rKe.get(e),"getBlock"),NKe=QH(e=>{rKe.set(e.id,e)},"setBlock"),IKe=QH(()=>console,"getLogger"),OKe=QH(function(){return cKe},"getClasses"),LKe={getConfig:QH(()=>GU().block,"getConfig"),typeStr2Type:vKe,edgeTypeStr2Type:bKe,edgeStrToEdgeData:xKe,getLogger:IKe,getBlocksFlat:_Ke,getBlocks:CKe,getEdges:SKe,setHierarchy:kKe,getBlock:AKe,setBlock:NKe,getColumns:TKe,getClasses:OKe,clear:yKe,generateId:EKe},MKe=QH((e,t)=>{const n=Pj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return Dj(r,i,a,t)},"fade"),RKe=QH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${MKe(e.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${MKe(e.mainBkg,.5)};\n fill: ${MKe(e.clusterBkg,.5)};\n stroke: ${MKe(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`,"getStyles"),DKe=QH((e,t,n,r)=>{t.forEach(t=>{qKe[t](e,n,r)})},"insertMarkers"),PKe=QH((e,t,n)=>{eU.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),$Ke=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),BKe=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),FKe=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),zKe=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),jKe=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),HKe=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),UKe=QH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),GKe=QH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),qKe={extension:PKe,composition:$Ke,aggregation:BKe,dependency:FKe,lollipop:zKe,point:jKe,circle:HKe,cross:UKe,barb:GKe},WKe=DKe,VKe=WG()?.block?.padding??8;function YKe(e,t){if(0===e||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(1===e)return{px:0,py:t};return{px:t%e,py:Math.floor(t/e)}}QH(YKe,"calculateBlockPosition");var XKe=QH(e=>{let t=0,n=0;for(const r of e.children){const{width:i,height:a,x:o,y:s}=r.size??{width:0,height:0,x:0,y:0};eU.debug("getMaxChildSize abc95 child:",r.id,"width:",i,"height:",a,"x:",o,"y:",s,r.type),"space"!==r.type&&(i>t&&(t=i/(e.widthInColumns??1)),a>n&&(n=a))}return{width:t,height:n}},"getMaxChildSize");function KKe(e,t,n=0,r=0){eU.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"sieblingWidth",n),e?.size?.width||(e.size={width:n,height:r,x:0,y:0});let i=0,a=0;if(e.children?.length>0){for(const n of e.children)KKe(n,t);const o=XKe(e);i=o.width,a=o.height,eU.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,a);for(const t of e.children)t.size&&(eU.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${i} ${a} ${JSON.stringify(t.size)}`),t.size.width=i*(t.widthInColumns??1)+VKe*((t.widthInColumns??1)-1),t.size.height=a,t.size.x=0,t.size.y=0,eU.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${i} maxHeight:${a}`));for(const n of e.children)KKe(n,t,i,a);const s=e.columns??-1;let l=0;for(const t of e.children)l+=t.widthInColumns??1;let c=e.children.length;s>0&&s0?Math.min(e.children.length,s):e.children.length;if(t>0){const n=(h-t*VKe-VKe)/t;eU.debug("abc95 (growing to fit) width",e.id,h,e.size?.width,n);for(const t of e.children)t.size&&(t.size.width=n)}}e.size={width:h,height:d,x:0,y:0}}eU.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function QKe(e,t){eU.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const n=e.columns??-1;if(eU.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){const t=e?.children[0]?.size?.width??0,r=e.children.length*t+(e.children.length-1)*VKe;eU.debug("widthOfChildren 88",r,"posX");let i=0;eU.debug("abc91 block?.size?.x",e.id,e?.size?.x);let a=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-VKe,o=0;for(const t of e.children){const r=e;if(!t.size)continue;const{width:s,height:l}=t.size,{px:c,py:u}=YKe(n,i);if(u!=o&&(o=u,a=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-VKe,eU.debug("New row in layout for block",e.id," and child ",t.id,o)),eU.debug(`abc89 layout blocks (child) id: ${t.id} Pos: ${i} (px, py) ${c},${u} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${s}${VKe}`),r.size){const e=s/2;t.size.x=a+VKe+e,eU.debug(`abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${a} new startingPosX${t.size.x} ${e} padding=${VKe} width=${s} halfWidth=${e} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${s*(t?.widthInColumns??1)/2}`),a=t.size.x+e,t.size.y=r.size.y-r.size.height/2+u*(l+VKe)+l/2+VKe,eU.debug(`abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${a}${VKe}${e}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${s*(t?.widthInColumns??1)/2}`)}t.children&&QKe(t),i+=t?.widthInColumns??1,eU.debug("abc88 columnsPos",t,i)}}eU.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function ZKe(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&"root"!==e.id){const{x:a,y:o,width:s,height:l}=e.size;a-s/2r&&(r=a+s/2),o+l/2>i&&(i=o+l/2)}if(e.children)for(const a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=ZKe(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}function JKe(e){const t=e.getBlock("root");if(!t)return;KKe(t,e,0,0),QKe(t),eU.debug("getBlocks",JSON.stringify(t,null,2));const{minX:n,minY:r,maxX:i,maxY:a}=ZKe(t);return{x:n,y:r,width:i-n,height:a-r}}function eQe(e,t){t&&e.attr("style",t)}function tQe(e){const t=EK(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=t.append("xhtml:div"),r=e.label,i=e.isNode?"nodeLabel":"edgeLabel",a=n.append("span");return a.html(r),eQe(a,e.labelStyle),a.attr("class",i),eQe(n,e.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}QH(KKe,"setBlockSizes"),QH(QKe,"layoutBlocks"),QH(ZKe,"findBounds"),QH(JKe,"layout"),QH(eQe,"applyStyle"),QH(tQe,"addHtmlLabel");var nQe=QH((e,t,n,r)=>{let i=e||"";if("object"==typeof i&&(i=i[0]),hG(WG().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),eU.debug("vertexText"+i);return tQe({isNode:r,label:f7(B5(i)),labelStyle:t.replace("fill:","color:")})}{const e=document.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",t.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const t of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)}return e}},"createLabel"),rQe=nQe,iQe=QH((e,t,n,r,i)=>{t.arrowTypeStart&&oQe(e,"start",t.arrowTypeStart,n,r,i),t.arrowTypeEnd&&oQe(e,"end",t.arrowTypeEnd,n,r,i)},"addEdgeMarkers"),aQe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},oQe=QH((e,t,n,r,i,a)=>{const o=aQe[n];if(!o)return void eU.warn(`Unknown arrow type: ${n}`);const s="start"===t?"Start":"End";e.attr(`marker-${t}`,`url(${r}#${i}_${a}-${o}${s})`)},"addEdgeMarker"),sQe={},lQe={},cQe=QH((e,t)=>{const n=WG(),r=hG(n.flowchart.htmlLabels),i="markdown"===t.labelType?g7(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0},n):rQe(t.label,t.labelStyle),a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label");o.node().appendChild(i);let s,l=i.getBBox();if(r){const e=i.children[0],t=EK(i);l=e.getBoundingClientRect(),t.attr("width",l.width),t.attr("height",l.height)}if(o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),sQe[t.id]=a,t.width=l.width,t.height=l.height,t.startLabelLeft){const n=rQe(t.startLabelLeft,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),lQe[t.id]||(lQe[t.id]={}),lQe[t.id].startLeft=r,uQe(s,t.startLabelLeft)}if(t.startLabelRight){const n=rQe(t.startLabelRight,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),lQe[t.id]||(lQe[t.id]={}),lQe[t.id].startRight=r,uQe(s,t.startLabelRight)}if(t.endLabelLeft){const n=rQe(t.endLabelLeft,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),lQe[t.id]||(lQe[t.id]={}),lQe[t.id].endLeft=r,uQe(s,t.endLabelLeft)}if(t.endLabelRight){const n=rQe(t.endLabelRight,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),lQe[t.id]||(lQe[t.id]={}),lQe[t.id].endRight=r,uQe(s,t.endLabelRight)}return i},"insertEdgeLabel");function uQe(e,t){WG().flowchart.htmlLabels&&e&&(e.style.width=9*t.length+"px",e.style.height="12px")}QH(uQe,"setTerminalWidth");var hQe=QH((e,t)=>{eU.debug("Moving label abc88 ",e.id,e.label,sQe[e.id],t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=WG(),{subGraphTitleTotalMargin:i}=oY(r);if(e.label){const r=sQe[e.id];let a=e.x,o=e.y;if(n){const r=P5.calcLabelPosition(n);eU.debug("Moving label "+e.label+" from (",a,",",o,") to (",r.x,",",r.y,") abc88"),t.updatedPath&&(a=r.x,o=r.y)}r.attr("transform",`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){const t=lQe[e.id].startLeft;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.startLabelRight){const t=lQe[e.id].startRight;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelLeft){const t=lQe[e.id].endLeft;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelRight){const t=lQe[e.id].endRight;let r=e.x,i=e.y;if(n){const t=P5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}},"positionEdgeLabel"),dQe=QH((e,t)=>{const n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},"outsideNode"),pQe=QH((e,t,n)=>{eU.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(t)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2;let s=n.xMath.abs(r-t.x)*l){let e=n.y{eU.debug("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(dQe(t,e)||i)r=e,i||n.push(e);else{const a=pQe(t,r,e);let o=!1;n.forEach(e=>{o=o||e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)||n.push(a),i=!0}}),n},"cutPathAtIntersect"),gQe=QH(function(e,t,n,r,i,a,o){let s=n.points;eU.debug("abc88 InsertEdge: edge=",n,"e=",t);let l=!1;const c=a.node(t.v);var u=a.node(t.w);u?.intersect&&c?.intersect&&(s=s.slice(1,n.points.length-1),s.unshift(c.intersect(s[0])),s.push(u.intersect(s[s.length-1]))),n.toCluster&&(eU.debug("to cluster abc88",r[n.toCluster]),s=fQe(n.points,r[n.toCluster].node),l=!0),n.fromCluster&&(eU.debug("from cluster abc88",r[n.fromCluster]),s=fQe(s.reverse(),r[n.fromCluster].node).reverse(),l=!0);const h=s.filter(e=>!Number.isNaN(e.y));let d=m2;!n.curve||"graph"!==i&&"flowchart"!==i||(d=n.curve);const{x:p,y:f}=aY(n),g=s2().x(p).y(f).curve(d);let m;switch(n.thickness){case"normal":m="edge-thickness-normal";break;case"thick":case"invisible":m="edge-thickness-thick";break;default:m=""}switch(n.pattern){case"solid":m+=" edge-pattern-solid";break;case"dotted":m+=" edge-pattern-dotted";break;case"dashed":m+=" edge-pattern-dashed"}const y=e.append("path").attr("d",g(h)).attr("id",n.id).attr("class"," "+m+(n.classes?" "+n.classes:"")).attr("style",n.style);let v="";(WG().flowchart.arrowMarkerAbsolute||WG().state.arrowMarkerAbsolute)&&(v=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,v=v.replace(/\(/g,"\\("),v=v.replace(/\)/g,"\\)")),iQe(y,n,v,o,i);let b={};return l&&(b.updatedPath=s),b.originalPath=n.points,b},"insertEdge"),mQe=QH(e=>{const t=new Set;for(const n of e)switch(n){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(n)}return t},"expandAndDeduplicateDirections"),yQe=QH((e,t,n)=>{const r=mQe(e),i=t.height+2*n.padding,a=i/2,o=t.width+2*a+n.padding,s=n.padding/2;return r.has("right")&&r.has("left")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:a,y:0},{x:o/2,y:2*s},{x:o-a,y:0},{x:o,y:0},{x:o,y:-i/3},{x:o+2*s,y:-i/2},{x:o,y:-2*i/3},{x:o,y:-i},{x:o-a,y:-i},{x:o/2,y:-i-2*s},{x:a,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*s,y:-i/2},{x:0,y:-i/3}]:r.has("right")&&r.has("left")&&r.has("up")?[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}]:r.has("right")&&r.has("left")&&r.has("down")?[{x:0,y:0},{x:a,y:-i},{x:o-a,y:-i},{x:o,y:0}]:r.has("right")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:o,y:-a},{x:o,y:-i+a},{x:0,y:-i}]:r.has("left")&&r.has("up")&&r.has("down")?[{x:o,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:o,y:-i}]:r.has("right")&&r.has("left")?[{x:a,y:0},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")&&r.has("down")?[{x:o/2,y:0},{x:0,y:-s},{x:a,y:-s},{x:a,y:-i+s},{x:0,y:-i+s},{x:o/2,y:-i},{x:o,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s},{x:o,y:-s}]:r.has("right")&&r.has("up")?[{x:0,y:0},{x:o,y:-a},{x:0,y:-i}]:r.has("right")&&r.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-i}]:r.has("left")&&r.has("up")?[{x:o,y:0},{x:0,y:-a},{x:o,y:-i}]:r.has("left")&&r.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-i}]:r.has("right")?[{x:a,y:-s},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i+s}]:r.has("left")?[{x:a,y:0},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")?[{x:a,y:-s},{x:a,y:-i+s},{x:0,y:-i+s},{x:o/2,y:-i},{x:o,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s}]:r.has("down")?[{x:o/2,y:0},{x:0,y:-s},{x:a,y:-s},{x:a,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s},{x:o,y:-s}]:[{x:0,y:0}]},"getArrowPoints");function vQe(e,t){return e.intersect(t)}QH(vQe,"intersectNode");var bQe=vQe;function xQe(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,l=Math.sqrt(t*t*s*s+n*n*o*o),c=Math.abs(t*n*o/l);r.x0}QH(TQe,"intersectLine"),QH(_Qe,"sameSign");var CQe=TQe,SQe=AQe;function AQe(e,t,n){var r=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof t.forEach?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));for(var l=r-e.width/2-o,c=i-e.height/2-s,u=0;u1&&a.sort(function(e,t){var r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,l=Math.sqrt(o*o+s*s);return a{var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=0===s?0:c*o/s,r=c):(o<0&&(l=-l),n=l,r=0===o?0:l*s/o),{x:i+n,y:a+r}},"intersectRect"),IQe={node:bQe,circle:kQe,ellipse:wQe,polygon:SQe,rect:NQe},OQe=QH(async(e,t,n,r)=>{const i=WG();let a;const o=t.useHtmlLabels||hG(i.flowchart.htmlLabels);a=n||"node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=s.insert("g").attr("class","label").attr("style",t.labelStyle);let c;c=void 0===t.labelText?"":"string"==typeof t.labelText?t.labelText:t.labelText[0];const u=l.node();let h;h="markdown"===t.labelType?g7(l,iG(B5(c),i),{useHtmlLabels:o,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(rQe(iG(B5(c),i),t.labelStyle,!1,r));let d=h.getBBox();const p=t.padding/2;if(hG(i.flowchart.htmlLabels)){const e=h.children[0],t=EK(h),n=e.getElementsByTagName("img");if(n){const e=""===c.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(e,10)*n+"px";t.style.minWidth=r,t.style.maxWidth=r}else t.style.width="100%";n(t)}QH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}d=e.getBoundingClientRect(),t.attr("width",d.width),t.attr("height",d.height)}return o?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:p,label:l}},"labelHelper"),LQe=QH((e,t)=>{const n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds");function MQe(e,t,n,r){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+n/2+")")}QH(MQe,"insertPolygonShape");var RQe=QH(async(e,t)=>{t.useHtmlLabels||WG().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:n,bbox:r,halfPadding:i}=await OQe(e,t,"node "+t.classes,!0);eU.info("Classes = ",t.classes);const a=n.insert("rect",":first-child");return a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-r.width/2-i).attr("y",-r.height/2-i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),LQe(t,a),t.intersect=function(e){return IQe.rect(t,e)},n},"note"),DQe=RQe,PQe=QH(e=>e?" "+e:"","formatClass"),$Qe=QH((e,t)=>`${t||"node default"}${PQe(e.classes)} ${PQe(e.class)}`,"getClassesFromNode"),BQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding+(r.height+t.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];eU.info("Question main (Circle)");const o=MQe(n,i,i,a);return o.attr("style",t.style),LQe(t,o),t.intersect=function(e){return eU.warn("Intersect called"),IQe.polygon(t,a,e)},n},"question"),FQe=QH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=n.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" "));return i.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(e){return IQe.circle(t,14,e)},n},"choice"),zQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.height+t.padding,a=i/4,o=r.width+2*a+t.padding,s=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=MQe(n,o,i,s);return l.attr("style",t.style),LQe(t,l),t.intersect=function(e){return IQe.polygon(t,s,e)},n},"hexagon"),jQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,void 0,!0),i=r.height+2*t.padding,a=i/2,o=r.width+2*a+t.padding,s=yQe(t.directions,r,t),l=MQe(n,o,i,s);return l.attr("style",t.style),LQe(t,l),t.intersect=function(e){return IQe.polygon(t,s,e)},n},"block_arrow"),HQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return MQe(n,i,a,o).attr("style",t.style),t.width=i+a,t.height=a,t.intersect=function(e){return IQe.polygon(t,o,e)},n},"rect_left_inv_arrow"),UQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"lean_right"),GQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"lean_left"),qQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"trapezoid"),WQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"inv_trapezoid"),VQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"rect_right_inv_arrow"),YQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=i/2,o=a/(2.5+i/50),s=r.height+o+t.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+i+" 0 a "+a+","+o+" 0,0,0 "+-i+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+i+" 0 l 0,"+-s,c=n.attr("label-offset-y",o).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(s/2+o)+")");return LQe(t,c),t.intersect=function(e){const n=IQe.rect(t,e),r=n.x-t.x;if(0!=a&&(Math.abs(r)t.height/2-o)){let i=o*o*(1-r*r/(a*a));0!=i&&(i=Math.sqrt(i)),i=o-i,e.y-t.y>0&&(i=-i),n.y+=i}return n},n},"cylinder"),XQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await OQe(e,t,"node "+t.classes+" "+t.class,!0),a=n.insert("rect",":first-child"),o=t.positioned?t.width:r.width+t.padding,s=t.positioned?t.height:r.height+t.padding,l=t.positioned?-o/2:-r.width/2-i,c=t.positioned?-s/2:-r.height/2-i;if(a.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",c).attr("width",o).attr("height",s),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(ZQe(a,t.props.borders,o,s),e.delete("borders")),e.forEach(e=>{eU.warn(`Unknown node property ${e}`)})}return LQe(t,a),t.intersect=function(e){return IQe.rect(t,e)},n},"rect"),KQe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await OQe(e,t,"node "+t.classes,!0),a=n.insert("rect",":first-child"),o=t.positioned?t.width:r.width+t.padding,s=t.positioned?t.height:r.height+t.padding,l=t.positioned?-o/2:-r.width/2-i,c=t.positioned?-s/2:-r.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",c).attr("width",o).attr("height",s),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(ZQe(a,t.props.borders,o,s),e.delete("borders")),e.forEach(e=>{eU.warn(`Unknown node property ${e}`)})}return LQe(t,a),t.intersect=function(e){return IQe.rect(t,e)},n},"composite"),QQe=QH(async(e,t)=>{const{shapeSvg:n}=await OQe(e,t,"label",!0);eU.trace("Classes = ",t.class);const r=n.insert("rect",":first-child");if(r.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(ZQe(r,t.props.borders,0,0),e.delete("borders")),e.forEach(e=>{eU.warn(`Unknown node property ${e}`)})}return LQe(t,r),t.intersect=function(e){return IQe.rect(t,e)},n},"labelRect");function ZQe(e,t,n,r){const i=[],a=QH(e=>{i.push(e,0)},"addBorder"),o=QH(e=>{i.push(0,e)},"skipBorder");t.includes("t")?(eU.debug("add top border"),a(n)):o(n),t.includes("r")?(eU.debug("add right border"),a(r)):o(r),t.includes("b")?(eU.debug("add bottom border"),a(n)):o(n),t.includes("l")?(eU.debug("add left border"),a(r)):o(r),e.attr("stroke-dasharray",i.join(" "))}QH(ZQe,"applyNodePropertyBorders");var JQe=QH((e,t)=>{let n;n=t.classes?"node "+t.classes:"node default";const r=e.insert("g").attr("class",n).attr("id",t.domId||t.id),i=r.insert("rect",":first-child"),a=r.insert("line"),o=r.insert("g").attr("class","label"),s=t.labelText.flat?t.labelText.flat():t.labelText;let l="";l="object"==typeof s?s[0]:s,eU.info("Label text abc79",l,s,"object"==typeof s);const c=o.node().appendChild(rQe(l,t.labelStyle,!0,!0));let u={width:0,height:0};if(hG(WG().flowchart.htmlLabels)){const e=c.children[0],t=EK(c);u=e.getBoundingClientRect(),t.attr("width",u.width),t.attr("height",u.height)}eU.info("Text 2",s);const h=s.slice(1,s.length);let d=c.getBBox();const p=o.node().appendChild(rQe(h.join?h.join("
    "):h,t.labelStyle,!0,!0));if(hG(WG().flowchart.htmlLabels)){const e=p.children[0],t=EK(p);u=e.getBoundingClientRect(),t.attr("width",u.width),t.attr("height",u.height)}const f=t.padding/2;return EK(p).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+f+5)+")"),EK(c).attr("transform","translate( "+(u.width{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.height+t.padding,a=r.width+i/4+t.padding,o=n.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return LQe(t,o),t.intersect=function(e){return IQe.rect(t,e)},n},"stadium"),tZe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await OQe(e,t,$Qe(t,void 0),!0),a=n.insert("circle",":first-child");return a.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),eU.info("Circle main"),LQe(t,a),t.intersect=function(e){return eU.info("Circle intersect",t,r.width/2+i,e),IQe.circle(t,r.width/2+i,e)},n},"circle"),nZe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await OQe(e,t,$Qe(t,void 0),!0),a=n.insert("g",":first-child"),o=a.insert("circle"),s=a.insert("circle");return a.attr("class",t.class),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i+5).attr("width",r.width+t.padding+10).attr("height",r.height+t.padding+10),s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),eU.info("DoubleCircle main"),LQe(t,o),t.intersect=function(e){return eU.info("DoubleCircle intersect",t,r.width/2+i+5,e),IQe.circle(t,r.width/2+i+5,e)},n},"doublecircle"),rZe=QH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await OQe(e,t,$Qe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],s=MQe(n,i,a,o);return s.attr("style",t.style),LQe(t,s),t.intersect=function(e){return IQe.polygon(t,o,e)},n},"subroutine"),iZe=QH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),LQe(t,r),t.intersect=function(e){return IQe.circle(t,7,e)},n},"start"),aZe=QH((e,t,n)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,a=10;"LR"===n&&(i=10,a=70);const o=r.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return LQe(t,o),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(e){return IQe.rect(t,e)},r},"forkJoin"),oZe=QH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=n.insert("circle",":first-child"),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),LQe(t,i),t.intersect=function(e){return IQe.circle(t,7,e)},n},"end"),sZe=QH((e,t)=>{const n=t.padding/2;let r;r=t.classes?"node "+t.classes:"node default";const i=e.insert("g").attr("class",r).attr("id",t.domId||t.id),a=i.insert("rect",":first-child"),o=i.insert("line"),s=i.insert("line");let l=0,c=4;const u=i.insert("g").attr("class","label");let h=0;const d=t.classData.annotations?.[0],p=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",f=u.node().appendChild(rQe(p,t.labelStyle,!0,!0));let g=f.getBBox();if(hG(WG().flowchart.htmlLabels)){const e=f.children[0],t=EK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}t.classData.annotations[0]&&(c+=g.height+4,l+=g.width);let m=t.classData.label;void 0!==t.classData.type&&""!==t.classData.type&&(WG().flowchart.htmlLabels?m+="<"+t.classData.type+">":m+="<"+t.classData.type+">");const y=u.node().appendChild(rQe(m,t.labelStyle,!0,!0));EK(y).attr("class","classTitle");let v=y.getBBox();if(hG(WG().flowchart.htmlLabels)){const e=y.children[0],t=EK(y);v=e.getBoundingClientRect(),t.attr("width",v.width),t.attr("height",v.height)}c+=v.height+4,v.width>l&&(l=v.width);const b=[];t.classData.members.forEach(e=>{const n=e.getDisplayDetails();let r=n.displayText;WG().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=u.node().appendChild(rQe(r,n.cssStyle?n.cssStyle:t.labelStyle,!0,!0));let a=i.getBBox();if(hG(WG().flowchart.htmlLabels)){const e=i.children[0],t=EK(i);a=e.getBoundingClientRect(),t.attr("width",a.width),t.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,b.push(i)}),c+=8;const x=[];if(t.classData.methods.forEach(e=>{const n=e.getDisplayDetails();let r=n.displayText;WG().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=u.node().appendChild(rQe(r,n.cssStyle?n.cssStyle:t.labelStyle,!0,!0));let a=i.getBBox();if(hG(WG().flowchart.htmlLabels)){const e=i.children[0],t=EK(i);a=e.getBoundingClientRect(),t.attr("width",a.width),t.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(i)}),c+=8,d){let e=(l-g.width)/2;EK(f).attr("transform","translate( "+(-1*l/2+e)+", "+-1*c/2+")"),h=g.height+4}let w=(l-v.width)/2;return EK(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+h)+")"),h+=v.height+4,o.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+h).attr("y2",-c/2-n+8+h),h+=8,b.forEach(e=>{EK(e).attr("transform","translate( "+-l/2+", "+(-1*c/2+h+4)+")");const t=e?.getBBox();h+=(t?.height??0)+4}),h+=8,s.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+h).attr("y2",-c/2-n+8+h),h+=8,x.forEach(e=>{EK(e).attr("transform","translate( "+-l/2+", "+(-1*c/2+h)+")");const t=e?.getBBox();h+=(t?.height??0)+4}),a.attr("style",t.style).attr("class","outer title-state").attr("x",-l/2-n).attr("y",-c/2-n).attr("width",l+t.padding).attr("height",c+t.padding),LQe(t,a),t.intersect=function(e){return IQe.rect(t,e)},i},"class_box"),lZe={rhombus:BQe,composite:KQe,question:BQe,rect:XQe,labelRect:QQe,rectWithTitle:JQe,choice:FQe,circle:tZe,doublecircle:nZe,stadium:eZe,hexagon:zQe,block_arrow:jQe,rect_left_inv_arrow:HQe,lean_right:UQe,lean_left:GQe,trapezoid:qQe,inv_trapezoid:WQe,rect_right_inv_arrow:VQe,cylinder:YQe,start:iZe,end:oZe,note:DQe,subroutine:rZe,fork:aZe,join:aZe,class_box:sZe},cZe={},uZe=QH(async(e,t,n)=>{let r,i;if(t.link){let a;"sandbox"===WG().securityLevel?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a),i=await lZe[t.shape](r,t,n)}else i=await lZe[t.shape](e,t,n),r=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),cZe[t.id]=r,t.haveCallback&&cZe[t.id].attr("class",cZe[t.id].attr("class")+" clickable"),r},"insertNode"),hZe=QH(e=>{const t=cZe[e.id];eU.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-8)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode");function dZe(e,t,n=!1){const r=e;let i="default";(r?.classes?.length||0)>0&&(i=(r?.classes??[]).join(" ")),i+=" flowchart-label";let a,o=0,s="";switch(r.type){case"round":o=5,s="rect";break;case"composite":o=0,s="composite",a=0;break;case"square":case"group":default:s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"doublecircle":s="doublecircle"}const l=y5(r?.styles??[]),c=r.label,u=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:s,labelText:c,rx:o,ry:o,class:i,style:l.style,id:r.id,directions:r.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:n,intersect:void 0,type:r.type,padding:a??GU()?.block?.padding??0}}async function pZe(e,t,n){const r=dZe(t,0,!1);if("group"===r.type)return;const i=GU(),a=await uZe(e,r,{config:i}),o=a.node().getBBox(),s=n.getBlock(r.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},n.setBlock(s),a.remove()}async function fZe(e,t,n){const r=dZe(t,0,!0);if("space"!==n.getBlock(r.id).type){const n=GU();await uZe(e,r,{config:n}),t.intersect=r?.intersect,hZe(r)}}async function gZe(e,t,n,r){for(const i of t)await r(e,i,n),i.children&&await gZe(e,i.children,n,r)}async function mZe(e,t,n){await gZe(e,t,n,pZe)}async function yZe(e,t,n){await gZe(e,t,n,fZe)}async function vZe(e,t,n,r,i){const a=new Pse({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(const n of t)if(n.start&&n.end){const t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){const r=t.size,s=o.size,l=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}];gQe(e,{v:n.start,w:n.end,name:n.id},{...n,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),n.label&&(await cQe(e,{...n,label:n.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),hQe({...n,x:l[1].x,y:l[1].y},{originalPath:l}))}}}QH(dZe,"getNodeFromBlock"),QH(pZe,"calculateBlockSize"),QH(fZe,"insertBlockPositioned"),QH(gZe,"performOperations"),QH(mZe,"calculateBlockSizes"),QH(yZe,"insertBlocks"),QH(vZe,"insertEdges");var bZe,xZe,wZe=QH(function(e,t){return t.db.getClasses()},"getClasses"),EZe=QH(async function(e,t,n,r){const{securityLevel:i,block:a}=GU(),o=r.db;let s;"sandbox"===i&&(s=EK("#i"+t));const l=EK("sandbox"===i?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${t}"]`):EK(`[id="${t}"]`);WKe(c,["point","circle","cross"],r.type,t);const u=o.getBlocks(),h=o.getBlocksFlat(),d=o.getEdges(),p=c.insert("g").attr("class","block");await mZe(p,u,o);const f=JKe(o);if(await yZe(p,u,o),await vZe(p,d,h,o,t),f){const e=f,t=Math.max(1,Math.round(e.width/e.height*.125)),n=e.height+t+10,r=e.width+10,{useMaxWidth:i}=a;CG(c,n,r,!!i),eU.debug("Here Bounds",f,e),c.attr("viewBox",`${e.x-5} ${e.y-5} ${e.width+10} ${e.height+10}`)}},"draw"),kZe={parser:nKe,db:LKe,renderer:{draw:EZe,getClasses:wZe},styles:RKe},TZe=Object.freeze({__proto__:null,diagram:kZe}),_Ze={exports:{}},CZe={exports:{}},SZe={exports:{}};function AZe(){return bZe||(bZe=1,function(e){!function(t,n){e.exports=n()}(0,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o},function(e,t,n){e.exports=function(e){this.vGraphObject=e}},function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(5);function c(e,t,n,o){null==n&&null==o&&(o=t),r.call(this,o),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new a(t.x,t.y,n.width,n.height):new a}for(var u in c.prototype=Object.create(r.prototype),r)c[u]=r[u];c.prototype.getEdges=function(){return this.edges},c.prototype.getChild=function(){return this.child},c.prototype.getOwner=function(){return this.owner},c.prototype.getWidth=function(){return this.rect.width},c.prototype.setWidth=function(e){this.rect.width=e},c.prototype.getHeight=function(){return this.rect.height},c.prototype.setHeight=function(e){this.rect.height=e},c.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},c.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},c.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},c.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},c.prototype.getRect=function(){return this.rect},c.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},c.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},c.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},c.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},c.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},c.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},c.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}}),t},c.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)}),t},c.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}}),e},c.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=c},function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),l=n(1),c=n(13),u=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(c,1),a.target!=a.source&&a.target.edges.splice(u,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l(e=c.getTop())&&(r=e),a>(t=c.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),u>(r=g.getTop())&&(u=r),h<(a=g.getBottom())&&(h=a)}var m=new c(s,u,l-s,h-u);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-o,this.right=m.x+m.width+o,this.top=m.y-o,this.bottom=m.y+m.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,u=-i.MAX_VALUE,h=e.length,d=0;d(t=p.getLeft())&&(o=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),u<(a=p.getBottom())&&(u=a)}return new c(o,l,s-o,u-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(ia)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(ra?(n[0]=u,n[1]=h,k=!0):(n[0]=c,n[1]=l,k=!0):_===S&&(r>a?(n[0]=s,n[1]=l,k=!0):(n[0]=d,n[1]=h,k=!0)),-C===S?a>r?(n[2]=v,n[3]=b,T=!0):(n[2]=y,n[3]=m,T=!0):C===S&&(a>r?(n[2]=g,n[3]=m,T=!0):(n[2]=x,n[3]=b,T=!0)),k&&T)return!1;if(r>a?i>o?(A=this.getCardinalDirection(_,S,4),N=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-_,S,3),N=this.getCardinalDirection(-C,S,1)):i>o?(A=this.getCardinalDirection(-_,S,1),N=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(_,S,2),N=this.getCardinalDirection(C,S,4)),!k)switch(A){case 1:O=l,I=r+-f/S,n[0]=I,n[1]=O;break;case 2:I=d,O=i+p*S,n[0]=I,n[1]=O;break;case 3:O=h,I=r+f/S,n[0]=I,n[1]=O;break;case 4:I=u,O=i+-p*S,n[0]=I,n[1]=O}if(!T)switch(N){case 1:M=m,L=a+-E/S,n[2]=L,n[3]=M;break;case 2:L=x,M=o+w*S,n[2]=L,n[3]=M;break;case 3:M=b,L=a+E/S,n[2]=L,n[3]=M;break;case 4:L=v,M=o+-w*S,n[2]=L,n[3]=M}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,c,u,h,d=e.x,p=e.y,f=t.x,g=t.y,m=n.x,y=n.y,v=i.x,b=i.y;return 0===(h=(a=g-p)*(l=m-v)-(o=b-y)*(s=d-f))?null:new r((s*(u=v*y-m*b)-l*(c=f*p-d*g))/h,(o*c-a*u)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var u=(-l+Math.sqrt(l*l-4*s*c))/(2*s),h=(-l-Math.sqrt(l*l-4*s*c))/(2*s);return u>=0&&u<=1?[u]:h>=0&&h<=1?[h]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(c[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);var h=u.getEdges();for(a=0;a-1&&c.splice(g,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(h,1),u.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}})}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){var r=n(15),i=n(4),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in l.prototype=Object.create(r.prototype),r)l[c]=r[c];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l,c=this.getGraphManager().getAllEdges(),u=0;ui.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||c>=s[0].length))for(var u=0;ue}}]),e}();e.exports=a},function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),a=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),s=0;s=0;S--)if(0!==this.s[S]){for(var A=S+1;A=0;D--){if(function(e,t){return e&&t}(D0;){var G=void 0,q=void 0;for(G=T-2;G>=-1&&-1!==G;G--)if(Math.abs(n[G])<=U+H*(Math.abs(this.s[G])+Math.abs(this.s[G+1]))){n[G]=0;break}if(G===T-2)q=4;else{var W=void 0;for(W=T-1;W>=G&&W!==G;W--){var V=(W!==T?Math.abs(n[W]):0)+(W!==G+1?Math.abs(n[W-1]):0);if(Math.abs(this.s[W])<=U+H*V){this.s[W]=0;break}}W===G?q=3:W===T-1?q=1:(q=2,G=W)}switch(G++,q){case 1:var Y=n[T-2];n[T-2]=0;for(var X=T-2;X>=G;X--){var K=r.hypot(this.s[X],Y),Q=this.s[X]/K,Z=Y/K;this.s[X]=K,X!==G&&(Y=-Z*n[X-1],n[X-1]=Q*n[X-1]);for(var J=0;J=this.s[G+1]);){var Te=this.s[G];if(this.s[G]=this.s[G+1],this.s[G+1]=Te,GMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),l=n(806),c=n(902),u=n(551).FDLayoutConstants,h=n(551).LayoutConstants,d=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,m=n(551).Integer,y=n(551).IGeometry,v=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},w.prototype.newNode=function(e){return new o(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return h.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=a)}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var c=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var h=new Map,d=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;h.has(t)?h.get(t).push(n):h.set(t,[n]),h.has(n)?h.get(n).push(t):h.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;d.has(r)?d.get(r).push(i):d.set(r,[i]),d.has(i)?d.get(i).push(r):d.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new x,a=new Set,o=0;return e.forEach(function(s,l){if(!a.has(l)){n[o]=[],r[o]=!1;var c=l;for(i.push(c),a.add(c),n[o].push(c);0!=i.length;)c=i.shift(),t.has(c)&&(r[o]=!0),e.get(c).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},f=p(h,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(d,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(h.WORLD_CENTER_X-o.x/2,h.WORLD_CENTER_Y-o.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var m=g[0];g.splice(0,1);var v=u.indexOf(m);v>=0&&u.splice(v,1),f--,h--}d=null!=t?(u.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/h,x=d;p!=h;x=++x%f){var E=u[x].getOtherEnd(e);if(E!=t){var k=(n+p*b)%360,T=(k+b)%360;w.branchRadialLayout(E,e,k,T,i+a,a),p++}}},w.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;ci?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}})},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=d.rect.height)}n+=u+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):"bottom"==i.labelPosVertical&&i.setHeight(o+i.labelHeight))}})},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var c,u=a/i,h=o/i,d=Math.pow(n-r,2)+4*(u+r)*(h+n)*i,p=(r-n+Math.sqrt(d))/(2*(u+r));t?(c=Math.ceil(p))==p&&c++:c=Math.floor(p);var f=c*(u+r)-r;return s>f&&(f=s),f+=2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,a=l.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},c=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=c;return o.idealRowWidth?(n=a)(e.id,t.id):n(e,t)});for(var u=0,h=0,d=0;d0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),o=e.width-a>=t+e.horizontalPadding?(e.height+l)/(a+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var h=i;h<=a;h++)c[0]+=this.grid[h][o-1].length+this.grid[h][o].length-1;if(a0)for(h=o;h<=s;h++)c[3]+=this.grid[i-1][h].length+this.grid[i][h].length-1;for(var d,p,f=m.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){"horizontal"==t?(h.set(e,l.has(e)?c[l.get(e)]:i.get(e)),a+=h.get(e)):(h.set(e,l.has(e)?u[l.get(e)]:i.get(e)),a+=h.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||h.set(e,a)})}else{var o=0;e.forEach(function(e){o+="horizontal"==t?l.has(e)?c[l.get(e)]:i.get(e):l.has(e)?u[l.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){h.set(e,o)})}});for(var f=function(){var r=p.shift();e.get(r).forEach(function(e){if(h.get(e.id)o&&(o=v),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw f}}var x=(r+o)/2-(a+s)/2,w=!0,E=!1,k=void 0;try{for(var T,_=e[Symbol.iterator]();!(w=(T=_.next()).done);w=!0){var C=T.value;h.set(C,h.get(C)+x)}}catch(e){E=!0,k=e}finally{try{!w&&_.return&&_.return()}finally{if(E)throw k}}})}return h},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?c[l.get(e.left)]-c[l.get(e.right)]>=0?t++:n++:u[l.get(e.top)]-u[l.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[c[l.get(e.nodeId)],u[l.get(e.nodeId)]]}),k=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return _.has(e)})),o=void 0;o=a.size>0?c[l.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){w[e]=[o,u[l.get(t)]],E[e]=[c[l.get(t)],u[l.get(t)]],e++})},a=0;a0?c[l.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){w[e]=[c[l.get(t)],a],E[e]=[c[l.get(t)],u[l.get(t)]],e++})},h=0;hN&&(N=A[O].length,I=O);if(N0){var V={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n,r,i={x:c[l.get(e.nodeId)],y:u[l.get(e.nodeId)]},a=e.position,o=(r=i,{x:(n=a).x-r.x,y:n.y-r.y});V.x+=o.x,V.y+=o.y}),V.x/=t.fixedNodeConstraint.length,V.y/=t.fixedNodeConstraint.length,c.forEach(function(e,t){c[t]+=V.x}),u.forEach(function(e,t){u[t]+=V.y}),t.fixedNodeConstraint.forEach(function(e){c[l.get(e.nodeId)]=e.position.x,u[l.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var Y=t.alignmentConstraint.vertical,X=function(e){var t=new Set;Y[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return _.has(e)})),i=void 0;i=n.size>0?c[l.get(n.values().next().value)]:g(t).x,t.forEach(function(e){_.has(e)||(c[l.get(e)]=i)})},K=0;K0?u[l.get(n.values().next().value)]:g(t).y,t.forEach(function(e){_.has(e)||(u[l.get(e)]=i)})},J=0;J{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(45),r;var t,n,r})}(CZe)),CZe.exports}!function(e){!function(t,n){e.exports=n(NZe())}(0,function(e){return t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(e){for(var t={},n=0;n0&&c.merge(e)});for(var u=0;u1){c=s[0],u=c.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,c=!1,u=void 0;try{for(var h,d=t.nodeIndexes[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var p=h.value,f=r(p,2),g=f[0],m=f[1],y=n.cy.getElementById(g);if(y){var v=y.boundingBox(),b=t.xCoords[m]-v.w/2,x=t.xCoords[m]+v.w/2,w=t.yCoords[m]-v.h/2,E=t.yCoords[m]+v.h/2;ba&&(a=x),ws&&(s=E)}}}catch(e){c=!0,u=e}finally{try{!l&&d.return&&d.return()}finally{if(c)throw u}}var k=e.x-(a+i)/2,T=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+k}),t.yCoords=t.yCoords.map(function(e){return e+T})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,c=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=l),cs&&(s=u)});var _=e.x-(a+i)/2,C=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+_,n.getCenterY()+C)})}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,u=void 0,h=void 0,d=e.descendants().not(":parent"),p=d.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),a<(c=t[r.get(g.id())]+g.width()/2)&&(a=c),o>(u=n[r.get(g.id())]-g.height()/2)&&(o=u),s<(h=n[r.get(g.id())]+g.height()/2)&&(s=h)}var m={};return m.topLeftX=i,m.topLeftY=o,m.width=a-i,m.height=s-o,m},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach(function(e){var t=!1;e.children().forEach(function(e){"none"!=e.css("display")&&(t=!0)}),t||n.merge(e)}),n}};e.exports=a},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,c=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,h=e.eles,d=h.nodes(),p=h.edges(),f=void 0,g=void 0,m=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,m=t.yCoords);var v=function(e){return"function"==typeof e},b=function(e,t){return v(e)?e(t):e},x=r.calcParentsWithoutChildren(n,h);null!=e.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(u.MAX_ITERATIONS=c.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(u.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=c.ANIMATE=l.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var c=n.length,u=0;u0&&e(i.getGraphManager().add(i.newGraph(),p),d,i,l)}}(E.addRoot(),r.getTopMostNodes(d),w,e),function(t,n,r){for(var i=0,a=0,o=0;o0?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=i/a:v(e.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,u.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(h){var d=a.getTopMostNodes(e.eles.nodes());if((l=a.connectComponents(t,e.eles,d)).forEach(function(e){var t=e.boundingBox();c.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),e.randomize&&l.forEach(function(t){e.eles=t,r.push(o(e))}),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,m={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach(function(e,t){0==e.edges().length&&(e.nodes().forEach(function(t,n){p.merge(e.nodes()[n]),t.isParent()||(m.nodeIndexes.set(e.nodes()[n].id(),g++),m.xCoords.push(e.nodes()[0].position().x),m.yCoords.push(e.nodes()[0].position().y))}),y.push(t))}),p.length>1){var v=p.boundingBox();c.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),l.push(p),r.push(m);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),c.splice(y[b],1)}}l.forEach(function(t,n){e.eles=t,i.push(s(e,r[n])),a.relocateComponent(c[n],i[n],e)})}else l.forEach(function(t,n){a.relocateComponent(c[n],r[n],e)});var x=new Set;if(l.length>1){var w=[],E=n.filter(function(e){return"none"==e.css("display")});l.forEach(function(t,n){var o=void 0;if("draft"==e.quality&&(o=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach(function(t){if("draft"==e.quality)if(t.isParent()){var c=a.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,o);s.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=o.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})}),t.edges().forEach(function(t){var l=t.source(),c=t.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==e.quality){var u=o.get(l.id()),h=o.get(c.id()),d=[],p=[];if(l.isParent()){var f=a.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,o);d.push(f.topLeftX+f.width/2),d.push(f.topLeftY+f.height/2)}else d.push(r[n].xCoords[u]),d.push(r[n].yCoords[u]);if(c.isParent()){var g=a.calcBoundingBox(c,r[n].xCoords,r[n].yCoords,o);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[h]),p.push(r[n].yCoords[h]);s.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][c.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][c.id()].getCenterX(),endY:i[n][c.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),x.add(n))}});var k=u.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+k[t].dx}),r=e.yCoords.map(function(e){return e+k[t].dy});e.xCoords=n,e.yCoords=r});else{var T=0;x.forEach(function(e){Object.keys(i[e]).forEach(function(t){var n=i[e][t];n.setCenter(n.getCenterX()+k[T].dx,n.getCenterY()+k[T].dy)}),T++})}}}else{var _=e.eles.boundingBox();if(c.push({x:_.x1+_.w/2,y:_.y1+_.h/2}),e.randomize){var C=o(e);r.push(C)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),a.relocateComponent(c[0],i[0],e)):a.relocateComponent(c[0],r[0],e)}var S=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var a=void 0,o=void 0,s=t.data("id");return i.forEach(function(e){s in e&&(a={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),e.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?a.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(a.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?a.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(a.y-=o.labelHeight/2))),null==a&&(a={x:t.position("x"),y:t.position("y")}),{x:a.x,y:a.y}}var l=void 0;return r.forEach(function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})}),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=a.calcParentsWithoutChildren(t,n),N=n.filter(function(e){return"none"==e.css("display")});e.eles=n.not(N),n.nodes().not(":parent").not(N).layoutPositions(this,e,S),A.length>0&&A.forEach(function(e){e.position(S(e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=c},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(":parent"),l=new Map,c=new Map,u=new Map,h=[],d=[],p=[],f=[],g=[],m=[],y=[],v=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,k=e.samplingType,T=e.nodeSeparation,_=void 0,C=function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,l=[],u=0,d=1,p=0;p=i;){o=r[i++];for(var f=h[o],y=0;yu&&(u=g[w],d=w)}return d};r.connectComponents(t,n,r.getTopMostNodes(o),l),s.forEach(function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)});for(var S=0,A=0;A0&&(r.isParent()?h[t].push(u.get(r.id())):h[t].push(r.id()))})});var P=function(e){var n=c.get(e),r=void 0;l.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,h[n].push(r),h[c.get(r)].push(e)})},$=!0,B=!1,F=void 0;try{for(var z,j=l.keys()[Symbol.iterator]();!($=(z=j.next()).done);$=!0)P(z.value)}catch(e){B=!0,F=e}finally{try{!$&&j.return&&j.return()}finally{if(B)throw F}}var H=void 0;if((b=c.size)>2){_=b=1)break;c=l}for(var f=0;f=1)break;c=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(579),r;var t,n,r})}(_Ze);var IZe=Zt(_Ze.exports),OZe={L:"left",R:"right",T:"top",B:"bottom"},LZe={L:QH(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:QH(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:QH(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:QH(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},MZe={L:QH((e,t)=>e-t+2,"L"),R:QH((e,t)=>e-2,"R"),T:QH((e,t)=>e-t+2,"T"),B:QH((e,t)=>e-2,"B")},RZe=QH(function(e){return PZe(e)?"L"===e?"R":"L":"T"===e?"B":"T"},"getOppositeArchitectureDirection"),DZe=QH(function(e){return"L"===e||"R"===e||"T"===e||"B"===e},"isArchitectureDirection"),PZe=QH(function(e){return"L"===e||"R"===e},"isArchitectureDirectionX"),$Ze=QH(function(e){return"T"===e||"B"===e},"isArchitectureDirectionY"),BZe=QH(function(e,t){const n=PZe(e)&&$Ze(t),r=$Ze(e)&&PZe(t);return n||r},"isArchitectureDirectionXY"),FZe=QH(function(e){const t=e[0],n=e[1],r=PZe(t)&&$Ze(n),i=$Ze(t)&&PZe(n);return r||i},"isArchitecturePairXY"),zZe=QH(function(e){return"LL"!==e&&"RR"!==e&&"TT"!==e&&"BB"!==e},"isValidArchitectureDirectionPair"),jZe=QH(function(e,t){const n=`${e}${t}`;return zZe(n)?n:void 0},"getArchitectureDirectionPair"),HZe=QH(function([e,t],n){const r=n[0],i=n[1];return PZe(r)?$Ze(i)?[e+("L"===r?-1:1),t+("T"===i?1:-1)]:[e+("L"===r?-1:1),t]:PZe(i)?[e+("L"===i?1:-1),t+("T"===r?1:-1)]:[e,t+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),UZe=QH(function(e){return"LT"===e||"TL"===e?[1,1]:"BL"===e||"LB"===e?[1,-1]:"BR"===e||"RB"===e?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),GZe=QH(function(e,t){return BZe(e,t)?"bend":PZe(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),qZe=QH(function(e){return"service"===e.type},"isArchitectureService"),WZe=QH(function(e){return"junction"===e.type},"isArchitectureJunction"),VZe=QH(e=>e.data(),"edgeData"),YZe=QH(e=>e.data(),"nodeData"),XZe=OU.architecture,KZe=new Mhe(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:XZe,dataStructures:void 0,elements:{}})),QZe=QH(()=>{KZe.reset(),$G()},"clear"),ZZe=QH(function({id:e,icon:t,in:n,title:r,iconText:i}){if(void 0!==KZe.records.registeredIds[e])throw new Error(`The service id [${e}] is already in use by another ${KZe.records.registeredIds[e]}`);if(void 0!==n){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(void 0===KZe.records.registeredIds[n])throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===KZe.records.registeredIds[n])throw new Error(`The service [${e}]'s parent is not a group`)}KZe.records.registeredIds[e]="node",KZe.records.nodes[e]={id:e,type:"service",icon:t,iconText:i,title:r,edges:[],in:n}},"addService"),JZe=QH(()=>Object.values(KZe.records.nodes).filter(qZe),"getServices"),eJe=QH(function({id:e,in:t}){KZe.records.registeredIds[e]="node",KZe.records.nodes[e]={id:e,type:"junction",edges:[],in:t}},"addJunction"),tJe=QH(()=>Object.values(KZe.records.nodes).filter(WZe),"getJunctions"),nJe=QH(()=>Object.values(KZe.records.nodes),"getNodes"),rJe=QH(e=>KZe.records.nodes[e],"getNode"),iJe=QH(function({id:e,icon:t,in:n,title:r}){if(void 0!==KZe.records.registeredIds[e])throw new Error(`The group id [${e}] is already in use by another ${KZe.records.registeredIds[e]}`);if(void 0!==n){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(void 0===KZe.records.registeredIds[n])throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===KZe.records.registeredIds[n])throw new Error(`The group [${e}]'s parent is not a group`)}KZe.records.registeredIds[e]="group",KZe.records.groups[e]={id:e,icon:t,title:r,in:n}},"addGroup"),aJe=QH(()=>Object.values(KZe.records.groups),"getGroups"),oJe=QH(function({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:l}){if(!DZe(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${n}`);if(!DZe(r))throw new Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${r}`);if(void 0===KZe.records.nodes[e]&&void 0===KZe.records.groups[e])throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===KZe.records.nodes[t]&&void 0===KZe.records.groups[e])throw new Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=KZe.records.nodes[e].in,u=KZe.records.nodes[t].in;if(o&&c&&u&&c==u)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&c&&u&&c==u)throw new Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const h={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:l};KZe.records.edges.push(h),KZe.records.nodes[e]&&KZe.records.nodes[t]&&(KZe.records.nodes[e].edges.push(KZe.records.edges[KZe.records.edges.length-1]),KZe.records.nodes[t].edges.push(KZe.records.edges[KZe.records.edges.length-1]))},"addEdge"),sJe=QH(()=>KZe.records.edges,"getEdges"),lJe=QH(()=>{if(void 0===KZe.records.dataStructures){const e={},t=Object.entries(KZe.records.nodes).reduce((t,[n,r])=>(t[n]=r.edges.reduce((t,r)=>{const i=rJe(r.lhsId)?.in,a=rJe(r.rhsId)?.in;if(i&&a&&i!==a){const t=GZe(r.lhsDir,r.rhsDir);"bend"!==t&&(e[i]??={},e[i][a]=t,e[a]??={},e[a][i]=t)}if(r.lhsId===n){const e=jZe(r.lhsDir,r.rhsDir);e&&(t[e]=r.rhsId)}else{const e=jZe(r.rhsDir,r.lhsDir);e&&(t[e]=r.lhsId)}return t},{}),t),{}),n=Object.keys(t)[0],r={[n]:1},i=Object.keys(t).reduce((e,t)=>t===n?e:{...e,[t]:1},{}),a=QH(e=>{const n={[e]:[0,0]},a=[e];for(;a.length>0;){const e=a.shift();if(e){r[e]=1,delete i[e];const o=t[e],[s,l]=n[e];Object.entries(o).forEach(([e,t])=>{r[t]||(n[t]=HZe([s,l],e),a.push(t))})}}return n},"BFS"),o=[a(n)];for(;Object.keys(i).length>0;)o.push(a(Object.keys(i)[0]));KZe.records.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return KZe.records.dataStructures},"getDataStructures"),cJe=QH((e,t)=>{KZe.records.elements[e]=t},"setElementForId"),uJe=QH(e=>KZe.records.elements[e],"getElementById"),hJe={clear:QZe,setDiagramTitle:HG,getDiagramTitle:UG,setAccTitle:BG,getAccTitle:FG,setAccDescription:zG,getAccDescription:jG,addService:ZZe,getServices:JZe,addJunction:eJe,getJunctions:tJe,getNodes:nJe,getNode:rJe,addGroup:iJe,getGroups:aJe,addEdge:oJe,getEdges:sJe,setElementForId:cJe,getElementById:uJe,getDataStructures:lJe};function dJe(e){const t=WG().architecture;return t?.[e]?t[e]:XZe[e]}QH(dJe,"getConfigField");var pJe=QH((e,t)=>{Lhe(e,t),e.groups.map(t.addGroup),e.services.map(e=>t.addService({...e,type:"service"})),e.junctions.map(e=>t.addJunction({...e,type:"junction"})),e.edges.map(t.addEdge)},"populateDb"),fJe={parse:QH(async e=>{const t=await Pke("architecture",e);eU.debug(t),pJe(t,hJe)},"parse")},gJe=QH(e=>`\n .edge {\n stroke-width: ${e.archEdgeWidth};\n stroke: ${e.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${e.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${e.archGroupBorderColor};\n stroke-width: ${e.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),mJe=QH(e=>`${e}`,"wrapIcon"),yJe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:mJe('')},server:{body:mJe('')},disk:{body:mJe('')},internet:{body:mJe('')},cloud:{body:mJe('')},unknown:kY,blank:{body:mJe("")}}},vJe=QH(async function(e,t){const n=dJe("padding"),r=dJe("iconSize"),i=r/2,a=r/6,o=a/2;await Promise.all(t.edges().map(async t=>{const{source:r,sourceDir:s,sourceArrow:l,sourceGroup:c,target:u,targetDir:h,targetArrow:d,targetGroup:p,label:f}=VZe(t);let{x:g,y:m}=t[0].sourceEndpoint();const{x:y,y:v}=t[0].midpoint();let{x:b,y:x}=t[0].targetEndpoint();const w=n+4;if(c&&(PZe(s)?g+="L"===s?-w:w:m+="T"===s?-w:w+18),p&&(PZe(h)?b+="L"===h?-w:w:x+="T"===h?-w:w+18),c||"junction"!==hJe.getNode(r)?.type||(PZe(s)?g+="L"===s?i:-i:m+="T"===s?i:-i),p||"junction"!==hJe.getNode(u)?.type||(PZe(h)?b+="L"===h?i:-i:x+="T"===h?i:-i),t[0]._private.rscratch){const t=e.insert("g");if(t.insert("path").attr("d",`M ${g},${m} L ${y},${v} L${b},${x} `).attr("class","edge"),l){const e=PZe(s)?MZe[s](g,a):g-o,n=$Ze(s)?MZe[s](m,a):m-o;t.insert("polygon").attr("points",LZe[s](a)).attr("transform",`translate(${e},${n})`).attr("class","arrow")}if(d){const e=PZe(h)?MZe[h](b,a):b-o,n=$Ze(h)?MZe[h](x,a):x-o;t.insert("polygon").attr("points",LZe[h](a)).attr("transform",`translate(${e},${n})`).attr("class","arrow")}if(f){const e=BZe(s,h)?"XY":PZe(s)?"X":"Y";let n=0;n="X"===e?Math.abs(g-b):"Y"===e?Math.abs(m-x)/1.5:Math.abs(g-b)/2;const r=t.append("g");if(await g7(r,f,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},WG()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===e)r.attr("transform","translate("+y+", "+v+")");else if("Y"===e)r.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===e){const e=jZe(s,h);if(e&&FZe(e)){const t=r.node().getBoundingClientRect(),[n,i]=UZe(e);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*i*45})`);const a=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${y}, ${v-t.height/2})\n translate(${n*a.width/2}, ${i*a.height/2})\n rotate(${-1*n*i*45}, 0, ${t.height/2})\n `)}}}}}))},"drawEdges"),bJe=QH(async function(e,t){const n=.75*dJe("padding"),r=dJe("fontSize"),i=dJe("iconSize")/2;await Promise.all(t.nodes().map(async t=>{const a=YZe(t);if("group"===a.type){const{h:o,w:s,x1:l,y1:c}=t.boundingBox();e.append("rect").attr("x",l+i).attr("y",c+i).attr("width",s).attr("height",o).attr("class","node-bkg");const u=e.append("g");let h=l,d=c;if(a.icon){const e=u.append("g");e.html(`${await AY(a.icon,{height:n,width:n,fallbackPrefix:yJe.prefix})}`),e.attr("transform","translate("+(h+i+1)+", "+(d+i+1)+")"),h+=n,d+=r/2-1-2}if(a.label){const e=u.append("g");await g7(e,a.label,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},WG()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),e.attr("transform","translate("+(h+i+4)+", "+(d+i+2)+")")}}}))},"drawGroups"),xJe=QH(async function(e,t,n){for(const r of n){const n=t.append("g"),i=dJe("iconSize");if(r.title){const e=n.append("g");await g7(e,r.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},WG()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const a=n.append("g");if(r.icon)a.html(`${await AY(r.icon,{height:i,width:i,fallbackPrefix:yJe.prefix})}`);else if(r.iconText){a.html(`${await AY("blank",{height:i,width:i,fallbackPrefix:yJe.prefix})}`);const e=a.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(r.iconText),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;e.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/t)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+r.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);n.attr("class","architecture-service");const{width:o,height:s}=n._groups[0][0].getBBox();r.width=o,r.height=s,e.setElementForId(r.id,n)}return 0},"drawServices"),wJe=QH(function(e,t,n){n.forEach(n=>{const r=t.append("g"),i=dJe("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",i).attr("height",i),r.attr("class","architecture-junction");const{width:a,height:o}=r._groups[0][0].getBBox();r.width=a,r.height=o,e.setElementForId(n.id,r)})},"drawJunctions");function EJe(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"service",id:e.id,icon:e.icon,label:e.title,parent:e.in,width:dJe("iconSize"),height:dJe("iconSize")},classes:"node-service"})})}function kJe(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"junction",id:e.id,parent:e.in,width:dJe("iconSize"),height:dJe("iconSize")},classes:"node-junction"})})}function TJe(e,t){t.nodes().map(t=>{const n=YZe(t);if("group"===n.type)return;n.x=t.position().x,n.y=t.position().y;e.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function _Je(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"group",id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:"node-group"})})}function CJe(e,t){e.forEach(e=>{const{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:l,rhsGroup:c,title:u}=e,h=BZe(e.lhsDir,e.rhsDir)?"segments":"straight",d={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===s?"0 50%":"R"===s?"100% 50%":"T"===s?"50% 0":"50% 100%",target:r,targetDir:l,targetArrow:o,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};t.add({group:"edges",data:d,classes:h})})}function SJe(e,t,n){const r=QH((e,t)=>Object.entries(e).reduce((e,[r,i])=>{let a=0;const o=Object.entries(i);if(1===o.length)return e[r]=o[0][1],e;for(let i=0;i{const n={},i={};return Object.entries(t).forEach(([t,[r,a]])=>{const o=e.getNode(t)?.in??"default";n[a]??={},n[a][o]??=[],n[a][o].push(t),i[r]??={},i[r][o]??=[],i[r][o].push(t)}),{horiz:Object.values(r(n,"horizontal")).filter(e=>e.length>1),vert:Object.values(r(i,"vertical")).filter(e=>e.length>1)}}),[a,o]=i.reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]);return{horizontal:a,vertical:o}}function AJe(e){const t=[],n=QH(e=>`${e[0]},${e[1]}`,"posToStr"),r=QH(e=>e.split(",").map(e=>parseInt(e)),"strToPos");return e.forEach(e=>{const i=Object.fromEntries(Object.entries(e).map(([e,t])=>[n(t),e])),a=[n([0,0])],o={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const e=a.shift();if(e){o[e]=1;const l=i[e];if(l){const c=r(e);Object.entries(s).forEach(([e,r])=>{const s=n([c[0]+r[0],c[1]+r[1]]),u=i[s];u&&!o[s]&&(a.push(s),t.push({[OZe[e]]:u,[OZe[RZe(e)]]:l,gap:1.5*dJe("iconSize")}))})}}}}),t}function NJe(e,t,n,r,i,{spatialMaps:a,groupAlignments:o}){return new Promise(s=>{const l=EK("body").append("div").attr("id","cy").attr("style","display:none"),c=VWe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${dJe("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${dJe("padding")}px`}}]});l.remove(),_Je(n,c),EJe(e,c),kJe(t,c),CJe(r,c);const u=SJe(i,a,o),h=AJe(a),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){const[t,n]=e.connectedNodes(),{parent:r}=YZe(t),{parent:i}=YZe(n);return r===i?1.5*dJe("iconSize"):.5*dJe("iconSize")},edgeElasticity(e){const[t,n]=e.connectedNodes(),{parent:r}=YZe(t),{parent:i}=YZe(n);return r===i?.45:.001},alignmentConstraint:u,relativePlacementConstraint:h});d.one("layoutstop",()=>{function e(e,t,n,r){let i,a;const{x:o,y:s}=e,{x:l,y:c}=t;a=(r-s+(o-n)*(s-c)/(o-l))/Math.sqrt(1+Math.pow((s-c)/(o-l),2)),i=Math.sqrt(Math.pow(r-s,2)+Math.pow(n-o,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-o,2)+Math.pow(c-s,2));let u=(l-o)*(r-s)-(c-s)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let h=(l-o)*(n-o)+(c-s)*(r-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}return a=Math.abs(a)*u,i*=h,{distances:a,weights:i}}QH(e,"getSegmentWeights"),c.startBatch();for(const t of Object.values(c.edges()))if(t.data?.()){const{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){const n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=VZe(t),[a,o]=$Ze(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:l}=e(n,r,a,o);t.style("segment-distances",l),t.style("segment-weights",s)}}c.endBatch(),d.run()}),d.run(),c.ready(e=>{eU.info("Ready",e),s(c)})})}CY([{name:yJe.prefix,icons:yJe}]),VWe.use(IZe),QH(EJe,"addServices"),QH(kJe,"addJunctions"),QH(TJe,"positionNodes"),QH(_Je,"addGroups"),QH(CJe,"addEdges"),QH(SJe,"getAlignments"),QH(AJe,"getRelativeConstraints"),QH(NJe,"layoutArchitecture");var IJe=QH(async(e,t,n,r)=>{const i=r.db,a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),u=Ate(t),h=u.append("g");h.attr("class","architecture-edges");const d=u.append("g");d.attr("class","architecture-services");const p=u.append("g");p.attr("class","architecture-groups"),await xJe(i,d,a),wJe(i,d,o);const f=await NJe(a,o,s,l,i,c);await vJe(h,f),await bJe(p,f),TJe(i,f),SG(void 0,u,dJe("padding"),dJe("useMaxWidth"))},"draw"),OJe={parser:fJe,db:hJe,renderer:{draw:IJe},styles:gJe},LJe=Object.freeze({__proto__:null,diagram:OJe}),MJe=Object.freeze({__proto__:null,InfoModule:vke,createInfoServices:bke}),RJe=Object.freeze({__proto__:null,PacketModule:wke,createPacketServices:Eke}),DJe=Object.freeze({__proto__:null,PieModule:_ke,createPieServices:Cke}),PJe=Object.freeze({__proto__:null,ArchitectureModule:Nke,createArchitectureServices:Ike}),$Je=Object.freeze({__proto__:null,GitGraphModule:gke,createGitGraphServices:mke}),BJe=Object.freeze({__proto__:null,RadarModule:Lke,createRadarServices:Mke});export{Pie as FullscreenModal,Die as FullscreenPage}; +var q$e=function(e){if(!(this instanceof q$e))return new q$e(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};q$e.prototype={fulfill:function(e){return W$e(this,1,"fulfillValue",e)},reject:function(e){return W$e(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new q$e;return n.onFulfilled.push(X$e(e,r,"fulfill")),n.onRejected.push(X$e(t,r,"reject")),V$e(n),r.proxy}};var W$e=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,V$e(e)),e},V$e=function(e){1===e.state?Y$e(e,"onFulfilled",e.fulfillValue):2===e.state&&Y$e(e,"onRejected",e.rejectReason)},Y$e=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1}}(),i=function(){if(qBe)return GBe;qBe=1;var e=zFe();return GBe=function(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this},GBe}();function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&t%1==0&&t0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){QMe(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],a=0,o=n.length;a0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};_ze.className=_ze.classNames=_ze.classes;var Cze={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:fRe,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Cze.variable="(?:[\\w-.]|(?:\\\\"+Cze.metaChar+"))+",Cze.className="(?:[\\w-]|(?:\\\\"+Cze.metaChar+"))+",Cze.value=Cze.string+"|"+Cze.number,Cze.id=Cze.variable,function(){var e,t,n;for(e=Cze.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Cze.comparatorOp+="|\\!"+t)}();var Sze=0,Aze=1,Nze=2,Ize=3,Oze=4,Lze=5,Mze=6,Rze=7,Dze=8,Pze=9,$ze=10,Bze=11,Fze=12,zze=13,jze=14,Hze=15,Uze=16,Gze=17,qze=18,Wze=19,Vze=20,Yze=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return function(e,t){return-1*bRe(e,t)}(e.selector,t.selector)}),Xze=function(){for(var e,t={},n=0;n0&&c.edgeCount>0)return lDe("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return lDe("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&lDe("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return XMe(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case Sze:var l=e(s);return l.substring(0,l.length-1);case Ize:var c=r.field,u=r.operator;return"["+c+n(e(u))+t(s)+"]";case Lze:var h=r.operator,d=r.field;return"["+e(h)+d+"]";case Oze:return"["+r.field+"]";case Mze:var p=r.operator;return"[["+r.field+n(e(p))+t(s)+"]]";case Rze:return s;case Dze:return"#"+s;case Pze:return"."+s;case Gze:case Hze:return i(r.parent,a)+n(">")+i(r.child,a);case qze:case Uze:return i(r.ancestor,a)+" "+i(r.descendant,a);case Wze:var f=i(r.left,a),g=i(r.subject,a),m=i(r.right,a);return f+(f.length>0?" ":"")+g+m;case Vze:return""}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)},"")},a="",o=0;o1&&o=0&&(t=t.replace("!",""),u=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(o||l||c)&&(i=o||s?""+e:"",a=""+n),c&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":h=!0,r=e>n;break;case">=":h=!0,r=e>=n;break;case"<":h=!0,r=e0;){var c=i.shift();t(c),a.add(c.id()),o&&r(i,a,c)}return e}function gje(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],gje)},pje.forEachUp=function(e){return fje(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],mje)},pje.forEachUpAndDown=function(e){return fje(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],yje)},pje.ancestors=pje.parents,(uje=hje={data:kze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:kze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:kze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:kze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:kze.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:kze.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=uje.data,uje.removeAttr=uje.removeData;var vje,bje,xje=hje,wje={};function Eje(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;ot}),minIndegree:kje("indegree",function(e,t){return et}),minOutdegree:kje("outdegree",function(e,t){return et})}),xRe(wje,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,u=c;c&&(l=l[0]);var h=u?l.position():{x:0,y:0};return i={x:s.x-h.x,y:s.y-h.y},void 0===e?i:i[e]}for(var d=0;d0,m=g;g&&(f=f[0]);var y=m?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}},vje.modelPosition=vje.point=vje.position,vje.modelPositions=vje.points=vje.positions,vje.renderedPoint=vje.renderedPosition,vje.relativePoint=vje.relativePosition;var Cje,Sje,Aje=bje;Cje=Sje={},Sje.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},Sje.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}}),this):this},Sje.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;0!==a.w&&0!==a.h||((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var c=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(c=100*c/i.height.val);var u=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(u=100*u/i.height.val);var h=y(i.width.val-a.w,s,l),d=h.biasDiff,p=h.biasComplementDiff,f=y(i.height.val-a.h,c,u),g=f.biasDiff,m=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-d+a.x1+a.x2+p)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-g+a.y1+a.y2+m)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Oje=function(e,t){return null==t?e:Ije(e,t.x1,t.y1,t.x2,t.y2)},Lje=function(e,t,n){return mDe(e,t,n)},Mje=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[n]=l[n]||{};c.x1=r-s,c.y1=i-s,c.x2=r+s,c.y2=i+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,oPe(c,1),Ije(e,c.x1,c.y1,c.x2,c.y2)}}},Rje=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o,s,l,c,u=t.pstyle("text-halign"),h=t.pstyle("text-valign"),d=Lje(a,"labelWidth",n),p=Lje(a,"labelHeight",n),f=Lje(a,"labelX",n),g=Lje(a,"labelY",n),m=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,v=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,k=p,T=d,_=T/2,C=k/2;if(v)o=f-_,s=f+_,l=g-C,c=g+C;else{switch(u.value){case"left":o=f-T,s=f;break;case"center":o=f-_,s=f+_;break;case"right":o=f,s=f+T}switch(h.value){case"top":l=g-k,c=g;break;case"center":l=g-C,c=g+C;break;case"bottom":l=g,c=g+k}}var S=m-Math.max(x,w)-E-2,A=m+Math.max(x,w)+E+2,N=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;o+=S,s+=A,l+=N,c+=I;var O=n||"main",L=i.labelBounds,M=L[O]=L[O]||{};M.x1=o,M.y1=l,M.x2=s,M.y2=c,M.w=s-o,M.h=c-l,M.leftPad=S,M.rightPad=A,M.topPad=N,M.botPad=I;var R=v&&"autorotate"===b.strValue,D=null!=b.pfValue&&0!==b.pfValue;if(R||D){var P=R?Lje(i.rstyle,"labelAngle",n):b.pfValue,$=Math.cos(P),B=Math.sin(P),F=(o+s)/2,z=(l+c)/2;if(!v){switch(u.value){case"left":F=s;break;case"right":F=o}switch(h.value){case"top":z=c;break;case"bottom":z=l}}var j=function(e,t){return{x:(e-=F)*$-(t-=z)*B+F,y:e*B+t*$+z}},H=j(o,l),U=j(o,c),G=j(s,l),q=j(s,c);o=Math.min(H.x,U.x,G.x,q.x),s=Math.max(H.x,U.x,G.x,q.x),l=Math.min(H.y,U.y,G.y,q.y),c=Math.max(H.y,U.y,G.y,q.y)}var W=O+"Rot",V=L[W]=L[W]||{};V.x1=o,V.y1=l,V.x2=s,V.y2=c,V.w=s-o,V.h=c-l,Ije(e,o,l,s,c),Ije(i.labelBounds.all,o,l,s,c)}return e}},Dje=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,r=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;Pje(e,t,n,r,"outside",r/2)}},Pje=function(e,t,n,r,i,a){if(!(0===n||r<=0||"inside"===i)){var o=t.cy(),s=t.pstyle("shape").value,l=o.renderer().nodeShapes[s],c=t.position(),u=c.x,h=c.y,d=t.width(),p=t.height();if(l.hasMiterBounds){"center"===i&&(r/=2);var f=l.miterBounds(u,h,d,p,r);Oje(e,f)}else null!=a&&a>0&&sPe(e,[a,a,a,a])}},$je=function(e,t){var n,r,i,a,o,s,l,c=e._private.cy,u=c.styleEnabled(),h=c.headless(),d=rPe(),p=e._private,f=e.isNode(),g=e.isEdge(),m=p.rstyle,y=f&&u?e.pstyle("bounds-expansion").pfValue:[0],v=function(e){return"none"!==e.pstyle("display").value},b=!u||v(e)&&(!g||v(e.source())&&v(e.target()));if(b){var x=0;u&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;u&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var E=Math.max(x,w),k=0;if(u&&(k=e.pstyle("width").pfValue/2),f&&t.includeNodes){var T=e.position();o=T.x,s=T.y;var _=e.outerWidth()/2,C=e.outerHeight()/2;Ije(d,n=o-_,i=s-C,r=o+_,a=s+C),u&&Dje(d,e),u&&t.includeOutlines&&!h&&Dje(d,e),u&&function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,r=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Pje(e,t,n,r,i)}}(d,e)}else if(g&&t.includeEdges)if(u&&!h){var S=e.pstyle("curve-style").strValue;if(n=Math.min(m.srcX,m.midX,m.tgtX),r=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),a=Math.max(m.srcY,m.midY,m.tgtY),Ije(d,n-=k,i-=k,r+=k,a+=k),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var N=n;n=r,r=N}if(i>(a=A[1].y)){var I=i;i=a,a=I}Ije(d,n-k,i-k,r+k,a+k)}}else if("bezier"===S||"unbundled-bezier"===S||pRe(S,"segments")||pRe(S,"taxi")){var O;switch(S){case"bezier":case"unbundled-bezier":O=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=m.linePts}if(null!=O)for(var L=0;L(r=D.x)){var P=n;n=r,r=P}if((i=R.y)>(a=D.y)){var $=i;i=a,a=$}Ije(d,n-=k,i-=k,r+=k,a+=k)}if(u&&t.includeEdges&&g&&(Mje(d,e,"mid-source"),Mje(d,e,"mid-target"),Mje(d,e,"source"),Mje(d,e,"target")),u)if("yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;Ije(d,d.x1+B,d.y1+F,d.x2+B,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};lPe(z,d),sPe(z,y),oPe(z,1),u&&(n=d.x1,r=d.x2,i=d.y1,a=d.y2,Ije(d,n-E,i-E,r+E,a+E));var j=p.overlayBounds=p.overlayBounds||{};lPe(j,d),sPe(j,y),oPe(j,1);var H=p.labelBounds=p.labelBounds||{};null!=H.all?((l=H.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):H.all=rPe(),u&&t.includeLabels&&(t.includeMainLabels&&Rje(d,e,null),g&&(t.includeSourceLabels&&Rje(d,e,"source"),t.includeTargetLabels&&Rje(d,e,"target")))}return d.x1=Nje(d.x1),d.y1=Nje(d.y1),d.x2=Nje(d.x2),d.y2=Nje(d.y2),d.w=Nje(d.x2-d.x1),d.h=Nje(d.y2-d.y1),d.w>0&&d.h>0&&b&&(sPe(d,y),oPe(d,1)),d},Bje=function(e){var t=0,n=function(e){return(e?1:0)<0&&void 0!==arguments[0]?arguments[0]:iHe,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)o(s);return this},oHe.removeAllListeners=function(){return this.removeListener("*")},oHe.emit=oHe.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,QMe(t)||(t=[t]),cHe(this,function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(){var n=r[s];if(n.type===a.type&&(!n.namespace||n.namespace===a.namespace||".*"===n.namespace)&&e.eventMatches(e.context,n,a)){var i=[a];null!=t&&function(e,t){for(var n=0;n1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&XMe(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=o)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,a=0;a=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n));var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(ZMe(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify("style")}else if(XMe(e)){if(void 0===t){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var a=0;a0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),RHe.neighbourhood=RHe.neighborhood,RHe.closedNeighbourhood=RHe.closedNeighborhood,RHe.openNeighbourhood=RHe.openNeighborhood,xRe(RHe,{source:dje(function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t},"source"),target:dje(function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t},"target"),sources:BHe({attr:"source"}),targets:BHe({attr:"target"})}),xRe(RHe,{edgesWith:dje(FHe(),"edgesWith"),edgesTo:dje(FHe({thisIsSrc:!0}),"edgesTo")}),xRe(RHe,{connectedEdges:dje(function(e){for(var t=[],n=0;n0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),RHe.componentsOf=RHe.components;var jHe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new vDe,a=!1;if(t){if(t.length>0&&ZMe(t[0])&&!nRe(t[0])){a=!0;for(var o=[],s=new xDe,l=0,c=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,s=[],l=[],c=0,u=i.length;c0){for(var R=e.length===i.length?i:new jHe(a,e),D=0;D0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?k.emitAndNotify("remove"):t&&k.emit("remove"));for(var T=0;T=.001?function(t,r){for(var i=0;i<4;++i){var a=d(r,e,n);if(0===a)return r;r-=(h(r,e,n)-t)/a}return r}(t,o):0===l?o:function(t,r,i){var a,o,s=0;do{(a=h(o=r+(i-r)/2,e,n)-t)>0?i=o:r=o}while(Math.abs(a)>1e-7&&++s<10);return o}(t,r,r+i)}var f=!1;function g(){f=!0,e===t&&n===r||function(){for(var t=0;t<11;++t)s[t]=h(t*i,e,n)}()}var m=function(i){return f||g(),e===t&&n===r?i:0===i?0:1===i?1:h(p(i),t,r)};m.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var y="generateBezier("+[e,t,n,r]+")";return m.toString=function(){return y},m} +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var qHe=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),c=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+c*r,n}return function e(t,r,i){var a,o,s,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,h=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,o=(a=null!==i)?(u=e(t,r))/i*.016:.016;s=n(s||l,o),c.push(1+s.x),u+=16,Math.abs(s.x)>h&&Math.abs(s.v)>h;);return a?function(e){return c[e*(c.length-1)|0]}:u}}(),WHe=function(e,t,n,r){var i=GHe(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},VHe={linear:function(e,t,n){return e+(t-e)*n},ease:WHe(.25,.1,.25,1),"ease-in":WHe(.42,0,1,1),"ease-out":WHe(0,0,.58,1),"ease-in-out":WHe(.42,0,.58,1),"ease-in-sine":WHe(.47,0,.745,.715),"ease-out-sine":WHe(.39,.575,.565,1),"ease-in-out-sine":WHe(.445,.05,.55,.95),"ease-in-quad":WHe(.55,.085,.68,.53),"ease-out-quad":WHe(.25,.46,.45,.94),"ease-in-out-quad":WHe(.455,.03,.515,.955),"ease-in-cubic":WHe(.55,.055,.675,.19),"ease-out-cubic":WHe(.215,.61,.355,1),"ease-in-out-cubic":WHe(.645,.045,.355,1),"ease-in-quart":WHe(.895,.03,.685,.22),"ease-out-quart":WHe(.165,.84,.44,1),"ease-in-out-quart":WHe(.77,0,.175,1),"ease-in-quint":WHe(.755,.05,.855,.06),"ease-out-quint":WHe(.23,1,.32,1),"ease-in-out-quint":WHe(.86,0,.07,1),"ease-in-expo":WHe(.95,.05,.795,.035),"ease-out-expo":WHe(.19,1,.22,1),"ease-in-out-expo":WHe(1,0,0,1),"ease-in-circ":WHe(.6,.04,.98,.335),"ease-out-circ":WHe(.075,.82,.165,1),"ease-in-out-circ":WHe(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return VHe.linear;var r=qHe(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":WHe};function YHe(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function XHe(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function KHe(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=XHe(e,i),s=XHe(t,i);if(JMe(o)&&JMe(s))return YHe(a,o,s,n,r);if(QMe(o)&&QMe(s)){for(var l=[],c=0;c0?("spring"===h&&d.push(o.duration),o.easingImpl=VHe[h].apply(null,d)):o.easingImpl=VHe[h]}var p,f=o.easingImpl;if(p=0===o.duration?1:(n-l)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),null==o.delay){var g=o.startPosition,m=o.position;if(m&&i&&!e.locked()){var y={};ZHe(g.x,m.x)&&(y.x=KHe(g.x,m.x,p,f)),ZHe(g.y,m.y)&&(y.y=KHe(g.y,m.y,p,f)),e.position(y)}var v=o.startPan,b=o.pan,x=a.pan,w=null!=b&&r;w&&(ZHe(v.x,b.x)&&(x.x=KHe(v.x,b.x,p,f)),ZHe(v.y,b.y)&&(x.y=KHe(v.y,b.y,p,f)),e.emit("pan"));var E=o.startZoom,k=o.zoom,T=null!=k&&r;T&&(ZHe(E,k)&&(a.zoom=nPe(a.minZoom,KHe(E,k,p,f),a.maxZoom)),e.emit("zoom")),(w||T)&&e.emit("viewport");var _=o.style;if(_&&_.length>0&&i){for(var C=0;C<_.length;C++){var S=_[C],A=S.name,N=S,I=o.startStyle[A],O=KHe(I,N,p,f,c.properties[I.name]);c.overrideBypass(e,A,O)}e.emit("style")}}return o.progress=p,p}function ZHe(e,t){return null!=e&&null!=t&&(!(!JMe(e)||!JMe(t))||!(!e||!t))}function JHe(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function eUe(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(0===a.length){var l=o.shift();l&&a.push(l)}for(var c=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},u=a.length-1;u>=0;u--){var h=a[u],d=h._private;d.stopped?(a.splice(u,1),d.hooked=!1,d.playing=!1,d.started=!1,c(d.frames)):(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||JHe(0,h,e),QHe(t,h,e,n),d.applying&&(d.applying=!1),c(d.frames),null!=d.step&&d.step(e),h.completed()&&(a.splice(u,1),d.hooked=!1,d.playing=!1,d.started=!1,c(d.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var tUe={animate:kze.animate(),animation:kze.animation(),animated:kze.animated(),clearQueue:kze.clearQueue(),delay:kze.delay(),delayAnimation:kze.delayAnimation(),stop:kze.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender(function(t,n){eUe(n,e)},t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&BRe(function(n){eUe(n,e),t()})}()}}},nUe={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&nRe(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},rUe=function(e){return XMe(e)?new sje(e):e},iUe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new aHe(nUe,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,rUe(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,rUe(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,rUe(t),n),this},once:function(e,t,n){return this.emitter().one(e,rUe(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};kze.eventAliasesOn(iUe);var aUe={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};aUe.jpeg=aUe.jpg;var oUe={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=XMe(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var a=new r(xRe({},e,{cy:t,eles:i}));return a}oDe("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else oDe("A `name` must be specified to make a layout");else oDe("Layout options must be specified to make a layout")}};oUe.createLayout=oUe.makeLayout=oUe.layout;var sUe={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};cUe.invalidateDimensions=cUe.resize;var uUe={collection:function(e,t){return XMe(e)?this.$(e):tRe(e)?e.collection():QMe(e)?(t||(t={}),new jHe(this,e,t.unique,t.removed)):new jHe(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};uUe.elements=uUe.filter=uUe.$;var hUe={},dUe="t";hUe.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(d||h&&p){var f=void 0;d&&p||d?f=c.properties:p&&(f=c.mappedProperties);for(var g=0;g1&&(m=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],k=i.valueMin[1],T=i.valueMax[1],_=i.valueMin[2],C=i.valueMax[2],S=null==i.valueMin[3]?1:i.valueMin[3],A=null==i.valueMax[3]?1:i.valueMax[3],N=[Math.round(w+(E-w)*m),Math.round(k+(T-k)*m),Math.round(_+(C-_)*m),Math.round(S+(A-S)*m)];n={bypass:i.bypass,name:i.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else{if(!s.number)return!1;var I=i.valueMin+(i.valueMax-i.valueMin)*m;n=this.parse(i.name,I,i.bypass,d)}if(!n)return g(),!1;n.mapping=i,i=n;break;case o.data:for(var O=i.field.split("."),L=h.data,M=0;M0&&a>0){for(var s={},l=!1,c=0;c0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},hUe.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);e.removed()||null!=s&&s(n,r,e)&&a(o)},hUe.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify("zorder",e)})},hUe.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},hUe.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},hUe.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},hUe.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var pUe={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;at.length?a.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(a.match(/^\s*$/))break;var l=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){lDe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}t=l[0];var c=l[1];if("core"!==c)if(new sje(c).invalid){lDe("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),o();continue}var u=l[2],h=!1;n=u;for(var d=[];;){if(n.match(/^\s*$/))break;var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){lDe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),h=!0;break}r=p[0];var f=p[1],g=p[2];if(this.properties[f])i.parse(f,g)?(d.push({name:f,val:g}),s()):(lDe("Skipping property: Invalid property definition in: "+r),s());else lDe("Skipping property: Invalid property name in: "+r),s()}if(h){o();break}i.selector(c);for(var m=0;m=7&&"d"===t[0]&&(c=new RegExp(s.data.regex).exec(t))){if(n)return!1;var d=s.data;return{name:e,value:c,strValue:""+t,mapped:d,field:c[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(u=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(h.multiple)return!1;var p=s.mapData;if(!h.color&&!h.number)return!1;var f=this.parse(e,u[4]);if(!f||f.mapped)return!1;var g=this.parse(e,u[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return lDe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(h.color){var m=f.value,y=g.value;if(!(m[0]!==y[0]||m[1]!==y[1]||m[2]!==y[2]||m[3]!==y[3]&&(null!=m[3]&&1!==m[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:u,strValue:""+t,mapped:p,field:u[1],fieldMin:parseFloat(u[2]),fieldMax:parseFloat(u[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(h.multiple&&"multiple"!==r){var v;if(v=l?t.split(/\s+/):QMe(t)?t:[t],h.evenMultiple&&v.length%2!=0)return null;for(var b=[],x=[],w=[],E="",k=!1,T=0;T0?" ":"")+_.strValue}return h.validate&&!h.validate(b,x)?null:h.singleEnum&&k?1===b.length&&XMe(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var C,S,A=function(){for(var r=0;rh.max||h.strictMax&&t===h.max))return null;var M={name:e,value:t,strValue:""+t+(N||""),units:N,bypass:n};return h.unitless||"px"!==N&&"em"!==N?M.pfValue=t:M.pfValue="px"!==N&&N?this.getEmSizeInPixels()*t:t,"ms"!==N&&"s"!==N||(M.pfValue="ms"===N?t:1e3*t),"deg"!==N&&"rad"!==N||(M.pfValue="rad"===N?t:(C=t,Math.PI*C/180)),"%"===N&&(M.pfValue=t/100),M}if(h.propList){var R=[],D=""+t;if("none"===D);else{for(var P=D.split(/\s*,\s*|\s+/),$=0;$0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:o=(o=(o=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:o)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),JMe(e)?n=e:ZMe(e)&&(n=e.level,null!=e.position?t=qDe(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;JMe(l.x)&&(t.pan.x=l.x,o=!1),JMe(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(XMe(e)){var n=e;e=this.mutableElements().filter(n)}else tRe(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var e=n.window().getComputedStyle(t),r=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-r("padding-left")-r("padding-right"),height:t.clientHeight-r("padding-top")-r("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};kUe.centre=kUe.center,kUe.autolockNodes=kUe.autolock,kUe.autoungrabifyNodes=kUe.autoungrabify;var TUe={data:kze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:kze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:kze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:kze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};TUe.attr=TUe.data,TUe.removeAttr=TUe.removeData;var _Ue=function(e){var t=this,n=(e=xRe({},e)).container;n&&!eRe(n)&&eRe(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==fMe&&void 0!==n&&!e.headless,o=e;o.layout=xRe({name:a?"grid":"null"},o.layout),o.renderer=xRe({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:o,elements:new jHe(this),listeners:[],aniEles:new jHe(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:JMe(o.zoom)?o.zoom:1,pan:{x:ZMe(o.pan)&&JMe(o.pan.x)?o.pan.x:0,y:ZMe(o.pan)&&JMe(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});l.styleEnabled&&t.setStyle([]);var c=xRe({},o,o.renderer);t.initRenderer(c);!function(e,t){if(e.some(sRe))return Q$e.all(e).then(t);t(e)}([o.style,o.elements],function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(ZMe(e)||QMe(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var a=xRe({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()}(a,function(){t.startAnimationLoop(),l.ready=!0,KMe(o.ready)&&t.on("ready",o.ready);for(var e=0;e0,l=!!t.boundingBox,c=rPe(l?t.boundingBox:structuredClone(n.extent()));if(tRe(t.roots))e=t.roots;else if(QMe(t.roots)){for(var u=[],h=0;h0;){var N=A(),I=T(N,C);if(I)N.outgoers().filter(function(e){return e.isNode()&&r.has(e)}).forEach(S);else if(null===I){lDe("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var L=0;L0&&y[0].length<=3?a/2:0),s=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(o=1),{x:q+o*Math.cos(s),y:W+o*Math.sin(s)}}var u=y[r].length,h=Math.max(1===u?0:l?(c.w-2*t.padding-V.w)/((t.grid?X:u)-1):(c.w-2*t.padding-V.w)/((t.grid?X:u)+1),O);return{x:q+(i+1-(u+1)/2)*h,y:W+(r+1-(F+1)/2)*Y}}(e),c,K[t.direction])}),this};var LUe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function MUe(e){this.options=xRe({},LUe,e)}MUe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o,s=rPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,c=s.y1+s.h/2,u=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),h=0,d=0;d1&&t.avoidOverlap){h*=1.75;var m=Math.cos(u)-Math.cos(0),y=Math.sin(u)-Math.sin(0),v=Math.sqrt(h*h/(m*m+y*y));o=Math.max(v,o)}return r.nodes().layoutPositions(this,t,function(e,n){var r=t.startAngle+n*u*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:l+a,y:c+s}}),this};var RUe,DUe={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function PUe(e){this.options=xRe({},DUe,e)}PUe.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,a=i.nodes().not(":parent"),o=rPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=o.x1+o.w/2,l=o.y1+o.h/2,c=[],u=0,h=0;h0)Math.abs(v[0].value-x.value)>=m&&(v=[],y.push(v));v.push(x)}var w=u+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,k=(Math.min(o.w,o.h)/2-w)/(y.length+E?1:0);w=Math.min(w,k)}for(var T=0,_=0;_1&&t.avoidOverlap){var N=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(N*N+I*I));T=Math.max(O,T)}C.r=T,T+=w}if(t.equidistant){for(var L=0,M=0,R=0;R=e.numIter)&&(qUe(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature=e.animationThreshold&&a(),BRe(u)):(rGe(r,e),s())};u()}else{for(;c;)c=o(l),l++;rGe(r,e),s()}return this},BUe.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},BUe.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var FUe=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=rPe(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},c=0;c0){o.graphSet.push(w);for(c=0;cr.count?0:r.graph},jUe=function(e,t,n,r){var i=r.graphSet[n];if(-10)var s=(c=r.nodeOverlap*o)*i/(g=Math.sqrt(i*i+a*a)),l=c*a/g;else{var c,u=KUe(e,i,a),h=KUe(t,-1*i,-1*a),d=h.x-u.x,p=h.y-u.y,f=d*d+p*p,g=Math.sqrt(f);s=(c=(e.nodeRepulsion+t.nodeRepulsion)/f)*d/g,l=c*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},XUe=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},KUe=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,c={};return 0===t&&0n?(c.x=r,c.y=i+a/2,c):0t&&-1*l<=s&&s<=l?(c.x=r-o/2,c.y=i-o*n/2/t,c):0=l)?(c.x=r+a*t/2/n,c.y=i+a/2,c):0>n&&(s<=-1*l||s>=l)?(c.x=r-a*t/2/n,c.y=i-a/2,c):c},QUe=function(e,t){for(var n=0;n1){var f=t.gravity*h/p,g=t.gravity*d/p;u.offsetX+=f,u.offsetY+=g}}}}},JUe=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},nGe=function(e,t){var n=e.parentId;if(null!=n){var r=t.layoutNodes[t.idToIndex[n]],i=!1;return(null==r.maxX||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(null==r.minX||e.minX-r.padLeftr.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(null==r.minY||e.minY-r.padTopf&&(h+=p+t.componentSpacing,u=0,d=0,p=0)}}},iGe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function aGe(e){this.options=xRe({},iGe,e)}aGe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var a=rPe(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,t,function(e){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),c=Math.round(a.w/a.h*s),u=function(e){if(null==e)return Math.min(l,c);Math.min(l,c)==l?l=e:c=e},h=function(e){if(null==e)return Math.max(l,c);Math.max(l,c)==l?l=e:c=e},d=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=p)l=d,c=p;else if(null!=d&&null==p)l=d,c=Math.ceil(o/l);else if(null==d&&null!=p)c=p,l=Math.ceil(o/c);else if(c*l>o){var f=u(),g=h();(f-1)*g>=o?u(f-1):(g-1)*f>=o&&h(g-1)}else for(;c*l=o?h(y+1):u(m+1)}var v=a.w/c,b=a.h/l;if(t.condense&&(v=0,b=0),t.avoidOverlap)for(var x=0;x=c&&(O=0,I++)},M={},R=0;R(r=bPe(e,t,x[w],x[w+1],x[w+2],x[w+3])))return m(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(x=a.allpts,w=0;w+5(r=vPe(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return m(n,r),!0;v=v||i.source,b=b||i.target;var E=o.getArrowWidth(l,u),k=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w0&&(y(v),y(b))}function b(e,t,n){return mDe(e,t,n)}function x(n,r){var i,a=n._private,o=f;i=r?r+"-":"",n.boundingBox();var s=a.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var c=b(a.rscratch,"labelX",r),u=b(a.rscratch,"labelY",r),h=b(a.rscratch,"labelAngle",r),d=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-o-d,y=s.x2+o-d,v=s.y1-o-p,x=s.y2+o-p;if(h){var w=Math.cos(h),E=Math.sin(h),k=function(e,t){return{x:(e-=c)*w-(t-=u)*E+c,y:e*E+t*w+u}},T=k(g,v),_=k(g,x),C=k(y,v),S=k(y,x),A=[T.x+d,T.y+p,C.x+d,C.y+p,S.x+d,S.y+p,_.x+d,_.y+p];if(xPe(e,t,A))return m(n),!0}else if(uPe(s,e,t))return m(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):v(E)||x(E)||x(E,"source")||x(E,"target")}return c},getAllInBox:function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),u=Math.max(t,r),h=rPe({x1:e=s,y1:t=c,x2:n=l,y2:r=u}),d=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[d[0],d[1]],[d[1],d[2]],[d[2],d[3]],[d[3],d[0]]];function f(e,t,n){return mDe(e,t,n)}function g(e,t){var n=e._private,r=a;e.boundingBox();var i=n.labelBounds.main;if(!i)return null;var o=f(n.rscratch,"labelX",t),s=f(n.rscratch,"labelY",t),l=f(n.rscratch,"labelAngle",t),c=e.pstyle("text-margin-x").pfValue,u=e.pstyle("text-margin-y").pfValue,h=i.x1-r-c,d=i.x2+r-c,p=i.y1-r-u,g=i.y2+r-u;if(l){var m=Math.cos(l),y=Math.sin(l),v=function(e,t){return{x:(e-=o)*m-(t-=s)*y+o,y:e*y+t*m+s}};return[v(h,p),v(d,p),v(d,g),v(h,g)]}return[{x:h,y:p},{x:d,y:p},{x:d,y:g},{x:h,y:g}]}function m(e,t,n,r){function i(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}for(var y=0;y0?-(Math.PI-a.ang):Math.PI+a.ang),BGe(t,n,$Ge),wGe=PGe.nx*$Ge.ny-PGe.ny*$Ge.nx,EGe=PGe.nx*$Ge.nx-PGe.ny*-$Ge.ny,_Ge=Math.asin(Math.max(-1,Math.min(1,wGe))),Math.abs(_Ge)<1e-6)return bGe=t.x,xGe=t.y,void(SGe=NGe=0);kGe=1,TGe=!1,EGe<0?_Ge<0?_Ge=Math.PI+_Ge:(_Ge=Math.PI-_Ge,kGe=-1,TGe=!0):_Ge>0&&(kGe=-1,TGe=!0),NGe=void 0!==t.radius?t.radius:r,CGe=_Ge/2,IGe=Math.min(PGe.len/2,$Ge.len/2),i?(AGe=Math.abs(Math.cos(CGe)*NGe/Math.sin(CGe)))>IGe?(AGe=IGe,SGe=Math.abs(AGe*Math.sin(CGe)/Math.cos(CGe))):SGe=NGe:(AGe=Math.min(IGe,NGe),SGe=Math.abs(AGe*Math.sin(CGe)/Math.cos(CGe))),MGe=t.x+$Ge.nx*AGe,RGe=t.y+$Ge.ny*AGe,bGe=MGe-$Ge.ny*SGe*kGe,xGe=RGe+$Ge.nx*SGe*kGe,OGe=t.x+PGe.nx*AGe,LGe=t.y+PGe.ny*AGe,DGe=t};function zGe(e,t){0===t.radius?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function jGe(e,t,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(FGe(e,t,n,r,i),{cx:bGe,cy:xGe,radius:SGe,startX:OGe,startY:LGe,stopX:MGe,stopY:RGe,startAngle:PGe.ang+Math.PI/2*kGe,endAngle:$Ge.ang-Math.PI/2*kGe,counterClockwise:TGe})}var HGe=.01,UGe=Math.sqrt(.02),GGe={};function qGe(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},S=C(T,E),A=C(_,k),N=!1;"auto"===m?g=Math.abs(S)>Math.abs(A)?i:r:m===l||m===s?(g=r,N=!0):m!==a&&m!==o||(g=i,N=!0);var I,O=g===r,L=O?A:S,M=O?_:T,R=KDe(M),D=!1;(N&&(v||x)||!(m===s&&M<0||m===l&&M>0||m===a&&M>0||m===o&&M<0)||(L=(R*=-1)*Math.abs(L),D=!0),v)?I=(b<0?1+b:b)*L:I=(b<0?L:0)+b*R;var P=function(e){return Math.abs(e)=Math.abs(L)},$=P(I),B=P(Math.abs(L)-Math.abs(I));if(($||B)&&!D)if(O){var F=Math.abs(M)<=h/2,z=Math.abs(T)<=d/2;if(F){var j=(c.x1+c.x2)/2,H=c.y1,U=c.y2;n.segpts=[j,H,j,U]}else if(z){var G=(c.y1+c.y2)/2,q=c.x1,W=c.x2;n.segpts=[q,G,W,G]}else n.segpts=[c.x1,c.y2]}else{var V=Math.abs(M)<=u/2,Y=Math.abs(_)<=p/2;if(V){var X=(c.y1+c.y2)/2,K=c.x1,Q=c.x2;n.segpts=[K,X,Q,X]}else if(Y){var Z=(c.x1+c.x2)/2,J=c.y1,ee=c.y2;n.segpts=[Z,J,Z,ee]}else n.segpts=[c.x2,c.y1]}else if(O){var te=c.y1+I+(f?h/2*R:0),ne=c.x1,re=c.x2;n.segpts=[ne,te,re,te]}else{var ie=c.x1+I+(f?u/2*R:0),ae=c.y1,oe=c.y2;n.segpts=[ie,ae,ie,oe]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},GGe.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,c=t.srcShape,u=t.tgtShape,h=t.srcCornerRadius,d=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!JMe(n.startX)||!JMe(n.startY),m=!JMe(n.arrowStartX)||!JMe(n.arrowStartY),y=!JMe(n.endX)||!JMe(n.endY),v=!JMe(n.arrowEndX)||!JMe(n.arrowEndY),b=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),x=QDe({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xg.poolIndex()){var m=f;f=g,g=m}var y=h.srcPos=f.position(),v=h.tgtPos=g.position(),b=h.srcW=f.outerWidth(),w=h.srcH=f.outerHeight(),E=h.tgtW=g.outerWidth(),k=h.tgtH=g.outerHeight(),T=h.srcShape=n.nodeShapes[t.getNodeShape(f)],_=h.tgtShape=n.nodeShapes[t.getNodeShape(g)],C=h.srcCornerRadius="auto"===f.pstyle("corner-radius").value?"auto":f.pstyle("corner-radius").pfValue,S=h.tgtCornerRadius="auto"===g.pstyle("corner-radius").value?"auto":g.pstyle("corner-radius").pfValue,A=h.tgtRs=g._private.rscratch,N=h.srcRs=f._private.rscratch;h.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var I=0;I=UGe||(G=Math.sqrt(Math.max(U*U,HGe)+Math.max(H*H,HGe)));var q=h.vector={x:U,y:H},W=h.vectorNorm={x:q.x/G,y:q.y/G},V={x:-W.y,y:W.x};h.nodesOverlap=!JMe(G)||_.checkPoint(P[0],P[1],0,E,k,v.x,v.y,S,A)||T.checkPoint(B[0],B[1],0,b,w,y.x,y.y,C,N),h.vectorNormInverse=V,e={nodesOverlap:h.nodesOverlap,dirCounts:h.dirCounts,calculatedIntersection:!0,hasBezier:h.hasBezier,hasUnbundled:h.hasUnbundled,eles:h.eles,srcPos:v,srcRs:A,tgtPos:y,tgtRs:N,srcW:E,srcH:k,tgtW:b,tgtH:w,srcIntn:F,tgtIntn:$,srcShape:_,tgtShape:T,posPts:{x1:j.x2,y1:j.y2,x2:j.x1,y2:j.y1},intersectionPts:{x1:z.x2,y1:z.y2,x2:z.x1,y2:z.y1},vector:{x:-q.x,y:-q.y},vectorNorm:{x:-W.x,y:-W.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var Y=D?e:h;L.nodesOverlap=Y.nodesOverlap,L.srcIntn=Y.srcIntn,L.tgtIntn=Y.tgtIntn,L.isRound=M.startsWith("round"),r&&(f.isParent()||f.isChild()||g.isParent()||g.isChild())&&(f.parents().anySame(g)||g.parents().anySame(f)||f.same(g)&&f.isParent())?t.findCompoundLoopPoints(O,Y,I,R):f===g?t.findLoopPoints(O,Y,I,R):M.endsWith("segments")?t.findSegmentsPoints(O,Y):M.endsWith("taxi")?t.findTaxiPoints(O,Y):"straight"===M||!R&&h.eles.length%2==1&&I===Math.floor(h.eles.length/2)?t.findStraightEdgePoints(O):t.findBezierPoints(O,Y,I,R,D),t.findEndpoints(O),t.tryToCorrectInvalidPoints(O,Y),t.checkForInvalidEdgeWarning(O),t.storeAllpts(O),t.storeEdgeProjections(O),t.calculateArrowAngles(O),t.recalculateEdgeLabelProjections(O),t.calculateLabelAngles(O)}},x=0;x0){var Z=p,J=ZDe(Z,VDe(a)),ee=ZDe(Z,VDe(Q)),te=J;if(ee2)ZDe(Z,{x:Q[2],y:Q[3]})0){var fe=f,ge=ZDe(fe,VDe(a)),me=ZDe(fe,VDe(pe)),ye=ge;if(me2)ZDe(fe,{x:pe[2],y:pe[3]})=c||v){u={cp:g,segment:y};break}}if(u)break}var b=u.cp,x=u.segment,w=(c-d)/x.length,E=x.t1-x.t0,k=s?x.t0+E*w:x.t1-E*w;k=nPe(0,k,1),t=tPe(b.p0,b.p1,b.p2,k),i=function(e,t,n,r){var i=nPe(0,r-.001,1),a=nPe(0,r+.001,1),o=tPe(e,t,n,i),s=tPe(e,t,n,a);return QGe(o,s)}(b.p0,b.p1,b.p2,k);break;case"straight":case"segments":case"haystack":for(var T,_,C,S,A=0,N=r.allpts.length,I=0;I+3=c));I+=2);var O=(c-_)/T;O=nPe(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,a=t.y-e.y,o=QDe(e,t),s=i/o,l=a/o;return n=null==n?0:n,r=null!=r?r:n*o,{x:e.x+s*r,y:e.y+l*r}}(C,S,O),i=QGe(C,S)}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,i)}};c("source"),c("target"),this.applyLabelDimensions(e)}},XGe.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},XGe.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=YRe(r,e._private.labelDimsKey);if(mDe(n.rscratch,"prefixedLabelDimsKey",t)!==i){yDe(n.rscratch,"prefixedLabelDimsKey",t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,s=e.pstyle("text-wrap").strValue,l=mDe(n.rscratch,"labelWrapCachedLines",t)||[],c="wrap"!==s?1:Math.max(l.length,1),u=a.height/c,h=u*o,d=a.width,p=a.height+(c-1)*(o-1)*u;yDe(n.rstyle,"labelWidth",t,d),yDe(n.rscratch,"labelWidth",t,d),yDe(n.rstyle,"labelHeight",t,p),yDe(n.rscratch,"labelHeight",t,p),yDe(n.rscratch,"labelLineHeight",t,h)}},XGe.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(yDe(n.rscratch,e,t,r),r):mDe(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=o("labelKey");if(null!=l&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var c=i.split("\n"),u=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],p=/[\s\u200b]+|$/g,f=0;fu){var v,b="",x=0,w=sMe(g.matchAll(p));try{for(w.s();!(v=w.n()).done;){var E=v.value,k=E[0],T=g.substring(x,E.index);x=E.index+k.length;var _=0===b.length?T:b+T+k;this.calculateLabelDimensions(e,_).width<=u?b+=T+k:(b&&d.push(b),b=T+k)}}catch(e){w.e(e)}finally{w.f()}b.match(/^[\s\u200b]+$/)||d.push(b)}else d.push(g)}o("labelWrapCachedLines",d),i=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",l)}else if("ellipsis"===s){var C=e.pstyle("text-max-width").pfValue,S="",A=!1;if(this.calculateLabelDimensions(e,i).widthC)break;S+=i[N],N===i.length-1&&(A=!0)}return A||(S+="…"),S}return i},XGe.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},XGe.calculateLabelDimensions=function(e,t){var n=this.cy.window().document,r=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue,a=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=this.labelCalcCanvas,l=this.labelCalcCanvasContext;if(!s){s=this.labelCalcCanvas=n.createElement("canvas"),l=this.labelCalcCanvasContext=s.getContext("2d");var c=s.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}l.font="".concat(r," ").concat(o," ").concat(i,"px ").concat(a);for(var u=0,h=0,d=t.split("\n"),p=0;p1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var C=i(t);m&&(e.hoverData.tapholdCancelled=!0);n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:u[0],y:u[1]});var S=function(e){return{originalEvent:t,type:e,position:{x:u[0],y:u[1]}}},A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||o.emit(S("boxstart")),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(m){var N=S("cxtdrag");b?b.emit(N):o.emit(N),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(S("cxtdragout")),e.hoverData.cxtOver=g,g&&g.emit(S("cxtdragover")))}}else if(e.hoverData.dragging){if(n=!0,o.panningEnabled()&&o.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(u[0]-O[0])*s,y:(u[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};o.panBy(I),o.emit(S("dragpan")),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:u[0],y:u[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:u[0],y:u[1]}),e.hoverData.last=g),b)if(m){if(o.boxSelectionEnabled()&&C)b&&b.grabbed()&&(h(w),b.emit(S("freeon")),w.emit(S("free")),e.dragData.didDrag&&(b.emit(S("dragfreeon")),w.emit(S("dragfree")))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var L=!e.dragData.didDrag;L&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||c(w,{inDragLayer:!0});var M={x:0,y:0};if(JMe(x[0])&&JMe(x[1])&&(M.x+=x[0],M.y+=x[1],L)){var R=e.hoverData.dragDelta;R&&JMe(R[0])&&JMe(R[1])&&(M.x+=R[0],M.y+=R[1])}e.hoverData.draggingEles=!0,w.silentShift(M).emit(S("position")).emit(S("drag")),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else if(m){if(e.hoverData.dragging||!o.boxSelectionEnabled()||!C&&o.panningEnabled()&&o.userPanningEnabled()){if(!e.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()){a(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=VDe(d),e.redrawHint("select",!0),e.redraw())}}else A();b&&b.pannable()&&b.active()&&b.unactivate()}return f[2]=u[0],f[3]=u[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}},!1),e.registerBinding(t,"mouseup",function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var a=e.cy,o=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(o[0],o[1],!0,!1),c=e.dragData.possibleDragElements,u=e.hoverData.down,d=i(t);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,u&&u.unactivate();var p=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(3===e.hoverData.which){var f=p("cxttapend");if(u?u.emit(f):a.emit(f),!e.hoverData.cxtDragged){var g=p("cxttap");u?u.emit(g):a.emit(g)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:o[0],y:o[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(u,["click","tap","vclick"],t,{x:o[0],y:o[1]}),x=!1,t.timeStamp-w<=a.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(u,["dblclick","dbltap","vdblclick"],t,{x:o[0],y:o[1]})):(b=setTimeout(function(){x||r(u,["oneclick","onetap","voneclick"],t,{x:o[0],y:o[1]})},a.multiClickDebounceTime()),w=t.timeStamp)),null!=u||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(a.$(n).unselect(["tapunselect"]),c.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=c=a.collection()),l!=u||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===a.selectionType()||d?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):d||(a.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var m=a.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),m.length>0&&e.redrawHint("eles",!0),a.emit(p("boxend"));var y=function(e){return e.selectable()&&!e.selected()};"additive"===a.selectionType()||d||a.$(n).unmerge(m).unselect(),m.emit(p("box")).stdFilter(y).select().emit(p("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=u&&u.grabbed();h(c),v&&(u.emit(p("freeon")),c.emit(p("free")),e.dragData.didDrag&&(u.emit(p("dragfreeon")),c.emit(p("dragfree"))))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}},!1);var k,T,_,C,S,A,N,I,O,L,M,R,D,P,$=[],B=1e5,F=function(t){var n=!1,r=t.deltaY;if(null==r&&(null!=t.wheelDeltaY?r=t.wheelDeltaY/4:null!=t.wheelDelta&&(r=t.wheelDelta/4)),0!==r){if(null==k)if($.length>=4){var i=$;if(k=function(e,t){for(var n=0;n5}if(k)for(var o=0;o5&&(r=5*KDe(r)),d=r/-250,k&&(d/=B,d*=3),d*=e.wheelSensitivity,1===t.deltaMode&&(d*=33);var p=s.zoom()*Math.pow(10,d);"gesturechange"===t.type&&(p=e.gestureStartZoom*t.scale),s.zoom({level:p,renderedPosition:{x:h[0],y:h[1]}}),s.emit({type:"gesturechange"===t.type?"pinchzoom":"scrollzoom",originalEvent:t,position:{x:u[0],y:u[1]}})}}}};e.registerBinding(e.container,"wheel",F,!0),e.registerBinding(t,"scroll",function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(t){e.hasTouchStarted||F(t)},!0),e.registerBinding(e.container,"mouseout",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,"mouseover",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})},!1);var z,j,H,U,G,q,W,V=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},Y=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",z=function(t){if(e.hasTouchStarted=!0,v(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(t.touches[1]){o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(t.touches[2]){o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=o[0],i[5]=o[1]}var l=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};if(t.touches[1]){e.touchData.singleTouchMoved=!0,h(e.dragData.touchDragEles);var d=e.findContainerClientCoords();L=d[0],M=d[1],R=d[2],D=d[3],T=t.touches[0].clientX-L,_=t.touches[0].clientY-M,C=t.touches[1].clientX-L,S=t.touches[1].clientY-M,P=0<=T&&T<=R&&0<=C&&C<=R&&0<=_&&_<=D&&0<=S&&S<=D;var f=n.pan(),g=n.zoom();A=V(T,_,C,S),N=Y(T,_,C,S),O=[((I=[(T+C)/2,(_+S)/2])[0]-f.x)/g,(I[1]-f.y)/g];if(N<4e4&&!t.touches[2]){var m=e.findNearestElement(i[0],i[1],!0,!0),y=e.findNearestElement(i[2],i[3],!0,!0);return m&&m.isNode()?(m.activate().emit(l("cxttapstart")),e.touchData.start=m):y&&y.isNode()?(y.activate().emit(l("cxttapstart")),e.touchData.start=y):n.emit(l("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var b=e.findNearestElements(i[0],i[1],!0,!0),x=b[0];if(null!=x&&(x.activate(),e.touchData.start=x,e.touchData.starts=b,e.nodeIsGrabbable(x))){var w=e.dragData.touchDragEles=n.collection(),E=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),x.selected()?(E=n.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),c(E,{addToList:w})):u(x,{addToList:w}),s(x),x.emit(l("grabon")),E?E.forEach(function(e){e.emit(l("grab"))}):x.emit(l("grab"))}r(x,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==x&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})},e.tapholdDuration)}if(t.touches.length>=1){for(var k=e.touchData.startPosition=[null,null,null,null,null,null],$=0;$=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var E=t.touches[0].clientX-L,k=t.touches[0].clientY-M,I=t.touches[1].clientX-L,R=t.touches[1].clientY-M,D=Y(E,k,I,R);if(D/N>=2.25||D>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var $=f("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit($),e.touchData.start=null):o.emit($)}}if(n&&e.touchData.cxt){$=f("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit($):o.emit($),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit(f("cxtdragout")),e.touchData.cxtOver=B,B&&B.emit(f("cxtdragover")))}else if(n&&t.touches[2]&&o.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||o.emit(f("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&o.zoomingEnabled()&&o.panningEnabled()&&o.userZoomingEnabled()&&o.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",H=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",U=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o=e.cy,s=o.zoom(),l=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);l[0]=u[0],l[1]=u[1]}if(t.touches[1]){u=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);l[2]=u[0],l[3]=u[1]}if(t.touches[2]){u=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);l[4]=u[0],l[5]=u[1]}var d,p=function(e){return{originalEvent:t,type:e,position:{x:l[0],y:l[1]}}};if(i&&i.unactivate(),e.touchData.cxt){if(d=p("cxttapend"),i?i.emit(d):o.emit(d),!e.touchData.cxtDragged){var f=p("cxttap");i?i.emit(f):o.emit(f)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&o.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var g=o.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint("select",!0),o.emit(p("boxend"));g.emit(p("box")).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(p("boxselect")),g.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var m=e.dragData.touchDragEles;if(null!=i){var y=i._private.grabbed;h(m),e.redrawHint("drag",!0),e.redrawHint("eles",!0),y&&(i.emit(p("freeon")),m.emit(p("free")),e.dragData.didDrag&&(i.emit(p("dragfreeon")),m.emit(p("dragfree")))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:l[0],y:l[1]}),i.unactivate(),e.touchData.start=null}else{var v=e.findNearestElement(l[0],l[1],!0,!0);r(v,["touchend","tapend","vmouseup","tapdragout"],t,{x:l[0],y:l[1]})}var b=e.touchData.startPosition[0]-l[0],x=b*b,w=e.touchData.startPosition[1]-l[1],E=(x+w*w)*s*s;e.touchData.singleTouchMoved||(i||o.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:l[0],y:l[1]}),G=!1,t.timeStamp-W<=o.multiClickDebounceTime()?(q&&clearTimeout(q),G=!0,W=null,r(i,["dbltap","vdblclick"],t,{x:l[0],y:l[1]})):(q=setTimeout(function(){G||r(i,["onetap","voneclick"],t,{x:l[0],y:l[1]})},o.multiClickDebounceTime()),W=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&E2){for(var p=[u[0],u[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return m[0]}return null},p=Object.keys(h),f=0;f0?c:gPe(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){var l=2*(s="auto"===s?RPe(r,i):s);if(wPe(e,t,this.points,a,o,r,i-l,[0,-1],n))return!0;if(wPe(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var c=r/2+2*n,u=i/2+2*n;return!!xPe(e,t,[a-c,o-u,a-c,o,a+c,o,a+c,o-u])||(!!TPe(e,t,l,l,a+r/2-s,o+i/2-s,n)||!!TPe(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},aqe.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",OPe(3,0)),this.generateRoundPolygon("round-triangle",OPe(3,0)),this.generatePolygon("rectangle",OPe(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",OPe(5,0)),this.generateRoundPolygon("round-pentagon",OPe(5,0)),this.generatePolygon("hexagon",OPe(6,0)),this.generateRoundPolygon("round-hexagon",OPe(6,0)),this.generatePolygon("heptagon",OPe(7,0)),this.generateRoundPolygon("round-heptagon",OPe(7,0)),this.generatePolygon("octagon",OPe(8,0)),this.generateRoundPolygon("round-octagon",OPe(8,0));var r=new Array(20),i=MPe(5,0),a=MPe(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*uqe)break;var m=e.deq(t,h,u);if(!(m.length>0))break;for(var y=0;y0&&(e.onDeqd(t,c),!i&&e.shouldRedraw(t,c,h,u)&&r())},i(t))}}},dqe=function(){return oMe(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rDe;aMe(this,e),this.idsByKey=new vDe,this.keyForId=new vDe,this.cachesByLvl=new vDe,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n},[{key:"getIdsFor",value:function(e){null==e&&oDe("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new xDe,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new vDe,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}])}(),pqe=7.99,fqe={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},gqe=pDe({getKey:null,doesEleInvalidateKey:rDe,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:nDe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),mqe=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=gqe(t);xRe(n,r),n.lookup=new dqe(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},yqe=mqe.prototype;yqe.reasons=fqe,yqe.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},yqe.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},yqe.getElementQueue=function(){var e=this.eleCacheQueue=this.eleCacheQueue||new ODe(function(e,t){return t.reqs-e.reqs});return e},yqe.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},yqe.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(XDe(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var c=Math.pow(2,r),u=t.h*c,h=t.w*c,d=o.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,d))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=u<=25?25:u<=50?50:50*Math.ceil(u/50),u>1024||h>1024)return null;var g=a.getTextureQueue(p),m=g[g.length-2],y=function(){return a.recycleTexture(p,h)||a.addTexture(p,h)};m||(m=g[g.length-1]),m||(m=y()),m.width-m.usedWidthr;S--)_=a.getElement(e,t,n,S,fqe.downscale);C()}else{var A;if(!x&&!w&&!E)for(var N=r-1;N>=-4;N--){var I=l.get(e,N);if(I){A=I;break}}if(b(A))return a.queueElement(e,r),A;m.context.translate(m.usedWidth,0),m.context.scale(c,c),this.drawElement(m.context,e,t,d,!1),m.context.scale(1/c,1/c),m.context.translate(-m.usedWidth,0)}return f={x:m.usedWidth,texture:m,level:r,scale:c,width:h,height:u,scaledLabelShown:d},m.usedWidth+=Math.ceil(h+8),m.eleCaches.push(f),l.set(e,r,f),a.checkTextureFullness(m),f},yqe.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},yqe.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?fDe(t,e):e.fullnessChecks++},yqe.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;fDe(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,gDe(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),fDe(r,a),n.push(a),a}},yqe.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},yqe.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o<1&&n.size()>0;o++){var s=n.pop(),l=s.key,c=s.eles[0],u=a.hasCache(c,s.level);if(r[l]=null,!u){i.push(s);var h=t.getBoundingBox(c);t.getElement(c,h,e,s.level,fqe.dequeue)}}return i},yqe.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=tDe,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},yqe.onDequeue=function(e){this.onDequeues.push(e)},yqe.offDequeue=function(e){fDe(this.onDequeues,e)},yqe.setupDequeueing=hqe({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var o,s,l=r.layersByLevel,c=Math.pow(2,n),u=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return u;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var a=u.length-1;a>=0;a--){var o=u[a];o.invalid&&fDe(u,o)}}();var h=function(t){var i=(t=t||{}).after;!function(){if(!o){o=rPe();for(var t=0;t32767||s>32767)return null;if(a*s>16e6)return null;var l=r.makeLayer(o,n);if(null!=i){var h=u.indexOf(i)+1;u.splice(h,0,l)}else(void 0===t.insert||t.insert)&&u.unshift(l);return l};if(r.skipping&&!a)return null;for(var d=null,p=e.length/1,f=!a,g=0;g=p||!dPe(d.bb,m.boundingBox()))&&!(d=h({insert:!0,after:d})))return null;s||f?r.queueLayer(d,m):r.drawEleInLayer(d,m,n,t),d.eles.push(m),v[n]=d}}return s||(f?null:u)},bqe.getEleLevelForLayerLevel=function(e,t){return e},bqe.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,true),i.setImgSmoothing(a,!0))},bqe.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===t.length},bqe.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},bqe.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=FRe(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},bqe.invalidateLayer=function(e){if(this.lastInvalidationTime=FRe(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];fDe(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,s=t._private.rscratch;if((!a||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var c=a?t.pstyle("opacity").value:1,u=a?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,m=t.pstyle("line-outline-color").value,y=c*u,v=c*u,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===h?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;o.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,k=t.pstyle("ghost-opacity").value,T=y*k;e.translate(w,E),b(T),x(T),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(o.colorStrokeStyle(e,m[0],m[1],m[2],n),"straight-triangle"===h?o.drawEdgeTrianglePath(t,e,s.allpts):(o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")):e.lineCap="butt"}();i&&o.drawEdgeUnderlay(e,t),b(),x(),i&&o.drawEdgeOverlay(e,t),o.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},$qe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==o.edgeType||a?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,o.allpts,"solid")}}}};Pqe.drawEdgeOverlay=$qe("overlay"),Pqe.drawEdgeUnderlay=$qe("underlay"),Pqe.drawEdgePath=function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,l=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");a.pathCacheKey&&a.pathCacheKey===h?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=h,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(c),o.lineDashOffset=u;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+35&&void 0!==arguments[5]?arguments[5]:5,o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}Fqe.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(XDe(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],o=this;if(null==r){if(a&&!o.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,u=t.pstyle("label"),h=t.pstyle("source-label"),d=t.pstyle("target-label");if(c||(!u||!u.value)&&(!h||!h.value)&&(!d||!d.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(o.drawText(e,t,null,f,a),t.isEdge()&&(o.drawText(e,t,"source",f,a),o.drawText(e,t,"target",f,a))):o.drawText(e,t,i,f,a),n&&e.translate(p.x1,p.y1)},Fqe.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,c=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],s),this.colorStrokeStyle(e,u[0],u[1],u[2],l)},Fqe.getTextAngle=function(e,t){var n,r=e._private.rscratch,i=t?t+"-":"",a=e.pstyle(i+"text-rotation");if("autorotate"===a.strValue){var o=mDe(r,"labelAngle",t);n=e.isEdge()?o:0}else n="none"===a.strValue?0:a.pfValue;return n},Fqe.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||0!==o&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,c=mDe(a,"labelX",n),u=mDe(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(e,t,i);var d,p=n?n+"-":"",f=mDe(a,"labelWidth",n),g=mDe(a,"labelHeight",n),m=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,v=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(v&&(b="center",x="center"),c+=m,u+=y,0!==(d=r?this.getTextAngle(t,n):0)&&(s=c,l=u,e.translate(s,l),e.rotate(d),c=0,u=0),x){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,T=t.pstyle("text-background-padding").pfValue,_=t.pstyle("text-background-shape").strValue,C="round-rectangle"===_||"roundrectangle"===_,S="circle"===_;if(w>0||k>0&&E>0){var A=e.fillStyle,N=e.strokeStyle,I=e.lineWidth,O=t.pstyle("text-background-color").value,L=t.pstyle("text-border-color").value,M=t.pstyle("text-border-style").value,R=w>0,D=k>0&&E>0,P=c-T;switch(b){case"left":P-=f;break;case"center":P-=f/2}var $=u-g-T,B=f+2*T,F=g+2*T;if(R&&(e.fillStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(w*o,")")),D&&(e.strokeStyle="rgba(".concat(L[0],",").concat(L[1],",").concat(L[2],",").concat(E*o,")"),e.lineWidth=k,e.setLineDash))switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;default:e.setLineDash([])}if(C?(e.beginPath(),zqe(e,P,$,B,F,2)):S?(e.beginPath(),function(e,t,n,r,i){var a=Math.min(r,i)/2,o=t+r/2,s=n+i/2;e.beginPath(),e.arc(o,s,a,0,2*Math.PI),e.closePath()}(e,P,$,B,F)):(e.beginPath(),e.rect(P,$,B,F)),R&&e.fill(),D&&e.stroke(),D&&"double"===M){var z=k/2;e.beginPath(),C?zqe(e,P+z,$+z,B-2*z,F-2*z,2):e.rect(P+z,$+z,B-2*z,F-2*z),e.stroke()}e.fillStyle=A,e.strokeStyle=N,e.lineWidth=I,e.setLineDash&&e.setLineDash([])}var j=2*t.pstyle("text-outline-width").pfValue;if(j>0&&(e.lineWidth=j),"wrap"===t.pstyle("text-wrap").value){var H=mDe(a,"labelWrapCachedLines",n),U=mDe(a,"labelLineHeight",n),G=f/2,q=this.getLabelJustification(t);switch("auto"===q||("left"===b?"left"===q?c+=-f:"center"===q&&(c+=-G):"center"===b?"left"===q?c+=-G:"right"===q&&(c+=G):"right"===b&&("center"===q?c+=G:"right"===q&&(c+=f))),x){case"top":case"center":case"bottom":u-=(H.length-1)*U}for(var W=0;W0&&e.strokeText(H[W],c,u),e.fillText(H[W],c,u),u+=U}else j>0&&e.strokeText(h,c,u),e.fillText(h,c,u);0!==d&&(e.rotate(-d),e.translate(-s,-l))}}};var jqe={drawNode:function(e,t,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,c=t._private,u=c.rscratch,h=t.position();if(JMe(h.x)&&JMe(h.y)&&(!s||t.visible())){var d,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),m=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var v=t.pstyle("background-image").value,b=new Array(v.length),x=new Array(v.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:S;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;l.colorStrokeStyle(e,A[0],A[1],A[2],t)},G=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F;l.colorStrokeStyle(e,$[0],$[1],$[2],t)},q=function(e,t,n,r){var i,a=l.nodePathCache=l.nodePathCache||[],o=XRe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+j),s=a[o],c=!1;return null!=s?(i=s,c=!0,u.pathCache=i):(i=new Path2D,a[o]=u.pathCache=i),{path:i,cacheHit:c}},W=t.pstyle("shape").strValue,V=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(h.x,h.y);var Y=q(r,i,W,V);d=Y.path,m=Y.cacheHit}var X=function(){if(!m){var n=h;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(d||e,n.x,n.y,r,i,j,u)}g?e.fill(d):e.fill()},K=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=c.backgrounding,a=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,a),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u)))},Z=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasStripe(t)&&(e.save(),g?e.clip(u.pathCache):(l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u),e.clip()),l.drawStripe(e,t,a),e.restore(),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i,j,u)))},J=function(){var t=(_>0?_:-_)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=_>0?0:255;0!==_&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(d):e.fill())},ee=function(){if(C>0){if(e.lineWidth=C,e.lineCap=O,e.lineJoin=I,e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(M),e.lineDashOffset=R;break;case"solid":case"double":e.setLineDash([])}if("center"!==L){if(e.save(),e.lineWidth*=2,"inside"===L)g?e.clip(d):e.clip();else{var t=new Path2D;t.rect(-r/2-C,-i/2-C,r+2*C,i+2*C),t.addPath(d),e.clip(t,"evenodd")}g?e.stroke(d):e.stroke(),e.restore()}else g?e.stroke(d):e.stroke();if("double"===N){e.lineWidth=C/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(d):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(P>0){if(e.lineWidth=P,e.lineCap="butt",e.setLineDash)switch(B){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=h;g&&(n={x:0,y:0});var a=l.getNodeShape(t),o=C;"inside"===L&&(o=0),"outside"===L&&(o*=2);var s,c=(r+o+(P+z))/r,u=(i+o+(P+z))/i,d=r*c,p=i*u,f=l.nodeShapes[a].points;if(g)s=q(d,p,a,f).path;if("ellipse"===a)l.drawEllipsePath(s||e,n.x,n.y,d,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var m=0,y=0,v=0;"round-diamond"===a?m=1.4*(o+z+P):"round-heptagon"===a?(m=1.075*(o+z+P),v=-(o/2+z+P)/35):"round-hexagon"===a?m=1.12*(o+z+P):"round-pentagon"===a?(m=1.13*(o+z+P),v=-(o/2+z+P)/15):"round-tag"===a?(m=1.12*(o+z+P),y=.07*(o/2+P+z)):"round-triangle"===a&&(m=(o+z+P)*(Math.PI/2),v=-(o+z/2+P)/Math.PI),0!==m&&(d=r*(c=(r+m)/r),["round-hexagon","round-tag"].includes(a)||(p=i*(u=(i+m)/i)));for(var b=d/2,x=p/2,w=(j="auto"===j?DPe(d,p):j)+(o+P+z)/2,E=new Array(f.length/2),k=new Array(f.length/2),T=0;T0){if(r=r||n.position(),null==i||null==a){var h=n.padding();i=n.width()+2*h,a=n.height()+2*h}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[c].draw(t,r.x,r.y,i+2*o,a+2*o,u),t.fill()}}}};jqe.drawNodeOverlay=Hqe("overlay"),jqe.drawNodeUnderlay=Hqe("underlay"),jqe.hasPie=function(e){return(e=e[0])._private.hasPie},jqe.hasStripe=function(e){return(e=e[0])._private.hasStripe},jqe.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i,a=t.cy().style(),o=t.pstyle("pie-size"),s=t.pstyle("pie-hole"),l=t.pstyle("pie-start-angle").pfValue,c=r.x,u=r.y,h=t.width(),d=t.height(),p=Math.min(h,d)/2,f=0;if(this.usePaths()&&(c=0,u=0),"%"===o.units?p*=o.pfValue:void 0!==o.pfValue&&(p=o.pfValue/2),"%"===s.units?i=p*s.pfValue:void 0!==s.pfValue&&(i=s.pfValue/2),!(i>=p))for(var g=1;g<=a.pieBackgroundN;g++){var m=t.pstyle("pie-"+g+"-background-size").value,y=t.pstyle("pie-"+g+"-background-color").value,v=t.pstyle("pie-"+g+"-background-opacity").value*n,b=m/100;b+f>1&&(b=1-f);var x=1.5*Math.PI+2*Math.PI*f,w=(x+=l)+2*Math.PI*b;0===m||f>=1||f+b>1||(0===i?(e.beginPath(),e.moveTo(c,u),e.arc(c,u,p,x,w),e.closePath()):(e.beginPath(),e.arc(c,u,p,x,w),e.arc(c,u,i,w,x,!0),e.closePath()),this.colorFillStyle(e,y[0],y[1],y[2],v),e.fill(),f+=b)}},jqe.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=r.x,o=r.y,s=t.width(),l=t.height(),c=0,u=this.usePaths();e.save();var h=t.pstyle("stripe-direction").value,d=t.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":e.rotate(-Math.PI/2)}var p=s,f=l;"%"===d.units?(p*=d.pfValue,f*=d.pfValue):void 0!==d.pfValue&&(p=d.pfValue,f=d.pfValue),u&&(a=0,o=0),o-=p/2,a-=f/2;for(var g=1;g<=i.stripeBackgroundN;g++){var m=t.pstyle("stripe-"+g+"-background-size").value,y=t.pstyle("stripe-"+g+"-background-color").value,v=t.pstyle("stripe-"+g+"-background-opacity").value*n,b=m/100;b+c>1&&(b=1-c),0===m||c>=1||c+b>1||(e.beginPath(),e.rect(a,o+f*c,p,f*b),e.closePath(),this.colorFillStyle(e,y[0],y[1],y[2],v),e.fill(),c+=b)}e.restore()};var Uqe,Gqe={};function qqe(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(r));return r}function Wqe(e,t,n){void 0===n&&(n=t);var r=e.makeOffscreenCanvas(t,n),i=r.context=r.getContext("2d");return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function Vqe(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function Yqe(e){return"solid"===e.pstyle("background-fill").value&&("none"===e.pstyle("background-image").strValue&&(0===e.pstyle("border-width").value||(0===e.pstyle("border-opacity").value||"solid"===e.pstyle("border-style").value)))}function Xqe(e,t){if(e.length!==t.length)return!1;for(var n=0;n>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function Zqe(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function Jqe(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function eWe(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function tWe(e,t,n,r,i,a){switch(t){case e.FLOAT:return new Float32Array(n.buffer,a*r,i);case e.INT:return new Int32Array(n.buffer,a*r,i)}}function nWe(e,t,n,r){var i=cMe(Jqe(e,n),3),a=i[0],o=i[1],s=i[2],l=eWe(e,o,t*a),c=a*s,u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,t*c,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,a,o,!1,c,0):o===e.INT&&e.vertexAttribIPointer(r,a,o,c,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var h=new Array(t),d=0;dt.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!h&&(u[t.NODE]=!0,u[t.SELECT_BOX]=!0);var v=n.style(),b=n.zoom(),x=void 0!==o?o:b,w=n.pan(),E={x:w.x,y:w.y},k={zoom:b,pan:{x:w.x,y:w.y}},T=t.prevViewport;void 0===T||k.zoom!==T.zoom||k.pan.x!==T.pan.x||k.pan.y!==T.pan.y||g&&!f||(t.motionBlurPxRatio=1),s&&(E=s),x*=l,E.x*=l,E.y*=l;var _=t.getCachedZSortedEles();function C(e,n,r,i,a){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",t.colorFillStyle(e,255,255,255,t.motionBlurTransparency),e.fillRect(n,r,i,a),e.globalCompositeOperation=o}function S(e,n){var a,l,u,h;t.clearingMotionBlur||e!==c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]&&e!==c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]?(a=E,l=x,u=t.canvasWidth,h=t.canvasHeight):(a={x:w.x*p,y:w.y*p},l=b*p,u=t.canvasWidth*p,h=t.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===n?C(e,0,0,u,h):r||void 0!==n&&!n||e.clearRect(0,0,u,h),i||(e.translate(a.x,a.y),e.scale(l,l)),s&&e.translate(s.x,s.y),o&&e.scale(o,o)}if(h||(t.textureDrawLastFrame=!1),h){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var A=t.data.bufferContexts[t.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:l*t.textureMult}),(k=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight}).mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}u[t.DRAG]=!1,u[t.NODE]=!1;var N=c.contexts[t.NODE],I=t.textureCache.texture;k=t.textureCache.viewport;N.setTransform(1,0,0,1,0,0),d?C(N,0,0,k.width,k.height):N.clearRect(0,0,k.width,k.height);var O=v.core("outside-texture-bg-color").value,L=v.core("outside-texture-bg-opacity").value;t.colorFillStyle(N,O[0],O[1],O[2],L),N.fillRect(0,0,k.width,k.height);b=n.zoom();S(N,!1),N.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),N.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else t.textureOnViewport&&!r&&(t.textureCache=null);var M=n.extent(),R=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),D=t.hideEdgesOnViewport&&R,P=[];if(P[t.NODE]=!u[t.NODE]&&d&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,P[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),P[t.DRAG]=!u[t.DRAG]&&d&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,P[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),u[t.NODE]||i||a||P[t.NODE]){var $=d&&!P[t.NODE]&&1!==p;S(N=r||($?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),d&&!$?"motionBlur":void 0),D?t.drawCachedNodes(N,_.nondrag,l,M):t.drawLayeredElements(N,_.nondrag,l,M),t.debug&&t.drawDebugPoints(N,_.nondrag),i||d||(u[t.NODE]=!1)}if(!a&&(u[t.DRAG]||i||P[t.DRAG])){$=d&&!P[t.DRAG]&&1!==p;S(N=r||($?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]),d&&!$?"motionBlur":void 0),D?t.drawCachedNodes(N,_.drag,l,M):t.drawCachedElements(N,_.drag,l,M),t.debug&&t.drawDebugPoints(N,_.drag),i||d||(u[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,S),d&&1!==p){var B=c.contexts[t.NODE],F=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],z=c.contexts[t.DRAG],j=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],H=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!y?e.clearRect(0,0,t.canvasWidth,t.canvasHeight):C(e,0,0,t.canvasWidth,t.canvasHeight);var i=p;e.drawImage(n,0,0,t.canvasWidth*i,t.canvasHeight*i,0,0,t.canvasWidth,t.canvasHeight)};(u[t.NODE]||P[t.NODE])&&(H(B,F,P[t.NODE]),u[t.NODE]=!1),(u[t.DRAG]||P[t.DRAG])&&(H(z,j,P[t.DRAG]),u[t.DRAG]=!1)}t.prevViewport=k,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),d&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!h,t.mbFrames=0,u[t.NODE]=!0,u[t.DRAG]=!0,t.redraw()},100)),r||n.emit("render")},Gqe.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,i=n.data,a=r.style(),o=e.drawOnlyNodeLayer,s=e.drawAllLayers,l=i.canvasNeedsRedraw,c=e.forcedContext;if(n.showFps||!o&&l[n.SELECT_BOX]&&!s){var u=c||i.contexts[n.SELECT_BOX];if(t(u),1==n.selection[4]&&(n.hoverData.selecting||n.touchData.selecting)){var h=n.cy.zoom(),d=a.core("selection-box-border-width").value/h;u.lineWidth=d,u.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",u.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),d>0&&(u.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",u.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){h=n.cy.zoom();var p=i.bgActivePosistion;u.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",u.beginPath(),u.arc(p.x,p.y,a.core("active-bg-size").pfValue/h,0,2*Math.PI),u.fill()}var f=n.lastRedrawTime;if(n.showFps&&f){f=Math.round(f);var g=Math.round(1e3/f),m="1 frame = "+f+" ms = "+g+" fps";if(u.setTransform(1,0,0,1,0,0),u.fillStyle="rgba(255, 0, 0, 0.75)",u.strokeStyle="rgba(255, 0, 0, 0.75)",u.font="30px Arial",!Uqe){var y=u.measureText(m);Uqe=y.actualBoundingBoxAscent}u.fillText(m,0,Uqe);u.strokeRect(0,Uqe+10,250,20),u.fillRect(0,Uqe+10,250*Math.min(g/60,1),20)}s||(l[n.SELECT_BOX]=!1)}};var rWe="undefined"!=typeof Float32Array?Float32Array:Array;function iWe(){var e=new rWe(9);return rWe!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function aWe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function oWe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=d*r+p*o+c,e[7]=d*i+p*s+u,e[8]=d*a+p*l+h,e}function sWe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(n),p=Math.cos(n);return e[0]=p*r+d*o,e[1]=p*i+d*s,e[2]=p*a+d*l,e[3]=p*o-d*r,e[4]=p*s-d*i,e[5]=p*l-d*a,e[6]=c,e[7]=u,e[8]=h,e}function lWe(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var cWe=function(){return oMe(function e(t,n,r,i){aMe(this,e),this.debugID=Math.floor(1e4*Math.random()),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(t,n,n),this.scratch=i(t,n,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(e){var t=e.w,n=e.h,r=this.texHeight,i=this.texSize,a=r/n,o=t*a,s=n*a;return o>i&&(o=t*(a=i/t),s=n*a),{scale:a,texW:o,texH:s}}},{key:"draw",value:function(e,t,n){var r=this;if(this.locked)throw new Error("can't draw, atlas is locked");var i=this.texSize,a=this.texRows,o=this.texHeight,s=this.getScale(t),l=s.scale,c=s.texW,u=s.texH,h=function(e,r){if(n&&r){var i=r.context,a=e.x,s=e.row,c=a,u=o*s;i.save(),i.translate(c,u),i.scale(l,l),n(i,t),i.restore()}},d=[null,null],p=function(){h(r.freePointer,r.canvas),d[0]={x:r.freePointer.x,y:r.freePointer.row*o,w:c,h:u},d[1]={x:r.freePointer.x+c,y:r.freePointer.row*o,w:0,h:u},r.freePointer.x+=c,r.freePointer.x==i&&(r.freePointer.x=0,r.freePointer.row++)},f=function(){r.freePointer.x=0,r.freePointer.row++};if(this.freePointer.x+c<=i)p();else{if(this.freePointer.row>=a-1)return!1;this.freePointer.x===i?(f(),p()):this.enableWrapping?function(){var e=r.scratch,t=r.canvas;e.clear(),h({x:0,row:0},e);var n=i-r.freePointer.x,a=c-n,s=o,l=r.freePointer.x,p=r.freePointer.row*o,f=n;t.context.drawImage(e,0,0,f,s,l,p,f,s),d[0]={x:l,y:p,w:f,h:u};var g=n,m=(r.freePointer.row+1)*o,y=a;t&&t.context.drawImage(e,g,0,y,s,0,m,y,s),d[1]={x:0,y:m,w:y,h:u},r.freePointer.x=a,r.freePointer.row++}():(f(),p())}return this.keyToLocation.set(e,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(e){return this.keyToLocation.get(e)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(e){if(this.locked)return!1;var t=this.texSize,n=this.texRows,r=this.getScale(e).texW;return!(this.freePointer.x+r>t)||this.freePointer.row1&&void 0!==arguments[1]?arguments[1]:{},i=r.forceRedraw,a=void 0!==i&&i,o=r.filterEle,s=void 0===o?function(){return!0}:o,l=r.filterType,c=void 0===l?function(){return!0}:l,u=!1,h=!1,d=sMe(e);try{for(d.s();!(t=d.n()).done;){var p=t.value;if(s(p)){var f,g=sMe(this.renderTypes.values());try{var m=function(){var e=f.value,t=e.type;if(c(t)){var r=n.collections.get(e.collection),i=e.getKey(p),o=Array.isArray(i)?i:[i];if(a)o.forEach(function(e){return r.markKeyForGC(e)}),h=!0;else{var s=e.getID?e.getID(p):p.id(),l=n._key(t,s),d=n.typeAndIdToKey.get(l);void 0===d||Xqe(o,d)||(u=!0,n.typeAndIdToKey.delete(l),d.forEach(function(e){return r.markKeyForGC(e)}))}}};for(g.s();!(f=g.n()).done;)m()}catch(e){g.e(e)}finally{g.f()}}}}catch(e){d.e(e)}finally{d.f()}return h&&(this.gc(),u=!1),u}},{key:"gc",value:function(){var e,t=sMe(this.collections.values());try{for(t.s();!(e=t.n()).done;){e.value.gc()}}catch(e){t.e(e)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(e,t,n,r){var i=this.renderTypes.get(t),a=this.collections.get(i.collection),o=!1,s=a.draw(r,n,function(t){i.drawClipped?(t.save(),t.beginPath(),t.rect(0,0,n.w,n.h),t.clip(),i.drawElement(t,e,n,!0,!0),t.restore()):i.drawElement(t,e,n,!0,!0),o=!0});if(o){var l=i.getID?i.getID(e):e.id(),c=this._key(t,l);this.typeAndIdToKey.has(c)?this.typeAndIdToKey.get(c).push(r):this.typeAndIdToKey.set(c,[r])}return s}},{key:"getAtlasInfo",value:function(e,t){var n=this,r=this.renderTypes.get(t),i=r.getKey(e);return(Array.isArray(i)?i:[i]).map(function(i){var a=r.getBoundingBox(e,i),o=n.getOrCreateAtlas(e,t,a,i),s=cMe(o.getOffsets(i),2),l=s[0];return{atlas:o,tex:l,tex1:l,tex2:s[1],bb:a}})}},{key:"getDebugInfo",value:function(){var e,t=[],n=sMe(this.collections);try{for(n.s();!(e=n.n()).done;){var r=cMe(e.value,2),i=r[0],a=r[1].getCounts(),o=a.keyCount,s=a.atlasCount;t.push({type:i,keyCount:o,atlasCount:s})}}catch(e){n.e(e)}finally{n.f()}return t}}])}(),dWe=function(){return oMe(function e(t){aMe(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]},[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(e,t){return t})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(e){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(e)}},{key:"getAtlasIndexForBatch",value:function(e){var t=this.batchAtlases.indexOf(e);if(t<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(e),t=this.batchAtlases.length-1}return t}}])}(),pWe={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},fWe=1,gWe=2,mWe=function(){return oMe(function e(t,n,r){aMe(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=Wqe,this.atlasManager=new hWe(t,r),this.batchManager=new dWe(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(pWe.SCREEN),this.pickingProgram=this._createShaderProgram(pWe.PICKING),this.vao=this._createVAO()},[{key:"addAtlasCollection",value:function(e,t){this.atlasManager.addAtlasCollection(e,t)}},{key:"addTextureAtlasRenderType",value:function(e,t){this.atlasManager.addRenderType(e,t)}},{key:"addSimpleShapeRenderType",value:function(e,t){this.simpleShapeOptions.set(e,t)}},{key:"invalidate",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type,n=this.atlasManager;return t?n.invalidate(e,{filterType:function(e){return e===t},forceRedraw:!0}):n.invalidate(e)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(e){var t=this.gl,n="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),r=this.batchManager.getIndexArray(),i="#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(r.map(function(e){return"uniform sampler2D uTexture".concat(e,";")}).join("\n\t"),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(r.map(function(e){return"if(vAtlasId == ".concat(e,") outColor = texture(uTexture").concat(e,", vTexCoord);")}).join("\n\telse "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(e.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "),a=function(e,t,n){var r=qqe(e,e.VERTEX_SHADER,t),i=qqe(e,e.FRAGMENT_SHADER,n),a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error("Could not initialize shaders");return a}(t,n,i);a.aPosition=t.getAttribLocation(a,"aPosition"),a.aIndex=t.getAttribLocation(a,"aIndex"),a.aVertType=t.getAttribLocation(a,"aVertType"),a.aTransform=t.getAttribLocation(a,"aTransform"),a.aAtlasId=t.getAttribLocation(a,"aAtlasId"),a.aTex=t.getAttribLocation(a,"aTex"),a.aPointAPointB=t.getAttribLocation(a,"aPointAPointB"),a.aPointCPointD=t.getAttribLocation(a,"aPointCPointD"),a.aLineWidth=t.getAttribLocation(a,"aLineWidth"),a.aColor=t.getAttribLocation(a,"aColor"),a.aCornerRadius=t.getAttribLocation(a,"aCornerRadius"),a.aBorderColor=t.getAttribLocation(a,"aBorderColor"),a.uPanZoomMatrix=t.getUniformLocation(a,"uPanZoomMatrix"),a.uAtlasSize=t.getUniformLocation(a,"uAtlasSize"),a.uBGColor=t.getUniformLocation(a,"uBGColor"),a.uZoom=t.getUniformLocation(a,"uZoom"),a.uTextures=[];for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:pWe.SCREEN;this.panZoomMatrix=e,this.renderTarget=t,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(e,t){return!!e.visible()&&(!t||!t.isVisible||t.isVisible(e))}},{key:"drawTexture",value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&(!e.isEdge()||this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(o===fWe)return;if(o==gWe)return void this.drawPickingRectangle(e,t,n)}var s,l=sMe(r.getAtlasInfo(e,n));try{for(l.s();!(s=l.n()).done;){var c=s.value,u=c.atlas,h=c.tex1,d=c.tex2;i.canAddToCurrentBatch(u)||this.endBatch();for(var p=i.getAtlasIndexForBatch(u),f=0,g=[[h,!0],[d,!1]];f=this.maxInstances&&this.endBatch()}}}}catch(e){l.e(e)}finally{l.f()}}}},{key:"setTransformMatrix",value:function(e,t,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var o=r.bb,s=r.tex1,l=r.tex2,c=s.w/(s.w+l.w);i||(c=1-c);var u=this._getAdjustedBB(o,a,i,c);this._applyTransformMatrix(t,u,n,e)}else{var h=n.getBoundingBox(e),d=this._getAdjustedBB(h,a,!0,1);this._applyTransformMatrix(t,d,n,e)}}},{key:"_applyTransformMatrix",value:function(e,t,n,r){var i,a;aWe(e);var o=n.getRotation?n.getRotation(r):0;if(0!==o){var s=n.getRotationPoint(r);oWe(e,e,[s.x,s.y]),sWe(e,e,o);var l=n.getRotationOffset(r);i=l.x+(t.xOffset||0),a=l.y+(t.yOffset||0)}else i=t.x1,a=t.y1;oWe(e,e,[i,a]),lWe(e,e,[t.w,t.h])}},{key:"_getAdjustedBB",value:function(e,t,n,r){var i=e.x1,a=e.y1,o=e.w,s=e.h;t&&(i-=t,a-=t,o+=2*t,s+=2*t);var l=0,c=o*r;return n&&r<1?o=c:!n&&r<1&&(i+=l=o-c,o=c),{x1:i,y1:a,w:o,h:s,xOffset:l,yOffset:e.yOffset}}},{key:"drawPickingRectangle",value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=4,Qqe(t,this.indexBuffer.getView(i)),Kqe([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(void 0===a||r.isSimple&&!r.isSimple(e))this.drawTexture(e,t,n);else{var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,5===a||6===a){var s=r.getBoundingBox(e),l=this._getCornerRadius(e,i.radius,s),c=this.cornerRadiusBuffer.getView(o);c[0]=l,c[1]=l,c[2]=l,c[3]=l,6===a&&(c[0]=0,c[2]=0)}Qqe(t,this.indexBuffer.getView(o)),Kqe(e.pstyle(i.color).value,e.pstyle(i.opacity).value,this.colorBuffer.getView(o));var u=this.lineWidthBuffer.getView(o);if(u[0]=0,u[1]=0,i.border){var h=e.pstyle("border-width").value;if(h>0){Kqe(e.pstyle("border-color").value,e.pstyle("border-opacity").value,this.borderColorBuffer.getView(o));var d=e.pstyle("border-position").value;if("inside"===d)u[0]=0,u[1]=-h;else if("outside"===d)u[0]=h,u[1]=0;else{var p=h/2;u[0]=p,u[1]=-p}}}var f=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,f,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"_getVertTypeForShape",value:function(e,t){switch(e.pstyle(t).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(e,t,n){var r=n.w,i=n.h;if("auto"===e.pstyle(t).value)return RPe(r,i);var a=e.pstyle(t).pfValue,o=r/2,s=i/2;return Math.min(a,s,o)}},{key:"drawEdgeArrow",value:function(e,t,n){if(e.visible()){var r,i,a,o=e._private.rscratch;if("source"===n?(r=o.arrowStartX,i=o.arrowStartY,a=o.srcArrowAngle):(r=o.arrowEndX,i=o.arrowEndY,a=o.tgtArrowAngle),!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a)||null==a))if("none"!==e.pstyle(n+"-arrow-shape").value){var s=e.pstyle(n+"-arrow-color").value,l=e.pstyle("opacity").value*e.pstyle("line-opacity").value,c=e.pstyle("width").pfValue,u=e.pstyle("arrow-scale").value,h=this.r.getArrowWidth(c,u),d=this.instanceCount,p=this.transformBuffer.getMatrixView(d);aWe(p),oWe(p,p,[r,i]),lWe(p,p,[h,h]),sWe(p,p,a),this.vertTypeBuffer.getView(d)[0]=3,Qqe(t,this.indexBuffer.getView(d)),Kqe(s,l,this.colorBuffer.getView(d)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle("opacity").value,i=e.pstyle("line-opacity").value,a=e.pstyle("width").pfValue,o=e.pstyle("line-color").value,s=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==n.length){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=1,Qqe(t,this.indexBuffer.getView(l)),Kqe(o,s,this.colorBuffer.getView(l)),this.lineWidthBuffer.getView(l)[0]=a;var c=this.pointAPointBBuffer.getView(l);c[0]=n[0],c[1]=n[1],c[2]=n[2],c[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var u=0;u=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(e){var t=e._private.rscratch;return!t.badLine&&null!=t.allpts&&!isNaN(t.allpts[0])}},{key:"_getEdgePoints",value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(4==n.length)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:"_getNumSegments",value:function(e){return Math.min(Math.max(15,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(e,t){if(4==e.length)return e;for(var n=Array(2*(t+1)),r=0;r<=t;r++)if(0==r)n[0]=e[0],n[1]=e[1];else if(r==t)n[2*r]=e[e.length-2],n[2*r+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,2*r)}return n}},{key:"_setCurvePoint",value:function(e,t,n,r){if(!(e.length<=2)){for(var i=Array(e.length-2),a=0;a0}},s=function(e){return"yes"===e.pstyle("text-events").strValue?gWe:fWe},l=function(e){var t=e.position(),n=t.x,r=t.y,i=e.outerWidth(),a=e.outerHeight();return{w:i,h:a,x1:n-i/2,y1:r-a/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Yqe,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:bWe(t.getLabelKey,null),getBoundingBox:xWe(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:a("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:bWe(t.getSourceLabelKey,"source"),getBoundingBox:xWe(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:i("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:a("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:bWe(t.getTargetLabelKey,"target"),getBoundingBox:xWe(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:i("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:a("target-label")});var c=RRe(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(e,t){var r=!1;t&&t.length>0&&(r|=n.drawing.invalidate(t)),r&&c()}),function(e){var t=e.render;e.render=function(n){n=n||{};var r=e.cy;e.webgl&&(r.zoom()>pqe?(!function(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}(e),t.call(e,n)):(!function(e){var t=function(t){t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.canvasWidth,e.canvasHeight),t.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}(e),kWe(e,n,pWe.SCREEN)))};var n=e.matchCanvasSize;e.matchCanvasSize=function(t){n.call(e,t),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0},e.findNearestElements=function(t,n,r,i){return function(e,t,n){var r,i,a,o=function(e,t,n){var r,i,a,o,s=Vqe(e),l=s.pan,c=s.zoom,u=function(e,t,n,r,i){var a=r*n+t.x,o=i*n+t.y;return[a,o=Math.round(e.canvasHeight-o)]}(e,l,c,t,n),h=cMe(u,2),d=h[0],p=h[1],f=6;if(r=d-f/2,i=p-f/2,a=f,o=f,0===a||0===o)return[];var g=e.data.contexts[e.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),kWe(e,null,pWe.PICKING),e.pickingFrameBuffer.needsDraw=!1);var m=a*o,y=new Uint8Array(4*m);g.readPixels(r,i,a,o,g.RGBA,g.UNSIGNED_BYTE,y),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var v=new Set,b=0;b=0&&v.add(x)}return v}(e,t,n),s=e.getCachedZSortedEles(),l=sMe(o);try{for(l.s();!(a=l.n()).done;){var c=s[a.value];if(!r&&c.isNode()&&(r=c),!i&&c.isEdge()&&(i=c),r&&i)break}}catch(e){l.e(e)}finally{l.f()}return[r,i].filter(Boolean)}(e,t,n)};var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0};var i=e.notify;e.notify=function(t,n){i.call(e,t,n),"viewport"===t||"bounds"===t?e.pickingFrameBuffer.needsDraw=!0:"background"===t&&e.drawing.invalidate(n,{type:"node-body"})}}(n)};var bWe=function(e,t){return function(n){var r=e(n),i=vWe(n,t);return i.length>1?i.map(function(e,t){return"".concat(r,"_").concat(t)}):r}},xWe=function(e,t){return function(n,r){var i=e(n);if("string"==typeof r){var a=r.indexOf("_");if(a>0){var o=Number(r.substring(a+1)),s=vWe(n,t),l=i.h/s.length,c=l*o,u=i.y1+c;return{x1:i.x1,w:i.w,y1:u,h:l,yOffset:c}}}return i}};function wWe(e,t){var n=e.canvasWidth,r=e.canvasHeight,i=Vqe(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(a.x,a.y),t.scale(o,o)}function EWe(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function kWe(e,t,n){var r;e.webglDebug&&(r=performance.now());var i=e.drawing,a=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&function(e,t){e.drawSelectionRectangle(t,function(t){return wWe(e,t)})}(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var o=e.data.contexts[e.WEBGL];n.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=function(e){var t=e.canvasWidth,n=e.canvasHeight,r=Vqe(e),i=r.pan,a=r.zoom,o=iWe();oWe(o,o,[i.x,i.y]),lWe(o,o,[a,a]);var s=iWe();!function(e,t,n){e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1}(s,t,n);var l=iWe();return function(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];e[0]=d*r+p*o+f*c,e[1]=d*i+p*s+f*u,e[2]=d*a+p*l+f*h,e[3]=g*r+m*o+y*c,e[4]=g*i+m*s+y*u,e[5]=g*a+m*l+y*h,e[6]=v*r+b*o+x*c,e[7]=v*i+b*s+x*u,e[8]=v*a+b*l+x*h}(l,s,o),l}(e),l=e.getCachedZSortedEles();if(a=l.length,i.startFrame(s,n),n.screen){for(var c=0;c0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),d.translate(g.x,g.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-g.x,-g.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,a),d.fill())}return h},OWe.png=function(e){return MWe(e,this.bufferCanvasImage(e),"image/png")},OWe.jpg=function(e){return MWe(e,this.bufferCanvasImage(e),"image/jpeg")};var RWe={nodeShapeImpl:function(e,t,n,r,i,a,o,s){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a,s);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}}},DWe=$We,PWe=$We.prototype;function $We(e){var t=this,n=t.cy.window().document;e.webgl&&(PWe.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(PWe.CANVAS_LAYERS),contexts:new Array(PWe.CANVAS_LAYERS),canvasNeedsRedraw:new Array(PWe.CANVAS_LAYERS),bufferCanvases:new Array(PWe.BUFFER_COUNT),bufferContexts:new Array(PWe.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};gMe&&gMe.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;lt&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=c},function(e,t,n){function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),c=n(13),u=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(c,1),a.target!=a.source&&a.target.edges.splice(u,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l(e=c.getTop())&&(r=e),a>(t=c.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),u>(r=g.getTop())&&(u=r),h<(a=g.getBottom())&&(h=a)}var m=new c(s,u,l-s,h-u);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-o,this.right=m.x+m.width+o,this.top=m.y-o,this.bottom=m.y+m.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,u=-i.MAX_VALUE,h=e.length,d=0;d(t=p.getLeft())&&(o=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),u<(a=p.getBottom())&&(u=a)}return new c(o,l,s-o,u-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(ia)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(ra?(n[0]=u,n[1]=h,k=!0):(n[0]=c,n[1]=l,k=!0):_===S&&(r>a?(n[0]=s,n[1]=l,k=!0):(n[0]=d,n[1]=h,k=!0)),-C===S?a>r?(n[2]=v,n[3]=b,T=!0):(n[2]=y,n[3]=m,T=!0):C===S&&(a>r?(n[2]=g,n[3]=m,T=!0):(n[2]=x,n[3]=b,T=!0)),k&&T)return!1;if(r>a?i>o?(A=this.getCardinalDirection(_,S,4),N=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-_,S,3),N=this.getCardinalDirection(-C,S,1)):i>o?(A=this.getCardinalDirection(-_,S,1),N=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(_,S,2),N=this.getCardinalDirection(C,S,4)),!k)switch(A){case 1:O=l,I=r+-f/S,n[0]=I,n[1]=O;break;case 2:I=d,O=i+p*S,n[0]=I,n[1]=O;break;case 3:O=h,I=r+f/S,n[0]=I,n[1]=O;break;case 4:I=u,O=i+-p*S,n[0]=I,n[1]=O}if(!T)switch(N){case 1:M=m,L=a+-E/S,n[2]=L,n[3]=M;break;case 2:L=x,M=o+w*S,n[2]=L,n[3]=M;break;case 3:M=b,L=a+E/S,n[2]=L,n[3]=M;break;case 4:L=v,M=o+-w*S,n[2]=L,n[3]=M}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,c,u,h,d=e.x,p=e.y,f=t.x,g=t.y,m=n.x,y=n.y,v=i.x,b=i.y;return 0===(h=(a=g-p)*(l=m-v)-(o=b-y)*(s=d-f))?null:new r((s*(u=v*y-m*b)-l*(c=f*p-d*g))/h,(o*c-a*u)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(c[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);var h=u.getEdges();for(a=0;a-1&&c.splice(g,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(h,1),u.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}})}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){var r=n(15),i=n(7),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in l.prototype=Object.create(r.prototype),r)l[c]=r[c];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||c>=s[0].length))for(var u=0;ue}}]),e}();e.exports=a},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n0&&(o=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(o,h,n))}},h.prototype.stop=function(){return this.stopped=!0,this};var p=function(e){e("layout","cose-bilkent",h)};"undefined"!=typeof cytoscape&&p(cytoscape),e.exports=p}])},JWe.exports=ZWe(function(){return QWe?eVe.exports:(QWe=1,e=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(u.WORLD_CENTER_X-o.x/2,u.WORLD_CENTER_Y-o.y/2))},v.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var y=m[0];m.splice(0,1);var b=u.indexOf(y);b>=0&&u.splice(b,1),f--,h--}d=null!=t?(u.indexOf(m[0])+1)%f:0;for(var x=Math.abs(r-n)/h,w=d;p!=h;w=++w%f){var E=u[w].getOtherEnd(e);if(E!=t){var k=(n+p*x)%360,T=(k+x)%360;v.branchRadialLayout(E,e,k,T,i+a,a),p++}}},v.maxDiagonalInTree=function(e){for(var t=f.MIN_VALUE,n=0;nt&&(t=r)}return t},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},v.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},v.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},v.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rl&&(l=u.rect.height)}n+=l+e.verticalPadding}},v.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},v.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:e.rect.width*e.rect.height0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},v.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},v.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a,o,s=0;return e.rowHeight[r]0&&(s=n+e.verticalPadding-e.rowHeight[r]),a=e.width-i>=t+e.horizontalPadding?(e.height+s)/(i+t+e.horizontalPadding):(e.height+s)/e.width,s=n+e.verticalPadding,(o=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var u=i;u<=a;u++)l[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a0)for(u=o;u<=s;u++)l[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var h,d,p=f.MAX_VALUE,g=0;g2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},v=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:return e.getLogger().trace("Found comment",t.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return e.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace("end icon"),this.popState();break;case 10:return e.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return e.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16: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 24:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 27:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return e.getLogger().trace("Long description:",t.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 e}();function b(){this.yy={}}return y.lexer=v,JH(b,"Parser"),b.prototype=y,y.Parser=b,new b}();iVe.parser=iVe;var aVe=iVe,oVe=[],sVe=0,lVe={},cVe=JH(()=>{oVe=[],sVe=0,lVe={}},"clear"),uVe=JH(function(e){for(let t=oVe.length-1;t>=0;t--)if(oVe[t].leveloVe.length>0?oVe[0]:null,"getMindmap"),dVe=JH((e,t,n,r)=>{nU.info("addNode",e,t,n,r);const i=YG();let a=i.mindmap?.padding??MU.mindmap.padding;switch(r){case pVe.ROUNDED_RECT:case pVe.RECT:case pVe.HEXAGON:a*=2}const o={id:sVe++,nodeId:oG(t,i),level:e,descr:oG(n,i),type:r,children:[],width:i.mindmap?.maxNodeWidth??MU.mindmap.maxNodeWidth,padding:a},s=uVe(e);if(s)s.children.push(o),oVe.push(o);else{if(0!==oVe.length)throw new Error('There can be only one root. No parent could be found for ("'+o.descr+'")');oVe.push(o)}},"addNode"),pVe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},fVe=JH((e,t)=>{switch(nU.debug("In get type",e,t),e){case"[":return pVe.RECT;case"(":return")"===t?pVe.ROUNDED_RECT:pVe.CLOUD;case"((":return pVe.CIRCLE;case")":return pVe.CLOUD;case"))":return pVe.BANG;case"{{":return pVe.HEXAGON;default:return pVe.DEFAULT}},"getType"),gVe=JH((e,t)=>{lVe[e]=t},"setElementForId"),mVe=JH(e=>{if(!e)return;const t=YG(),n=oVe[oVe.length-1];e.icon&&(n.icon=oG(e.icon,t)),e.class&&(n.class=oG(e.class,t))},"decorateNode"),yVe=JH(e=>{switch(e){case pVe.DEFAULT:return"no-border";case pVe.RECT:return"rect";case pVe.ROUNDED_RECT:return"rounded-rect";case pVe.CIRCLE:return"circle";case pVe.CLOUD:return"cloud";case pVe.BANG:return"bang";case pVe.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),vVe=JH(()=>nU,"getLogger"),bVe=JH(e=>lVe[e],"getElementById"),xVe={clear:cVe,addNode:dVe,getMindmap:hVe,nodeType:pVe,getType:fVe,setElementForId:gVe,decorateNode:mVe,type2Str:yVe,getLogger:vVe,getElementById:bVe},wVe=JH(function(e,t,n,r){t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 ${n.height-5} v${10-n.height} q0,-5 5,-5 h${n.width-10} q5,0 5,5 v${n.height-5} H0 Z`),t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",n.height).attr("x2",n.width).attr("y2",n.height)},"defaultBkg"),EVe=JH(function(e,t,n){t.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("height",n.height).attr("width",n.width)},"rectBkg"),kVe=JH(function(e,t,n){const r=n.width,i=n.height,a=.15*r,o=.25*r,s=.35*r,l=.2*r;t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*r},${-1*r*.1}\n a${s},${s} 1 0,1 ${.4*r},${-1*r*.1}\n a${o},${o} 1 0,1 ${.35*r},${1*r*.2}\n\n a${a},${a} 1 0,1 ${.15*r},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*r*.15},${1*i*.65}\n\n a${o},${a} 1 0,1 ${-1*r*.25},${.15*r}\n a${s},${s} 1 0,1 ${-1*r*.5},0\n a${a},${a} 1 0,1 ${-1*r*.25},${-1*r*.15}\n\n a${a},${a} 1 0,1 ${-1*r*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*r},${-1*i*.65}\n\n H0 V0 Z`)},"cloudBkg"),TVe=JH(function(e,t,n){const r=n.width,i=n.height,a=.15*r;t.append("path").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*r},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},0\n a${a},${a} 1 0,0 ${.25*r},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*r},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*r*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*r*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},0\n a${a},${a} 1 0,0 ${-1*r*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*r*.1},${-1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${-1*i*.34}\n a${a},${a} 1 0,0 ${.1*r},${-1*i*.33}\n\n H0 V0 Z`)},"bangBkg"),_Ve=JH(function(e,t,n){t.append("circle").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("r",n.width/2)},"circleBkg");function CVe(e,t,n,r,i){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+(i.width-t)/2+", "+n+")")}JH(CVe,"insertPolygonShape");var SVe=JH(function(e,t,n){const r=n.height,i=r/4,a=n.width-n.padding+2*i;CVe(t,a,r,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-r/2},{x:a-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],n)},"hexagonBkg"),AVe=JH(function(e,t,n){t.append("rect").attr("id","node-"+n.id).attr("class","node-bkg node-"+e.type2Str(n.type)).attr("height",n.height).attr("rx",n.padding).attr("ry",n.padding).attr("width",n.width)},"roundedRectBkg"),NVe=JH(async function(e,t,n,r,i){const a=i.htmlLabels,o=r%11,s=t.append("g");n.section=o;let l="section-"+o;o<0&&(l+=" section-root"),s.attr("class",(n.class?n.class+" ":"")+"mindmap-node "+l);const c=s.append("g"),u=s.append("g"),h=n.descr.replace(/()/g,"\n");await y7(u,h,{useHtmlLabels:a,width:n.width,classes:"mindmap-node-label"},i),a||u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=u.node().getBBox(),[p]=P5(i.fontSize);if(n.height=d.height+1.1*p*.5+n.padding,n.width=d.width+2*n.padding,n.icon)if(n.type===e.nodeType.CIRCLE){n.height+=50,n.width+=50;s.append("foreignObject").attr("height","50px").attr("width",n.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+o+" "+n.icon),u.attr("transform","translate("+n.width/2+", "+(n.height/2-1.5*n.padding)+")")}else{n.width+=50;const e=n.height;n.height=Math.max(e,60);const t=Math.abs(n.height-e);s.append("foreignObject").attr("width","60px").attr("height",n.height).attr("style","text-align: center;margin-top:"+t/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+o+" "+n.icon),u.attr("transform","translate("+(25+n.width/2)+", "+(t/2+n.padding/2)+")")}else if(a){const e=(n.width-d.width)/2,t=(n.height-d.height)/2;u.attr("transform","translate("+e+", "+t+")")}else{const e=n.width/2,t=n.padding/2;u.attr("transform","translate("+e+", "+t+")")}switch(n.type){case e.nodeType.DEFAULT:wVe(e,c,n,o);break;case e.nodeType.ROUNDED_RECT:AVe(e,c,n,o);break;case e.nodeType.RECT:EVe(e,c,n,o);break;case e.nodeType.CIRCLE:c.attr("transform","translate("+n.width/2+", "+ +n.height/2+")"),_Ve(e,c,n,o);break;case e.nodeType.CLOUD:kVe(e,c,n,o);break;case e.nodeType.BANG:TVe(e,c,n,o);break;case e.nodeType.HEXAGON:SVe(e,c,n,o)}return e.setElementForId(n.id,s),n.height},"drawNode"),IVe=JH(function(e,t){const n=e.getElementById(t.id),r=t.x||0,i=t.y||0;n.attr("transform","translate("+r+","+i+")")},"positionNode");async function OVe(e,t,n,r,i){await NVe(e,t,n,r,i),n.children&&await Promise.all(n.children.map((n,a)=>OVe(e,t,n,r<0?a:r,i)))}function LVe(e,t){t.edges().map((t,n)=>{const r=t.data();if(t[0]._private.bodyBounds){const i=t[0]._private.rscratch;nU.trace("Edge: ",n,r),e.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+r.section+" edge-depth-"+r.depth)}})}function MVe(e,t,n,r){t.add({group:"nodes",data:{id:e.id.toString(),labelText:e.descr,height:e.height,width:e.width,level:r,nodeId:e.id,padding:e.padding,type:e.type},position:{x:e.x,y:e.y}}),e.children&&e.children.forEach(i=>{MVe(i,t,n,r+1),t.add({group:"edges",data:{id:`${e.id}_${i.id}`,source:e.id,target:i.id,depth:r,section:i.section}})})}function RVe(e,t){return new Promise(n=>{const r=TK("body").append("div").attr("id","cy").attr("style","display:none"),i=XWe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),MVe(e,i,t,0),i.nodes().forEach(function(e){e.layoutDimensions=()=>{const t=e.data();return{w:t.width,h:t.height}}}),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready(e=>{nU.info("Ready",e),n(i)})})}function DVe(e,t){t.nodes().map((t,n)=>{const r=t.data();r.x=t.position().x,r.y=t.position().y,IVe(e,r);const i=e.getElementById(r.nodeId);nU.info("Id:",n,"Position: (",t.position().x,", ",t.position().y,")",r),i.attr("transform",`translate(${t.position().x-r.width/2}, ${t.position().y-r.height/2})`),i.attr("attr",`apa-${n})`)})}XWe.use(rVe),JH(OVe,"drawNodes"),JH(LVe,"drawEdges"),JH(MVe,"addNodes"),JH(RVe,"layoutMindmap"),JH(DVe,"positionNodes");var PVe=JH(async(e,t,n,r)=>{nU.debug("Rendering mindmap diagram\n"+e);const i=r.db,a=i.getMindmap();if(!a)return;const o=YG();o.htmlLabels=!1;const s=Ite(t),l=s.append("g");l.attr("class","mindmap-edges");const c=s.append("g");c.attr("class","mindmap-nodes"),await OVe(i,c,a,-1,o);const u=await RVe(a,o);LVe(l,u),DVe(i,u),NG(void 0,s,o.mindmap?.padding??MU.mindmap.padding,o.mindmap?.useMaxWidth??MU.mindmap.useMaxWidth)},"draw"),$Ve={draw:PVe},BVe=JH(e=>{let t="";for(let t=0;t`\n .edge {\n stroke-width: 3;\n }\n ${BVe(e)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`,"getStyles")},zVe=Object.freeze({__proto__:null,diagram:FVe}),jVe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],c=[1,26],u=[1,24],h=[1,25],d=[6,7,11],p=[1,31],f=[6,7,11,24],g=[1,6,13,16,17,20,23],m=[1,35],y=[1,36],v=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:JH(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:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info("Node: ",a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace("Icon: ",a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace("Node: ",a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace("node found ..",a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace("node found ..",a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:c,7:u,10:23,11:h},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:s}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(f,[2,25]),e(f,[2,26]),e(f,[2,28],{20:[1,32]}),{21:[1,33]},{6:c,7:u,10:34,11:h},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(g,[2,14],{7:m,11:y}),e(v,[2,8]),e(v,[2,9]),e(v,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:b}),e(f,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:m,11:y}),e(v,[2,11]),e(v,[2,12]),e(d,[2,15],{24:b}),e(f,[2,30]),{22:[1,41]},e(f,[2,27]),e(f,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},w=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:return this.pushState("shapeData"),t.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return t.yytext=t.yytext.replace(n,"
    "),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return e.getLogger().trace("Found comment",t.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return e.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace("end icon"),this.popState();break;case 16:return e.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return e.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22: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 30:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 33:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return e.getLogger().trace("Long description:",t.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 e}();function E(){this.yy={}}return x.lexer=w,JH(E,"Parser"),E.prototype=x,x.Parser=E,new E}();jVe.parser=jVe;var HVe=jVe,UVe=[],GVe=[],qVe=0,WVe={},VVe=JH(()=>{UVe=[],GVe=[],qVe=0,WVe={}},"clear"),YVe=JH(e=>{if(0===UVe.length)return null;const t=UVe[0].level;let n=null;for(let e=UVe.length-1;e>=0;e--)if(UVe[e].level!==t||n||(n=UVe[e]),UVe[e].levele.parentId===r.id);for(const t of i){const i={id:t.id,parentId:r.id,label:oG(t.label??"",n),isGroup:!1,ticket:t?.ticket,priority:t?.priority,assigned:t?.assigned,icon:t?.icon,shape:"kanbanItem",level:t.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(i)}}return{nodes:e,edges:[],other:{},config:YG()}},"getData"),QVe=JH((e,t,n,r,i)=>{const a=YG();let o=a.mindmap?.padding??MU.mindmap.padding;switch(r){case ZVe.ROUNDED_RECT:case ZVe.RECT:case ZVe.HEXAGON:o*=2}const s={id:oG(t,a)||"kbn"+qVe++,level:e,label:oG(n,a),width:a.mindmap?.maxNodeWidth??MU.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(void 0!==i){let e;e=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const t=rY(e,{schema:nY});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes("_")))throw new Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&"kanbanItem"===t.shape&&(s.shape=t?.shape),t?.label&&(s.label=t?.label),t?.icon&&(s.icon=t?.icon.toString()),t?.assigned&&(s.assigned=t?.assigned.toString()),t?.ticket&&(s.ticket=t?.ticket.toString()),t?.priority&&(s.priority=t?.priority)}const l=YVe(e);l?s.parentId=l.id||"kbn"+qVe++:GVe.push(s),UVe.push(s)},"addNode"),ZVe={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},JVe=JH((e,t)=>{switch(nU.debug("In get type",e,t),e){case"[":return ZVe.RECT;case"(":return")"===t?ZVe.ROUNDED_RECT:ZVe.CLOUD;case"((":return ZVe.CIRCLE;case")":return ZVe.CLOUD;case"))":return ZVe.BANG;case"{{":return ZVe.HEXAGON;default:return ZVe.DEFAULT}},"getType"),eYe=JH((e,t)=>{WVe[e]=t},"setElementForId"),tYe=JH(e=>{if(!e)return;const t=YG(),n=UVe[UVe.length-1];e.icon&&(n.icon=oG(e.icon,t)),e.class&&(n.cssClasses=oG(e.class,t))},"decorateNode"),nYe=JH(e=>{switch(e){case ZVe.DEFAULT:return"no-border";case ZVe.RECT:return"rect";case ZVe.ROUNDED_RECT:return"rounded-rect";case ZVe.CIRCLE:return"circle";case ZVe.CLOUD:return"cloud";case ZVe.BANG:return"bang";case ZVe.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),rYe=JH(()=>nU,"getLogger"),iYe=JH(e=>WVe[e],"getElementById"),aYe={clear:VVe,addNode:QVe,getSections:XVe,getData:KVe,nodeType:ZVe,getType:JVe,setElementForId:eYe,decorateNode:tYe,type2Str:nYe,getLogger:rYe,getElementById:iYe},oYe=JH(async(e,t,n,r)=>{nU.debug("Rendering kanban diagram\n"+e);const i=r.db.getData(),a=YG();a.htmlLabels=!1;const o=Ite(t),s=o.append("g");s.attr("class","sections");const l=o.append("g");l.attr("class","items");const c=i.nodes.filter(e=>e.isGroup);let u=0;const h=[];let d=25;for(const e of c){const t=a?.kanban?.sectionWidth||200;u+=1,e.x=t*u+10*(u-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+u;const n=await W8(s,e);d=Math.max(d,n?.labelBBox?.height),h.push(n)}let p=0;for(const e of c){const t=h[p];p+=1;const n=a?.kanban?.sectionWidth||200,r=3*-n/2+d;let o=r;const s=i.nodes.filter(t=>t.parentId===e.id);for(const t of s){if(t.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");t.x=e.x,t.width=n-15;const r=(await Fee(l,t,{config:a})).node().getBBox();t.y=o+r.height/2,await Hee(t),o=t.y+r.height/2+5}const c=t.cluster.select("rect"),u=Math.max(o-r+30,50)+(d-25);c.attr("height",u)}NG(void 0,o,a.mindmap?.padding??MU.kanban.padding,a.mindmap?.useMaxWidth??MU.kanban.useMaxWidth)},"draw"),sYe={draw:oYe},lYe=JH(e=>{let t="";for(let t=0;te.darkMode?Uj(t,n):Hj(t,n),"adjuster");for(let r=0;r`\n .edge {\n stroke-width: 3;\n }\n ${lYe(e)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${e.textColor};\n fill: ${e.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`,"getStyles")},uYe=Object.freeze({__proto__:null,diagram:cYe});function hYe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function dYe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function pYe(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function fYe(e){return e.target.depth}function gYe(e,t){return e.sourceLinks.length?e.depth:t-1}function mYe(e){return function(){return e}}function yYe(e,t){return bYe(e.source,t.source)||e.index-t.index}function vYe(e,t){return bYe(e.target,t.target)||e.index-t.index}function bYe(e,t){return e.y0-t.y0}function xYe(e){return e.value}function wYe(e){return e.index}function EYe(e){return e.nodes}function kYe(e){return e.links}function TYe(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function _Ye({nodes:e}){for(const t of e){let e=t.y0,n=e;for(const n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(const e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function CYe(){let e,t,n,r=0,i=0,a=1,o=1,s=24,l=8,c=wYe,u=gYe,h=EYe,d=kYe,p=6;function f(){const f={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];const r=new Map(e.map((t,n)=>[c(t,n,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:i}=n;"object"!=typeof t&&(t=n.source=TYe(r,t)),"object"!=typeof i&&(i=n.target=TYe(r,i)),t.sourceLinks.push(n),i.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}(f),function({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(pYe(t.sourceLinks,xYe),pYe(t.targetLinks,xYe)):t.fixedValue}(f),function({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.depth=i;for(const{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}(f),function({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.height=i;for(const{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}(f),function(n){const c=function({nodes:e}){const n=hYe(e,e=>e.depth)+1,i=(a-r-s)/(n-1),o=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(u.call(null,t,n))));t.layer=e,t.x0=r+e*i,t.x1=t.x0+s,o[e]?o[e].push(t):o[e]=[t]}if(t)for(const e of o)e.sort(t);return o}(n);e=Math.min(l,(o-i)/(hYe(c,e=>e.length)-1)),function(t){const n=dYe(t,t=>(o-i-(t.length-1)*e)/pYe(t,xYe));for(const r of t){let t=i;for(const i of r){i.y0=t,i.y1=t+i.value*n,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*n}t=(o-t+e)/(r.length+1);for(let e=0;e0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,x(e)}void 0===t&&a.sort(bYe),y(a,r)}}function m(e,n,r){for(let i=e.length-2;i>=0;--i){const a=e[i];for(const e of a){let t=0,r=0;for(const{target:n,value:i}of e.sourceLinks){let a=i*(n.layer-e.layer);t+=k(e,n)*a,r+=a}if(!(r>0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,x(e)}void 0===t&&a.sort(bYe),y(a,r)}}function y(t,n){const r=t.length>>1,a=t[r];b(t,a.y0-e,r-1,n),v(t,a.y1+e,r+1,n),b(t,o,t.length-1,n),v(t,i,0,n)}function v(t,n,r,i){for(;r1e-6&&(a.y0+=o,a.y1+=o),n=a.y1+e}}function b(t,n,r,i){for(;r>=0;--r){const a=t[r],o=(a.y1-n)*i;o>1e-6&&(a.y0-=o,a.y1-=o),n=a.y0-e}}function x({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort(vYe);for(const{target:{targetLinks:t}}of e)t.sort(yYe)}}function w(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(vYe),n.sort(yYe)}function E(t,n){let r=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:a}of t.sourceLinks){if(i===n)break;r+=a+e}for(const{source:e,width:i}of n.targetLinks){if(e===t)break;r-=i}return r}function k(t,n){let r=n.y0-(n.targetLinks.length-1)*e/2;for(const{source:i,width:a}of n.targetLinks){if(i===t)break;r+=a+e}for(const{target:e,width:i}of t.sourceLinks){if(e===n)break;r-=i}return r}return f.update=function(e){return _Ye(e),e},f.nodeId=function(e){return arguments.length?(c="function"==typeof e?e:mYe(e),f):c},f.nodeAlign=function(e){return arguments.length?(u="function"==typeof e?e:mYe(e),f):u},f.nodeSort=function(e){return arguments.length?(t=e,f):t},f.nodeWidth=function(e){return arguments.length?(s=+e,f):s},f.nodePadding=function(t){return arguments.length?(l=e=+t,f):l},f.nodes=function(e){return arguments.length?(h="function"==typeof e?e:mYe(e),f):h},f.links=function(e){return arguments.length?(d="function"==typeof e?e:mYe(e),f):d},f.linkSort=function(e){return arguments.length?(n=e,f):n},f.size=function(e){return arguments.length?(r=i=0,a=+e[0],o=+e[1],f):[a-r,o-i]},f.extent=function(e){return arguments.length?(r=+e[0][0],a=+e[1][0],i=+e[0][1],o=+e[1][1],f):[[r,i],[a,o]]},f.iterations=function(e){return arguments.length?(p=+e,f):p},f}var SYe=Math.PI,AYe=2*SYe,NYe=1e-6,IYe=AYe-NYe;function OYe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function LYe(){return new OYe}function MYe(e){return function(){return e}}function RYe(e){return e[0]}function DYe(e){return e[1]}OYe.prototype=LYe.prototype={constructor:OYe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,c=a-e,u=o-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>NYe)if(Math.abs(u*s-l*c)>NYe&&i){var d=n-a,p=r-o,f=s*s+l*l,g=d*d+p*p,m=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((SYe-Math.acos((f+h-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>NYe&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*p)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,a){e=+e,t=+t,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+o,c=t+s,u=1^a,h=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>NYe||Math.abs(this._y1-c)>NYe)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%AYe+AYe),h>IYe?this._+="A"+n+","+n+",0,1,"+u+","+(e-o)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>NYe&&(this._+="A"+n+","+n+",0,"+ +(h>=SYe)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var PYe=Array.prototype.slice;function $Ye(e){return e.source}function BYe(e){return e.target}function FYe(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function zYe(){return function(e){var t=$Ye,n=BYe,r=RYe,i=DYe,a=null;function o(){var o,s=PYe.call(arguments),l=t.apply(this,s),c=n.apply(this,s);if(a||(a=o=LYe()),e(a,+r.apply(this,(s[0]=l,s)),+i.apply(this,s),+r.apply(this,(s[0]=c,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r="function"==typeof e?e:MYe(+e),o):r},o.y=function(e){return arguments.length?(i="function"==typeof e?e:MYe(+e),o):i},o.context=function(e){return arguments.length?(a=null==e?null:e,o):a},o}(FYe)}function jYe(e){return[e.source.x1,e.y0]}function HYe(e){return[e.target.x0,e.y1]}var UYe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,9],n=[1,10],r=[1,5,10,12],i={trace:JH(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:const e=r.findOrCreateNode(a[s-4].trim().replaceAll('""','"')),t=r.findOrCreateNode(a[s-2].trim().replaceAll('""','"')),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:t,20:n},{1:[2,6],7:11,10:[1,12]},e(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(r,[2,8]),e(r,[2,9]),{19:[1,16]},e(r,[2,11]),{1:[2,1]},{1:[2,5]},e(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:n},{15:18,16:7,17:8,18:t,20:n},{18:[1,19]},e(n,[2,3]),{12:[1,20]},e(r,[2,10]),{15:21,16:7,17:8,18:t,20:n},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},a=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:JH(function(e,t,n,r){switch(n){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},"anonymous"),rules:[/^(?:sankey-beta\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:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return e}();function o(){this.yy={}}return i.lexer=a,JH(o,"Parser"),o.prototype=i,i.Parser=o,new o}();UYe.parser=UYe;var GYe=UYe,qYe=[],WYe=[],VYe=new Map,YYe=JH(()=>{qYe=[],WYe=[],VYe=new Map,FG()},"clear"),XYe=class{constructor(e,t,n=0){this.source=e,this.target=t,this.value=n}static{JH(this,"SankeyLink")}},KYe=JH((e,t,n)=>{qYe.push(new XYe(e,t,n))},"addLink"),QYe=class{constructor(e){this.ID=e}static{JH(this,"SankeyNode")}},ZYe=JH(e=>{e=_G.sanitizeText(e,YG());let t=VYe.get(e);return void 0===t&&(t=new QYe(e),VYe.set(e,t),WYe.push(t)),t},"findOrCreateNode"),JYe=JH(()=>WYe,"getNodes"),eXe=JH(()=>qYe,"getLinks"),tXe=JH(()=>({nodes:WYe.map(e=>({id:e.ID})),links:qYe.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),"getGraph"),nXe={nodesMap:VYe,getConfig:JH(()=>YG().sankey,"getConfig"),getNodes:JYe,getLinks:eXe,getGraph:tXe,addLink:KYe,findOrCreateNode:ZYe,getAccTitle:jG,setAccTitle:zG,getAccDescription:UG,setAccDescription:HG,getDiagramTitle:qG,setDiagramTitle:GG,clear:YYe},rXe=class e{static{JH(this,"Uid")}static{this.count=0}static next(t){return new e(t+ ++e.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},iXe={left:function(e){return e.depth},right:function(e,t){return t-1-e.height},center:function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?dYe(e.sourceLinks,fYe)-1:0},justify:gYe},aXe=JH(function(e,t,n,r){const{securityLevel:i,sankey:a}=YG(),o=KG.sankey;let s;"sandbox"===i&&(s=TK("#i"+t));const l=TK("sandbox"===i?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${t}"]`):TK(`[id="${t}"]`),u=a?.width??o.width,h=a?.height??o.width,d=a?.useMaxWidth??o.useMaxWidth,p=a?.nodeAlignment??o.nodeAlignment,f=a?.prefix??o.prefix,g=a?.suffix??o.suffix,m=a?.showValues??o.showValues,y=r.db.getGraph(),v=iXe[p],b=CYe().nodeId(e=>e.id).nodeWidth(10).nodePadding(10+(m?15:0)).nodeAlign(v).extent([[0,0],[u,h]]);b(y);const x=cJ(P1);c.append("g").attr("class","nodes").selectAll(".node").data(y.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=rXe.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=>x(e.id));const w=JH(({id:e,value:t})=>m?`${e}\n${f}${Math.round(100*t)/100}${g}`:e,"getText");c.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(y.nodes).join("text").attr("x",e=>e.x0(e.y1+e.y0)/2).attr("dy",(m?"0":"0.35")+"em").attr("text-anchor",e=>e.x0(e.uid=rXe.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",e=>e.source.x1).attr("x2",e=>e.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",e=>x(e.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",e=>x(e.target.id))}let T;switch(k){case"gradient":T=JH(e=>e.uid,"coloring");break;case"source":T=JH(e=>x(e.source.id),"coloring");break;case"target":T=JH(e=>x(e.target.id),"coloring");break;default:T=k}E.append("path").attr("d",zYe().source(jYe).target(HYe)).attr("stroke",T).attr("stroke-width",e=>Math.max(1,e.width)),NG(void 0,c,0,d)},"draw"),oXe={draw:aXe},sXe=JH(e=>e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),lXe=JH(e=>`.label {\n font-family: ${e.fontFamily};\n }`,"getStyles"),cXe=GYe.parse.bind(GYe);GYe.parse=e=>cXe(sXe(e));var uXe={styles:lXe,parser:GYe,db:nXe,renderer:oXe},hXe=Object.freeze({__proto__:null,diagram:uXe}),dXe={packet:[]},pXe=structuredClone(dXe),fXe=MU.packet,gXe=JH(()=>{const e=$5({...fXe,...WU().packet});return e.showBits&&(e.paddingY+=10),e},"getConfig"),mXe=JH(()=>pXe.packet,"getPacket"),yXe={pushWord:JH(e=>{e.length>0&&pXe.packet.push(e)},"pushWord"),getPacket:mXe,getConfig:gXe,clear:JH(()=>{FG(),pXe=structuredClone(dXe)},"clear"),setAccTitle:zG,getAccTitle:jG,setDiagramTitle:GG,getDiagramTitle:qG,getAccDescription:UG,setAccDescription:HG},vXe=JH(e=>{Rhe(e,yXe);let t=-1,n=[],r=1;const{bitsPerRow:i}=yXe.getConfig();for(let{start:a,end:o,label:s}of e.blocks){if(o&&o{if(void 0===e.end&&(e.end=e.start),e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);return e.end+1<=t*n?[e,void 0]:[{start:e.start,end:t*n-1,label:e.label},{start:t*n,end:e.end,label:e.label}]},"getNextFittingBlock"),xXe={parse:JH(async e=>{const t=await Bke("packet",e);nU.debug(t),vXe(t)},"parse")},wXe=JH((e,t,n,r)=>{const i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:c}=a,u=i.getPacket(),h=i.getDiagramTitle(),d=o+s,p=d*(u.length+1)-(h?0:o),f=l*c+2,g=Ite(t);g.attr("viewbox",`0 0 ${f} ${p}`),AG(g,p,f,a.useMaxWidth);for(const[e,t]of u.entries())EXe(g,t,e,a);g.append("text").text(h).attr("x",f/2).attr("y",p-d/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),EXe=JH((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{const c=e.append("g"),u=n*(r+a)+a;for(const e of t){const t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(c.append("rect").attr("x",t).attr("y",u).attr("width",n).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",t+n/2).attr("y",u+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(e.label),!l)continue;const a=e.end===e.start,h=u-2;c.append("text").attr("x",t+(a?n/2:0)).attr("y",h).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",a?"middle":"start").text(e.start),a||c.append("text").attr("x",t+n).attr("y",h).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(e.end)}},"drawWord"),kXe={draw:wXe},TXe={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},_Xe=JH(({packet:e}={})=>{const t=$5(TXe,e);return`\n\t.packetByte {\n\t\tfont-size: ${t.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${t.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${t.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${t.labelColor};\n\t\tfont-size: ${t.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${t.titleColor};\n\t\tfont-size: ${t.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${t.blockStrokeColor};\n\t\tstroke-width: ${t.blockStrokeWidth};\n\t\tfill: ${t.blockFillColor};\n\t}\n\t`},"styles"),CXe={parser:xXe,db:yXe,renderer:kXe,styles:_Xe},SXe=Object.freeze({__proto__:null,diagram:CXe}),AXe={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},NXe={axes:[],curves:[],options:AXe},IXe=structuredClone(NXe),OXe=MU.radar,LXe=JH(()=>$5({...OXe,...WU().radar}),"getConfig"),MXe=JH(()=>IXe.axes,"getAxes"),RXe=JH(()=>IXe.curves,"getCurves"),DXe=JH(()=>IXe.options,"getOptions"),PXe=JH(e=>{IXe.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),$Xe=JH(e=>{IXe.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:BXe(e.entries)}))},"setCurves"),BXe=JH(e=>{if(null==e[0].axis)return e.map(e=>e.value);const t=MXe();if(0===t.length)throw new Error("Axes must be populated before curves for reference entries");return t.map(t=>{const n=e.find(e=>e.axis?.$refText===t.name);if(void 0===n)throw new Error("Missing entry for axis "+t.label);return n.value})},"computeCurveEntries"),FXe=JH(e=>{const t=e.reduce((e,t)=>(e[t.name]=t,e),{});IXe.options={showLegend:t.showLegend?.value??AXe.showLegend,ticks:t.ticks?.value??AXe.ticks,max:t.max?.value??AXe.max,min:t.min?.value??AXe.min,graticule:t.graticule?.value??AXe.graticule}},"setOptions"),zXe={getAxes:MXe,getCurves:RXe,getOptions:DXe,setAxes:PXe,setCurves:$Xe,setOptions:FXe,getConfig:LXe,clear:JH(()=>{FG(),IXe=structuredClone(NXe)},"clear"),setAccTitle:zG,getAccTitle:jG,setDiagramTitle:GG,getDiagramTitle:qG,getAccDescription:UG,setAccDescription:HG},jXe=JH(e=>{Rhe(e,zXe);const{axes:t,curves:n,options:r}=e;zXe.setAxes(t),zXe.setCurves(n),zXe.setOptions(r)},"populate"),HXe={parse:JH(async e=>{const t=await Bke("radar",e);nU.debug(t),jXe(t)},"parse")},UXe=JH((e,t,n,r)=>{const i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),c=i.getDiagramTitle(),u=Ite(t),h=GXe(u,l),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),p=s.min,f=Math.min(l.width,l.height)/2;qXe(h,a,f,s.ticks,s.graticule),WXe(h,a,f,l),VXe(h,a,o,p,d,s.graticule,l),KXe(h,o,s.showLegend,l),h.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),GXe=JH((e,t)=>{const n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i=t.marginLeft+t.width/2,a=t.marginTop+t.height/2;return e.attr("viewbox",`0 0 ${n} ${r}`).attr("width",n).attr("height",r),e.append("g").attr("transform",`translate(${i}, ${a})`)},"drawFrame"),qXe=JH((e,t,n,r,i)=>{if("circle"===i)for(let t=0;t{const n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(" ");e.append("polygon").attr("points",s).attr("class","radarGraticule")}}},"drawGraticule"),WXe=JH((e,t,n,r)=>{const i=t.length;for(let a=0;a{if(t.entries.length!==s)return;const c=t.entries.map((e,t)=>{const n=2*Math.PI*t/s-Math.PI/2,a=YXe(e,r,i,l);return{x:a*Math.cos(n),y:a*Math.sin(n)}});"circle"===a?e.append("path").attr("d",XXe(c,o.curveTension)).attr("class",`radarCurve-${n}`):"polygon"===a&&e.append("polygon").attr("points",c.map(e=>`${e.x},${e.y}`).join(" ")).attr("class",`radarCurve-${n}`)})}function YXe(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}function XXe(e,t){const n=e.length;let r=`M${e[0].x},${e[0].y}`;for(let i=0;i{const r=e.append("g").attr("transform",`translate(${i}, ${a+20*n})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${n}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(t.label)})}JH(VXe,"drawCurves"),JH(YXe,"relativeRadius"),JH(XXe,"closedRoundCurve"),JH(KXe,"drawLegend");var QXe={draw:UXe},ZXe=JH((e,t)=>{let n="";for(let r=0;r{const t=$5(TU(),WU().themeVariables);return{themeVariables:t,radarOptions:$5(t.radar,e)}},"buildRadarStyleOptions"),eKe=JH(({radar:e}={})=>{const{themeVariables:t,radarOptions:n}=JXe(e);return`\n\t.radarTitle {\n\t\tfont-size: ${t.fontSize};\n\t\tcolor: ${t.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${n.axisColor};\n\t\tstroke-width: ${n.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${n.axisLabelFontSize}px;\n\t\tcolor: ${n.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${n.graticuleColor};\n\t\tfill-opacity: ${n.graticuleOpacity};\n\t\tstroke: ${n.graticuleColor};\n\t\tstroke-width: ${n.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${n.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${ZXe(t,n)}\n\t`},"styles"),tKe={parser:HXe,db:zXe,renderer:QXe,styles:eKe},nKe=Object.freeze({__proto__:null,diagram:tKe}),rKe=function(){var e=JH(function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},"o"),t=[1,7],n=[1,13],r=[1,14],i=[1,15],a=[1,19],o=[1,16],s=[1,17],l=[1,18],c=[8,30],u=[8,21,28,29,30,31,32,40,44,47],h=[1,23],d=[1,24],p=[8,15,16,21,28,29,30,31,32,40,44,47],f=[8,15,16,21,27,28,29,30,31,32,40,44,47],g=[1,49],m={trace:JH(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,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList: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:49,$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:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"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],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:JH(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug("Rule: separator (NL) ");break;case 5:r.getLogger().debug("Rule: separator (Space) ");break;case 6:r.getLogger().debug("Rule: separator (EOF) ");break;case 7:r.getLogger().debug("Rule: hierarchy: ",a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug("Stop NL ");break;case 9:r.getLogger().debug("Stop EOF ");break;case 10:r.getLogger().debug("Stop NL2 ");break;case 11:r.getLogger().debug("Stop EOF2 ");break;case 12:r.getLogger().debug("Rule: statement: ",a[s]),"number"==typeof a[s].length?this.$=a[s]:this.$=[a[s]];break;case 13:r.getLogger().debug("Rule: statement #2: ",a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug("Rule: link: ",a[s],e),this.$={edgeTypeStr:a[s],label:""};break;case 15:r.getLogger().debug("Rule: LABEL link: ",a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:const t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:"space",label:"",width:t,children:[]};break;case 23:r.getLogger().debug("Rule: (nodeStatement link node) ",a[s-2],a[s-1],a[s]," typestr: ",a[s-1].edgeTypeStr);const i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+"-"+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:"edge",directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:"arrow_open"},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug("Rule: nodeStatement (node) ",a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug("APA123",this?this:"na"),r.getLogger().debug("COLUMNS: ",a[s]),this.$={type:"column-setting",columns:"auto"===a[s]?-1:parseInt(a[s])};break;case 27:r.getLogger().debug("Rule: id-block statement : ",a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:"composite",children:a[s-1]};break;case 28:r.getLogger().debug("Rule: blockStatement : ",a[s-2],a[s-1],a[s]);const o=r.generateId();this.$={id:o,type:"composite",label:"",children:a[s-1]};break;case 29:r.getLogger().debug("Rule: node (NODE_ID separator): ",a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug("Rule: dirList: ",a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug("Rule: dirList: ",a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug("Rule: nodeShapeNLabel: ",a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",a[s-3],a[s-2]," #3:",a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:"classDef",id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:"applyClass",id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:"applyStyles",id:a[s-1].trim(),stylesStr:a[s].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{8:[1,20]},e(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:t,28:n,29:r,31:i,32:a,40:o,44:s,47:l}),e(u,[2,16],{14:22,15:h,16:d}),e(u,[2,17]),e(u,[2,18]),e(u,[2,19]),e(u,[2,20]),e(u,[2,21]),e(u,[2,22]),e(p,[2,25],{27:[1,25]}),e(u,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(f,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(c,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},e(p,[2,24]),{11:37,13:4,14:22,15:h,16:d,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:n,29:r,31:i,32:a,40:o,44:s,47:l},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(f,[2,30]),{18:[1,43]},{18:[1,44]},e(p,[2,23]),{18:[1,45]},{30:[1,46]},e(u,[2,28]),e(u,[2,35]),e(u,[2,36]),e(u,[2,37]),e(u,[2,38]),{37:[1,47]},{34:48,35:g},{15:[1,50]},e(u,[2,27]),e(f,[2,33]),{39:[1,51]},{34:52,35:g,39:[2,31]},{32:[2,15]},e(f,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:JH(function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},"parseError"),parse:JH(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,c=0,u=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var g=h.options&&h.options.ranges;function m(){var e;return"number"!=typeof(e=r.pop()||h.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,JH(function(e){n.length=n.length-2*e,i.length=i.length-e,a.length=a.length-e},"popStack"),JH(m,"lex");for(var y,v,b,x,w,E,k,T,_={};;){if(v=n[n.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null==y&&(y=m()),b=o[v]&&o[v][y]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[v])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:f,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+y);switch(b[0]){case 1:n.push(y),i.push(h.yytext),a.push(h.yylloc),n.push(b[1]),y=null,c=h.yyleng,s=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(E=this.productions_[b[1]][1],_.$=i[i.length-E],_._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},g&&(_._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(_,[s,c,l,d.yy,b[1],i,a].concat(u))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(_.$),a.push(_._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},"parse")},y=function(){var e={EOF:1,parseError:JH(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:JH(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:JH(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:JH(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:JH(function(){return this._more=!0,this},"more"),reject:JH(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:JH(function(e){this.unput(this.match.slice(e))},"less"),pastInput:JH(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:JH(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:JH(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:JH(function(e,t){var n,r,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))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},"test_match"),next:JH(function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:JH(function(){var e=this.next();return e||this.lex()},"lex"),begin:JH(function(e){this.conditionStack.push(e)},"begin"),popState:JH(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:JH(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:JH(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:JH(function(e){this.begin(e)},"pushState"),stateStackSize:JH(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:JH(function(e,t,n,r){switch(n){case 0:return 10;case 1:return e.getLogger().debug("Found space-block"),31;case 2:return e.getLogger().debug("Found nl-block"),31;case 3:return e.getLogger().debug("Found space-block"),29;case 4:e.getLogger().debug(".",t.yytext);break;case 5:e.getLogger().debug("_",t.yytext);break;case 6:return 5;case 7:return t.yytext=-1,28;case 8:return t.yytext=t.yytext.replace(/columns\s+/,""),e.getLogger().debug("COLUMNS (LEX)",t.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:e.getLogger().debug("LEX: POPPING STR:",t.yytext),this.popState();break;case 14:return e.getLogger().debug("LEX: STR end:",t.yytext),"STR";case 15:return t.yytext=t.yytext.replace(/space\:/,""),e.getLogger().debug("SPACE NUM (LEX)",t.yytext),21;case 16:return t.yytext="1",e.getLogger().debug("COLUMNS (LEX)",t.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),e.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),e.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),e.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),e.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),e.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),e.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),e.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),e.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),e.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),e.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),e.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),e.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return e.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return e.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return e.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return e.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return e.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return e.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return e.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return e.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),e.getLogger().debug("LEX ARR START"),38;case 75:return e.getLogger().debug("Lex: NODE_ID",t.yytext),32;case 76:return e.getLogger().debug("Lex: EOF",t.yytext),8;case 79:return"NODE_DESCR";case 81:e.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:e.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return e.getLogger().debug("LEX: NODE_DESCR:",t.yytext),"NODE_DESCR";case 84:e.getLogger().debug("LEX POPPING"),this.popState();break;case 85:e.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (right): dir:",t.yytext),"DIR";case 87:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (left):",t.yytext),"DIR";case 88:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (x):",t.yytext),"DIR";case 89:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (y):",t.yytext),"DIR";case 90:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (up):",t.yytext),"DIR";case 91:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (down):",t.yytext),"DIR";case 92:return t.yytext="]>",e.getLogger().debug("Lex (ARROW_DIR end):",t.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 94:case 95:case 96:return e.getLogger().debug("Lex: LINK",t.yytext),15;case 97:case 98:case 99:return e.getLogger().debug("Lex: START_LINK",t.yytext),this.pushState("LLABEL"),16;case 101:return e.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 103:case 104:return this.popState(),e.getLogger().debug("Lex: LINK",t.yytext),15;case 105:return e.getLogger().debug("Lex: COLON",t.yytext),t.yytext=t.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return e}();function v(){this.yy={}}return m.lexer=y,JH(v,"Parser"),v.prototype=m,m.Parser=v,new v}();rKe.parser=rKe;var iKe=rKe,aKe=new Map,oKe=[],sKe=new Map,lKe="color",cKe="fill",uKe=YG(),hKe=new Map,dKe=JH(e=>_G.sanitizeText(e,uKe),"sanitizeText"),pKe=JH(function(e,t=""){let n=hKe.get(e);n||(n={id:e,styles:[],textStyles:[]},hKe.set(e,n)),null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(lKe).exec(e)){const e=t.replace(cKe,"bgFill").replace(lKe,cKe);n.textStyles.push(e)}n.styles.push(t)})},"addStyleClass"),fKe=JH(function(e,t=""){const n=aKe.get(e);null!=t&&(n.styles=t.split(","))},"addStyle2Node"),gKe=JH(function(e,t){e.split(",").forEach(function(e){let n=aKe.get(e);if(void 0===n){const t=e.trim();n={id:t,type:"na",children:[]},aKe.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},"setCssClass"),mKe=JH((e,t)=>{const n=e.flat(),r=[];for(const e of n)if(e.label&&(e.label=dKe(e.label)),"classDef"!==e.type)if("applyClass"!==e.type)if("applyStyles"!==e.type)if("column-setting"===e.type)t.columns=e.columns??-1;else if("edge"===e.type){const t=(sKe.get(e.id)??0)+1;sKe.set(e.id,t),e.id=t+"-"+e.id,oKe.push(e)}else{e.label||("composite"===e.type?e.label="":e.label=e.id);const t=aKe.get(e.id);if(void 0===t?aKe.set(e.id,e):("na"!==e.type&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&mKe(e.children,e),"space"===e.type){const t=e.width??1;for(let n=0;n{nU.debug("Clear called"),FG(),vKe={id:"root",type:"composite",children:[],columns:-1},aKe=new Map([["root",vKe]]),yKe=[],hKe=new Map,oKe=[],sKe=new Map},"clear");function xKe(e){switch(nU.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return nU.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function wKe(e){return nU.debug("typeStr2Type",e),"=="===e?"thick":"normal"}function EKe(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}JH(xKe,"typeStr2Type"),JH(wKe,"edgeTypeStr2Type"),JH(EKe,"edgeStrToEdgeData");var kKe=0,TKe=JH(()=>(kKe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+kKe),"generateId"),_Ke=JH(e=>{vKe.children=e,mKe(e,vKe),yKe=vKe.children},"setHierarchy"),CKe=JH(e=>{const t=aKe.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),SKe=JH(()=>[...aKe.values()],"getBlocksFlat"),AKe=JH(()=>yKe||[],"getBlocks"),NKe=JH(()=>oKe,"getEdges"),IKe=JH(e=>aKe.get(e),"getBlock"),OKe=JH(e=>{aKe.set(e.id,e)},"setBlock"),LKe=JH(()=>console,"getLogger"),MKe=JH(function(){return hKe},"getClasses"),RKe={getConfig:JH(()=>WU().block,"getConfig"),typeStr2Type:xKe,edgeTypeStr2Type:wKe,edgeStrToEdgeData:EKe,getLogger:LKe,getBlocksFlat:SKe,getBlocks:AKe,getEdges:NKe,setHierarchy:_Ke,getBlock:IKe,setBlock:OKe,getColumns:CKe,getClasses:MKe,clear:bKe,generateId:TKe},DKe=JH((e,t)=>{const n=Bj,r=n(e,"r"),i=n(e,"g"),a=n(e,"b");return $j(r,i,a,t)},"fade"),PKe=JH(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${DKe(e.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${DKe(e.mainBkg,.5)};\n fill: ${DKe(e.clusterBkg,.5)};\n stroke: ${DKe(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`,"getStyles"),$Ke=JH((e,t,n,r)=>{t.forEach(t=>{VKe[t](e,n,r)})},"insertMarkers"),BKe=JH((e,t,n)=>{nU.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),FKe=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),zKe=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),jKe=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),HKe=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),UKe=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),GKe=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),qKe=JH((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),WKe=JH((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),VKe={extension:BKe,composition:FKe,aggregation:zKe,dependency:jKe,lollipop:HKe,point:UKe,circle:GKe,cross:qKe,barb:WKe},YKe=$Ke,XKe=YG()?.block?.padding??8;function KKe(e,t){if(0===e||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(1===e)return{px:0,py:t};return{px:t%e,py:Math.floor(t/e)}}JH(KKe,"calculateBlockPosition");var QKe=JH(e=>{let t=0,n=0;for(const r of e.children){const{width:i,height:a,x:o,y:s}=r.size??{width:0,height:0,x:0,y:0};nU.debug("getMaxChildSize abc95 child:",r.id,"width:",i,"height:",a,"x:",o,"y:",s,r.type),"space"!==r.type&&(i>t&&(t=i/(e.widthInColumns??1)),a>n&&(n=a))}return{width:t,height:n}},"getMaxChildSize");function ZKe(e,t,n=0,r=0){nU.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"sieblingWidth",n),e?.size?.width||(e.size={width:n,height:r,x:0,y:0});let i=0,a=0;if(e.children?.length>0){for(const n of e.children)ZKe(n,t);const o=QKe(e);i=o.width,a=o.height,nU.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,a);for(const t of e.children)t.size&&(nU.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${i} ${a} ${JSON.stringify(t.size)}`),t.size.width=i*(t.widthInColumns??1)+XKe*((t.widthInColumns??1)-1),t.size.height=a,t.size.x=0,t.size.y=0,nU.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${i} maxHeight:${a}`));for(const n of e.children)ZKe(n,t,i,a);const s=e.columns??-1;let l=0;for(const t of e.children)l+=t.widthInColumns??1;let c=e.children.length;s>0&&s0?Math.min(e.children.length,s):e.children.length;if(t>0){const n=(h-t*XKe-XKe)/t;nU.debug("abc95 (growing to fit) width",e.id,h,e.size?.width,n);for(const t of e.children)t.size&&(t.size.width=n)}}e.size={width:h,height:d,x:0,y:0}}nU.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function JKe(e,t){nU.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const n=e.columns??-1;if(nU.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){const t=e?.children[0]?.size?.width??0,r=e.children.length*t+(e.children.length-1)*XKe;nU.debug("widthOfChildren 88",r,"posX");let i=0;nU.debug("abc91 block?.size?.x",e.id,e?.size?.x);let a=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-XKe,o=0;for(const t of e.children){const r=e;if(!t.size)continue;const{width:s,height:l}=t.size,{px:c,py:u}=KKe(n,i);if(u!=o&&(o=u,a=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-XKe,nU.debug("New row in layout for block",e.id," and child ",t.id,o)),nU.debug(`abc89 layout blocks (child) id: ${t.id} Pos: ${i} (px, py) ${c},${u} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${s}${XKe}`),r.size){const e=s/2;t.size.x=a+XKe+e,nU.debug(`abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${a} new startingPosX${t.size.x} ${e} padding=${XKe} width=${s} halfWidth=${e} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${s*(t?.widthInColumns??1)/2}`),a=t.size.x+e,t.size.y=r.size.y-r.size.height/2+u*(l+XKe)+l/2+XKe,nU.debug(`abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${a}${XKe}${e}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${s*(t?.widthInColumns??1)/2}`)}t.children&&JKe(t),i+=t?.widthInColumns??1,nU.debug("abc88 columnsPos",t,i)}}nU.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function eQe(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&"root"!==e.id){const{x:a,y:o,width:s,height:l}=e.size;a-s/2r&&(r=a+s/2),o+l/2>i&&(i=o+l/2)}if(e.children)for(const a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=eQe(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}function tQe(e){const t=e.getBlock("root");if(!t)return;ZKe(t,e,0,0),JKe(t),nU.debug("getBlocks",JSON.stringify(t,null,2));const{minX:n,minY:r,maxX:i,maxY:a}=eQe(t);return{x:n,y:r,width:i-n,height:a-r}}function nQe(e,t){t&&e.attr("style",t)}function rQe(e){const t=TK(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=t.append("xhtml:div"),r=e.label,i=e.isNode?"nodeLabel":"edgeLabel",a=n.append("span");return a.html(r),nQe(a,e.labelStyle),a.attr("class",i),nQe(n,e.labelStyle),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}JH(ZKe,"setBlockSizes"),JH(JKe,"layoutBlocks"),JH(eQe,"findBounds"),JH(tQe,"layout"),JH(nQe,"applyStyle"),JH(rQe,"addHtmlLabel");var iQe=JH((e,t,n,r)=>{let i=e||"";if("object"==typeof i&&(i=i[0]),pG(YG().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),nU.debug("vertexText"+i);return rQe({isNode:r,label:m7(z5(i)),labelStyle:t.replace("fill:","color:")})}{const e=document.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",t.replace("color:","fill:"));let r=[];r="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(const t of r){const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),n?r.setAttribute("class","title-row"):r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)}return e}},"createLabel"),aQe=iQe,oQe=JH((e,t,n,r,i)=>{t.arrowTypeStart&&lQe(e,"start",t.arrowTypeStart,n,r,i),t.arrowTypeEnd&&lQe(e,"end",t.arrowTypeEnd,n,r,i)},"addEdgeMarkers"),sQe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},lQe=JH((e,t,n,r,i,a)=>{const o=sQe[n];if(!o)return void nU.warn(`Unknown arrow type: ${n}`);const s="start"===t?"Start":"End";e.attr(`marker-${t}`,`url(${r}#${i}_${a}-${o}${s})`)},"addEdgeMarker"),cQe={},uQe={},hQe=JH((e,t)=>{const n=YG(),r=pG(n.flowchart.htmlLabels),i="markdown"===t.labelType?y7(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0},n):aQe(t.label,t.labelStyle),a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label");o.node().appendChild(i);let s,l=i.getBBox();if(r){const e=i.children[0],t=TK(i);l=e.getBoundingClientRect(),t.attr("width",l.width),t.attr("height",l.height)}if(o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),cQe[t.id]=a,t.width=l.width,t.height=l.height,t.startLabelLeft){const n=aQe(t.startLabelLeft,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),uQe[t.id]||(uQe[t.id]={}),uQe[t.id].startLeft=r,dQe(s,t.startLabelLeft)}if(t.startLabelRight){const n=aQe(t.startLabelRight,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=r.node().appendChild(n),i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),uQe[t.id]||(uQe[t.id]={}),uQe[t.id].startRight=r,dQe(s,t.startLabelRight)}if(t.endLabelLeft){const n=aQe(t.endLabelLeft,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),uQe[t.id]||(uQe[t.id]={}),uQe[t.id].endLeft=r,dQe(s,t.endLabelLeft)}if(t.endLabelRight){const n=aQe(t.endLabelRight,t.labelStyle),r=e.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner");s=i.node().appendChild(n);const a=n.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),r.node().appendChild(n),uQe[t.id]||(uQe[t.id]={}),uQe[t.id].endRight=r,dQe(s,t.endLabelRight)}return i},"insertEdgeLabel");function dQe(e,t){YG().flowchart.htmlLabels&&e&&(e.style.width=9*t.length+"px",e.style.height="12px")}JH(dQe,"setTerminalWidth");var pQe=JH((e,t)=>{nU.debug("Moving label abc88 ",e.id,e.label,cQe[e.id],t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=YG(),{subGraphTitleTotalMargin:i}=lY(r);if(e.label){const r=cQe[e.id];let a=e.x,o=e.y;if(n){const r=B5.calcLabelPosition(n);nU.debug("Moving label "+e.label+" from (",a,",",o,") to (",r.x,",",r.y,") abc88"),t.updatedPath&&(a=r.x,o=r.y)}r.attr("transform",`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){const t=uQe[e.id].startLeft;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.startLabelRight){const t=uQe[e.id].startRight;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelLeft){const t=uQe[e.id].endLeft;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}if(e.endLabelRight){const t=uQe[e.id].endRight;let r=e.x,i=e.y;if(n){const t=B5.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);r=t.x,i=t.y}t.attr("transform",`translate(${r}, ${i})`)}},"positionEdgeLabel"),fQe=JH((e,t)=>{const n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},"outsideNode"),gQe=JH((e,t,n)=>{nU.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(t)}\n insidePoint : ${JSON.stringify(n)}\n node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2;let s=n.xMath.abs(r-t.x)*l){let e=n.y{nU.debug("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(fQe(t,e)||i)r=e,i||n.push(e);else{const a=gQe(t,r,e);let o=!1;n.forEach(e=>{o=o||e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)||n.push(a),i=!0}}),n},"cutPathAtIntersect"),yQe=JH(function(e,t,n,r,i,a,o){let s=n.points;nU.debug("abc88 InsertEdge: edge=",n,"e=",t);let l=!1;const c=a.node(t.v);var u=a.node(t.w);u?.intersect&&c?.intersect&&(s=s.slice(1,n.points.length-1),s.unshift(c.intersect(s[0])),s.push(u.intersect(s[s.length-1]))),n.toCluster&&(nU.debug("to cluster abc88",r[n.toCluster]),s=mQe(n.points,r[n.toCluster].node),l=!0),n.fromCluster&&(nU.debug("from cluster abc88",r[n.fromCluster]),s=mQe(s.reverse(),r[n.fromCluster].node).reverse(),l=!0);const h=s.filter(e=>!Number.isNaN(e.y));let d=v2;!n.curve||"graph"!==i&&"flowchart"!==i||(d=n.curve);const{x:p,y:f}=sY(n),g=c2().x(p).y(f).curve(d);let m;switch(n.thickness){case"normal":m="edge-thickness-normal";break;case"thick":case"invisible":m="edge-thickness-thick";break;default:m=""}switch(n.pattern){case"solid":m+=" edge-pattern-solid";break;case"dotted":m+=" edge-pattern-dotted";break;case"dashed":m+=" edge-pattern-dashed"}const y=e.append("path").attr("d",g(h)).attr("id",n.id).attr("class"," "+m+(n.classes?" "+n.classes:"")).attr("style",n.style);let v="";(YG().flowchart.arrowMarkerAbsolute||YG().state.arrowMarkerAbsolute)&&(v=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,v=v.replace(/\(/g,"\\("),v=v.replace(/\)/g,"\\)")),oQe(y,n,v,o,i);let b={};return l&&(b.updatedPath=s),b.originalPath=n.points,b},"insertEdge"),vQe=JH(e=>{const t=new Set;for(const n of e)switch(n){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(n)}return t},"expandAndDeduplicateDirections"),bQe=JH((e,t,n)=>{const r=vQe(e),i=t.height+2*n.padding,a=i/2,o=t.width+2*a+n.padding,s=n.padding/2;return r.has("right")&&r.has("left")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:a,y:0},{x:o/2,y:2*s},{x:o-a,y:0},{x:o,y:0},{x:o,y:-i/3},{x:o+2*s,y:-i/2},{x:o,y:-2*i/3},{x:o,y:-i},{x:o-a,y:-i},{x:o/2,y:-i-2*s},{x:a,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*s,y:-i/2},{x:0,y:-i/3}]:r.has("right")&&r.has("left")&&r.has("up")?[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}]:r.has("right")&&r.has("left")&&r.has("down")?[{x:0,y:0},{x:a,y:-i},{x:o-a,y:-i},{x:o,y:0}]:r.has("right")&&r.has("up")&&r.has("down")?[{x:0,y:0},{x:o,y:-a},{x:o,y:-i+a},{x:0,y:-i}]:r.has("left")&&r.has("up")&&r.has("down")?[{x:o,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:o,y:-i}]:r.has("right")&&r.has("left")?[{x:a,y:0},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")&&r.has("down")?[{x:o/2,y:0},{x:0,y:-s},{x:a,y:-s},{x:a,y:-i+s},{x:0,y:-i+s},{x:o/2,y:-i},{x:o,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s},{x:o,y:-s}]:r.has("right")&&r.has("up")?[{x:0,y:0},{x:o,y:-a},{x:0,y:-i}]:r.has("right")&&r.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-i}]:r.has("left")&&r.has("up")?[{x:o,y:0},{x:0,y:-a},{x:o,y:-i}]:r.has("left")&&r.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-i}]:r.has("right")?[{x:a,y:-s},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i+s}]:r.has("left")?[{x:a,y:0},{x:a,y:-s},{x:o-a,y:-s},{x:o-a,y:-i+s},{x:a,y:-i+s},{x:a,y:-i},{x:0,y:-i/2}]:r.has("up")?[{x:a,y:-s},{x:a,y:-i+s},{x:0,y:-i+s},{x:o/2,y:-i},{x:o,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s}]:r.has("down")?[{x:o/2,y:0},{x:0,y:-s},{x:a,y:-s},{x:a,y:-i+s},{x:o-a,y:-i+s},{x:o-a,y:-s},{x:o,y:-s}]:[{x:0,y:0}]},"getArrowPoints");function xQe(e,t){return e.intersect(t)}JH(xQe,"intersectNode");var wQe=xQe;function EQe(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,l=Math.sqrt(t*t*s*s+n*n*o*o),c=Math.abs(t*n*o/l);r.x0}JH(CQe,"intersectLine"),JH(SQe,"sameSign");var AQe=CQe,NQe=IQe;function IQe(e,t,n){var r=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof t.forEach?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));for(var l=r-e.width/2-o,c=i-e.height/2-s,u=0;u1&&a.sort(function(e,t){var r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,l=Math.sqrt(o*o+s*s);return a{var n,r,i=e.x,a=e.y,o=t.x-i,s=t.y-a,l=e.width/2,c=e.height/2;return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),n=0===s?0:c*o/s,r=c):(o<0&&(l=-l),n=l,r=0===o?0:l*s/o),{x:i+n,y:a+r}},"intersectRect"),LQe={node:wQe,circle:_Qe,ellipse:kQe,polygon:NQe,rect:OQe},MQe=JH(async(e,t,n,r)=>{const i=YG();let a;const o=t.useHtmlLabels||pG(i.flowchart.htmlLabels);a=n||"node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=s.insert("g").attr("class","label").attr("style",t.labelStyle);let c;c=void 0===t.labelText?"":"string"==typeof t.labelText?t.labelText:t.labelText[0];const u=l.node();let h;h="markdown"===t.labelType?y7(l,oG(z5(c),i),{useHtmlLabels:o,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(aQe(oG(z5(c),i),t.labelStyle,!1,r));let d=h.getBBox();const p=t.padding/2;if(pG(i.flowchart.htmlLabels)){const e=h.children[0],t=TK(h),n=e.getElementsByTagName("img");if(n){const e=""===c.replace(/]*>/g,"").trim();await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",e){const e=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,n=5,r=parseInt(e,10)*n+"px";t.style.minWidth=r,t.style.maxWidth=r}else t.style.width="100%";n(t)}JH(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}d=e.getBoundingClientRect(),t.attr("width",d.width),t.attr("height",d.height)}return o?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:p,label:l}},"labelHelper"),RQe=JH((e,t)=>{const n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds");function DQe(e,t,n,r){return e.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+n/2+")")}JH(DQe,"insertPolygonShape");var PQe=JH(async(e,t)=>{t.useHtmlLabels||YG().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:n,bbox:r,halfPadding:i}=await MQe(e,t,"node "+t.classes,!0);nU.info("Classes = ",t.classes);const a=n.insert("rect",":first-child");return a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-r.width/2-i).attr("y",-r.height/2-i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),RQe(t,a),t.intersect=function(e){return LQe.rect(t,e)},n},"note"),$Qe=PQe,BQe=JH(e=>e?" "+e:"","formatClass"),FQe=JH((e,t)=>`${t||"node default"}${BQe(e.classes)} ${BQe(e.class)}`,"getClassesFromNode"),zQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding+(r.height+t.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];nU.info("Question main (Circle)");const o=DQe(n,i,i,a);return o.attr("style",t.style),RQe(t,o),t.intersect=function(e){return nU.warn("Intersect called"),LQe.polygon(t,a,e)},n},"question"),jQe=JH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=n.insert("polygon",":first-child").attr("points",r.map(function(e){return e.x+","+e.y}).join(" "));return i.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(e){return LQe.circle(t,14,e)},n},"choice"),HQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.height+t.padding,a=i/4,o=r.width+2*a+t.padding,s=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=DQe(n,o,i,s);return l.attr("style",t.style),RQe(t,l),t.intersect=function(e){return LQe.polygon(t,s,e)},n},"hexagon"),UQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,void 0,!0),i=r.height+2*t.padding,a=i/2,o=r.width+2*a+t.padding,s=bQe(t.directions,r,t),l=DQe(n,o,i,s);return l.attr("style",t.style),RQe(t,l),t.intersect=function(e){return LQe.polygon(t,s,e)},n},"block_arrow"),GQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return DQe(n,i,a,o).attr("style",t.style),t.width=i+a,t.height=a,t.intersect=function(e){return LQe.polygon(t,o,e)},n},"rect_left_inv_arrow"),qQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"lean_right"),WQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"lean_left"),VQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"trapezoid"),YQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"inv_trapezoid"),XQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"rect_right_inv_arrow"),KQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=i/2,o=a/(2.5+i/50),s=r.height+o+t.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+i+" 0 a "+a+","+o+" 0,0,0 "+-i+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+i+" 0 l 0,"+-s,c=n.attr("label-offset-y",o).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(s/2+o)+")");return RQe(t,c),t.intersect=function(e){const n=LQe.rect(t,e),r=n.x-t.x;if(0!=a&&(Math.abs(r)t.height/2-o)){let i=o*o*(1-r*r/(a*a));0!=i&&(i=Math.sqrt(i)),i=o-i,e.y-t.y>0&&(i=-i),n.y+=i}return n},n},"cylinder"),QQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await MQe(e,t,"node "+t.classes+" "+t.class,!0),a=n.insert("rect",":first-child"),o=t.positioned?t.width:r.width+t.padding,s=t.positioned?t.height:r.height+t.padding,l=t.positioned?-o/2:-r.width/2-i,c=t.positioned?-s/2:-r.height/2-i;if(a.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",c).attr("width",o).attr("height",s),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(eZe(a,t.props.borders,o,s),e.delete("borders")),e.forEach(e=>{nU.warn(`Unknown node property ${e}`)})}return RQe(t,a),t.intersect=function(e){return LQe.rect(t,e)},n},"rect"),ZQe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await MQe(e,t,"node "+t.classes,!0),a=n.insert("rect",":first-child"),o=t.positioned?t.width:r.width+t.padding,s=t.positioned?t.height:r.height+t.padding,l=t.positioned?-o/2:-r.width/2-i,c=t.positioned?-s/2:-r.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",c).attr("width",o).attr("height",s),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(eZe(a,t.props.borders,o,s),e.delete("borders")),e.forEach(e=>{nU.warn(`Unknown node property ${e}`)})}return RQe(t,a),t.intersect=function(e){return LQe.rect(t,e)},n},"composite"),JQe=JH(async(e,t)=>{const{shapeSvg:n}=await MQe(e,t,"label",!0);nU.trace("Classes = ",t.class);const r=n.insert("rect",":first-child");if(r.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),t.props){const e=new Set(Object.keys(t.props));t.props.borders&&(eZe(r,t.props.borders,0,0),e.delete("borders")),e.forEach(e=>{nU.warn(`Unknown node property ${e}`)})}return RQe(t,r),t.intersect=function(e){return LQe.rect(t,e)},n},"labelRect");function eZe(e,t,n,r){const i=[],a=JH(e=>{i.push(e,0)},"addBorder"),o=JH(e=>{i.push(0,e)},"skipBorder");t.includes("t")?(nU.debug("add top border"),a(n)):o(n),t.includes("r")?(nU.debug("add right border"),a(r)):o(r),t.includes("b")?(nU.debug("add bottom border"),a(n)):o(n),t.includes("l")?(nU.debug("add left border"),a(r)):o(r),e.attr("stroke-dasharray",i.join(" "))}JH(eZe,"applyNodePropertyBorders");var tZe=JH((e,t)=>{let n;n=t.classes?"node "+t.classes:"node default";const r=e.insert("g").attr("class",n).attr("id",t.domId||t.id),i=r.insert("rect",":first-child"),a=r.insert("line"),o=r.insert("g").attr("class","label"),s=t.labelText.flat?t.labelText.flat():t.labelText;let l="";l="object"==typeof s?s[0]:s,nU.info("Label text abc79",l,s,"object"==typeof s);const c=o.node().appendChild(aQe(l,t.labelStyle,!0,!0));let u={width:0,height:0};if(pG(YG().flowchart.htmlLabels)){const e=c.children[0],t=TK(c);u=e.getBoundingClientRect(),t.attr("width",u.width),t.attr("height",u.height)}nU.info("Text 2",s);const h=s.slice(1,s.length);let d=c.getBBox();const p=o.node().appendChild(aQe(h.join?h.join("
    "):h,t.labelStyle,!0,!0));if(pG(YG().flowchart.htmlLabels)){const e=p.children[0],t=TK(p);u=e.getBoundingClientRect(),t.attr("width",u.width),t.attr("height",u.height)}const f=t.padding/2;return TK(p).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+f+5)+")"),TK(c).attr("transform","translate( "+(u.width{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.height+t.padding,a=r.width+i/4+t.padding,o=n.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return RQe(t,o),t.intersect=function(e){return LQe.rect(t,e)},n},"stadium"),rZe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await MQe(e,t,FQe(t,void 0),!0),a=n.insert("circle",":first-child");return a.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),nU.info("Circle main"),RQe(t,a),t.intersect=function(e){return nU.info("Circle intersect",t,r.width/2+i,e),LQe.circle(t,r.width/2+i,e)},n},"circle"),iZe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await MQe(e,t,FQe(t,void 0),!0),a=n.insert("g",":first-child"),o=a.insert("circle"),s=a.insert("circle");return a.attr("class",t.class),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i+5).attr("width",r.width+t.padding+10).attr("height",r.height+t.padding+10),s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding),nU.info("DoubleCircle main"),RQe(t,o),t.intersect=function(e){return nU.info("DoubleCircle intersect",t,r.width/2+i+5,e),LQe.circle(t,r.width/2+i+5,e)},n},"doublecircle"),aZe=JH(async(e,t)=>{const{shapeSvg:n,bbox:r}=await MQe(e,t,FQe(t,void 0),!0),i=r.width+t.padding,a=r.height+t.padding,o=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],s=DQe(n,i,a,o);return s.attr("style",t.style),RQe(t,s),t.intersect=function(e){return LQe.polygon(t,o,e)},n},"subroutine"),oZe=JH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),RQe(t,r),t.intersect=function(e){return LQe.circle(t,7,e)},n},"start"),sZe=JH((e,t,n)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,a=10;"LR"===n&&(i=10,a=70);const o=r.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return RQe(t,o),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(e){return LQe.rect(t,e)},r},"forkJoin"),lZe=JH((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),r=n.insert("circle",":first-child"),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),RQe(t,i),t.intersect=function(e){return LQe.circle(t,7,e)},n},"end"),cZe=JH((e,t)=>{const n=t.padding/2;let r;r=t.classes?"node "+t.classes:"node default";const i=e.insert("g").attr("class",r).attr("id",t.domId||t.id),a=i.insert("rect",":first-child"),o=i.insert("line"),s=i.insert("line");let l=0,c=4;const u=i.insert("g").attr("class","label");let h=0;const d=t.classData.annotations?.[0],p=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",f=u.node().appendChild(aQe(p,t.labelStyle,!0,!0));let g=f.getBBox();if(pG(YG().flowchart.htmlLabels)){const e=f.children[0],t=TK(f);g=e.getBoundingClientRect(),t.attr("width",g.width),t.attr("height",g.height)}t.classData.annotations[0]&&(c+=g.height+4,l+=g.width);let m=t.classData.label;void 0!==t.classData.type&&""!==t.classData.type&&(YG().flowchart.htmlLabels?m+="<"+t.classData.type+">":m+="<"+t.classData.type+">");const y=u.node().appendChild(aQe(m,t.labelStyle,!0,!0));TK(y).attr("class","classTitle");let v=y.getBBox();if(pG(YG().flowchart.htmlLabels)){const e=y.children[0],t=TK(y);v=e.getBoundingClientRect(),t.attr("width",v.width),t.attr("height",v.height)}c+=v.height+4,v.width>l&&(l=v.width);const b=[];t.classData.members.forEach(e=>{const n=e.getDisplayDetails();let r=n.displayText;YG().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=u.node().appendChild(aQe(r,n.cssStyle?n.cssStyle:t.labelStyle,!0,!0));let a=i.getBBox();if(pG(YG().flowchart.htmlLabels)){const e=i.children[0],t=TK(i);a=e.getBoundingClientRect(),t.attr("width",a.width),t.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,b.push(i)}),c+=8;const x=[];if(t.classData.methods.forEach(e=>{const n=e.getDisplayDetails();let r=n.displayText;YG().flowchart.htmlLabels&&(r=r.replace(//g,">"));const i=u.node().appendChild(aQe(r,n.cssStyle?n.cssStyle:t.labelStyle,!0,!0));let a=i.getBBox();if(pG(YG().flowchart.htmlLabels)){const e=i.children[0],t=TK(i);a=e.getBoundingClientRect(),t.attr("width",a.width),t.attr("height",a.height)}a.width>l&&(l=a.width),c+=a.height+4,x.push(i)}),c+=8,d){let e=(l-g.width)/2;TK(f).attr("transform","translate( "+(-1*l/2+e)+", "+-1*c/2+")"),h=g.height+4}let w=(l-v.width)/2;return TK(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+h)+")"),h+=v.height+4,o.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+h).attr("y2",-c/2-n+8+h),h+=8,b.forEach(e=>{TK(e).attr("transform","translate( "+-l/2+", "+(-1*c/2+h+4)+")");const t=e?.getBBox();h+=(t?.height??0)+4}),h+=8,s.attr("class","divider").attr("x1",-l/2-n).attr("x2",l/2+n).attr("y1",-c/2-n+8+h).attr("y2",-c/2-n+8+h),h+=8,x.forEach(e=>{TK(e).attr("transform","translate( "+-l/2+", "+(-1*c/2+h)+")");const t=e?.getBBox();h+=(t?.height??0)+4}),a.attr("style",t.style).attr("class","outer title-state").attr("x",-l/2-n).attr("y",-c/2-n).attr("width",l+t.padding).attr("height",c+t.padding),RQe(t,a),t.intersect=function(e){return LQe.rect(t,e)},i},"class_box"),uZe={rhombus:zQe,composite:ZQe,question:zQe,rect:QQe,labelRect:JQe,rectWithTitle:tZe,choice:jQe,circle:rZe,doublecircle:iZe,stadium:nZe,hexagon:HQe,block_arrow:UQe,rect_left_inv_arrow:GQe,lean_right:qQe,lean_left:WQe,trapezoid:VQe,inv_trapezoid:YQe,rect_right_inv_arrow:XQe,cylinder:KQe,start:oZe,end:lZe,note:$Qe,subroutine:aZe,fork:sZe,join:sZe,class_box:cZe},hZe={},dZe=JH(async(e,t,n)=>{let r,i;if(t.link){let a;"sandbox"===YG().securityLevel?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a),i=await uZe[t.shape](r,t,n)}else i=await uZe[t.shape](e,t,n),r=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),hZe[t.id]=r,t.haveCallback&&hZe[t.id].attr("class",hZe[t.id].attr("class")+" clickable"),r},"insertNode"),pZe=JH(e=>{const t=hZe[e.id];nU.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-8)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode");function fZe(e,t,n=!1){const r=e;let i="default";(r?.classes?.length||0)>0&&(i=(r?.classes??[]).join(" ")),i+=" flowchart-label";let a,o=0,s="";switch(r.type){case"round":o=5,s="rect";break;case"composite":o=0,s="composite",a=0;break;case"square":case"group":default:s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"doublecircle":s="doublecircle"}const l=b5(r?.styles??[]),c=r.label,u=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:s,labelText:c,rx:o,ry:o,class:i,style:l.style,id:r.id,directions:r.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:n,intersect:void 0,type:r.type,padding:a??WU()?.block?.padding??0}}async function gZe(e,t,n){const r=fZe(t,0,!1);if("group"===r.type)return;const i=WU(),a=await dZe(e,r,{config:i}),o=a.node().getBBox(),s=n.getBlock(r.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},n.setBlock(s),a.remove()}async function mZe(e,t,n){const r=fZe(t,0,!0);if("space"!==n.getBlock(r.id).type){const n=WU();await dZe(e,r,{config:n}),t.intersect=r?.intersect,pZe(r)}}async function yZe(e,t,n,r){for(const i of t)await r(e,i,n),i.children&&await yZe(e,i.children,n,r)}async function vZe(e,t,n){await yZe(e,t,n,gZe)}async function bZe(e,t,n){await yZe(e,t,n,mZe)}async function xZe(e,t,n,r,i){const a=new Bse({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(const n of t)if(n.start&&n.end){const t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){const r=t.size,s=o.size,l=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}];yQe(e,{v:n.start,w:n.end,name:n.id},{...n,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),n.label&&(await hQe(e,{...n,label:n.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),pQe({...n,x:l[1].x,y:l[1].y},{originalPath:l}))}}}JH(fZe,"getNodeFromBlock"),JH(gZe,"calculateBlockSize"),JH(mZe,"insertBlockPositioned"),JH(yZe,"performOperations"),JH(vZe,"calculateBlockSizes"),JH(bZe,"insertBlocks"),JH(xZe,"insertEdges");var wZe,EZe,kZe=JH(function(e,t){return t.db.getClasses()},"getClasses"),TZe=JH(async function(e,t,n,r){const{securityLevel:i,block:a}=WU(),o=r.db;let s;"sandbox"===i&&(s=TK("#i"+t));const l=TK("sandbox"===i?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${t}"]`):TK(`[id="${t}"]`);YKe(c,["point","circle","cross"],r.type,t);const u=o.getBlocks(),h=o.getBlocksFlat(),d=o.getEdges(),p=c.insert("g").attr("class","block");await vZe(p,u,o);const f=tQe(o);if(await bZe(p,u,o),await xZe(p,d,h,o,t),f){const e=f,t=Math.max(1,Math.round(e.width/e.height*.125)),n=e.height+t+10,r=e.width+10,{useMaxWidth:i}=a;AG(c,n,r,!!i),nU.debug("Here Bounds",f,e),c.attr("viewBox",`${e.x-5} ${e.y-5} ${e.width+10} ${e.height+10}`)}},"draw"),_Ze={parser:iKe,db:RKe,renderer:{draw:TZe,getClasses:kZe},styles:PKe},CZe=Object.freeze({__proto__:null,diagram:_Ze}),SZe={exports:{}},AZe={exports:{}},NZe={exports:{}};function IZe(){return wZe||(wZe=1,function(e){!function(t,n){e.exports=n()}(0,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o},function(e,t,n){e.exports=function(e){this.vGraphObject=e}},function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(5);function c(e,t,n,o){null==n&&null==o&&(o=t),r.call(this,o),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new a(t.x,t.y,n.width,n.height):new a}for(var u in c.prototype=Object.create(r.prototype),r)c[u]=r[u];c.prototype.getEdges=function(){return this.edges},c.prototype.getChild=function(){return this.child},c.prototype.getOwner=function(){return this.owner},c.prototype.getWidth=function(){return this.rect.width},c.prototype.setWidth=function(e){this.rect.width=e},c.prototype.getHeight=function(){return this.rect.height},c.prototype.setHeight=function(e){this.rect.height=e},c.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},c.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},c.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},c.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},c.prototype.getRect=function(){return this.rect},c.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},c.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},c.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},c.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},c.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},c.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},c.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}}),t},c.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)}),t},c.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}}),e},c.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=c},function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),l=n(1),c=n(13),u=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(c,1),a.target!=a.source&&a.target.edges.splice(u,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l(e=c.getTop())&&(r=e),a>(t=c.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),u>(r=g.getTop())&&(u=r),h<(a=g.getBottom())&&(h=a)}var m=new c(s,u,l-s,h-u);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=m.x-o,this.right=m.x+m.width+o,this.top=m.y-o,this.bottom=m.y+m.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,u=-i.MAX_VALUE,h=e.length,d=0;d(t=p.getLeft())&&(o=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),u<(a=p.getBottom())&&(u=a)}return new c(o,l,s-o,u-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(ia)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(ra?(n[0]=u,n[1]=h,k=!0):(n[0]=c,n[1]=l,k=!0):_===S&&(r>a?(n[0]=s,n[1]=l,k=!0):(n[0]=d,n[1]=h,k=!0)),-C===S?a>r?(n[2]=v,n[3]=b,T=!0):(n[2]=y,n[3]=m,T=!0):C===S&&(a>r?(n[2]=g,n[3]=m,T=!0):(n[2]=x,n[3]=b,T=!0)),k&&T)return!1;if(r>a?i>o?(A=this.getCardinalDirection(_,S,4),N=this.getCardinalDirection(C,S,2)):(A=this.getCardinalDirection(-_,S,3),N=this.getCardinalDirection(-C,S,1)):i>o?(A=this.getCardinalDirection(-_,S,1),N=this.getCardinalDirection(-C,S,3)):(A=this.getCardinalDirection(_,S,2),N=this.getCardinalDirection(C,S,4)),!k)switch(A){case 1:O=l,I=r+-f/S,n[0]=I,n[1]=O;break;case 2:I=d,O=i+p*S,n[0]=I,n[1]=O;break;case 3:O=h,I=r+f/S,n[0]=I,n[1]=O;break;case 4:I=u,O=i+-p*S,n[0]=I,n[1]=O}if(!T)switch(N){case 1:M=m,L=a+-E/S,n[2]=L,n[3]=M;break;case 2:L=x,M=o+w*S,n[2]=L,n[3]=M;break;case 3:M=b,L=a+E/S,n[2]=L,n[3]=M;break;case 4:L=v,M=o+-w*S,n[2]=L,n[3]=M}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,c,u,h,d=e.x,p=e.y,f=t.x,g=t.y,m=n.x,y=n.y,v=i.x,b=i.y;return 0===(h=(a=g-p)*(l=m-v)-(o=b-y)*(s=d-f))?null:new r((s*(u=v*y-m*b)-l*(c=f*p-d*g))/h,(o*c-a*u)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var u=(-l+Math.sqrt(l*l-4*s*c))/(2*s),h=(-l-Math.sqrt(l*l-4*s*c))/(2*s);return u>=0&&u<=1?[u]:h>=0&&h<=1?[h]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(c[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);var h=u.getEdges();for(a=0;a-1&&c.splice(g,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(h,1),u.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}})}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){var r=n(15),i=n(4),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in l.prototype=Object.create(r.prototype),r)l[c]=r[c];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l,c=this.getGraphManager().getAllEdges(),u=0;ui.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||c>=s[0].length))for(var u=0;ue}}]),e}();e.exports=a},function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),a=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),s=0;s=0;S--)if(0!==this.s[S]){for(var A=S+1;A=0;D--){if(function(e,t){return e&&t}(D0;){var G=void 0,q=void 0;for(G=T-2;G>=-1&&-1!==G;G--)if(Math.abs(n[G])<=U+H*(Math.abs(this.s[G])+Math.abs(this.s[G+1]))){n[G]=0;break}if(G===T-2)q=4;else{var W=void 0;for(W=T-1;W>=G&&W!==G;W--){var V=(W!==T?Math.abs(n[W]):0)+(W!==G+1?Math.abs(n[W-1]):0);if(Math.abs(this.s[W])<=U+H*V){this.s[W]=0;break}}W===G?q=3:W===T-1?q=1:(q=2,G=W)}switch(G++,q){case 1:var Y=n[T-2];n[T-2]=0;for(var X=T-2;X>=G;X--){var K=r.hypot(this.s[X],Y),Q=this.s[X]/K,Z=Y/K;this.s[X]=K,X!==G&&(Y=-Z*n[X-1],n[X-1]=Q*n[X-1]);for(var J=0;J=this.s[G+1]);){var Te=this.s[G];if(this.s[G]=this.s[G+1],this.s[G+1]=Te,GMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),l=n(806),c=n(902),u=n(551).FDLayoutConstants,h=n(551).LayoutConstants,d=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,m=n(551).Integer,y=n(551).IGeometry,v=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},w.prototype.newNode=function(e){return new o(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return h.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=a)}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var c=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var h=new Map,d=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;h.has(t)?h.get(t).push(n):h.set(t,[n]),h.has(n)?h.get(n).push(t):h.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;d.has(r)?d.get(r).push(i):d.set(r,[i]),d.has(i)?d.get(i).push(r):d.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new x,a=new Set,o=0;return e.forEach(function(s,l){if(!a.has(l)){n[o]=[],r[o]=!1;var c=l;for(i.push(c),a.add(c),n[o].push(c);0!=i.length;)c=i.shift(),t.has(c)&&(r[o]=!0),e.get(c).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},f=p(h,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(d,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(h.WORLD_CENTER_X-o.x/2,h.WORLD_CENTER_Y-o.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var m=g[0];g.splice(0,1);var v=u.indexOf(m);v>=0&&u.splice(v,1),f--,h--}d=null!=t?(u.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/h,x=d;p!=h;x=++x%f){var E=u[x].getOtherEnd(e);if(E!=t){var k=(n+p*b)%360,T=(k+b)%360;w.branchRadialLayout(E,e,k,T,i+a,a),p++}}},w.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;ci?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}})},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=d.rect.height)}n+=u+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):"bottom"==i.labelPosVertical&&i.setHeight(o+i.labelHeight))}})},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var c,u=a/i,h=o/i,d=Math.pow(n-r,2)+4*(u+r)*(h+n)*i,p=(r-n+Math.sqrt(d))/(2*(u+r));t?(c=Math.ceil(p))==p&&c++:c=Math.floor(p);var f=c*(u+r)-r;return s>f&&(f=s),f+=2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,a=l.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},c=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=c;return o.idealRowWidth?(n=a)(e.id,t.id):n(e,t)});for(var u=0,h=0,d=0;d0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),o=e.width-a>=t+e.horizontalPadding?(e.height+l)/(a+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var h=i;h<=a;h++)c[0]+=this.grid[h][o-1].length+this.grid[h][o].length-1;if(a0)for(h=o;h<=s;h++)c[3]+=this.grid[i-1][h].length+this.grid[i][h].length-1;for(var d,p,f=m.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){"horizontal"==t?(h.set(e,l.has(e)?c[l.get(e)]:i.get(e)),a+=h.get(e)):(h.set(e,l.has(e)?u[l.get(e)]:i.get(e)),a+=h.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||h.set(e,a)})}else{var o=0;e.forEach(function(e){o+="horizontal"==t?l.has(e)?c[l.get(e)]:i.get(e):l.has(e)?u[l.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){h.set(e,o)})}});for(var f=function(){var r=p.shift();e.get(r).forEach(function(e){if(h.get(e.id)o&&(o=v),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw f}}var x=(r+o)/2-(a+s)/2,w=!0,E=!1,k=void 0;try{for(var T,_=e[Symbol.iterator]();!(w=(T=_.next()).done);w=!0){var C=T.value;h.set(C,h.get(C)+x)}}catch(e){E=!0,k=e}finally{try{!w&&_.return&&_.return()}finally{if(E)throw k}}})}return h},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?c[l.get(e.left)]-c[l.get(e.right)]>=0?t++:n++:u[l.get(e.top)]-u[l.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[c[l.get(e.nodeId)],u[l.get(e.nodeId)]]}),k=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return _.has(e)})),o=void 0;o=a.size>0?c[l.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){w[e]=[o,u[l.get(t)]],E[e]=[c[l.get(t)],u[l.get(t)]],e++})},a=0;a0?c[l.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){w[e]=[c[l.get(t)],a],E[e]=[c[l.get(t)],u[l.get(t)]],e++})},h=0;hN&&(N=A[O].length,I=O);if(N0){var V={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n,r,i={x:c[l.get(e.nodeId)],y:u[l.get(e.nodeId)]},a=e.position,o=(r=i,{x:(n=a).x-r.x,y:n.y-r.y});V.x+=o.x,V.y+=o.y}),V.x/=t.fixedNodeConstraint.length,V.y/=t.fixedNodeConstraint.length,c.forEach(function(e,t){c[t]+=V.x}),u.forEach(function(e,t){u[t]+=V.y}),t.fixedNodeConstraint.forEach(function(e){c[l.get(e.nodeId)]=e.position.x,u[l.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var Y=t.alignmentConstraint.vertical,X=function(e){var t=new Set;Y[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return _.has(e)})),i=void 0;i=n.size>0?c[l.get(n.values().next().value)]:g(t).x,t.forEach(function(e){_.has(e)||(c[l.get(e)]=i)})},K=0;K0?u[l.get(n.values().next().value)]:g(t).y,t.forEach(function(e){_.has(e)||(u[l.get(e)]=i)})},J=0;J{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(45),r;var t,n,r})}(AZe)),AZe.exports}!function(e){!function(t,n){e.exports=n(OZe())}(0,function(e){return t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(e){for(var t={},n=0;n0&&c.merge(e)});for(var u=0;u1){c=s[0],u=c.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,c=!1,u=void 0;try{for(var h,d=t.nodeIndexes[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var p=h.value,f=r(p,2),g=f[0],m=f[1],y=n.cy.getElementById(g);if(y){var v=y.boundingBox(),b=t.xCoords[m]-v.w/2,x=t.xCoords[m]+v.w/2,w=t.yCoords[m]-v.h/2,E=t.yCoords[m]+v.h/2;ba&&(a=x),ws&&(s=E)}}}catch(e){c=!0,u=e}finally{try{!l&&d.return&&d.return()}finally{if(c)throw u}}var k=e.x-(a+i)/2,T=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+k}),t.yCoords=t.yCoords.map(function(e){return e+T})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,c=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=l),cs&&(s=u)});var _=e.x-(a+i)/2,C=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+_,n.getCenterY()+C)})}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,u=void 0,h=void 0,d=e.descendants().not(":parent"),p=d.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),a<(c=t[r.get(g.id())]+g.width()/2)&&(a=c),o>(u=n[r.get(g.id())]-g.height()/2)&&(o=u),s<(h=n[r.get(g.id())]+g.height()/2)&&(s=h)}var m={};return m.topLeftX=i,m.topLeftY=o,m.width=a-i,m.height=s-o,m},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach(function(e){var t=!1;e.children().forEach(function(e){"none"!=e.css("display")&&(t=!0)}),t||n.merge(e)}),n}};e.exports=a},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,c=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,h=e.eles,d=h.nodes(),p=h.edges(),f=void 0,g=void 0,m=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,m=t.yCoords);var v=function(e){return"function"==typeof e},b=function(e,t){return v(e)?e(t):e},x=r.calcParentsWithoutChildren(n,h);null!=e.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(u.MAX_ITERATIONS=c.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(u.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=c.ANIMATE=l.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var c=n.length,u=0;u0&&e(i.getGraphManager().add(i.newGraph(),p),d,i,l)}}(E.addRoot(),r.getTopMostNodes(d),w,e),function(t,n,r){for(var i=0,a=0,o=0;o0?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=i/a:v(e.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,u.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(h){var d=a.getTopMostNodes(e.eles.nodes());if((l=a.connectComponents(t,e.eles,d)).forEach(function(e){var t=e.boundingBox();c.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),e.randomize&&l.forEach(function(t){e.eles=t,r.push(o(e))}),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,m={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach(function(e,t){0==e.edges().length&&(e.nodes().forEach(function(t,n){p.merge(e.nodes()[n]),t.isParent()||(m.nodeIndexes.set(e.nodes()[n].id(),g++),m.xCoords.push(e.nodes()[0].position().x),m.yCoords.push(e.nodes()[0].position().y))}),y.push(t))}),p.length>1){var v=p.boundingBox();c.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),l.push(p),r.push(m);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),c.splice(y[b],1)}}l.forEach(function(t,n){e.eles=t,i.push(s(e,r[n])),a.relocateComponent(c[n],i[n],e)})}else l.forEach(function(t,n){a.relocateComponent(c[n],r[n],e)});var x=new Set;if(l.length>1){var w=[],E=n.filter(function(e){return"none"==e.css("display")});l.forEach(function(t,n){var o=void 0;if("draft"==e.quality&&(o=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach(function(t){if("draft"==e.quality)if(t.isParent()){var c=a.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,o);s.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=o.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})}),t.edges().forEach(function(t){var l=t.source(),c=t.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==e.quality){var u=o.get(l.id()),h=o.get(c.id()),d=[],p=[];if(l.isParent()){var f=a.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,o);d.push(f.topLeftX+f.width/2),d.push(f.topLeftY+f.height/2)}else d.push(r[n].xCoords[u]),d.push(r[n].yCoords[u]);if(c.isParent()){var g=a.calcBoundingBox(c,r[n].xCoords,r[n].yCoords,o);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[h]),p.push(r[n].yCoords[h]);s.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][c.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][c.id()].getCenterX(),endY:i[n][c.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),x.add(n))}});var k=u.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+k[t].dx}),r=e.yCoords.map(function(e){return e+k[t].dy});e.xCoords=n,e.yCoords=r});else{var T=0;x.forEach(function(e){Object.keys(i[e]).forEach(function(t){var n=i[e][t];n.setCenter(n.getCenterX()+k[T].dx,n.getCenterY()+k[T].dy)}),T++})}}}else{var _=e.eles.boundingBox();if(c.push({x:_.x1+_.w/2,y:_.y1+_.h/2}),e.randomize){var C=o(e);r.push(C)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),a.relocateComponent(c[0],i[0],e)):a.relocateComponent(c[0],r[0],e)}var S=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var a=void 0,o=void 0,s=t.data("id");return i.forEach(function(e){s in e&&(a={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),e.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?a.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(a.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?a.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(a.y-=o.labelHeight/2))),null==a&&(a={x:t.position("x"),y:t.position("y")}),{x:a.x,y:a.y}}var l=void 0;return r.forEach(function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})}),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=a.calcParentsWithoutChildren(t,n),N=n.filter(function(e){return"none"==e.css("display")});e.eles=n.not(N),n.nodes().not(":parent").not(N).layoutPositions(this,e,S),A.length>0&&A.forEach(function(e){e.position(S(e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=c},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(":parent"),l=new Map,c=new Map,u=new Map,h=[],d=[],p=[],f=[],g=[],m=[],y=[],v=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,k=e.samplingType,T=e.nodeSeparation,_=void 0,C=function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,l=[],u=0,d=1,p=0;p=i;){o=r[i++];for(var f=h[o],y=0;yu&&(u=g[w],d=w)}return d};r.connectComponents(t,n,r.getTopMostNodes(o),l),s.forEach(function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)});for(var S=0,A=0;A0&&(r.isParent()?h[t].push(u.get(r.id())):h[t].push(r.id()))})});var P=function(e){var n=c.get(e),r=void 0;l.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,h[n].push(r),h[c.get(r)].push(e)})},$=!0,B=!1,F=void 0;try{for(var z,j=l.keys()[Symbol.iterator]();!($=(z=j.next()).done);$=!0)P(z.value)}catch(e){B=!0,F=e}finally{try{!$&&j.return&&j.return()}finally{if(B)throw F}}var H=void 0;if((b=c.size)>2){_=b=1)break;c=l}for(var f=0;f=1)break;c=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(579),r;var t,n,r})}(SZe);var LZe=Zt(SZe.exports),MZe={L:"left",R:"right",T:"top",B:"bottom"},RZe={L:JH(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:JH(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:JH(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:JH(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},DZe={L:JH((e,t)=>e-t+2,"L"),R:JH((e,t)=>e-2,"R"),T:JH((e,t)=>e-t+2,"T"),B:JH((e,t)=>e-2,"B")},PZe=JH(function(e){return BZe(e)?"L"===e?"R":"L":"T"===e?"B":"T"},"getOppositeArchitectureDirection"),$Ze=JH(function(e){return"L"===e||"R"===e||"T"===e||"B"===e},"isArchitectureDirection"),BZe=JH(function(e){return"L"===e||"R"===e},"isArchitectureDirectionX"),FZe=JH(function(e){return"T"===e||"B"===e},"isArchitectureDirectionY"),zZe=JH(function(e,t){const n=BZe(e)&&FZe(t),r=FZe(e)&&BZe(t);return n||r},"isArchitectureDirectionXY"),jZe=JH(function(e){const t=e[0],n=e[1],r=BZe(t)&&FZe(n),i=FZe(t)&&BZe(n);return r||i},"isArchitecturePairXY"),HZe=JH(function(e){return"LL"!==e&&"RR"!==e&&"TT"!==e&&"BB"!==e},"isValidArchitectureDirectionPair"),UZe=JH(function(e,t){const n=`${e}${t}`;return HZe(n)?n:void 0},"getArchitectureDirectionPair"),GZe=JH(function([e,t],n){const r=n[0],i=n[1];return BZe(r)?FZe(i)?[e+("L"===r?-1:1),t+("T"===i?1:-1)]:[e+("L"===r?-1:1),t]:BZe(i)?[e+("L"===i?1:-1),t+("T"===r?1:-1)]:[e,t+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),qZe=JH(function(e){return"LT"===e||"TL"===e?[1,1]:"BL"===e||"LB"===e?[1,-1]:"BR"===e||"RB"===e?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),WZe=JH(function(e,t){return zZe(e,t)?"bend":BZe(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),VZe=JH(function(e){return"service"===e.type},"isArchitectureService"),YZe=JH(function(e){return"junction"===e.type},"isArchitectureJunction"),XZe=JH(e=>e.data(),"edgeData"),KZe=JH(e=>e.data(),"nodeData"),QZe=MU.architecture,ZZe=new Dhe(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:QZe,dataStructures:void 0,elements:{}})),JZe=JH(()=>{ZZe.reset(),FG()},"clear"),eJe=JH(function({id:e,icon:t,in:n,title:r,iconText:i}){if(void 0!==ZZe.records.registeredIds[e])throw new Error(`The service id [${e}] is already in use by another ${ZZe.records.registeredIds[e]}`);if(void 0!==n){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(void 0===ZZe.records.registeredIds[n])throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===ZZe.records.registeredIds[n])throw new Error(`The service [${e}]'s parent is not a group`)}ZZe.records.registeredIds[e]="node",ZZe.records.nodes[e]={id:e,type:"service",icon:t,iconText:i,title:r,edges:[],in:n}},"addService"),tJe=JH(()=>Object.values(ZZe.records.nodes).filter(VZe),"getServices"),nJe=JH(function({id:e,in:t}){ZZe.records.registeredIds[e]="node",ZZe.records.nodes[e]={id:e,type:"junction",edges:[],in:t}},"addJunction"),rJe=JH(()=>Object.values(ZZe.records.nodes).filter(YZe),"getJunctions"),iJe=JH(()=>Object.values(ZZe.records.nodes),"getNodes"),aJe=JH(e=>ZZe.records.nodes[e],"getNode"),oJe=JH(function({id:e,icon:t,in:n,title:r}){if(void 0!==ZZe.records.registeredIds[e])throw new Error(`The group id [${e}] is already in use by another ${ZZe.records.registeredIds[e]}`);if(void 0!==n){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(void 0===ZZe.records.registeredIds[n])throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===ZZe.records.registeredIds[n])throw new Error(`The group [${e}]'s parent is not a group`)}ZZe.records.registeredIds[e]="group",ZZe.records.groups[e]={id:e,icon:t,title:r,in:n}},"addGroup"),sJe=JH(()=>Object.values(ZZe.records.groups),"getGroups"),lJe=JH(function({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:l}){if(!$Ze(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${n}`);if(!$Ze(r))throw new Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${r}`);if(void 0===ZZe.records.nodes[e]&&void 0===ZZe.records.groups[e])throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===ZZe.records.nodes[t]&&void 0===ZZe.records.groups[e])throw new Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);const c=ZZe.records.nodes[e].in,u=ZZe.records.nodes[t].in;if(o&&c&&u&&c==u)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&c&&u&&c==u)throw new Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const h={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:l};ZZe.records.edges.push(h),ZZe.records.nodes[e]&&ZZe.records.nodes[t]&&(ZZe.records.nodes[e].edges.push(ZZe.records.edges[ZZe.records.edges.length-1]),ZZe.records.nodes[t].edges.push(ZZe.records.edges[ZZe.records.edges.length-1]))},"addEdge"),cJe=JH(()=>ZZe.records.edges,"getEdges"),uJe=JH(()=>{if(void 0===ZZe.records.dataStructures){const e={},t=Object.entries(ZZe.records.nodes).reduce((t,[n,r])=>(t[n]=r.edges.reduce((t,r)=>{const i=aJe(r.lhsId)?.in,a=aJe(r.rhsId)?.in;if(i&&a&&i!==a){const t=WZe(r.lhsDir,r.rhsDir);"bend"!==t&&(e[i]??={},e[i][a]=t,e[a]??={},e[a][i]=t)}if(r.lhsId===n){const e=UZe(r.lhsDir,r.rhsDir);e&&(t[e]=r.rhsId)}else{const e=UZe(r.rhsDir,r.lhsDir);e&&(t[e]=r.lhsId)}return t},{}),t),{}),n=Object.keys(t)[0],r={[n]:1},i=Object.keys(t).reduce((e,t)=>t===n?e:{...e,[t]:1},{}),a=JH(e=>{const n={[e]:[0,0]},a=[e];for(;a.length>0;){const e=a.shift();if(e){r[e]=1,delete i[e];const o=t[e],[s,l]=n[e];Object.entries(o).forEach(([e,t])=>{r[t]||(n[t]=GZe([s,l],e),a.push(t))})}}return n},"BFS"),o=[a(n)];for(;Object.keys(i).length>0;)o.push(a(Object.keys(i)[0]));ZZe.records.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return ZZe.records.dataStructures},"getDataStructures"),hJe=JH((e,t)=>{ZZe.records.elements[e]=t},"setElementForId"),dJe=JH(e=>ZZe.records.elements[e],"getElementById"),pJe={clear:JZe,setDiagramTitle:GG,getDiagramTitle:qG,setAccTitle:zG,getAccTitle:jG,setAccDescription:HG,getAccDescription:UG,addService:eJe,getServices:tJe,addJunction:nJe,getJunctions:rJe,getNodes:iJe,getNode:aJe,addGroup:oJe,getGroups:sJe,addEdge:lJe,getEdges:cJe,setElementForId:hJe,getElementById:dJe,getDataStructures:uJe};function fJe(e){const t=YG().architecture;return t?.[e]?t[e]:QZe[e]}JH(fJe,"getConfigField");var gJe=JH((e,t)=>{Rhe(e,t),e.groups.map(t.addGroup),e.services.map(e=>t.addService({...e,type:"service"})),e.junctions.map(e=>t.addJunction({...e,type:"junction"})),e.edges.map(t.addEdge)},"populateDb"),mJe={parse:JH(async e=>{const t=await Bke("architecture",e);nU.debug(t),gJe(t,pJe)},"parse")},yJe=JH(e=>`\n .edge {\n stroke-width: ${e.archEdgeWidth};\n stroke: ${e.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${e.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${e.archGroupBorderColor};\n stroke-width: ${e.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),vJe=JH(e=>`${e}`,"wrapIcon"),bJe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:vJe('')},server:{body:vJe('')},disk:{body:vJe('')},internet:{body:vJe('')},cloud:{body:vJe('')},unknown:_Y,blank:{body:vJe("")}}},xJe=JH(async function(e,t){const n=fJe("padding"),r=fJe("iconSize"),i=r/2,a=r/6,o=a/2;await Promise.all(t.edges().map(async t=>{const{source:r,sourceDir:s,sourceArrow:l,sourceGroup:c,target:u,targetDir:h,targetArrow:d,targetGroup:p,label:f}=XZe(t);let{x:g,y:m}=t[0].sourceEndpoint();const{x:y,y:v}=t[0].midpoint();let{x:b,y:x}=t[0].targetEndpoint();const w=n+4;if(c&&(BZe(s)?g+="L"===s?-w:w:m+="T"===s?-w:w+18),p&&(BZe(h)?b+="L"===h?-w:w:x+="T"===h?-w:w+18),c||"junction"!==pJe.getNode(r)?.type||(BZe(s)?g+="L"===s?i:-i:m+="T"===s?i:-i),p||"junction"!==pJe.getNode(u)?.type||(BZe(h)?b+="L"===h?i:-i:x+="T"===h?i:-i),t[0]._private.rscratch){const t=e.insert("g");if(t.insert("path").attr("d",`M ${g},${m} L ${y},${v} L${b},${x} `).attr("class","edge"),l){const e=BZe(s)?DZe[s](g,a):g-o,n=FZe(s)?DZe[s](m,a):m-o;t.insert("polygon").attr("points",RZe[s](a)).attr("transform",`translate(${e},${n})`).attr("class","arrow")}if(d){const e=BZe(h)?DZe[h](b,a):b-o,n=FZe(h)?DZe[h](x,a):x-o;t.insert("polygon").attr("points",RZe[h](a)).attr("transform",`translate(${e},${n})`).attr("class","arrow")}if(f){const e=zZe(s,h)?"XY":BZe(s)?"X":"Y";let n=0;n="X"===e?Math.abs(g-b):"Y"===e?Math.abs(m-x)/1.5:Math.abs(g-b)/2;const r=t.append("g");if(await y7(r,f,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},YG()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===e)r.attr("transform","translate("+y+", "+v+")");else if("Y"===e)r.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===e){const e=UZe(s,h);if(e&&jZe(e)){const t=r.node().getBoundingClientRect(),[n,i]=qZe(e);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*i*45})`);const a=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${y}, ${v-t.height/2})\n translate(${n*a.width/2}, ${i*a.height/2})\n rotate(${-1*n*i*45}, 0, ${t.height/2})\n `)}}}}}))},"drawEdges"),wJe=JH(async function(e,t){const n=.75*fJe("padding"),r=fJe("fontSize"),i=fJe("iconSize")/2;await Promise.all(t.nodes().map(async t=>{const a=KZe(t);if("group"===a.type){const{h:o,w:s,x1:l,y1:c}=t.boundingBox();e.append("rect").attr("x",l+i).attr("y",c+i).attr("width",s).attr("height",o).attr("class","node-bkg");const u=e.append("g");let h=l,d=c;if(a.icon){const e=u.append("g");e.html(`${await IY(a.icon,{height:n,width:n,fallbackPrefix:bJe.prefix})}`),e.attr("transform","translate("+(h+i+1)+", "+(d+i+1)+")"),h+=n,d+=r/2-1-2}if(a.label){const e=u.append("g");await y7(e,a.label,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},YG()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),e.attr("transform","translate("+(h+i+4)+", "+(d+i+2)+")")}}}))},"drawGroups"),EJe=JH(async function(e,t,n){for(const r of n){const n=t.append("g"),i=fJe("iconSize");if(r.title){const e=n.append("g");await y7(e,r.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},YG()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const a=n.append("g");if(r.icon)a.html(`${await IY(r.icon,{height:i,width:i,fallbackPrefix:bJe.prefix})}`);else if(r.iconText){a.html(`${await IY("blank",{height:i,width:i,fallbackPrefix:bJe.prefix})}`);const e=a.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(r.iconText),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;e.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/t)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+r.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);n.attr("class","architecture-service");const{width:o,height:s}=n._groups[0][0].getBBox();r.width=o,r.height=s,e.setElementForId(r.id,n)}return 0},"drawServices"),kJe=JH(function(e,t,n){n.forEach(n=>{const r=t.append("g"),i=fJe("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",i).attr("height",i),r.attr("class","architecture-junction");const{width:a,height:o}=r._groups[0][0].getBBox();r.width=a,r.height=o,e.setElementForId(n.id,r)})},"drawJunctions");function TJe(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"service",id:e.id,icon:e.icon,label:e.title,parent:e.in,width:fJe("iconSize"),height:fJe("iconSize")},classes:"node-service"})})}function _Je(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"junction",id:e.id,parent:e.in,width:fJe("iconSize"),height:fJe("iconSize")},classes:"node-junction"})})}function CJe(e,t){t.nodes().map(t=>{const n=KZe(t);if("group"===n.type)return;n.x=t.position().x,n.y=t.position().y;e.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function SJe(e,t){e.forEach(e=>{t.add({group:"nodes",data:{type:"group",id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:"node-group"})})}function AJe(e,t){e.forEach(e=>{const{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:l,rhsGroup:c,title:u}=e,h=zZe(e.lhsDir,e.rhsDir)?"segments":"straight",d={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===s?"0 50%":"R"===s?"100% 50%":"T"===s?"50% 0":"50% 100%",target:r,targetDir:l,targetArrow:o,targetGroup:c,targetEndpoint:"L"===l?"0 50%":"R"===l?"100% 50%":"T"===l?"50% 0":"50% 100%"};t.add({group:"edges",data:d,classes:h})})}function NJe(e,t,n){const r=JH((e,t)=>Object.entries(e).reduce((e,[r,i])=>{let a=0;const o=Object.entries(i);if(1===o.length)return e[r]=o[0][1],e;for(let i=0;i{const n={},i={};return Object.entries(t).forEach(([t,[r,a]])=>{const o=e.getNode(t)?.in??"default";n[a]??={},n[a][o]??=[],n[a][o].push(t),i[r]??={},i[r][o]??=[],i[r][o].push(t)}),{horiz:Object.values(r(n,"horizontal")).filter(e=>e.length>1),vert:Object.values(r(i,"vertical")).filter(e=>e.length>1)}}),[a,o]=i.reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]);return{horizontal:a,vertical:o}}function IJe(e){const t=[],n=JH(e=>`${e[0]},${e[1]}`,"posToStr"),r=JH(e=>e.split(",").map(e=>parseInt(e)),"strToPos");return e.forEach(e=>{const i=Object.fromEntries(Object.entries(e).map(([e,t])=>[n(t),e])),a=[n([0,0])],o={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const e=a.shift();if(e){o[e]=1;const l=i[e];if(l){const c=r(e);Object.entries(s).forEach(([e,r])=>{const s=n([c[0]+r[0],c[1]+r[1]]),u=i[s];u&&!o[s]&&(a.push(s),t.push({[MZe[e]]:u,[MZe[PZe(e)]]:l,gap:1.5*fJe("iconSize")}))})}}}}),t}function OJe(e,t,n,r,i,{spatialMaps:a,groupAlignments:o}){return new Promise(s=>{const l=TK("body").append("div").attr("id","cy").attr("style","display:none"),c=XWe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${fJe("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${fJe("padding")}px`}}]});l.remove(),SJe(n,c),TJe(e,c),_Je(t,c),AJe(r,c);const u=NJe(i,a,o),h=IJe(a),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){const[t,n]=e.connectedNodes(),{parent:r}=KZe(t),{parent:i}=KZe(n);return r===i?1.5*fJe("iconSize"):.5*fJe("iconSize")},edgeElasticity(e){const[t,n]=e.connectedNodes(),{parent:r}=KZe(t),{parent:i}=KZe(n);return r===i?.45:.001},alignmentConstraint:u,relativePlacementConstraint:h});d.one("layoutstop",()=>{function e(e,t,n,r){let i,a;const{x:o,y:s}=e,{x:l,y:c}=t;a=(r-s+(o-n)*(s-c)/(o-l))/Math.sqrt(1+Math.pow((s-c)/(o-l),2)),i=Math.sqrt(Math.pow(r-s,2)+Math.pow(n-o,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-o,2)+Math.pow(c-s,2));let u=(l-o)*(r-s)-(c-s)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let h=(l-o)*(n-o)+(c-s)*(r-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}return a=Math.abs(a)*u,i*=h,{distances:a,weights:i}}JH(e,"getSegmentWeights"),c.startBatch();for(const t of Object.values(c.edges()))if(t.data?.()){const{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){const n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=XZe(t),[a,o]=FZe(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:l}=e(n,r,a,o);t.style("segment-distances",l),t.style("segment-weights",s)}}c.endBatch(),d.run()}),d.run(),c.ready(e=>{nU.info("Ready",e),s(c)})})}AY([{name:bJe.prefix,icons:bJe}]),XWe.use(LZe),JH(TJe,"addServices"),JH(_Je,"addJunctions"),JH(CJe,"positionNodes"),JH(SJe,"addGroups"),JH(AJe,"addEdges"),JH(NJe,"getAlignments"),JH(IJe,"getRelativeConstraints"),JH(OJe,"layoutArchitecture");var LJe=JH(async(e,t,n,r)=>{const i=r.db,a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),u=Ite(t),h=u.append("g");h.attr("class","architecture-edges");const d=u.append("g");d.attr("class","architecture-services");const p=u.append("g");p.attr("class","architecture-groups"),await EJe(i,d,a),kJe(i,d,o);const f=await OJe(a,o,s,l,i,c);await xJe(h,f),await wJe(p,f),CJe(i,f),NG(void 0,u,fJe("padding"),fJe("useMaxWidth"))},"draw"),MJe={parser:mJe,db:pJe,renderer:{draw:LJe},styles:yJe},RJe=Object.freeze({__proto__:null,diagram:MJe}),DJe=Object.freeze({__proto__:null,InfoModule:xke,createInfoServices:wke}),PJe=Object.freeze({__proto__:null,PacketModule:kke,createPacketServices:Tke}),$Je=Object.freeze({__proto__:null,PieModule:Ske,createPieServices:Ake}),BJe=Object.freeze({__proto__:null,ArchitectureModule:Oke,createArchitectureServices:Lke}),FJe=Object.freeze({__proto__:null,GitGraphModule:yke,createGitGraphServices:vke}),zJe=Object.freeze({__proto__:null,RadarModule:Rke,createRadarServices:Dke});export{Bie as FullscreenModal,$ie as FullscreenPage}; diff --git a/web/widgets/searchbox/package.json b/web/widgets/searchbox/package.json index 640ab0c5..084164b4 100644 --- a/web/widgets/searchbox/package.json +++ b/web/widgets/searchbox/package.json @@ -38,7 +38,7 @@ "watch": "tsup --watch" }, "dependencies": { - "@infinilabs/search-chat": "^1.2.47", + "@infinilabs/search-chat": "^1.2.50", "react": "^18.3.1", "react-dom": "^18.3.1", "searchbox": "link:" diff --git a/web/widgets/searchbox/src/DocSearch.jsx b/web/widgets/searchbox/src/DocSearch.jsx index 4e5fc753..6f51fbec 100644 --- a/web/widgets/searchbox/src/DocSearch.jsx +++ b/web/widgets/searchbox/src/DocSearch.jsx @@ -9,7 +9,7 @@ const DEFAULT_HOTKEYS = ["ctrl+/"]; const DARK_MODE_MEDIA_QUERY = '(prefers-color-scheme: dark)' export const DocSearch = (props) => { - const { hotKeys = DEFAULT_HOTKEYS, server, id, token, linkHref, formatUrl } = props; + const { hotKeys = DEFAULT_HOTKEYS, server, id, linkHref, formatUrl } = props; const [isOpen, setIsOpen] = useState(false); const [initialQuery, setInitialQuery] = useState(); @@ -101,13 +101,12 @@ export const DocSearch = (props) => { } }, [isOpen, currentHotkeys]) - async function fetchSettings(server, id, token) { - if (!server || !id || !token) return; + async function fetchSettings(server, id) { + if (!server || !id) return; fetch(`${server}/integration/${id}`, { headers: { 'APP-INTEGRATION-ID': id, 'Content-Type': 'application/json', - 'X-API-TOKEN': token }, method: 'GET', credentials: 'include', @@ -164,16 +163,18 @@ export const DocSearch = (props) => { function renderModal(server, settings, triggerBtnType, theme, isOpen) { if (!window[`${id}_shadow`]) return; + + window[`${id}_modal_root`]?.unmount() + window[`${id}_modal_container`]?.remove() if (!isOpen) { - window[`${id}_modal_root`]?.unmount() - window[`${id}_modal_container`]?.remove() return; - } + } const props = { server, settings, + refreshSettings: () => fetchSettings(server, id), onClose, triggerBtnType, theme, @@ -230,8 +231,8 @@ export const DocSearch = (props) => { }, [onKeyDown]) useEffect(() => { - fetchSettings(server, id, token); - }, [server, id, token]); + fetchSettings(server, id); + }, [server, id]); useEffect(() => { const body = document.body; diff --git a/web/widgets/searchbox/src/DocSearchModal.jsx b/web/widgets/searchbox/src/DocSearchModal.jsx index 2abdd127..391f5bf4 100644 --- a/web/widgets/searchbox/src/DocSearchModal.jsx +++ b/web/widgets/searchbox/src/DocSearchModal.jsx @@ -4,6 +4,7 @@ import { useEffect, useState } from 'react'; export const DocSearchModal = ({ server, settings, + refreshSettings, onClose, triggerBtnType, theme, @@ -16,8 +17,9 @@ export const DocSearchModal = ({ const [isPinned, setIsPinned] = useState(false); - const { appearance = {}, enabled_module = {}, id, token, type } = settings || {}; + const { appearance = {}, enabled_module = {}, id, type } = settings || {}; const { ai_chat, features, search } = enabled_module; + const { language } = appearance const hasModules = []; if (search?.enabled) { @@ -52,7 +54,6 @@ export const DocSearchModal = ({
    diff --git a/web/widgets/ui-search/src/ChatMessage/Markdown.jsx b/web/widgets/ui-search/src/ChatMessage/Markdown.jsx index d94587af..621cdfc7 100644 --- a/web/widgets/ui-search/src/ChatMessage/Markdown.jsx +++ b/web/widgets/ui-search/src/ChatMessage/Markdown.jsx @@ -185,6 +185,7 @@ const CustomCode = forwardRef((props, ref) => { // 5 function escapeBrackets(text) { + if (!text) return text; const pattern = /(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g; return text?.replace( @@ -205,6 +206,7 @@ function escapeBrackets(text) { // 4 function tryWrapHtmlCode(text) { // try add wrap html code (fixed: html codeblock include 2 newline) + if (!text) return text; return text ?.replace( /([`]*?)(\w*?)([\n\r]*?)()/g, @@ -291,7 +293,7 @@ export default function Markdown(props) { onDoubleClickCapture={props.onDoubleClickCapture} dir="auto" > - + { props.content ? : null}
    ); diff --git a/web/widgets/ui-search/src/Fullscreen.jsx b/web/widgets/ui-search/src/Fullscreen.jsx index bad638b4..e95469b6 100644 --- a/web/widgets/ui-search/src/Fullscreen.jsx +++ b/web/widgets/ui-search/src/Fullscreen.jsx @@ -162,7 +162,7 @@ const Fullscreen = (props) => { } resultHeader={} aiOverview={ - !aiOverview?.enabled ? ( + aiOverview?.enabled ? (